I am trying to send my last data from my channel fields to my PushingBox scenario. I want to pass my fresh data from my fields.
On the PushingBox side i have set up few variables in my body message: "$variable_1$, $variable_2$, $variable_3$"
On my ThingSpeak side i have set up ThingHTTP with this:
URL: "http://api.pushingbox.com/pushingbox?devid=[MY PUSHINGBOX DEVICE ID]"
HTTP Auth Username: [MY PUSHINGBOX DEVICE ID]
HTTP Auth Password:
Content Type: application/json
I tried this:
URL: http://api.pushingbox.com/pushingbox?devid=%5BMY PUSHINGBOX DEVICE ID]&variable_1="TEST-1"&variable_2="TEST-2"&variable_3="TEST-3"
This works and i got notifications with these values. But what i want is not static data but data from my channel fields! So instead of "TEST-1" i want to have field_1 data and "TEST-2" i want to have field_2, etc.
Probably it has something to do with "Channel Value Replacements"
So my URL should look like something like this(but it doesn't work):
URL: http://api.pushingbox.com/pushingbox?devid=%5BMY PUSHINGBOX DEVICE ID]&variable_1=channel_[MY CHANNEL ID]_field_1%% &variable_2=channel_[MY CHANNEL ID]_field_1%%&variable_3=channel_[MY CHANNEL ID]_field_1%%
But how to use it, could u give me an example.
Should i append it in my URL or my body field, where exactly ... example please.
Am i missing something?
Maybe your second URL is missing the %% at the start of the variable -try
URL: http://api.pushingbox.com/pushingbox?devid=MY PUSHINGBOX DEVICE ID]&variable_1=%%channel_[MY CHANNEL ID]_field_1%% &variable_2=%%channel_[MY CHANNEL ID]_field_1%%&variable_3=channel_[MY CHANNEL ID]_field_1%%
If you include all the info in the parameters you probably can change
2) Post and Get. I have changed from POST to GET but without result. Could u give me an example of changing info in parameters?
Does pushingbox have a way to view incoming requests?
If not perhaps you can set up a url at http://requestb.in/ (click on create) then send your requests to there instead
eg (the 14j2... string will be different for yours)
The website will display what your program is sending to it and allow you to make changes. Perhaps thingspeak variable substitution doesnt work in the URL parameters... If so you may have to put the data in the body and go back to POST.
It works! THANK YOU!
I used requestb.in for testing.
Content Type: application/x-www-form-urlencoded
result is something like this: ....temperature=33.000001200456&humidity=46.00045660045
now i need to limit-format decimals to look something like this"0.00" I know that i can do it from arduino side but what about thingspeak side.
format --> %%channel_XXXXXXXX_field_1%%
So you confirmed that variable substitution DIDNT happen in the URL parameters? Thats useful information to know.
I suspect there's not much control over the formatting during variable substitution- if you want more control then maybe you have to use a matlab analysis app with the webwrite function.
Most Users Ever Online: 114
Currently Browsing this Page:
Guest Posters: 1
Administrators: Hans, lee