I’m trying to get a simple POST working to read a temperature variable. It works fine using curl in Terminal, but with Postman in Chrome it fails. (my ultimate goal is to use Python)
The preview from Postman looks like:
POST /v1/devices/54ff6e06666751515441567/temperature HTTP/1.1
access_token=<my access token>
The response I get is:
"error": "Permission Denied",
"info": "I didn't recognize that core name or ID, try opening https://api.spark.io/v1/devices?access_token=<my access token>"
For a spark variable, you need to do a GET request, not a POST. IF you have a spark function, that takes a POST.
I tried GET, but it returns the same error.
https://api.spark.io/v1/devices/54ff6e06666751515441567/temperature?access_token=<my access token>
https://api.spark.io/v1/devices?access_token=<my access token> say?
I have struggled with very odd cut/paste problems that make it hard to see that either an access token is wrong (literally one digit got wrecked in the cut/paste) or the device ID.
I have to copy paste very carefully on my mac, and I cannot use notepad for that reason.
That’s weird it was a copy/paste issue with the device ID. Some kind of encoding issue? I tried saving it in Sublime Text though. What worked was manually typing the device ID into Postman.
What I see is that the variable that you are trying to retrieve isn’t available on the core…
You might want to reflash the firmware again
After typing the device ID manually the GET request is working and I’m getting this response: