I’ve just started playing with my Particle Photon.
I have been able to fire an event from curl and successfully subscribed to it over on the photon (using this documentation
I’ve been here: https://docs.particle.io/reference/api/#publish-an-event).
This is great, except what i would really like to do is call the publish api method and pass data to it using JSON rather than the additional url parameters. Is that possible?
Instead of doing an HTML POST to this url:
https://api.particle.io/v1/devices/events -d “name=my_event_name” -d “data=Hello World” -d “private=false” -d “ttl=60” -d access_token=xyz
Do something like this:
POST to https://api.particle.io/v1/devices/events -d access_token=xyz
with a JSON body of something like this:
The webhook that i’m going to eventually use to trigger this doesn’t allow me to put parameters into the URL, rather it just lets me populate them into a JSON body. If need be i can write my own web api to accept the JSON and then translate that into the url style that works… but just curious if that was my only option.
Thanks in advance!