Webwrite to metadata Thingspeak Channel
Show older comments
Helllo,
I would like to write to the Metadat of my channel but I cna't get it to work. as a test , I tried wiriting to the Status which works.
if fieldName = "status"; is changed to fieldName = "metadata"; it doesn't work! does anyone know the trick for getting this to work?
code here:
%keys & ID here ...
thingSpeakURL = "http://api.thingspeak.com/";
thingSpeakWriteURL = thingSpeakURL + "update";
fieldName = "status";
fieldValue = '[100 100 100 92 93 93 94 ; 55 55 56 57 58 63 64 ; 333 444 555 666 777 888 999]';
response = webwrite(thingSpeakWriteURL,"api_key",writeApiKey,fieldName,fieldValue);
1 Comment
Marc Hanssens
on 9 Jul 2024
Answers (1)
Piyush Kumar
on 26 Jun 2024
0 votes
"Metadata" is one of the channel properties. You can change your channel properties on the My Channels page in the Channel Settings tab. You can also use the REST API to Write Settings.
If you are using REST API to write settings, the URL format should be like this - https://api.thingspeak.com/channels/<channel_id>.<format>
You can go through these links for more details -
- https://www.mathworks.com/help/thingspeak/channel-settings.html
- https://www.mathworks.com/help/thingspeak/writesettings.html - It has an example on how to "Use POSTMAN to Write Channel Settings".
- https://www.mathworks.com/help/thingspeak/rest-api.html
If you want to update channel data using REST API, the URL format should be like this - https://api.thingspeak.com/update.<format>
1 Comment
Marc Hanssens
on 27 Jun 2024
Categories
Find more on Write Data to 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!