Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions JotForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,20 @@ class JotForm {
private $outputType;
private $apiVersion = 'v1';

public function __construct($apiKey = '', $outputType = 'json', $debugMode = false) {
public function __construct($apiKey = '', $outputType = 'json', $debugMode = false, $hipaaSupport = false) {

$this->apiKey = $apiKey;
$this->debugMode = $debugMode;
$this->outputType = strtolower($outputType);
$user = $this->getUser();
# set base url for EU users
if (isset($user['euOnly'])) {
$this->baseURL = 'https://eu-api.jotform.com';

if ($hipaaSupport) {
$this->baseURL = 'https://hipaa-api.jotform.com';
} else {
$user = $this->getUser();
# set base url for EU users
if (isset($user['euOnly'])) {
$this->baseURL = 'https://eu-api.jotform.com';
}
}
}

Expand Down
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,18 @@ JotForm API requires API key for all user related calls. You can create your API

### Examples

Create a new instance of JotForm client

```php
<?php

include "jotform-api-php/JotForm.php";

$jotformAPI = new JotForm("YOUR API KEY", $outputType = 'json', $debugMode = false, $hipaaSupport = false);

?>
```

Print all forms of the user

```php
Expand Down