- Particle
- constructor
- login
- sendOtp
- enableMfa
- confirmMfa
- disableMfa
- createCustomer
- 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
- changeUsername
- changeUserPassword
- 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
optionsObject 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
optionsObject Options for this API call
Returns Promise
If login failed with an 'mfa_required' error, this must be called with a valid OTP code to login
Parameters
optionsObject Options for this API call
Returns Promise
Enable MFA on the currently logged in user
Parameters
optionsObject Options for this API call
Returns Promise
Confirm MFA for the user. This must be called with current TOTP code, determined from the results of enableMfa(). You will be prompted to enter an OTP code every time you login after enrollment is confirmed.
Parameters
optionsObject Options for this API call
Returns Promise
Disable MFA for the user.
Parameters
optionsObject Options for this API call
Returns Promise
Create Customer for Product.
Parameters
optionsObject 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
optionsObject Options for this API call
Returns Promise
Verify new user account via verification email
Parameters
optionsObject Options for this API calloptions.tokenString 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
optionsObject 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
optionsObject Options for this API call
Returns Promise
Retrieves the information that is used to identify the current login for tracking.
Parameters
optionsObject 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
optionsObject Options for this API calloptions.deviceIdString? (Product only) Filter results to devices with this ID (partial matching)options.deviceNameString? (Product only) Filter results to devices with this name (partial matching)options.sortAttrString? (Product only) The attribute by which to sort results. See API docs for options.options.sortDirString? (Product only) The direction of sorting. See API docs for options.options.pageNumber? (Product only) Current page of resultsoptions.perPageNumber? (Product only) Records per pageoptions.productString? List devices in this product ID or slugoptions.authString Access Tokenoptions.context
Returns Promise
Get detailed informationa about a device
Parameters
optionsObject Options for this API call
Returns Promise
Claim a device to the account. The device must be online and unclaimed.
Parameters
optionsObject Options for this API call
Returns Promise
Add a device to a product or move device out of quarantine.
Parameters
optionsObject Options for this API call
Returns Promise
Unclaim / Remove a device from your account or product, or deny quarantine
Parameters
optionsObject Options for this API call
Returns Promise
Unclaim a product device its the owner, but keep it in the product
Parameters
optionsObject Options for this API call
Returns Promise
Rename a device
Parameters
optionsObject Options for this API call
Returns Promise
Instruct the device to turn on/off the LED in a rainbow pattern
Parameters
optionsObject Options for this API call
Returns Promise
Store some notes about device
Parameters
optionsObject 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
optionsObject 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
optionsObject Options for this API call
Returns Promise
Mark device as receiving automatic firmware updates
Parameters
optionsObject Options for this API call
Returns Promise
Update multiple device attributes at the same time
Parameters
optionsObject Options for this API calloptions.deviceIdString Device ID or Nameoptions.nameString? Desired Nameoptions.signalBoolean Signal device on or offoptions.developmentBoolean? (Product only) Set to true to mark as development, false to return to product fleetoptions.productString? Device in this product ID or slugoptions.authString Access Tokenoptions.notesoptions.desiredFirmwareVersionoptions.flashoptions.context
Returns Promise
Provision a new device for products that allow self-provisioning
Parameters
optionsObject 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
optionsObject Options for this API call
Returns Promise
Get the value of a device variable
Parameters
optionsObject 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
optionsObject Options for this API calloptions.deviceIdString Device ID or Nameoptions.filesObject 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.targetVersionString System firmware version to compile against (optional, defaultlatest)options.authString Stringoptions.context
Returns Promise
DEPRECATED: Flash the Tinker application to a device. Instead compile and flash the Tinker source code.
Parameters
optionsObject Options for this API call
Returns Promise
Compile firmware using the Particle Cloud
Parameters
optionsObject Options for this API calloptions.filesObject 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.platformIdNumber? Platform id number of the device you are compiling for. Common values are 0=Core, 6=Photon, 10=Electron.options.targetVersionString System firmware version to compile against (optional, defaultlatest)options.authString Access Tokenoptions.context
Returns Promise
Download a firmware binary
Parameters
optionsObject Options for this API call
Returns Request
Send a new device public key to the Particle Cloud
Parameters
optionsObject Options for this API call
Returns Promise
Call a device function
Parameters
optionsObject Options for this API call
Returns Promise
Get a stream of events
Parameters
optionsObject 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
optionsObject Options for this API call
Returns Promise
Create a webhook
Parameters
optionsObject Options for this API calloptions.deviceIdString Trigger webhook only for this device ID or Nameoptions.nameString Webhook nameoptions.urlString URL the webhook should hitoptions.requestTypeString HTTP method to use (optional, defaultPOST)options.headersObject? Additional headers to add to the webhookoptions.jsonObject? JSON dataoptions.queryObject? Query string dataoptions.bodyString? Custom webhook request bodyoptions.responseTemplateObject? Webhook response templateoptions.responseTopicObject? Webhook response topicoptions.rejectUnauthorizedBoolean? Reject invalid HTTPS certificatesoptions.webhookAuthObject? HTTP Basic Auth informationoptions.formObject? Form dataoptions.productString? Webhook for this product ID or slugoptions.authString Access Tokenoptions.noDefaultsoptions.context
Returns Promise
Delete a webhook
Parameters
optionsObject Options for this API call
Returns Promise
List all webhooks owned by the account or product
Parameters
optionsObject 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
optionsObject Options for this API calloptions.integrationTypeString The kind of external integration. One of Webhook, AzureIotHub, GoogleCloudPubSub, GoogleMapsoptions.eventString Event that triggers the integrationoptions.deviceIdString? Trigger integration only for this device ID or Nameoptions.productString? Integration for this product ID or slugoptions.authString Access Tokenoptions.settingsoptions.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
optionsObject Options for this API calloptions.integrationIdString The integration to editoptions.eventString? Change the event that triggers the integrationoptions.deviceIdString? Trigger integration only for this device ID or Nameoptions.productString? Integration for this product ID or slugoptions.authString Access Tokenoptions.settingsoptions.context
Returns Promise
Delete an integration to send events to an external service
Parameters
optionsObject Options for this API call
Returns Promise
List all integrations owned by the account or product
Parameters
optionsObject Options for this API call
Returns Promise
Get details about the current user
Parameters
Returns Promise
Set details on the current user
Parameters
optionsObject Options for this API call
Returns Promise
Change username (i.e, email)
Parameters
optionsObject Options for this API call
Returns Promise
Change user's password
Parameters
optionsObject Options for this API call
Returns Promise
List SIM cards owned by a user or product
Parameters
optionsObject Options for this API calloptions.iccidString? (Product only) Filter to SIM cards matching this ICCIDoptions.deviceIdString? (Product only) Filter to SIM cards matching this device IDoptions.deviceNameString? (Product only) Filter to SIM cards matching this device nameoptions.pageNumber? (Product only) Current page of resultsoptions.perPageNumber? (Product only) Records per pageoptions.productString? SIM cards for this product ID or slugoptions.authString Access Tokenoptions.context
Returns Promise
Get data usage for one SIM card for the current billing period
Parameters
optionsObject Options for this API call
Returns Promise
Get data usage for all SIM cards in a product the current billing period
Parameters
optionsObject Options for this API call
Returns Promise
Activate and add SIM cards to an account or product
Parameters
optionsObject Options for this API calloptions.iccidString ICCID of the SIM cardoptions.iccidsArray<String> (Product only) ICCID of multiple SIM cards to importoptions.countryString The ISO country code for the SIM cardsoptions.productString? SIM cards for this product ID or slugoptions.authString Access Tokenoptions.promoCodeoptions.context
Returns Promise
Deactivate a SIM card so it doesn't incur data usage in future months.
Parameters
optionsObject Options for this API call
Returns Promise
Reactivate a SIM card the was deactivated or unpause a SIM card that was automatically paused
Parameters
optionsObject Options for this API call
Returns Promise
Update SIM card data limit
Parameters
optionsObject Options for this API call
Returns Promise
Remove a SIM card from an account so it can be activated by a different account
Parameters
optionsObject Options for this API call
Returns Promise
List valid build targets to be used for compiling
Parameters
optionsObject Options for this API call
Returns Promise
List firmware libraries
Parameters
optionsObject Options for this API calloptions.pageNumber Page index (default, first page)options.limitNumber Number of items per pageoptions.filterString Search term for the librariesoptions.sortString Ordering key for the library listoptions.architecturesArray<String> List of architectures to filteroptions.categoryString Category to filteroptions.scopeString 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.excludeScopesString list of scopes to excludeoptions.authString Access Tokenoptions.context
Returns Promise
Get firmware library details
Parameters
optionsObject Options for this API call
Returns Promise
Firmware library details for each version
Parameters
optionsObject Options for this API call
Returns Promise
Contribute a new library version from a compressed archive
Parameters
optionsObject Options for this API call
Returns Promise
Publish the latest version of a library to the public
Parameters
optionsObject Options for this API call
Returns Promise
Delete one version of a library or an entire private library
Parameters
optionsObject 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
optionsObject Options for this API call
Returns Promise
Create an OAuth client
Parameters
optionsObject Options for this API calloptions.nameString Name of the OAuth clientoptions.typeString web, installed or weboptions.redirect_uriString? URL to redirect after OAuth flow. Only for type web.options.scopeObject? Limits what the access tokens created by this client can do.options.productString? Create client for this product ID or slugoptions.authString Access Tokenoptions.context
Returns Promise
Update an OAuth client
Parameters
optionsObject Options for this API call
Returns Promise
Delete an OAuth client
Parameters
optionsObject Options for this API call
Returns Promise
List products the account has access to
Parameters
Returns Promise
Get detailed information about a product
Parameters
optionsObject Options for this API call
Returns Promise
List product firmware versions
Parameters
optionsObject Options for this API call
Returns Promise
List product firmware versions
Parameters
optionsObject Options for this API calloptions.fileObject 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.versionNumber Version number of new firmwareoptions.titleString Short identifier for the new firmwareoptions.descriptionString? Longer description for the new firmwareoptions.productString Firmware for this product ID or slugoptions.authString Access Tokenoptions.context
Returns Promise
Get information about a product firmware version
Parameters
optionsObject Options for this API call
Returns Promise
Update information for a product firmware version
Parameters
optionsObject Options for this API call
Returns Promise
Download a product firmware binary
Parameters
optionsObject Options for this API call
Returns Request
Release a product firmware version as the default version
Parameters
optionsObject Options for this API call
Returns Promise
List product team members
Parameters
optionsObject Options for this API call
Returns Promise
Invite Particle user to a product team
Parameters
optionsObject Options for this API call
Returns Promise
Remove Particle user to a product team
Parameters
optionsObject Options for this API call
Returns Promise
Fetch details about a serial number
Parameters
optionsObject Options for this API call
Returns Promise