- Particle
- constructor
- login
- loginAsClientOwner
- createUser
- verifyUser
- resetPassword
- deleteAccessToken
- deleteCurrentAccessToken
- listAccessTokens
- trackingIdentity
- listDevices
- getDevice
- claimDevice
- addDeviceToProduct
- removeDevice
- removeDeviceOwner
- renameDevice
- signalDevice
- setDeviceNotes
- markAsDevelopmentDevice
- lockDeviceProductFirmware
- unlockDeviceProductFirmware
- updateDevice
- provisionDevice
- getClaimCode
- getVariable
- flashDevice
- flashTinker
- compileCode
- downloadFirmwareBinary
- sendPublicKey
- callFunction
- getEventStream
- publishEvent
- createWebhook
- deleteWebhook
- listWebhooks
- createIntegration
- editIntegration
- deleteIntegration
- listIntegrations
- getUserInfo
- setUserInfo
- listSIMs
- getSIMDataUsage
- getFleetDataUsage
- activateSIM
- deactivateSIM
- reactivateSIM
- updateSIM
- removeSIM
- listBuildTargets
- listLibraries
- getLibrary
- getLibraryVersions
- contributeLibrary
- publishLibrary
- deleteLibrary
- downloadFile
- listOAuthClients
- createOAuthClient
- updateOAuthClient
- deleteOAuthClient
- listProducts
- getProduct
- listProductFirmware
- uploadProductFirmware
- getProductFirmware
- updateProductFirmware
- downloadProductFirmware
- releaseProductFirmware
- listTeamMembers
- inviteTeamMember
- removeTeamMember
- lookupSerialNumber
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
options
with key/value pairs for each option.
Parameters
options
(optional, default{}
)
Contructor for the Cloud API wrapper.
Create a new Particle object and call methods below on it.
Parameters
options
Object Options for this API call Options to be used for all requests (see Defaults) (optional, default{}
)
Login to Particle Cloud using an existing Particle acccount.
Parameters
options
Object Options for this API call
Returns Promise
Login to Particle Cloud using an OAuth client.
Parameters
Returns Promise
Create a user account for the Particle Cloud
Parameters
options
Object Options for this API call
Returns Promise
Verify new user account via verification email
Parameters
options
Object Options for this API calloptions.token
String the string token sent in the verification emailoptions.context
Returns Promise
Send reset password email for a Particle Cloud user account
Parameters
Returns Promise
Revoke an access token
Parameters
options
Object Options for this API call
Returns Promise
Revoke the current session access token
Parameters
Returns Promise
List all valid access tokens for a Particle Cloud account
Parameters
options
Object Options for this API call
Returns Promise
Retrieves the information that is used to identify the current login for tracking.
Parameters
options
Object Options for this API call (optional, default{}
)
Returns Promise<Object> Resolve the tracking identify of the current login
List devices claimed to the account or product
Parameters
options
Object Options for this API calloptions.deviceId
String? (Product only) Filter results to devices with this ID (partial matching)options.deviceName
String? (Product only) Filter results to devices with this name (partial matching)options.sortAttr
String? (Product only) The attribute by which to sort results. See API docs for options.options.sortDir
String? (Product only) The direction of sorting. See API docs for options.options.page
Number? (Product only) Current page of resultsoptions.perPage
Number? (Product only) Records per pageoptions.product
String? List devices in this product ID or slugoptions.auth
String Access Tokenoptions.context
Returns Promise
Get detailed informationa about a device
Parameters
options
Object Options for this API call
Returns Promise
Claim a device to the account. The device must be online and unclaimed.
Parameters
options
Object Options for this API call
Returns Promise
Add a device to a product or move device out of quarantine.
Parameters
options
Object Options for this API call
Returns Promise
Unclaim / Remove a device from your account or product, or deny quarantine
Parameters
options
Object Options for this API call
Returns Promise
Unclaim a product device its the owner, but keep it in the product
Parameters
options
Object Options for this API call
Returns Promise
Rename a device
Parameters
options
Object Options for this API call
Returns Promise
Instruct the device to turn on/off the LED in a rainbow pattern
Parameters
options
Object Options for this API call
Returns Promise
Store some notes about device
Parameters
options
Object Options for this API call
Returns Promise
Mark device as being used in development of a product so it opts out of automatic firmware updates
Parameters
options
Object Options for this API call
Returns Promise
Mark device as being used in development of a product so it opts out of automatic firmware updates
Parameters
options
Object Options for this API call
Returns Promise
Mark device as receiving automatic firmware updates
Parameters
options
Object Options for this API call
Returns Promise
Update multiple device attributes at the same time
Parameters
options
Object Options for this API calloptions.deviceId
String Device ID or Nameoptions.name
String? Desired Nameoptions.signal
Boolean Signal device on or offoptions.development
Boolean? (Product only) Set to true to mark as development, false to return to product fleetoptions.product
String? Device in this product ID or slugoptions.auth
String Access Tokenoptions.notes
options.desiredFirmwareVersion
options.flash
options.context
Returns Promise
Provision a new device for products that allow self-provisioning
Parameters
options
Object Options for this API call
Returns Promise
Generate a claim code to use in the device claiming process. To generate a claim code for a product, the access token MUST belong to a customer of the product.
Parameters
options
Object Options for this API call
Returns Promise
Get the value of a device variable
Parameters
options
Object Options for this API call
Returns Promise
Compile and flash application firmware to a device. Pass a pre-compiled binary to flash it directly to the device.
Parameters
options
Object Options for this API calloptions.deviceId
String Device ID or Nameoptions.files
Object Object containing files to be compiled and flashed. Keys should be the filenames, including relative path, and the values should be a path or Buffer of the file contents in Node, or a File or Blob in the browser.options.targetVersion
String System firmware version to compile against (optional, defaultlatest
)options.auth
String Stringoptions.context
Returns Promise
DEPRECATED: Flash the Tinker application to a device. Instead compile and flash the Tinker source code.
Parameters
options
Object Options for this API call
Returns Promise
Compile firmware using the Particle Cloud
Parameters
options
Object Options for this API calloptions.files
Object Object containing files to be compiled. Keys should be the filenames, including relative path, and the values should be a path or Buffer of the file contents in Node, or a File or Blob in the browser.options.platformId
Number? Platform id number of the device you are compiling for. Common values are 0=Core, 6=Photon, 10=Electron.options.targetVersion
String System firmware version to compile against (optional, defaultlatest
)options.auth
String Access Tokenoptions.context
Returns Promise
Download a firmware binary
Parameters
options
Object Options for this API call
Returns Request
Send a new device public key to the Particle Cloud
Parameters
options
Object Options for this API call
Returns Promise
Call a device function
Parameters
options
Object Options for this API call
Returns Promise
Get a stream of events
Parameters
options
Object Options for this API call
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
options
Object Options for this API call
Returns Promise
Create a webhook
Parameters
options
Object Options for this API calloptions.deviceId
String Trigger webhook only for this device ID or Nameoptions.name
String Webhook nameoptions.url
String URL the webhook should hitoptions.requestType
String HTTP method to use (optional, defaultPOST
)options.headers
Object? Additional headers to add to the webhookoptions.json
Object? JSON dataoptions.query
Object? Query string dataoptions.body
String? Custom webhook request bodyoptions.responseTemplate
Object? Webhook response templateoptions.responseTopic
Object? Webhook response topicoptions.rejectUnauthorized
Boolean? Reject invalid HTTPS certificatesoptions.webhookAuth
Object? HTTP Basic Auth informationoptions.form
Object? Form dataoptions.product
String? Webhook for this product ID or slugoptions.auth
String Access Tokenoptions.noDefaults
options.context
Returns Promise
Delete a webhook
Parameters
options
Object Options for this API call
Returns Promise
List all webhooks owned by the account or product
Parameters
options
Object Options for this API call
Returns Promise
Create an integration to send events to an external service
See the API docs for details https://docs.particle.io/reference/api/#integrations-webhooks-
Parameters
options
Object Options for this API calloptions.integrationType
String The kind of external integration. One of Webhook, AzureIotHub, GoogleCloudPubSub, GoogleMapsoptions.event
String Event that triggers the integrationoptions.deviceId
String? Trigger integration only for this device ID or Nameoptions.product
String? Integration for this product ID or slugoptions.auth
String Access Tokenoptions.settings
options.context
Returns Promise
Edit an integration to send events to an external service
See the API docs for details https://docs.particle.io/reference/api/#integrations-webhooks-
Parameters
options
Object Options for this API calloptions.integrationId
String The integration to editoptions.event
String? Change the event that triggers the integrationoptions.deviceId
String? Trigger integration only for this device ID or Nameoptions.product
String? Integration for this product ID or slugoptions.auth
String Access Tokenoptions.settings
options.context
Returns Promise
Delete an integration to send events to an external service
Parameters
options
Object Options for this API call
Returns Promise
List all integrations owned by the account or product
Parameters
options
Object Options for this API call
Returns Promise
Get details about the current user
Parameters
Returns Promise
Set details on the current user
Parameters
options
Object Options for this API call
Returns Promise
List SIM cards owned by a user or product
Parameters
options
Object Options for this API calloptions.iccid
String? (Product only) Filter to SIM cards matching this ICCIDoptions.deviceId
String? (Product only) Filter to SIM cards matching this device IDoptions.deviceName
String? (Product only) Filter to SIM cards matching this device nameoptions.page
Number? (Product only) Current page of resultsoptions.perPage
Number? (Product only) Records per pageoptions.product
String? SIM cards for this product ID or slugoptions.auth
String Access Tokenoptions.context
Returns Promise
Get data usage for one SIM card for the current billing period
Parameters
options
Object Options for this API call
Returns Promise
Get data usage for all SIM cards in a product the current billing period
Parameters
options
Object Options for this API call
Returns Promise
Activate and add SIM cards to an account or product
Parameters
options
Object Options for this API calloptions.iccid
String ICCID of the SIM cardoptions.iccids
Array<String> (Product only) ICCID of multiple SIM cards to importoptions.countryCode
String The ISO country code for the SIM cardsoptions.product
String? SIM cards for this product ID or slugoptions.auth
String Access Tokenoptions.promoCode
options.context
Returns Promise
Deactivate a SIM card so it doesn't incur data usage in future months.
Parameters
options
Object Options for this API call
Returns Promise
Reactivate a SIM card the was deactivated or unpause a SIM card that was automatically paused
Parameters
options
Object Options for this API call
Returns Promise
Update SIM card data limit
Parameters
options
Object Options for this API call
Returns Promise
Remove a SIM card from an account so it can be activated by a different account
Parameters
options
Object Options for this API call
Returns Promise
List valid build targets to be used for compiling
Parameters
options
Object Options for this API call
Returns Promise
List firmware libraries
Parameters
options
Object Options for this API calloptions.page
Number Page index (default, first page)options.limit
Number Number of items per pageoptions.filter
String Search term for the librariesoptions.sort
String Ordering key for the library listoptions.architectures
Array<String> List of architectures to filteroptions.category
String Category to filteroptions.scope
String The library scope to list. Default is 'all'. Other values are- 'all' - list public libraries and my private libraries- 'public' - list only public libraries
- 'private' - list only my private libraries
- 'mine' - list my libraries (public and private)
- 'official' - list only official libraries
- 'verified' - list only verified libraries
- 'featured' - list only featured libraries
options.excludeScopes
String list of scopes to excludeoptions.auth
String Access Tokenoptions.context
Returns Promise
Get firmware library details
Parameters
options
Object Options for this API call
Returns Promise
Firmware library details for each version
Parameters
options
Object Options for this API call
Returns Promise
Contribute a new library version from a compressed archive
Parameters
options
Object Options for this API call
Returns Promise
Publish the latest version of a library to the public
Parameters
options
Object Options for this API call
Returns Promise
Delete one version of a library or an entire private library
Parameters
options
Object Options for this API call
Returns Promise
Download an external file that may not be on the API
Parameters
Returns Promise Resolves to a buffer with the file data
List OAuth client created by the account
Parameters
options
Object Options for this API call
Returns Promise
Create an OAuth client
Parameters
options
Object Options for this API calloptions.name
String Name of the OAuth clientoptions.type
String web, installed or weboptions.redirect_uri
String? URL to redirect after OAuth flow. Only for type web.options.scope
Object? Limits what the access tokens created by this client can do.options.product
String? Create client for this product ID or slugoptions.auth
String Access Tokenoptions.context
Returns Promise
Update an OAuth client
Parameters
options
Object Options for this API call
Returns Promise
Delete an OAuth client
Parameters
options
Object Options for this API call
Returns Promise
List products the account has access to
Parameters
Returns Promise
Get detailed information about a product
Parameters
options
Object Options for this API call
Returns Promise
List product firmware versions
Parameters
options
Object Options for this API call
Returns Promise
List product firmware versions
Parameters
options
Object Options for this API calloptions.file
Object Path or Buffer of the new firmware file Either a path or Buffer of the file contents in Node, or a File or Blob in the browser.options.version
Number Version number of new firmwareoptions.title
String Short identifier for the new firmwareoptions.description
String? Longer description for the new firmwareoptions.product
String Firmware for this product ID or slugoptions.auth
String Access Tokenoptions.context
Returns Promise
Get information about a product firmware version
Parameters
options
Object Options for this API call
Returns Promise
Update information for a product firmware version
Parameters
options
Object Options for this API call
Returns Promise
Download a product firmware binary
Parameters
options
Object Options for this API call
Returns Request
Release a product firmware version as the default version
Parameters
options
Object Options for this API call
Returns Promise
List product team members
Parameters
options
Object Options for this API call
Returns Promise
Invite Particle user to a product team
Parameters
options
Object Options for this API call
Returns Promise
Remove Particle user to a product team
Parameters
options
Object Options for this API call
Returns Promise
Fetch details about a serial number
Parameters
options
Object Options for this API call
Returns Promise