HTTP API examples just got a big update:
If there’s anyone with Arduino GSM shield - could you please check if it works for you?
Thank you!
HTTP API examples just got a big update:
If there’s anyone with Arduino GSM shield - could you please check if it works for you?
Thank you!
Hi
I’ve been looking for something like this. I do a lot of work with data collection with Xively. Very good but the API key is a pain as it needs a header sent separately rather than in the URL like Thingspeak. I did raise a request to see if the Blynk webhooks could be extended to support the header function of the HTTP get/put calls but not had anything back so far.
Does by chance the library you have published handle header?
Here is what I do normally for the Yun and VBA respectively. But in the meantime I’ll give the library a bash on my esp8266:
Yun:
apiString = F(“X-ApiKey: “);
apiString += APIKEY;
Process xively;
// form the string for the URL parameter:
url = F(“https://api.xively.com/v2/feeds/”);
url += sFeed;
url += F(”/datastreams/”);
url += dataStream;
url += F(".csv");
// Send the HTTP GET request to xively.com
xively.begin(F(“curl”));
xively.addParameter(F("-k"));
xively.addParameter(F("–request"));
xively.addParameter(F(“GET”));
xively.addParameter(F("–header"));
xively.addParameter(apiString);
xively.addParameter(F("–verbose"));
xively.addParameter(url);
xively.run();
This is what it looks like using VBA:
Dim PutData As String
Dim MyRequest As Object
feed = “96473”
PutData = “8,” + “2013-01-27T00:00:00Z,” + “0” + vbCrLf
Set MyRequest = CreateObject(“WinHttp.WinHttpRequest.5.1”)
MyRequest.Open “PUT”, “http://api.xively.com/v2/feeds/” + feed + “.csv”
MyRequest.setRequestHeader “X-PachubeApiKey”, “blahblah”
MyRequest.setRequestHeader “Content-Length”, Len(PutData)
’ Send Request.
MyRequest.send (PutData)
Ah I see what you are doing now. This is not a general thing for HTTP for ESP8266 it is for your Blynk API. In any case it has introduced me to the Blynk API
However, do you know how the ESP8266wifi library can be used to do a header as per my requirement above and also is there a thought about extending the Blynk webhooks to handle headers?
You can do exactly the same as you would do with an Arduino regarding headers within your Blynk sketch but outside of Webhooks. You might be able to use Google scripting to send the header and then interface with the script via webhooks.
Hi. Thanks for getting back to me. I’ll detail the context of my challenge to illustrate why I asked the question. Please don’t worry if it is going to take up too much of your time - just if you have some quick kick starts for me.
Any pointers welcome but only if it won’t drain your time.
If the Yun is short of memory buy a 1MB ESP for a few dollars. WeMos D1 Mini Pro at $5 would be my choice. 1MB programmable memory and 15MB storage, currently 3MB useable until the Arduino core for ESP is updated.
Hi. sorry I pre-emptively posted the post. But yes your suggestion is one of the options but the challenge is the header unless I can find the code in the core library that you are using. I have a couple of ESP based boards on the way.