I have a problem: I want to publish an event from an external source to the particle cloud. When I try it with the following website, all works great: http://onlinecurl.com/
This uses a URL with just the events path but adds parameters using -d for all the other required elements. These parameters are passed in the body of the POST request and not in the URL. This is one of the primary differences between POST and GET requests over HTTP.
Ok , my problem is that a website should send something to my electron but the electron doesn’t have a static ip so my idea was that I use the cloud so that the electron can receive the data. Any other ideas?
OK so using publish to send stuff to your device works well–you just can’t use a GET URL to publish, you have to POST. Not only does your electron have a non-static IP address, it is on a cellular network that is not routed the same way as an ethernet or WiFi network so outbound TCP connections are fine, but inbound is a no-no.
What code on the website are you using to send the publish? NodeJS? PHP? Python? Curl? Something else? That is the part you are missing.
I am assuming you control and code the website but if not, then is this something a webhook could be used for? Having the Particle Cloud act as the intermediary works well too.
@peekay123, a webhook response is limited to 512 bytes per response message. A longer website response will create two or more subscription responses so you may need to accommodate for that. Have you looked at the total response payload size from paypas?
The problem is that the data doesnt show up (because I had to use “test” which creates a “test-event” but I wasn’t able to add some custom data
@electronweather, if the “test” payload is 900 bytes then when you do get the data in there, you can expect at least two subscribe messages back to your device. As for getting the right message/data together, I will need to defer to @bko.
I guess I have come around to think that you do in fact want to have your own server talking to paypal on the one side and the particle cloud on the other.
As I understand the API, you can view the payment data and basically say “yes” or “no” to the transaction. I think you should set up your own server that abstracts the data (do you really need all that data on the Electron?) and then lets you say “yes” or “no” from the Electron back to your server, which would then give the final answer to paypal.