Particle Cloud API wrapper.
See https://docs.particle.io/reference/javascript/ for examples
of using the Particle class.
Most Particle methods take a single unnamed argument object documented as
$0 with key/value pairs for each option.
Constructor for the Cloud API wrapper.
Create a new Particle object and call methods below on it.
Parameters
Login to Particle Cloud using an existing Particle acccount.
Parameters
$0Object
Returns Promise
Create a user account for the Particle Cloud
Parameters
$0Object
Returns Promise
Create a shadow user account (two-legged auth) for the Particle Cloud
Parameters
Returns Promise
Verify new user account via verification email
Parameters
Returns Promise
Send reset password email for a Particle Cloud user account
Parameters
Returns Promise
Revoke an access token
Parameters
$0Object
Returns Promise
List all valid access tokens for a Particle Cloud account
Parameters
Returns Promise
List devices claimed to the account
Parameters
Returns Promise
Get detailed information about a device
Parameters
Returns Promise
Claim a device to the account. The device must be online and unclaimed.
Parameters
Returns Promise
Unclaim / Remove a device from your account
Parameters
Returns Promise
Rename a device
Parameters
$0Object
Returns Promise
Generate a claim code to use in the device claiming process.
Parameters
Returns Promise
Get the value of a device variable
Parameters
$0Object
Returns Promise
Instruct the device to turn on/off the LED in a rainbow pattern
Parameters
$0Object
Returns Promise
Compile and flash application firmware to a device
Parameters
$0Object$0.deviceIdString Device ID or Name$0.filesObject Object containing files to be compiled. Keys should be the filenames, and the values should be a path or Buffer of the file contents.$0.targetVersionString? System firmware version to compile against (optional, defaultlatest)$0.authString String
Returns Promise
Flash the Tinker application to a device
Parameters
Returns Promise
Compile firmware using the Particle Cloud
Parameters
$0Object$0.filesObject Object containing files to be compiled. Keys should be the filenames, and the values should be a path or Buffer of the file contents.$0.platformIdNumber? Platform id number of the device you are compiling for. Common values are 0=Core, 6=Photon, 10=Electron.$0.targetVersionString? System firmware version to compile against (optional, defaultlatest)$0.authString Access Token
Returns Promise
Download a firmware binary
Parameters
$0Object
Returns Request
Send a new device public key to the Particle Cloud
Parameters
$0Object
Returns Promise
Call a device function
Parameters
$0Object
Returns Promise
Get a stream of events
Parameters
$0Object
Returns Promise If the promise resolves, the resolution value will be an EventStream object that will emit 'event' events, as well as the specific named event.
Publish a event to the Particle Cloud
Parameters
$0Object
Returns Promise
Create a webhook
Parameters
$0Object$0.deviceIdString Device ID or Name$0.nameString Webhook name$0.urlString URL the webhook should hit$0.requestTypeString? HTTP method to use (optional, defaultPOST)$0.headersObject? Additional headers to add to the webhook$0.jsonObject? JSON data$0.queryObject? Query string data$0.responseTemplateObject? Webhook response template$0.responseTopicObject? Webhook response topic$0.rejectUnauthorizedBoolean? Reject invalid HTTPS certificates$0.webhookAuthObject? HTTP Basic Auth information$0.formObject? Form data$0.authString Access Token
Returns Promise
Delete a webhook
Parameters
Returns Promise
List all webhooks owned by the account
Parameters
Returns Promise
Get details about the current user
Parameters
Returns Promise
Set details on the current user
Parameters
$0Object
Returns Promise
List valid build targets to be used for compiling
Parameters
$0Object
Returns Promise
List firmware libraries
Parameters
$0Object$0.authString Access Token$0.pageNumber Page index (default, first page)$0.limitNumber Number of items per page$0.filterString Search term for the libraries$0.sortString Ordering key for the library list$0.architecturesArray<String> List of architectures to filter$0.categoryString Category to filter
Returns Promise
Get firmware library details
Parameters
$0Object
Returns Promise
Firmware library details for each version
Parameters
$0Object
Returns Promise
Contribute a new library version int the compressed archive
Parameters
$0Object
Returns Promise
Delete one version of a library or an entire published library
Parameters
$0Object
Returns Promise
Download an external file that may not be on the API
Parameters
Returns Promise Resolves to a buffer with the file data