NetTalk Central
Toggle navigation
Login
Register
×
Welcome,Guest
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
NetTalk Central
»
NetTalk Web Server
»
Web Server - Ask For Help
»
Sending Token
« previous
next »
Print
Pages: [
1
]
Author
Topic: Sending Token (Read 2951 times)
wasatchconsulting
Jr. Member
Posts: 72
Sending Token
«
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
Logged
Bruce
Global Moderator
Hero Member
Posts: 11244
Re: Sending Token
«
Reply #1 on:
August 11, 2021, 10:13:08 PM »
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
Logged
wasatchconsulting
Jr. Member
Posts: 72
Re: Sending Token
«
Reply #2 on:
August 12, 2021, 03:54:24 PM »
Thanks Bruce, that did the trick.
Logged
Print
Pages: [
1
]
« previous
next »
NetTalk Central
»
NetTalk Web Server
»
Web Server - Ask For Help
»
Sending Token