Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d9fff7a

Browse files
committed
#3 Allow baseUrl to be specified at instantiation time for European users who have a different JotForm endpoint. Also add a supporting note to the README.
1 parent 035175e commit d9fff7a

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,12 @@ JotForm API requires API key for all user related calls. You can create your API
2828

2929
### Examples
3030

31+
The following examples are aimed towards users using the main JotForm API endpoint at `api.jotform.com`.
32+
33+
NB. If you are located in Europe, use the following code to instantiate the client:
34+
35+
jotformAPIClient = JotformAPIClient(apiKey='YOUR API KEY', baseUrl='https://eu-api.jotform.com/')
36+
3137
Print all forms of the user
3238

3339
```python

jotform.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,16 @@
1414
from xml.dom.minidom import parseString
1515

1616
class JotformAPIClient:
17-
__baseUrl = 'https://api.jotform.com/'
17+
__baseUrl = None
1818
__apiVersion = 'v1'
1919

2020
__apiKey = None
2121
__debugMode = False
2222
__outputType = "json"
2323

24-
def __init__(self, apiKey='', outputType='json', debug=False):
24+
def __init__(self, apiKey='', outputType='json', baseUrl='https://api.jotform.com/', debug=False):
2525

26+
self.__baseUrl = baseUrl
2627
self.__apiKey = apiKey
2728
self.__debugMode = debug
2829
self.__outputType = outputType.lower()

0 commit comments

Comments
 (0)