Hi everyone,
I am very new to this I am on day 5 as a photon owner. Here is what i am trying to do and what I could use a little advice about.
I need to post more then one value from my photon to a web API. Sending it as a Get is also an option but again its more then one value that must be sent.
Here is what i have come up with so far.
Lets say Light level and devices IP address. I have been reading about this for a while. Here is what i have come up with.
IPAddress myAddr = WiFi.localIP();
byte oct1 = myAddr[0];
byte oct2 = myAddr[1];
byte oct3 = myAddr[2];
byte oct4 = myAddr[3];
char s[16];
sprintf(s, "%d.%d.%d.%d", oct1, oct2, oct3, oct4);
char crap[1000] ;
sprintf(crap,"{ \"DeviceLocation\": \"LivingRoom\",\"DeviceIP\": \"%s\" ,\"LightLevel\": \"%u\"}" , s,analogvalue);
Particle.publish("CurrentData", crap, PRIVATE);
This should if i understand it correctly send a JSon string to the event log.
I have been looking at web hooks and i cant figure out if its even possible to get the web hook to read the events json string and then post that to the server location i have set in the web hook. everything i have found was for using forms and {{PARTICLE_EVENT_VALUE}} I don’t think i can use that because i need to send more then one value from the device.
Unfortunately my device is offline for some reason and i cant test it. But I want to be sure i am on the right track with this before i start going off in the wrong direction.