I am trying to use the Ajax component to call out to an API but am having issues with getting the header right for Bearer Token Auth. It should return a number but all I get is the full url as below.
Settings:
Source: HTTP
URL: https://myservice.com/service/core/v2/Users?count=true
Method: GET
Response: JSON
Credentials: Off
Only Changes: On
Parameters: None (left blank)
Headers:
“Authorization”: “Bearer xxxxxxxxxxx”
Display Mode: Direct HTML
This is the output ->
{“err”:{“data”:null,“status”:-1,“config”:{“method”:“GET”,“transformRequest”:[null],“transformResponse”:[null],“jsonpCallbackParam”:“callback”,“responseType”:“json”,“url”:“https://myservice.com/service/core/v2/Users?count=true",“params”:{},“headers”:{“Authorization”:"Bearer xxxxxxxxxx”,“Accept”:“application/json, text/plain, /”},“cache”:false,“withCredentials”:false,“retry”:0},“statusText”:"",“xhrStatus”:“error”},“cancelled”:true}