Bulk update 401. error unauthorized

조회 수: 12 (최근 30일)
Mario Guthrie
Mario Guthrie 2020년 10월 16일
댓글: cog 2023년 2월 12일
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."}
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

답변 (1개)

Vinod
Vinod 2020년 10월 16일
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
Mario Guthrie
Mario Guthrie 2020년 10월 17일
Thanks Vinod -- The curl works. You should add that to the documentation.
I was able to get my code working and it appears to have had something to do with how I constructed the code , maybe newlines ? not sure yet but will isolate the issue as others may have same.
Thanks!
cog
cog 2023년 2월 12일
Mario, did you isolate what it was about the way you built the data?

댓글을 달려면 로그인하십시오.

커뮤니티

더 많은 답변 보기:  ThingSpeak 커뮤니티

카테고리

Help CenterFile Exchange에서 Read Data from Channel에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by