Hey thank you so much for the reply, I’ve been reading and testing in order to make a good reply.
I read about webhooks, and thats the way to go. I have some doubts regarding defining the reponse template.
This is my JSON, http://api.openweathermap.org/data/2.5/weather?q=Buenos%20Aires,ar&units=metric&lang=es_ar
On the response template I should add the complete description of the JSON I am using? or just the fields I want to retrieve?
Regarding the code on the spark core, I am ok there, Im a bit of a JR when it come to web and json, so sorry if some of my questions are really basic.
Also, should I nano a local json, using the format your provided??
like:
{
"event": "get_my_weather",
"url": "my own JSON",
"requestType": "POST",
"headers": null,
"query": null,
"responseTemplate": //my own response template,
"json": null,
"auth": null,
"mydevices": true
}
when I add a new json using the client, I get this kind of definition:
particle webhook GET get_weather2 http://api.openweathermap.org/data/2.5/weather?q=Buenos%20Aires,ar&units=metric&lang=es_aSending webhook request { uri: 'https://api.particle.io/v1/webhooks',
method: 'POST',
json:
{ event: 'get_weather',
url: 'http://api.openweathermap.org/data/2.5/weather?q=Buenos%20Aires,ar',
deviceid: undefined,
requestType: 'GET',
mydevices: true },
headers: { Authorization: 'Bearer 75ee4042b0e4ec052387ef6900d4b342511XXXX' } }
Successfully created webhook with ID 5608591cbcf35fab63XXXXXX
Thanks in advance.