Klaus in MATLAB Answers
上次活动时间: 2025-5-29

Hi, I tried to delete a channel data using POSTMAN as described here https://www.mathworks.com/help/thingspeak/clearchannel.html in Examples section: Use POSTMAN to Clear Channel The channel ID is correct, the write API key is correct, and the answer of postman after sending request is: { "status": "401", "error": { "error_code": "error_auth_required", "message": "Authorization Required", "details": "Please provide proper authentication details." } } I already tried to authorize me in Authorization tab using Basic Auth (username and password), but the result is the same. I already tried to use api_key in the request command directly: https://api.thingspeak.com/channels/1234567/feeds.json?api_key=XXXXXXXXXXXXXXXX The result is the same. 🙁 Does this channel deletion method work at all on ThingSpeak?
cog in MATLAB Answers
上次活动时间: 2023-8-2

I am attempting to bulk write some JSON data to a ThingSpeak channel using the API. An example payload is: % Payload is data = { 'write_api_key': <my_api_write_key>, 'updates': [ {'field5': 833.205, 'field4': 6, 'field3': 775.648, 'field2': 24.2523, 'delta_t': 1, 'field1': 59.1391}, {'field5': 833.199, 'field4': 6, 'field3': 771.03, 'field2': 24.2844, 'delta_t': 2, 'field1': 59.1331}, {'field5': 833.208, 'field4': 6, 'field3': 750.343, 'field2': 24.3008, 'delta_t': 3, 'field1': 59.1405}, {'field5': 833.208, 'field4': 7, 'field3': None, 'field2': 24.2903, 'delta_t': 5, 'field1': 59.1479}, {'field5': 833.216, 'field4': 7, 'field3': 748.45, 'field2': 24.2965, 'delta_t': 6, 'field1': 59.1686}, {'field5': 833.21, 'field4': 8, 'field3': None, 'field2': 24.2914, 'delta_t': 7, 'field1': 59.1756}, {'field5': 833.204, 'field4': 8, 'field3': 738.847, 'field2': 24.2867, 'delta_t': 8, 'field1': 59.1943}, {'field5': 833.208, 'field4': 8, 'field3': 732.472, 'field2': 24.2814, 'delta_t': 10, 'field1': 59.1964}, {'field5': 833.212, 'field4': 8, 'field3': None, 'field2': 24.2599, 'delta_t': 11, 'field1': 59.1971}, {'field5': 833.207, 'field4': 8, 'field3': 737.475, 'field2': 24.2658, 'delta_t': 12, 'field1': 59.2122}, {'field5': 833.212, 'field4': 8, 'field3': None, 'field2': 24.2498, 'delta_t': 14, 'field1': 59.2161}, {'field5': 833.209, 'field4': 7, 'field3': 749.432, 'field2': 24.2503, 'delta_t': 15, 'field1': 59.2298}, {'field5': 833.208, 'field4': 7, 'field3': 760.224, 'field2': 24.2396, 'delta_t': 16, 'field1': 59.2308} ] } I am sending this payload programatically, in Python, with the requests library using the following command: response = requests.post(url='https://api.thingspeak.com/channels/<my_channel_id>/bulk_update.json', ... data=json.dumps(data)) This results in the response below: % Response { "status": "401", "error": { "error_code":"error_auth_required", "message":"Authorization Required", "details":"Please provide proper authentication details." } } I am certain that the API write key and channel_id are correct. I have used both for single writes successfully. I am using a free ThingSpeak account. I have also tried adding headers to the requests.post() call to indicate explicitly that this is json data. I'm not sure why this is occuring and would sincerely appreciate any pointers.
Adam in MATLAB Answers
上次活动时间: 2021-5-19

I modified the WriteMultipleFields example to include a MAX31855 which measures the board temp and a K-type thermocouple. I seem to be getting the "Problem updating channel. HTTP error code -401" in my seriel monitor however it seems to updating my channel properly. I copied and pasted my API so I dont think there is a typo, especially since it updates the channel. Any ideas on how to fix this? or can it be left alone since it still works? Also, can you change the timezone in the visualization from GMT to a different zone? I updated my profile but that didn't do it I am using an Arduino Nano 33 IoT
Julius Kübler in MATLAB Answers
上次活动时间: 2021-1-28

Hey there, I want to delete a thingspeak channel using the webwrite function. This is what it looks like: url = ['https://api.thingspeak.com/channels/' channelID '.json'] options = weboptions('RequestMethod','delete', 'MediaType','application/x-www-form-urlencoded'); response = webwrite(url,'api_key',userAPIkey,options) This returns status 401 Unauthorized. But if I only change the RequestMethod to 'put', I don't get any errors. But using 'put' only allows me to change the channel settings. How do I delete the channel using webwrite?
Benjamin Cortez in MATLAB Answers
上次活动时间: 2020-1-28

I explain, under an alternative internet, I can send information without any problem from the Arduino to ThingSpeak, but when I connect to the network of my work (Ministry of Housing and Urbanization of Chile), it fails to send the applications, or I think it sends them but it is not able to receive answers .. In some occasions it does not solve the DNS, or in others, it resolves them, but it throws error 401 Unauthorized. So, I need to know what exactly the problem is, in order to send a ticket to those who are responsible for modifying the network here. To be more exact, I use an ENC28J60 module I would appreciate any help, if more information is missing just ask me, thank you and have a good day.

关于 ThingSpeak

The community for students, researchers, and engineers looking to use MATLAB, Simulink, and ThingSpeak for Internet of Things applications. You can find the latest ThingSpeak news, tutorials to jump-start your next IoT project, and a forum to engage in a discussion on your latest cloud-based project. You can see answers to problems other users have solved and share how you solved a problem.