API Builder 7 BETA3 not working properly -
I installed the 7-BETA3.jar file , created an app with a simple form, added the Manage API key menu in the userview, created an api key for basic authentication, base64 encoded the admin:passwordhere string and did the following using python requests as well as in postman
import requests
url = 'http://appcenterint.xrxdev.ca/jw/api/form/smallGetData/addWithFiles'
payload = {'language': '1',
'home_address': 'ca home',
'first_name': 'daniel.1',
'last_name': 'fung.1',
'dateModified': '',
'dateCreated': '',
'createdBy': '',
'id': '',
'modifiedBy': '',
'createdByName': '',
'modifiedByName': ''}
files = {'your_photo': open('C:/Users/myusernamehere/Documents/small-doc-sample1.pdf','rb')}
proxies = {"http":None, "https":None}
headers = {
'api_id':'API-f255212a-2f0a-4b13-a453-7dc30a205b32'
,'api_key':'ce26291e29c743e09e2fb87cc87d2df3'
,'Authorization':'*Basic YWRtaW46c21AbGxTcHJpbmc3MyE='
,'Content-Type': 'multipart/form-data'
,'accept':'application/json'}
# response = requests.request('POST', url, headers=headers, data=payload, files=files, proxies=proxies)
# response = requests.request('POST', url, headers=headers, data=payload, files=files, proxies=proxies)
response = requests.request('POST', url, headers=headers, proxies=proxies)
print(response.text.encode('utf8'))
I get the following error from the print above
'{"date":"Tue Nov 17 20:53:04 EST 2020","code":"401","message":"Authentication Failure"}'
i see the following in the Manage API Key Log
| 17-11-2020 09:07 PM | API-f255212a-2f0a-4b13-a453-7dc30a205b32 | ce26291e29c743e09e2fb87cc87d2df3 | 401 | form/smallGetData/addWithFiles | python-requests/2.23.0 | 192.168.122.217 | Authentication Failure | 365 |
in the APP's Logs I see the following
INFO 17 Nov 2020 20:19:43 org.joget.api.service.ApiBuilder - Authentication for user admin (10.11.6.55) : true
3839
ERROR 17 Nov 2020 20:19:43 org.joget.plugin.property.service.PropertyUtil - A JSONObject text must begin with '{' at character 0
3840
org.json.JSONException: A JSONObject text must begin with '{' at character 0
3841
at org.json.JSONTokener.syntaxError(JSONTokener.java:496)
3842
at org.json.JSONObject.<init>(JSONObject.java:180)
3843
at org.json.JSONObject.<init>(JSONObject.java:403)
3844
at org.joget.plugin.property.service.PropertyUtil.getPropertiesValueFromJson(PropertyUtil.java:140)
3845
at org.joget.api.service.ApiBuilder.authenticate(ApiBuilder.java:893)
3846
at org.joget.api.service.ApiBuilder.serveApi(ApiBuilder.java:711) ....
I tried this using POSTMAN, Visual Studio Code WIth Python Requests ( from 2 different servers) and all of them error out the same way.
I have API Domain and API IP whitelists both set to *