API calls return 106 invalid API KEY token when using POST

David Sullivan Posted in Technical Support 1 month ago

When I use GET with the parameters passed as part of the URL I get the expected output:

http://<address>/api/v1.0/user_details?api_key_token=<api key>&guid=2

If I try doing this with POST passing the parameters as JSON (curl or Python), I get a 106 response about the API key being invalid. I have validated the JSON syntax Sample JSON:

{
    "api_key_token":"<api key>",
    "guid":2
}

Curl command:

curl -d @test.json -H "Content-Type: application/json" -X POST http://<address>/api/v1.0/user_details

OSSN ver: 6.1

Replies
Indonesian Arsalan Shah Replied 1 month ago

Hi, it is because you are sending JSON and its not expecting JSON format. Valid Format should look like

curl --data "api_key_token=api_key" --data "guid=2" http://<address>/api/v1.0/user_details