NetTalk Central
NetTalk Web Server => Web Server - Ask For Help => Topic started by: wasatchconsulting on August 11, 2021, 10:36:14 AM
-
I am using NT12 and I have the following that works great when tested using a curl testing program. It is returning a JSON response.
curl -H "apikey: a123456c-07dd-4bec-974f-b9f7c217f4a6" https://api.aq360.com/project/08-10-2021
In NT I have:
ThisWebClient.ContentType = 'application/json'
ThisWebClient.Authorization = 'Token a123456c-07dd-4bec-974f-b9f7c217f4a6'
ThisWebClient.Get('https://api.aq360.com/project/08-10-2021',PostString)
The response I get back is "Invalid Api Key"
Any ideas of what to change?
Thanks
Ken Watts
-
Hi Ken,
Remove this line;
ThisWebClient.Authorization = 'Token a123456c-07dd-4bec-974f-b9f7c217f4a6'
Add this line
ThisWebClient.CustomHeader = 'apikey: a123456c-07dd-4bec-974f-b9f7c217f4a6'
Change the call to GET to
ThisWebClient.Get('https://api.aq360.com/project/08-10-2021')
Cheers
Bruce
-
Thanks Bruce, that did the trick.