Hi Warren,
It looks like you are on the right track, but there are some things that need to be considered when using ThingHTTP for GET requests with dynamic data from ThingSpeak channels. The %% notation is indeed used for placeholders, but the setup must be done correctly in ThingHTTP.
Here is a step-by-step guide to help you set this up:
- Click Apps > ThingHTTP, and then click New ThingHTTP.
- The next step is to configure the ThingHTTP. See the following section to properly configure ThingHTTP. https://www.mathworks.com/help/thingspeak/thinghttp-app.html#bvtzy2y-1:~:text=New%20ThingHTTP.-,Specify%20settings,-.%20Not%20all%20settings
- Finally, test the ThingHTTP url. Once saved, You can use POSTMAN to try out your HTTP requests using the RESTful API for ThingSpeak.
If the above steps are correctly followed, the placeholder `%%channel_1234567_field_1%%` should be replaced with the actual value from the specified ThingSpeak channel and field.
Please note that if this does not resolve your query, then following these troubleshooting steps can help -
- Check Channel ID and Field Number: Ensure that the channel ID and field number are correct.
- Public or Private Channels: Replacement requests to private channels not owned by the same user as the ThingHTTP request return blank values.
- URL Encoding: Make sure the URL is properly encoded if it contains special characters.
If you follow these steps and ensure all configurations are correct, you should be able to successfully include a ThingSpeak channel field value in your ThingHTTP GET request.
I hope this helps!