Sending Data from the Webhook or External Cloud or any Application to Particle device

I an New to particle devices and would like to know about a small topic.
I am trying to integrate an Application with Particle cloud and would like to know some reference help about. How can i send some data from an application or a cloud platform in internet to the particle cloud and then to the Particle device.

@dilipkumarmadda, welcome to the Community! There are a couple of ways to send data from a cloud application to a device. Both are limited to 1024 bytes per transaction so if your data is larger than this, multiple transactions and a programmatic way to handle these will be needed.

  1. Device targeted data using Particle.function(). This allows your cloud application to send data to a specific device (by name or device ID). The device provides a specific response to the Particle.function() call that the cloud can receive.

  2. Event targeted data using Particle.subscribe(). One or more Particle devices subscribes to a cloud-published event along with its data. This approach does not provide a device-specific response to the cloud-published event.

Which approach you take will take may be influenced by, for example, whether you have a fleet of devices (commercial) or just a few personal ones, and whether you want to send the data to multiple devices at once versus one device at a time.

This Community has lots of examples you can find and asking questions is always welcome.

1 Like

@peekay123, Thanks for the reply and help about this. But to be more specific can the Particle cloud be a broker. The scenerio as publishing some data to particle cloud from webhooks lets say Thingspeak and send this data to the particle device which subscribe for the same data?

The Particle Cloud does not support incoming webhooks from external services for sending data to devices.

You can, however, call the Particle REST API for sending an event to a device from an external service. The main caveats are:

  • The external service must be able to create the data in the Particle API format. This is easiest when you have a service like Google Cloud Functions, Amazon Lambda, or NodeRED, but may be possible from other services.
  • The external service must know the Device ID of the device to send the data to. If they start from a received webhook from Particle, the payload contains this.
  • The external service must have an authorization token for your Particle account. This means you must trust the external service to securely hold it for you. For products, you can minimize the risk by using an API user that only has privileges for sending events.
1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.