Bulk update 401. error unauthorized
Show older comments
Is bulk update API broken? Was working , day later not working...
Tried using bulk update and get
{"status":"401","error":{"error_code":"error_auth_required","message":"Authorization Required","details":"Please provide proper authentication details."}
tried a POST to http://api.thingspeak.com/channels/1191021/bulk_update.json
with this payload:
{
"write_api_key": "WRITE_API_KEY",
"updates": [{
"created_at": "2018-01-30 10:26:2 -0500",
"field1": "1.0",
"field2": "2.0"
},
{
"created_at": "2018-02-02 11:27:27 -0500",
"field1": "1.1",
"field2": "2.2",
"status": "well done"
}
]
}
And I get
{"status":"401","error":{"error_code":"error_auth_required","message":"Authorization Required","details":"Please provide proper authentication details."}
Already tried
- new channel
- new key
- validated key
Answers (1)
Vinod
on 16 Oct 2020
0 votes
Nothing has changed on the ThingSpeak end that will cause that.
Have a look at the documentation for the bulk_update endpoint. We suspect the content-type header is not specified correctly. It needs to be 'application/json' since you are sending in JSON data.
5 Comments
Mario Guthrie
on 16 Oct 2020
Mario Guthrie
on 16 Oct 2020
Edited: Mario Guthrie
on 16 Oct 2020
curl --request POST 'https://api.thingspeak.com/channels/936997/bulk_update.json' --header 'Content-Type: application/json' --data-raw '{"write_api_key": "MY_WRITE_API_KEY","updates": [{"created_at": "2020-10-17 10:26:2 -0500","field1": "1.0","field2": "2.0"},{"created_at": "2020-10-17 11:27:27 -0500","field1": "1.1","field2": "2.2","status": "well done"}]}'
Can you modify it for your channel and confirm it works?
Here's a link to my request on reqbin: https://reqbin.com/po2ag36d
Mario Guthrie
on 17 Oct 2020
cog
on 12 Feb 2023
Mario, did you isolate what it was about the way you built the data?
Communities
More Answers in the ThingSpeak Community
Categories
Find more on Read Data from Channel in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!