Hi All,
I have followed the instructions for cloud functions and access tokens in the particle reference. I have used Curl, Postman and a few other things. I have generated tokens using the Web interface and the CLI.
The best I get is "The access token provided is invalid."
I have been working with APIs for years. I am used to working with bearer tokens and API keys. I prefer to use the Postman app. If put the access_token into the message header, all I get is "The access token was not found"
If I put the access_token in the URL I get "The access token provided is invalid."
If I use curl - curl https://api.particle.io/v1/devices/[deviceid]/blinkLED?access_token=[token]/args=3 or variations of it I get "The access token provided is invalid."
If I put the access_token but no args in the URL or curl I get "error": "Unknown Variable: blinkLED" where blinkLED is the function I am trying to call.
Can someone please let me know what I am missing.
Thanks in advance
Rob
Hi, just the other day another community member got in trouble and this is how they fixed it.
Hint: the token goes in the body, not the url, when calling a function. It can go in the url when getting a variable, though.
Best
1 Like
Thanks for the reply.
So the access token goes in as form data? And the args go as another form data entry?
I will give it a try.
Rob
None of that worked. An someone please help?
Can someone please answer these simple questions?
Does the access_token go in:
a) The URL,
b) The header, which is what I would expect, or
c) The body?
If it is in the body, is it regular form data, JSON or something else?
Does the arg go in:
a) the URL, or
b) the body?
I have tried every possible combination of these things, including several attempts at using Curl exactly as instructed, and I only ever get one of two responses:
"the access token was not found" or
"the access token provided is invalid"
Can someone please help? I am trying to deploy a prototype here.
Rob
I worked it out myself. See my post on using Postman.