401 error code when trying to bulk-write to Thingspeak using AT-COMMAND
9 ビュー (過去 30 日間)
古いコメントを表示
Hi everyone,
I would like to bulk-write json data to Thingspeak using AT commands (I'm using SIM7600 module). As I want to send a large amount of data at the same time, the json buffer is not enough. So I'm posting from a file. However I always get a 401 error code.
Does someone know why I get this error ?
The whole commands and results are reported below.
Thank you in advance
AT+HTTPINIT
OK
AT+HTTPPARA="URL","https://api.thingspeak.com/channels/<my_channel_id>/bulk_update.json"
OK
AT+HTTPPARA="CONTENT","application/json"
OK
AT+HTTPPOSTFILE="/data.txt",2,1,1
OK
AT+HTTPACTION=1
OK
+HTTPACTION: 1,401,0
+HTTPACTION: 1,401,154
+HTTP_PEER_CLOSED
AT+HTTPREAD=0,1000
OK
+HTTPREAD: DATA,154
{"status":"401","error":{"error_code":"error_auth_required","message":"Authorization Required","details":"Please provide proper authentication details."}}
+HTTPREAD:0
AT+HTTPTERM
OK
0 件のコメント
回答 (1 件)
Christopher Stapels
2024 年 7 月 1 日
The bulk endpoint requires a somewhat complex syntax. Check out the bulk JSON update page here. You aren't providing all the correct information, for example AIP key, etc.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で JSON Format についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!