particle-api-js 11.1.7 → 12.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +90 -10
- package/dist/particle.min.js +1 -1
- package/dist/particle.min.js.map +1 -1
- package/fs.d.ts +2 -0
- package/lib/fs.d.ts +2 -0
- package/lib/fs.js +3 -0
- package/lib/package.json +110 -0
- package/lib/src/Agent.d.ts +40 -0
- package/lib/src/Agent.d.ts.map +1 -0
- package/lib/src/Agent.js +233 -0
- package/lib/src/Agent.js.map +1 -0
- package/lib/src/Client.d.ts +80 -0
- package/lib/src/Client.d.ts.map +1 -0
- package/lib/src/Client.js +104 -0
- package/lib/src/Client.js.map +1 -0
- package/lib/src/Defaults.d.ts +6 -0
- package/lib/src/Defaults.d.ts.map +1 -0
- package/lib/src/Defaults.js +12 -0
- package/lib/src/Defaults.js.map +1 -0
- package/lib/src/EventStream.d.ts +31 -0
- package/lib/src/EventStream.d.ts.map +1 -0
- package/lib/src/EventStream.js +275 -0
- package/lib/src/EventStream.js.map +1 -0
- package/lib/src/Library.d.ts +33 -0
- package/lib/src/Library.d.ts.map +1 -0
- package/lib/src/Library.js +19 -0
- package/lib/src/Library.js.map +1 -0
- package/{src/Particle.js → lib/src/Particle.d.ts} +623 -1779
- package/lib/src/Particle.d.ts.map +1 -0
- package/lib/src/Particle.js +2578 -0
- package/lib/src/Particle.js.map +1 -0
- package/lib/src/types/common.d.ts +73 -0
- package/lib/src/types/common.d.ts.map +1 -0
- package/lib/src/types/common.js +3 -0
- package/lib/src/types/common.js.map +1 -0
- package/lib/src/types/index.d.ts +4 -0
- package/lib/src/types/index.d.ts.map +1 -0
- package/lib/src/types/index.js +20 -0
- package/lib/src/types/index.js.map +1 -0
- package/lib/src/types/requests.d.ts +568 -0
- package/lib/src/types/requests.d.ts.map +1 -0
- package/lib/src/types/requests.js +3 -0
- package/lib/src/types/requests.js.map +1 -0
- package/lib/src/types/responses.d.ts +449 -0
- package/lib/src/types/responses.d.ts.map +1 -0
- package/lib/src/types/responses.js +3 -0
- package/lib/src/types/responses.js.map +1 -0
- package/package.json +35 -14
- package/scripts/postprocess-docs.js +306 -0
- package/typedoc.json +20 -0
- package/.circleci/config.yml +0 -104
- package/.nvmrc +0 -1
- package/CHANGELOG.md +0 -404
- package/EventStream-e2e-browser.html +0 -39
- package/EventStream-e2e-node.js +0 -34
- package/RELEASE.md +0 -12
- package/bower.json +0 -30
- package/docs/api.md +0 -2594
- package/eslint.config.mjs +0 -7
- package/examples/login/login.html +0 -17
- package/karma.conf.js +0 -80
- package/src/Agent.js +0 -397
- package/src/Client.js +0 -171
- package/src/Defaults.js +0 -8
- package/src/EventStream.js +0 -269
- package/src/Library.js +0 -33
- package/test/Agent.integration.js +0 -23
- package/test/Agent.spec.js +0 -488
- package/test/Client.spec.js +0 -216
- package/test/Defaults.spec.js +0 -30
- package/test/EventStream.feature +0 -65
- package/test/EventStream.spec.js +0 -263
- package/test/FakeAgent.js +0 -27
- package/test/Library.spec.js +0 -40
- package/test/Particle.integration.js +0 -38
- package/test/Particle.spec.js +0 -3198
- package/test/fixtures/index.js +0 -15
- package/test/fixtures/libraries.json +0 -33
- package/test/fixtures/library.json +0 -31
- package/test/fixtures/libraryVersions.json +0 -211
- package/test/out.tmp +0 -0
- package/test/support/FixtureHttpServer.js +0 -28
- package/test/test-setup.js +0 -17
- package/tsconfig.json +0 -17
- package/webpack.config.js +0 -46
package/docs/api.md
DELETED
|
@@ -1,2594 +0,0 @@
|
|
|
1
|
-
<!-- Generated by documentation.js. Update this documentation by updating the source code. -->
|
|
2
|
-
|
|
3
|
-
### Table of Contents
|
|
4
|
-
|
|
5
|
-
- [Particle](#particle)
|
|
6
|
-
- [constructor](#constructor)
|
|
7
|
-
- [ToolContext](#toolcontext)
|
|
8
|
-
- [ProjectContext](#projectcontext)
|
|
9
|
-
- [setContext](#setcontext)
|
|
10
|
-
- [login](#login)
|
|
11
|
-
- [sendOtp](#sendotp)
|
|
12
|
-
- [enableMfa](#enablemfa)
|
|
13
|
-
- [confirmMfa](#confirmmfa)
|
|
14
|
-
- [disableMfa](#disablemfa)
|
|
15
|
-
- [createCustomer](#createcustomer)
|
|
16
|
-
- [loginAsClientOwner](#loginasclientowner)
|
|
17
|
-
- [createUser](#createuser)
|
|
18
|
-
- [verifyUser](#verifyuser)
|
|
19
|
-
- [resetPassword](#resetpassword)
|
|
20
|
-
- [deleteAccessToken](#deleteaccesstoken)
|
|
21
|
-
- [deleteCurrentAccessToken](#deletecurrentaccesstoken)
|
|
22
|
-
- [deleteActiveAccessTokens](#deleteactiveaccesstokens)
|
|
23
|
-
- [deleteUser](#deleteuser)
|
|
24
|
-
- [trackingIdentity](#trackingidentity)
|
|
25
|
-
- [listDevices](#listdevices)
|
|
26
|
-
- [getDevice](#getdevice)
|
|
27
|
-
- [claimDevice](#claimdevice)
|
|
28
|
-
- [addDeviceToProduct](#adddevicetoproduct)
|
|
29
|
-
- [removeDevice](#removedevice)
|
|
30
|
-
- [removeDeviceOwner](#removedeviceowner)
|
|
31
|
-
- [renameDevice](#renamedevice)
|
|
32
|
-
- [signalDevice](#signaldevice)
|
|
33
|
-
- [setDeviceNotes](#setdevicenotes)
|
|
34
|
-
- [markAsDevelopmentDevice](#markasdevelopmentdevice)
|
|
35
|
-
- [lockDeviceProductFirmware](#lockdeviceproductfirmware)
|
|
36
|
-
- [unlockDeviceProductFirmware](#unlockdeviceproductfirmware)
|
|
37
|
-
- [updateDevice](#updatedevice)
|
|
38
|
-
- [unprotectDevice](#unprotectdevice)
|
|
39
|
-
- [provisionDevice](#provisiondevice)
|
|
40
|
-
- [getClaimCode](#getclaimcode)
|
|
41
|
-
- [getVariable](#getvariable)
|
|
42
|
-
- [flashDevice](#flashdevice)
|
|
43
|
-
- [flashTinker](#flashtinker)
|
|
44
|
-
- [compileCode](#compilecode)
|
|
45
|
-
- [downloadFirmwareBinary](#downloadfirmwarebinary)
|
|
46
|
-
- [sendPublicKey](#sendpublickey)
|
|
47
|
-
- [callFunction](#callfunction)
|
|
48
|
-
- [getEventStream](#geteventstream)
|
|
49
|
-
- [publishEvent](#publishevent)
|
|
50
|
-
- [Hook](#hook)
|
|
51
|
-
- [createWebhook](#createwebhook)
|
|
52
|
-
- [deleteWebhook](#deletewebhook)
|
|
53
|
-
- [listWebhooks](#listwebhooks)
|
|
54
|
-
- [createIntegration](#createintegration)
|
|
55
|
-
- [editIntegration](#editintegration)
|
|
56
|
-
- [deleteIntegration](#deleteintegration)
|
|
57
|
-
- [listIntegrations](#listintegrations)
|
|
58
|
-
- [getUserInfo](#getuserinfo)
|
|
59
|
-
- [setUserInfo](#setuserinfo)
|
|
60
|
-
- [changeUsername](#changeusername)
|
|
61
|
-
- [changeUserPassword](#changeuserpassword)
|
|
62
|
-
- [listSIMs](#listsims)
|
|
63
|
-
- [getSIMDataUsage](#getsimdatausage)
|
|
64
|
-
- [getFleetDataUsage](#getfleetdatausage)
|
|
65
|
-
- [checkSIM](#checksim)
|
|
66
|
-
- [activateSIM](#activatesim)
|
|
67
|
-
- [deactivateSIM](#deactivatesim)
|
|
68
|
-
- [reactivateSIM](#reactivatesim)
|
|
69
|
-
- [updateSIM](#updatesim)
|
|
70
|
-
- [removeSIM](#removesim)
|
|
71
|
-
- [listBuildTargets](#listbuildtargets)
|
|
72
|
-
- [listLibraries](#listlibraries)
|
|
73
|
-
- [getLibrary](#getlibrary)
|
|
74
|
-
- [getLibraryVersions](#getlibraryversions)
|
|
75
|
-
- [contributeLibrary](#contributelibrary)
|
|
76
|
-
- [publishLibrary](#publishlibrary)
|
|
77
|
-
- [deleteLibrary](#deletelibrary)
|
|
78
|
-
- [downloadFile](#downloadfile)
|
|
79
|
-
- [listOAuthClients](#listoauthclients)
|
|
80
|
-
- [createOAuthClient](#createoauthclient)
|
|
81
|
-
- [updateOAuthClient](#updateoauthclient)
|
|
82
|
-
- [deleteOAuthClient](#deleteoauthclient)
|
|
83
|
-
- [listProducts](#listproducts)
|
|
84
|
-
- [getProduct](#getproduct)
|
|
85
|
-
- [listProductFirmware](#listproductfirmware)
|
|
86
|
-
- [uploadProductFirmware](#uploadproductfirmware)
|
|
87
|
-
- [getProductFirmware](#getproductfirmware)
|
|
88
|
-
- [updateProductFirmware](#updateproductfirmware)
|
|
89
|
-
- [downloadProductFirmware](#downloadproductfirmware)
|
|
90
|
-
- [downloadManufacturingBackup](#downloadmanufacturingbackup)
|
|
91
|
-
- [releaseProductFirmware](#releaseproductfirmware)
|
|
92
|
-
- [listTeamMembers](#listteammembers)
|
|
93
|
-
- [inviteTeamMember](#inviteteammember)
|
|
94
|
-
- [removeTeamMember](#removeteammember)
|
|
95
|
-
- [lookupSerialNumber](#lookupserialnumber)
|
|
96
|
-
- [createMeshNetwork](#createmeshnetwork)
|
|
97
|
-
- [removeMeshNetwork](#removemeshnetwork)
|
|
98
|
-
- [listMeshNetworks](#listmeshnetworks)
|
|
99
|
-
- [getMeshNetwork](#getmeshnetwork)
|
|
100
|
-
- [updateMeshNetwork](#updatemeshnetwork)
|
|
101
|
-
- [addMeshNetworkDevice](#addmeshnetworkdevice)
|
|
102
|
-
- [removeMeshNetworkDevice](#removemeshnetworkdevice)
|
|
103
|
-
- [listMeshNetworkDevices](#listmeshnetworkdevices)
|
|
104
|
-
- [getProductConfiguration](#getproductconfiguration)
|
|
105
|
-
- [getProductConfigurationSchema](#getproductconfigurationschema)
|
|
106
|
-
- [getProductDeviceConfiguration](#getproductdeviceconfiguration)
|
|
107
|
-
- [getProductDeviceConfigurationSchema](#getproductdeviceconfigurationschema)
|
|
108
|
-
- [setProductConfiguration](#setproductconfiguration)
|
|
109
|
-
- [setProductDeviceConfiguration](#setproductdeviceconfiguration)
|
|
110
|
-
- [getProductLocations](#getproductlocations)
|
|
111
|
-
- [getProductDeviceLocations](#getproductdevicelocations)
|
|
112
|
-
- [executeLogic](#executelogic)
|
|
113
|
-
- [createLogicFunction](#createlogicfunction)
|
|
114
|
-
- [getLogicFunction](#getlogicfunction)
|
|
115
|
-
- [updateLogicFunction](#updatelogicfunction)
|
|
116
|
-
- [deleteLogicFunction](#deletelogicfunction)
|
|
117
|
-
- [listLogicFunctions](#listlogicfunctions)
|
|
118
|
-
- [listLogicRuns](#listlogicruns)
|
|
119
|
-
- [getLogicRun](#getlogicrun)
|
|
120
|
-
- [getLogicRunLogs](#getlogicrunlogs)
|
|
121
|
-
- [createLedger](#createledger)
|
|
122
|
-
- [getLedger](#getledger)
|
|
123
|
-
- [updateLedger](#updateledger)
|
|
124
|
-
- [archiveLedger](#archiveledger)
|
|
125
|
-
- [Scope](#scope)
|
|
126
|
-
- [listLedgers](#listledgers)
|
|
127
|
-
- [getLedgerInstance](#getledgerinstance)
|
|
128
|
-
- [SetMode](#setmode)
|
|
129
|
-
- [setLedgerInstance](#setledgerinstance)
|
|
130
|
-
- [deleteLedgerInstance](#deleteledgerinstance)
|
|
131
|
-
- [listLedgerInstances](#listledgerinstances)
|
|
132
|
-
- [listLedgerInstanceVersions](#listledgerinstanceversions)
|
|
133
|
-
- [getLedgerInstanceVersion](#getledgerinstanceversion)
|
|
134
|
-
- [listDeviceOsVersions](#listdeviceosversions)
|
|
135
|
-
- [getDeviceOsVersion](#getdeviceosversion)
|
|
136
|
-
- [setDefaultAuth](#setdefaultauth)
|
|
137
|
-
- [get](#get)
|
|
138
|
-
- [head](#head)
|
|
139
|
-
- [post](#post)
|
|
140
|
-
- [put](#put)
|
|
141
|
-
- [delete](#delete)
|
|
142
|
-
- [request](#request)
|
|
143
|
-
|
|
144
|
-
## Particle
|
|
145
|
-
|
|
146
|
-
[src/Particle.js:20-2867](https://github.com/particle-iot/particle-api-js/blob/c3b9ce2826acb6e82333287cafc0fa1b75dc16d6/src/Particle.js#L20-L2867 "Source code on GitHub")
|
|
147
|
-
|
|
148
|
-
Particle Cloud API wrapper.
|
|
149
|
-
|
|
150
|
-
See <https://docs.particle.io/reference/javascript/> for examples
|
|
151
|
-
of using the `Particle` class.
|
|
152
|
-
|
|
153
|
-
Most Particle methods take a single unnamed argument object documented as
|
|
154
|
-
`options` with key/value pairs for each option.
|
|
155
|
-
|
|
156
|
-
**Parameters**
|
|
157
|
-
|
|
158
|
-
- `options` (optional, default `{}`)
|
|
159
|
-
|
|
160
|
-
### constructor
|
|
161
|
-
|
|
162
|
-
[src/Particle.js:33-43](https://github.com/particle-iot/particle-api-js/blob/c3b9ce2826acb6e82333287cafc0fa1b75dc16d6/src/Particle.js#L33-L43 "Source code on GitHub")
|
|
163
|
-
|
|
164
|
-
Contructor for the Cloud API wrapper.
|
|
165
|
-
|
|
166
|
-
Create a new Particle object and call methods below on it.
|
|
167
|
-
|
|
168
|
-
**Parameters**
|
|
169
|
-
|
|
170
|
-
- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Options for this API call Options to be used for all requests (see [Defaults](../src/Defaults.js)) (optional, default `{}`)
|
|
171
|
-
- `options.baseUrl` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?**
|
|
172
|
-
- `options.clientSecret` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?**
|
|
173
|
-
- `options.clientId` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?**
|
|
174
|
-
- `options.tokenDuration` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)?**
|
|
175
|
-
- `options.auth` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** The access token. If not specified here, will have to be added to every request
|
|
176
|
-
|
|
177
|
-
### ToolContext
|
|
178
|
-
|
|
179
|
-
[src/Particle.js:68-76](https://github.com/particle-iot/particle-api-js/blob/c3b9ce2826acb6e82333287cafc0fa1b75dc16d6/src/Particle.js#L68-L76 "Source code on GitHub")
|
|
180
|
-
|
|
181
|
-
Type: [Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)
|
|
182
|
-
|
|
183
|
-
**Parameters**
|
|
184
|
-
|
|
185
|
-
- `name`
|
|
186
|
-
- `context`
|
|
187
|
-
|
|
188
|
-
**Properties**
|
|
189
|
-
|
|
190
|
-
- `name` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)**
|
|
191
|
-
- `version` **([string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) \| [number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number))?**
|
|
192
|
-
- `components` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<Omit<ToolContext, `"components"`>>?**
|
|
193
|
-
|
|
194
|
-
### ProjectContext
|
|
195
|
-
|
|
196
|
-
[src/Particle.js:68-76](https://github.com/particle-iot/particle-api-js/blob/c3b9ce2826acb6e82333287cafc0fa1b75dc16d6/src/Particle.js#L68-L76 "Source code on GitHub")
|
|
197
|
-
|
|
198
|
-
Type: Record<[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String), ([string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) \| [number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number))>
|
|
199
|
-
|
|
200
|
-
**Parameters**
|
|
201
|
-
|
|
202
|
-
- `name`
|
|
203
|
-
- `context`
|
|
204
|
-
|
|
205
|
-
**Properties**
|
|
206
|
-
|
|
207
|
-
- `name` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)**
|
|
208
|
-
|
|
209
|
-
### setContext
|
|
210
|
-
|
|
211
|
-
[src/Particle.js:68-76](https://github.com/particle-iot/particle-api-js/blob/c3b9ce2826acb6e82333287cafc0fa1b75dc16d6/src/Particle.js#L68-L76 "Source code on GitHub")
|
|
212
|
-
|
|
213
|
-
Allows setting a tool or project context which will be sent as headers with every request.
|
|
214
|
-
Tool- x-particle-tool
|
|
215
|
-
Project- x-particle-project
|
|
216
|
-
|
|
217
|
-
**Parameters**
|
|
218
|
-
|
|
219
|
-
- `name` **(`"tool"` \| `"project"`)**
|
|
220
|
-
- `context` **(ToolContext | ProjectContext | [undefined](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined))**
|
|
221
|
-
|
|
222
|
-
### login
|
|
223
|
-
|
|
224
|
-
[src/Particle.js:99-116](https://github.com/particle-iot/particle-api-js/blob/c3b9ce2826acb6e82333287cafc0fa1b75dc16d6/src/Particle.js#L99-L116 "Source code on GitHub")
|
|
225
|
-
|
|
226
|
-
Login to Particle Cloud using an existing Particle acccount.
|
|
227
|
-
|
|
228
|
-
**Parameters**
|
|
229
|
-
|
|
230
|
-
- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Options for this API call
|
|
231
|
-
- `options.username` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Username for the Particle account
|
|
232
|
-
- `options.password` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Password for the Particle account
|
|
233
|
-
- `options.tokenDuration` **[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** How long the access token should last in seconds (optional, default `this.tokenDuration`)
|
|
234
|
-
- `options.headers` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
235
|
-
- `options.context` **[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)?** Request context
|
|
236
|
-
|
|
237
|
-
Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)** A promise
|
|
238
|
-
|
|
239
|
-
### sendOtp
|
|
240
|
-
|
|
241
|
-
[src/Particle.js:127-143](https://github.com/particle-iot/particle-api-js/blob/c3b9ce2826acb6e82333287cafc0fa1b75dc16d6/src/Particle.js#L127-L143 "Source code on GitHub")
|
|
242
|
-
|
|
243
|
-
If login failed with an 'mfa_required' error, this must be called with a valid OTP code to login
|
|
244
|
-
|
|
245
|
-
**Parameters**
|
|
246
|
-
|
|
247
|
-
- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Options for this API call
|
|
248
|
-
- `options.mfaToken` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Given as 'mfa_token' in the error body of `.login()`.
|
|
249
|
-
- `options.otp` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Current one-time-password generated from the authentication application
|
|
250
|
-
- `options.headers` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
251
|
-
- `options.context` **[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)?** Request context
|
|
252
|
-
|
|
253
|
-
Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)** A promise
|
|
254
|
-
|
|
255
|
-
### enableMfa
|
|
256
|
-
|
|
257
|
-
[src/Particle.js:153-155](https://github.com/particle-iot/particle-api-js/blob/c3b9ce2826acb6e82333287cafc0fa1b75dc16d6/src/Particle.js#L153-L155 "Source code on GitHub")
|
|
258
|
-
|
|
259
|
-
Enable MFA on the currently logged in user
|
|
260
|
-
|
|
261
|
-
**Parameters**
|
|
262
|
-
|
|
263
|
-
- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Options for this API call
|
|
264
|
-
- `options.auth` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** The access token. Can be ignored if provided in constructor
|
|
265
|
-
- `options.headers` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
266
|
-
- `options.context` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Request context
|
|
267
|
-
|
|
268
|
-
Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)** A promise
|
|
269
|
-
|
|
270
|
-
### confirmMfa
|
|
271
|
-
|
|
272
|
-
[src/Particle.js:168-182](https://github.com/particle-iot/particle-api-js/blob/c3b9ce2826acb6e82333287cafc0fa1b75dc16d6/src/Particle.js#L168-L182 "Source code on GitHub")
|
|
273
|
-
|
|
274
|
-
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.
|
|
275
|
-
|
|
276
|
-
**Parameters**
|
|
277
|
-
|
|
278
|
-
- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Options for this API call
|
|
279
|
-
- `options.mfaToken` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Token given from previous step to
|
|
280
|
-
- `options.otp` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Current one-time-password generated from the authentication app
|
|
281
|
-
- `options.invalidateTokens` **[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Should all tokens be invalidated (optional, default `false`)
|
|
282
|
-
- `options.auth` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** The access token. Can be ignored if provided in constructor
|
|
283
|
-
- `options.headers` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
284
|
-
- `options.context` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Request context
|
|
285
|
-
|
|
286
|
-
Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)** A promise
|
|
287
|
-
|
|
288
|
-
### disableMfa
|
|
289
|
-
|
|
290
|
-
[src/Particle.js:193-201](https://github.com/particle-iot/particle-api-js/blob/c3b9ce2826acb6e82333287cafc0fa1b75dc16d6/src/Particle.js#L193-L201 "Source code on GitHub")
|
|
291
|
-
|
|
292
|
-
Disable MFA for the user.
|
|
293
|
-
|
|
294
|
-
**Parameters**
|
|
295
|
-
|
|
296
|
-
- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Options for this API call
|
|
297
|
-
- `options.currentPassword` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** User's current password
|
|
298
|
-
- `options.auth` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** The access token. Can be ignored if provided in constructor
|
|
299
|
-
- `options.headers` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
300
|
-
- `options.context` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Request context
|
|
301
|
-
|
|
302
|
-
Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)** A promise
|
|
303
|
-
|
|
304
|
-
### createCustomer
|
|
305
|
-
|
|
306
|
-
[src/Particle.js:213-229](https://github.com/particle-iot/particle-api-js/blob/c3b9ce2826acb6e82333287cafc0fa1b75dc16d6/src/Particle.js#L213-L229 "Source code on GitHub")
|
|
307
|
-
|
|
308
|
-
Create Customer for Product.
|
|
309
|
-
|
|
310
|
-
**Parameters**
|
|
311
|
-
|
|
312
|
-
- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Options for this API call
|
|
313
|
-
- `options.email` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Username for the Particle account
|
|
314
|
-
- `options.password` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Password for the Particle account
|
|
315
|
-
- `options.product` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Create the customer in this product ID or slug
|
|
316
|
-
- `options.headers` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
317
|
-
- `options.context` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Request context
|
|
318
|
-
|
|
319
|
-
Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)** A promise
|
|
320
|
-
|
|
321
|
-
### loginAsClientOwner
|
|
322
|
-
|
|
323
|
-
[src/Particle.js:238-252](https://github.com/particle-iot/particle-api-js/blob/c3b9ce2826acb6e82333287cafc0fa1b75dc16d6/src/Particle.js#L238-L252 "Source code on GitHub")
|
|
324
|
-
|
|
325
|
-
Login to Particle Cloud using an OAuth client.
|
|
326
|
-
|
|
327
|
-
**Parameters**
|
|
328
|
-
|
|
329
|
-
- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Options for this API call
|
|
330
|
-
- `options.headers` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
331
|
-
- `options.context` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Request context
|
|
332
|
-
|
|
333
|
-
Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)** A promise
|
|
334
|
-
|
|
335
|
-
### createUser
|
|
336
|
-
|
|
337
|
-
[src/Particle.js:265-277](https://github.com/particle-iot/particle-api-js/blob/c3b9ce2826acb6e82333287cafc0fa1b75dc16d6/src/Particle.js#L265-L277 "Source code on GitHub")
|
|
338
|
-
|
|
339
|
-
Create a user account for the Particle Cloud
|
|
340
|
-
|
|
341
|
-
**Parameters**
|
|
342
|
-
|
|
343
|
-
- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Options for this API call
|
|
344
|
-
- `options.username` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Email of the new user
|
|
345
|
-
- `options.password` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Password
|
|
346
|
-
- `options.accountInfo` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Object that contains account information fields such as user real name, company name, business account flag etc
|
|
347
|
-
- `options.utm` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Object that contains info about the campaign that lead to this user creation
|
|
348
|
-
- `options.headers` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
349
|
-
- `options.context` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Request context
|
|
350
|
-
|
|
351
|
-
Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)** A promise
|
|
352
|
-
|
|
353
|
-
### verifyUser
|
|
354
|
-
|
|
355
|
-
[src/Particle.js:287-294](https://github.com/particle-iot/particle-api-js/blob/c3b9ce2826acb6e82333287cafc0fa1b75dc16d6/src/Particle.js#L287-L294 "Source code on GitHub")
|
|
356
|
-
|
|
357
|
-
Verify new user account via verification email
|
|
358
|
-
|
|
359
|
-
**Parameters**
|
|
360
|
-
|
|
361
|
-
- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Options for this API call
|
|
362
|
-
- `options.token` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** The string token sent in the verification email
|
|
363
|
-
- `options.headers` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
364
|
-
- `options.context` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Request context
|
|
365
|
-
|
|
366
|
-
Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)** A promise
|
|
367
|
-
|
|
368
|
-
### resetPassword
|
|
369
|
-
|
|
370
|
-
[src/Particle.js:304-311](https://github.com/particle-iot/particle-api-js/blob/c3b9ce2826acb6e82333287cafc0fa1b75dc16d6/src/Particle.js#L304-L311 "Source code on GitHub")
|
|
371
|
-
|
|
372
|
-
Send reset password email for a Particle Cloud user account
|
|
373
|
-
|
|
374
|
-
**Parameters**
|
|
375
|
-
|
|
376
|
-
- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Options for this API call
|
|
377
|
-
- `options.username` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Email of the user
|
|
378
|
-
- `options.headers` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
379
|
-
- `options.context` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Request context
|
|
380
|
-
|
|
381
|
-
Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)** A promise
|
|
382
|
-
|
|
383
|
-
### deleteAccessToken
|
|
384
|
-
|
|
385
|
-
[src/Particle.js:321-327](https://github.com/particle-iot/particle-api-js/blob/c3b9ce2826acb6e82333287cafc0fa1b75dc16d6/src/Particle.js#L321-L327 "Source code on GitHub")
|
|
386
|
-
|
|
387
|
-
Revoke an access token
|
|
388
|
-
|
|
389
|
-
**Parameters**
|
|
390
|
-
|
|
391
|
-
- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Options for this API call
|
|
392
|
-
- `options.token` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Access token you wish to revoke
|
|
393
|
-
- `options.headers` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
394
|
-
- `options.context` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Request context
|
|
395
|
-
|
|
396
|
-
Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)** A promise
|
|
397
|
-
|
|
398
|
-
### deleteCurrentAccessToken
|
|
399
|
-
|
|
400
|
-
[src/Particle.js:337-344](https://github.com/particle-iot/particle-api-js/blob/c3b9ce2826acb6e82333287cafc0fa1b75dc16d6/src/Particle.js#L337-L344 "Source code on GitHub")
|
|
401
|
-
|
|
402
|
-
Revoke the current session access token
|
|
403
|
-
|
|
404
|
-
**Parameters**
|
|
405
|
-
|
|
406
|
-
- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Options for this API call
|
|
407
|
-
- `options.auth` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** The access token. Can be ignored if provided in constructor
|
|
408
|
-
- `options.headers` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
409
|
-
- `options.context` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Request context
|
|
410
|
-
|
|
411
|
-
Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)** A promise
|
|
412
|
-
|
|
413
|
-
### deleteActiveAccessTokens
|
|
414
|
-
|
|
415
|
-
[src/Particle.js:354-361](https://github.com/particle-iot/particle-api-js/blob/c3b9ce2826acb6e82333287cafc0fa1b75dc16d6/src/Particle.js#L354-L361 "Source code on GitHub")
|
|
416
|
-
|
|
417
|
-
Revoke all active access tokens
|
|
418
|
-
|
|
419
|
-
**Parameters**
|
|
420
|
-
|
|
421
|
-
- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Options for this API call
|
|
422
|
-
- `options.auth` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** The access token. Can be ignored if provided in constructor
|
|
423
|
-
- `options.headers` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
424
|
-
- `options.context` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Request context
|
|
425
|
-
|
|
426
|
-
Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)** A promise
|
|
427
|
-
|
|
428
|
-
### deleteUser
|
|
429
|
-
|
|
430
|
-
[src/Particle.js:372-380](https://github.com/particle-iot/particle-api-js/blob/c3b9ce2826acb6e82333287cafc0fa1b75dc16d6/src/Particle.js#L372-L380 "Source code on GitHub")
|
|
431
|
-
|
|
432
|
-
Delete the current user
|
|
433
|
-
|
|
434
|
-
**Parameters**
|
|
435
|
-
|
|
436
|
-
- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Options for this API call
|
|
437
|
-
- `options.auth` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** The access token. Can be ignored if provided in constructor
|
|
438
|
-
- `options.password` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Password
|
|
439
|
-
- `options.headers` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
440
|
-
- `options.context` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Request context
|
|
441
|
-
|
|
442
|
-
Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)** A promise
|
|
443
|
-
|
|
444
|
-
### trackingIdentity
|
|
445
|
-
|
|
446
|
-
[src/Particle.js:392-400](https://github.com/particle-iot/particle-api-js/blob/c3b9ce2826acb6e82333287cafc0fa1b75dc16d6/src/Particle.js#L392-L400 "Source code on GitHub")
|
|
447
|
-
|
|
448
|
-
Retrieves the information that is used to identify the current login for tracking.
|
|
449
|
-
|
|
450
|
-
**Parameters**
|
|
451
|
-
|
|
452
|
-
- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Options for this API call (optional, default `{}`)
|
|
453
|
-
- `options.full` **[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)?** When true, retrieve all information for registering a user with the tracking API. When false,
|
|
454
|
-
retrieve only the unique tracking ID for the current login. (optional, default `false`)
|
|
455
|
-
- `options.auth` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** The access token. Can be ignored if provided in constructor
|
|
456
|
-
- `options.headers` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
457
|
-
- `options.context` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Request context
|
|
458
|
-
|
|
459
|
-
Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)<[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)>** Resolve the tracking identify of the current login
|
|
460
|
-
|
|
461
|
-
### listDevices
|
|
462
|
-
|
|
463
|
-
[src/Particle.js:418-437](https://github.com/particle-iot/particle-api-js/blob/c3b9ce2826acb6e82333287cafc0fa1b75dc16d6/src/Particle.js#L418-L437 "Source code on GitHub")
|
|
464
|
-
|
|
465
|
-
List devices claimed to the account or product
|
|
466
|
-
|
|
467
|
-
**Parameters**
|
|
468
|
-
|
|
469
|
-
- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Options for this API call
|
|
470
|
-
- `options.deviceId` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** (Product only) Filter results to devices with this ID (partial matching)
|
|
471
|
-
- `options.deviceName` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** (Product only) Filter results to devices with this name (partial matching)
|
|
472
|
-
- `options.groups` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)>?** (Product only) A list of full group names to filter results to devices belonging to these groups only.
|
|
473
|
-
- `options.sortAttr` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** (Product only) The attribute by which to sort results. See API docs for options.
|
|
474
|
-
- `options.sortDir` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** (Product only) The direction of sorting. See API docs for options.
|
|
475
|
-
- `options.page` **[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)?** (Product only) Current page of results
|
|
476
|
-
- `options.perPage` **[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)?** (Product only) Records per page
|
|
477
|
-
- `options.product` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** List devices in this product ID or slug
|
|
478
|
-
- `options.auth` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** The access token. Can be ignored if provided in constructor
|
|
479
|
-
- `options.headers` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
480
|
-
- `options.context` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Request context
|
|
481
|
-
|
|
482
|
-
Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)** A promise
|
|
483
|
-
|
|
484
|
-
### getDevice
|
|
485
|
-
|
|
486
|
-
[src/Particle.js:449-452](https://github.com/particle-iot/particle-api-js/blob/c3b9ce2826acb6e82333287cafc0fa1b75dc16d6/src/Particle.js#L449-L452 "Source code on GitHub")
|
|
487
|
-
|
|
488
|
-
Get detailed informationa about a device
|
|
489
|
-
|
|
490
|
-
**Parameters**
|
|
491
|
-
|
|
492
|
-
- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Options for this API call
|
|
493
|
-
- `options.deviceId` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Device ID or Name
|
|
494
|
-
- `options.product` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** Device in this product ID or slug
|
|
495
|
-
- `options.auth` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** The access token. Can be ignored if provided in constructor
|
|
496
|
-
- `options.headers` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
497
|
-
- `options.context` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Request context
|
|
498
|
-
|
|
499
|
-
Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)** A promise
|
|
500
|
-
|
|
501
|
-
### claimDevice
|
|
502
|
-
|
|
503
|
-
[src/Particle.js:464-475](https://github.com/particle-iot/particle-api-js/blob/c3b9ce2826acb6e82333287cafc0fa1b75dc16d6/src/Particle.js#L464-L475 "Source code on GitHub")
|
|
504
|
-
|
|
505
|
-
Claim a device to the account. The device must be online and unclaimed.
|
|
506
|
-
|
|
507
|
-
**Parameters**
|
|
508
|
-
|
|
509
|
-
- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Options for this API call
|
|
510
|
-
- `options.deviceId` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Device ID
|
|
511
|
-
- `options.requestTransfer` **[boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** True to request the device be transfered from another user
|
|
512
|
-
- `options.auth` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** The access token. Can be ignored if provided in constructor
|
|
513
|
-
- `options.headers` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
514
|
-
- `options.context` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Request context
|
|
515
|
-
|
|
516
|
-
Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)** A promise
|
|
517
|
-
|
|
518
|
-
### addDeviceToProduct
|
|
519
|
-
|
|
520
|
-
[src/Particle.js:489-507](https://github.com/particle-iot/particle-api-js/blob/c3b9ce2826acb6e82333287cafc0fa1b75dc16d6/src/Particle.js#L489-L507 "Source code on GitHub")
|
|
521
|
-
|
|
522
|
-
Add a device to a product or move device out of quarantine.
|
|
523
|
-
|
|
524
|
-
**Parameters**
|
|
525
|
-
|
|
526
|
-
- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Options for this API call
|
|
527
|
-
- `options.deviceId` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Device ID
|
|
528
|
-
- `options.product` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Add to this product ID or slug
|
|
529
|
-
- `options.file` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** A file that contains a single-column list of device IDs, device serial numbers, device IMEIs, or devie ICCIDs.
|
|
530
|
-
Node: Either a path or Buffer. Browser: a File or Blob.
|
|
531
|
-
- `options.auth` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** The access token. Can be ignored if provided in constructor
|
|
532
|
-
- `options.headers` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
533
|
-
- `options.context` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Request context
|
|
534
|
-
|
|
535
|
-
Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)** A promise
|
|
536
|
-
|
|
537
|
-
### removeDevice
|
|
538
|
-
|
|
539
|
-
[src/Particle.js:520-524](https://github.com/particle-iot/particle-api-js/blob/c3b9ce2826acb6e82333287cafc0fa1b75dc16d6/src/Particle.js#L520-L524 "Source code on GitHub")
|
|
540
|
-
|
|
541
|
-
Unclaim / Remove a device from your account or product, or deny quarantine
|
|
542
|
-
|
|
543
|
-
**Parameters**
|
|
544
|
-
|
|
545
|
-
- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Options for this API call
|
|
546
|
-
- `options.deviceId` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Device ID or Name
|
|
547
|
-
- `options.deny` **[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)?** (Product only) Deny this quarantined device, instead of removing an already approved device
|
|
548
|
-
- `options.product` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Remove from this product ID or slug
|
|
549
|
-
- `options.auth` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** The access token. Can be ignored if provided in constructor
|
|
550
|
-
- `options.headers` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
551
|
-
- `options.context` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Request context
|
|
552
|
-
|
|
553
|
-
Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)** A promise
|
|
554
|
-
|
|
555
|
-
### removeDeviceOwner
|
|
556
|
-
|
|
557
|
-
[src/Particle.js:536-539](https://github.com/particle-iot/particle-api-js/blob/c3b9ce2826acb6e82333287cafc0fa1b75dc16d6/src/Particle.js#L536-L539 "Source code on GitHub")
|
|
558
|
-
|
|
559
|
-
Unclaim a product device its the owner, but keep it in the product
|
|
560
|
-
|
|
561
|
-
**Parameters**
|
|
562
|
-
|
|
563
|
-
- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Options for this API call
|
|
564
|
-
- `options.deviceId` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Device ID or Name
|
|
565
|
-
- `options.product` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Remove from this product ID or slug
|
|
566
|
-
- `options.auth` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** The access token. Can be ignored if provided in constructor
|
|
567
|
-
- `options.headers` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
568
|
-
- `options.context` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Request context
|
|
569
|
-
|
|
570
|
-
Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)** A promise
|
|
571
|
-
|
|
572
|
-
### renameDevice
|
|
573
|
-
|
|
574
|
-
[src/Particle.js:552-554](https://github.com/particle-iot/particle-api-js/blob/c3b9ce2826acb6e82333287cafc0fa1b75dc16d6/src/Particle.js#L552-L554 "Source code on GitHub")
|
|
575
|
-
|
|
576
|
-
Rename a device
|
|
577
|
-
|
|
578
|
-
**Parameters**
|
|
579
|
-
|
|
580
|
-
- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Options for this API call
|
|
581
|
-
- `options.deviceId` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Device ID or Name
|
|
582
|
-
- `options.name` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Desired Name
|
|
583
|
-
- `options.product` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** Rename device in this product ID or slug
|
|
584
|
-
- `options.auth` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** The access token. Can be ignored if provided in constructor
|
|
585
|
-
- `options.headers` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
586
|
-
- `options.context` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Request context
|
|
587
|
-
|
|
588
|
-
Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)** A promise
|
|
589
|
-
|
|
590
|
-
### signalDevice
|
|
591
|
-
|
|
592
|
-
[src/Particle.js:567-569](https://github.com/particle-iot/particle-api-js/blob/c3b9ce2826acb6e82333287cafc0fa1b75dc16d6/src/Particle.js#L567-L569 "Source code on GitHub")
|
|
593
|
-
|
|
594
|
-
Instruct the device to turn on/off the LED in a rainbow pattern
|
|
595
|
-
|
|
596
|
-
**Parameters**
|
|
597
|
-
|
|
598
|
-
- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Options for this API call
|
|
599
|
-
- `options.deviceId` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Device ID or Name
|
|
600
|
-
- `options.signal` **[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Signal on or off
|
|
601
|
-
- `options.product` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** Device in this product ID or slug
|
|
602
|
-
- `options.auth` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** The access token. Can be ignored if provided in constructor
|
|
603
|
-
- `options.headers` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
604
|
-
- `options.context` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Request context
|
|
605
|
-
|
|
606
|
-
Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)** A promise
|
|
607
|
-
|
|
608
|
-
### setDeviceNotes
|
|
609
|
-
|
|
610
|
-
[src/Particle.js:582-584](https://github.com/particle-iot/particle-api-js/blob/c3b9ce2826acb6e82333287cafc0fa1b75dc16d6/src/Particle.js#L582-L584 "Source code on GitHub")
|
|
611
|
-
|
|
612
|
-
Store some notes about device
|
|
613
|
-
|
|
614
|
-
**Parameters**
|
|
615
|
-
|
|
616
|
-
- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Options for this API call
|
|
617
|
-
- `options.deviceId` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Device ID or Name
|
|
618
|
-
- `options.notes` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Your notes about this device
|
|
619
|
-
- `options.product` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** Device in this product ID or slug
|
|
620
|
-
- `options.auth` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** The access token. Can be ignored if provided in constructor
|
|
621
|
-
- `options.headers` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
622
|
-
- `options.context` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Request context
|
|
623
|
-
|
|
624
|
-
Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)** A promise
|
|
625
|
-
|
|
626
|
-
### markAsDevelopmentDevice
|
|
627
|
-
|
|
628
|
-
[src/Particle.js:597-599](https://github.com/particle-iot/particle-api-js/blob/c3b9ce2826acb6e82333287cafc0fa1b75dc16d6/src/Particle.js#L597-L599 "Source code on GitHub")
|
|
629
|
-
|
|
630
|
-
Mark device as being used in development of a product so it opts out of automatic firmware updates
|
|
631
|
-
|
|
632
|
-
**Parameters**
|
|
633
|
-
|
|
634
|
-
- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Options for this API call
|
|
635
|
-
- `options.deviceId` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Device ID or Name
|
|
636
|
-
- `options.development` **[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Set to true to mark as development, false to return to product fleet (optional, default `true`)
|
|
637
|
-
- `options.product` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Device in this product ID or slug
|
|
638
|
-
- `options.auth` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** The access token. Can be ignored if provided in constructor
|
|
639
|
-
- `options.headers` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
640
|
-
- `options.context` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Request context
|
|
641
|
-
|
|
642
|
-
Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)** A promise
|
|
643
|
-
|
|
644
|
-
### lockDeviceProductFirmware
|
|
645
|
-
|
|
646
|
-
[src/Particle.js:613-615](https://github.com/particle-iot/particle-api-js/blob/c3b9ce2826acb6e82333287cafc0fa1b75dc16d6/src/Particle.js#L613-L615 "Source code on GitHub")
|
|
647
|
-
|
|
648
|
-
Mark device as being used in development of a product, so it opts out of automatic firmware updates
|
|
649
|
-
|
|
650
|
-
**Parameters**
|
|
651
|
-
|
|
652
|
-
- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Options for this API call
|
|
653
|
-
- `options.deviceId` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Device ID or Name
|
|
654
|
-
- `options.desiredFirmwareVersion` **[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** Lock the product device to run this firmware version.
|
|
655
|
-
- `options.flash` **[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)?** Immediately flash firmware indicated by desiredFirmwareVersion
|
|
656
|
-
- `options.product` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Device in this product ID or slug
|
|
657
|
-
- `options.auth` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** The access token. Can be ignored if provided in constructor
|
|
658
|
-
- `options.headers` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
659
|
-
- `options.context` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Request context
|
|
660
|
-
|
|
661
|
-
Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)** A promise
|
|
662
|
-
|
|
663
|
-
### unlockDeviceProductFirmware
|
|
664
|
-
|
|
665
|
-
[src/Particle.js:627-629](https://github.com/particle-iot/particle-api-js/blob/c3b9ce2826acb6e82333287cafc0fa1b75dc16d6/src/Particle.js#L627-L629 "Source code on GitHub")
|
|
666
|
-
|
|
667
|
-
Mark device as receiving automatic firmware updates
|
|
668
|
-
|
|
669
|
-
**Parameters**
|
|
670
|
-
|
|
671
|
-
- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Options for this API call
|
|
672
|
-
- `options.deviceId` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Device ID or Name
|
|
673
|
-
- `options.product` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Device in this product ID or slug
|
|
674
|
-
- `options.auth` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** The access token. Can be ignored if provided in constructor
|
|
675
|
-
- `options.headers` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
676
|
-
- `options.context` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Request context
|
|
677
|
-
|
|
678
|
-
Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)** A promise
|
|
679
|
-
|
|
680
|
-
### updateDevice
|
|
681
|
-
|
|
682
|
-
[src/Particle.js:648-660](https://github.com/particle-iot/particle-api-js/blob/c3b9ce2826acb6e82333287cafc0fa1b75dc16d6/src/Particle.js#L648-L660 "Source code on GitHub")
|
|
683
|
-
|
|
684
|
-
Update multiple device attributes at the same time
|
|
685
|
-
|
|
686
|
-
**Parameters**
|
|
687
|
-
|
|
688
|
-
- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Options for this API call
|
|
689
|
-
- `options.deviceId` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Device ID or Name
|
|
690
|
-
- `options.name` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** Desired Name
|
|
691
|
-
- `options.signal` **[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)?** Signal device on or off
|
|
692
|
-
- `options.notes` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** Your notes about this device
|
|
693
|
-
- `options.development` **[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)?** (Product only) Set to true to mark as development, false to return to product fleet
|
|
694
|
-
- `options.desiredFirmwareVersion` **([Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number) | null)?** (Product only) Lock the product device to run this firmware version.
|
|
695
|
-
Pass `null` to unlock firmware and go back to released firmware.
|
|
696
|
-
- `options.flash` **[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)?** (Product only) Immediately flash firmware indicated by desiredFirmwareVersion
|
|
697
|
-
- `options.product` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** Device in this product ID or slug
|
|
698
|
-
- `options.auth` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** The access token. Can be ignored if provided in constructor
|
|
699
|
-
- `options.headers` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
700
|
-
- `options.context` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Request context
|
|
701
|
-
|
|
702
|
-
Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)** A promise
|
|
703
|
-
|
|
704
|
-
### unprotectDevice
|
|
705
|
-
|
|
706
|
-
[src/Particle.js:680-696](https://github.com/particle-iot/particle-api-js/blob/c3b9ce2826acb6e82333287cafc0fa1b75dc16d6/src/Particle.js#L680-L696 "Source code on GitHub")
|
|
707
|
-
|
|
708
|
-
Disable device protection.
|
|
709
|
-
|
|
710
|
-
**Parameters**
|
|
711
|
-
|
|
712
|
-
- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Options for this API call.
|
|
713
|
-
- `options.deviceId` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Device ID or name.
|
|
714
|
-
- `options.org` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** Organziation ID or slug.
|
|
715
|
-
- `options.product` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** Product ID or slug.
|
|
716
|
-
- `options.action` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Request action: `prepare` or `confirm`.
|
|
717
|
-
- `options.serverNonce` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** Base64-encoded server nonce. Mandatory if `action` is `confirm`,
|
|
718
|
-
- `options.deviceNonce` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** Base64-encoded device nonce. Mandatory if `action` is `confirm`,
|
|
719
|
-
- `options.deviceSignature` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** Base64-encoded device signature. Mandatory if `action` is `confirm`,
|
|
720
|
-
- `options.devicePublicKeyFingerprint` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** Base64-encoded fingerprint of the device public key.
|
|
721
|
-
Mandatory if `action` is `confirm`,
|
|
722
|
-
- `options.auth` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** The access token. Can be ignored if provided in constructor.
|
|
723
|
-
- `options.headers` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Key/value pairs to send as headers.
|
|
724
|
-
- `options.context` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Request context.
|
|
725
|
-
|
|
726
|
-
Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)** A promise
|
|
727
|
-
|
|
728
|
-
### provisionDevice
|
|
729
|
-
|
|
730
|
-
[src/Particle.js:707-715](https://github.com/particle-iot/particle-api-js/blob/c3b9ce2826acb6e82333287cafc0fa1b75dc16d6/src/Particle.js#L707-L715 "Source code on GitHub")
|
|
731
|
-
|
|
732
|
-
Provision a new device for products that allow self-provisioning
|
|
733
|
-
|
|
734
|
-
**Parameters**
|
|
735
|
-
|
|
736
|
-
- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Options for this API call
|
|
737
|
-
- `options.productId` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Product ID where to create this device
|
|
738
|
-
- `options.auth` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** The access token. Can be ignored if provided in constructor
|
|
739
|
-
- `options.headers` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
740
|
-
- `options.context` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Request context
|
|
741
|
-
|
|
742
|
-
Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)** A promise
|
|
743
|
-
|
|
744
|
-
### getClaimCode
|
|
745
|
-
|
|
746
|
-
[src/Particle.js:729-732](https://github.com/particle-iot/particle-api-js/blob/c3b9ce2826acb6e82333287cafc0fa1b75dc16d6/src/Particle.js#L729-L732 "Source code on GitHub")
|
|
747
|
-
|
|
748
|
-
Generate a claim code to use in the device claiming process.
|
|
749
|
-
To generate a claim code for a product, the access token MUST belong to a
|
|
750
|
-
customer of the product.
|
|
751
|
-
|
|
752
|
-
**Parameters**
|
|
753
|
-
|
|
754
|
-
- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Options for this API call
|
|
755
|
-
- `options.iccid` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** ICCID of the SIM card used in the Electron
|
|
756
|
-
- `options.product` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** Device in this product ID or slug
|
|
757
|
-
- `options.auth` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** The access token. Can be ignored if provided in constructor
|
|
758
|
-
- `options.headers` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
759
|
-
- `options.context` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Request context
|
|
760
|
-
|
|
761
|
-
Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)** A promise
|
|
762
|
-
|
|
763
|
-
### getVariable
|
|
764
|
-
|
|
765
|
-
[src/Particle.js:754-760](https://github.com/particle-iot/particle-api-js/blob/c3b9ce2826acb6e82333287cafc0fa1b75dc16d6/src/Particle.js#L754-L760 "Source code on GitHub")
|
|
766
|
-
|
|
767
|
-
Get the value of a device variable
|
|
768
|
-
|
|
769
|
-
**Parameters**
|
|
770
|
-
|
|
771
|
-
- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Options for this API call
|
|
772
|
-
- `options.deviceId` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Device ID or Name
|
|
773
|
-
- `options.name` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Variable name
|
|
774
|
-
- `options.product` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** Device in this product ID or slug
|
|
775
|
-
- `options.auth` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** The access token. Can be ignored if provided in constructor
|
|
776
|
-
- `options.headers` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
777
|
-
- `options.context` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Request context
|
|
778
|
-
|
|
779
|
-
Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)** A promise
|
|
780
|
-
|
|
781
|
-
### flashDevice
|
|
782
|
-
|
|
783
|
-
[src/Particle.js:774-785](https://github.com/particle-iot/particle-api-js/blob/c3b9ce2826acb6e82333287cafc0fa1b75dc16d6/src/Particle.js#L774-L785 "Source code on GitHub")
|
|
784
|
-
|
|
785
|
-
Compile and flash application firmware to a device. Pass a pre-compiled binary to flash it directly to the device.
|
|
786
|
-
|
|
787
|
-
**Parameters**
|
|
788
|
-
|
|
789
|
-
- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Options for this API call
|
|
790
|
-
- `options.deviceId` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Device ID or Name
|
|
791
|
-
- `options.product` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Flash device in this product ID or slug
|
|
792
|
-
- `options.files` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/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.
|
|
793
|
-
- `options.targetVersion` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** System firmware version to compile against (optional, default `latest`)
|
|
794
|
-
- `options.auth` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** The access token. Can be ignored if provided in constructor
|
|
795
|
-
- `options.headers` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
796
|
-
- `options.context` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Request context
|
|
797
|
-
|
|
798
|
-
Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)** A promise
|
|
799
|
-
|
|
800
|
-
### flashTinker
|
|
801
|
-
|
|
802
|
-
[src/Particle.js:796-811](https://github.com/particle-iot/particle-api-js/blob/c3b9ce2826acb6e82333287cafc0fa1b75dc16d6/src/Particle.js#L796-L811 "Source code on GitHub")
|
|
803
|
-
|
|
804
|
-
DEPRECATED: Flash the Tinker application to a device. Instead compile and flash the Tinker source code.
|
|
805
|
-
|
|
806
|
-
**Parameters**
|
|
807
|
-
|
|
808
|
-
- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Options for this API call
|
|
809
|
-
- `options.deviceId` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Device ID or Name
|
|
810
|
-
- `options.auth` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** The access token. Can be ignored if provided in constructor
|
|
811
|
-
- `options.headers` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
812
|
-
- `options.context` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Request context
|
|
813
|
-
|
|
814
|
-
Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)** A promise
|
|
815
|
-
|
|
816
|
-
### compileCode
|
|
817
|
-
|
|
818
|
-
[src/Particle.js:824-842](https://github.com/particle-iot/particle-api-js/blob/c3b9ce2826acb6e82333287cafc0fa1b75dc16d6/src/Particle.js#L824-L842 "Source code on GitHub")
|
|
819
|
-
|
|
820
|
-
Compile firmware using the Particle Cloud
|
|
821
|
-
|
|
822
|
-
**Parameters**
|
|
823
|
-
|
|
824
|
-
- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Options for this API call
|
|
825
|
-
- `options.files` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/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.
|
|
826
|
-
- `options.platformId` **[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)?** Platform id number of the device you are compiling for. Common values are 0=Core, 6=Photon, 10=Electron.
|
|
827
|
-
- `options.targetVersion` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** System firmware version to compile against (optional, default `latest`)
|
|
828
|
-
- `options.auth` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** The access token. Can be ignored if provided in constructor
|
|
829
|
-
- `options.headers` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
830
|
-
- `options.context` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Request context
|
|
831
|
-
|
|
832
|
-
Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)** A promise
|
|
833
|
-
|
|
834
|
-
### downloadFirmwareBinary
|
|
835
|
-
|
|
836
|
-
[src/Particle.js:853-862](https://github.com/particle-iot/particle-api-js/blob/c3b9ce2826acb6e82333287cafc0fa1b75dc16d6/src/Particle.js#L853-L862 "Source code on GitHub")
|
|
837
|
-
|
|
838
|
-
Download a firmware binary
|
|
839
|
-
|
|
840
|
-
**Parameters**
|
|
841
|
-
|
|
842
|
-
- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Options for this API call
|
|
843
|
-
- `options.binaryId` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Binary ID received from a successful compile call
|
|
844
|
-
- `options.auth` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** The access token. Can be ignored if provided in constructor
|
|
845
|
-
- `options.headers` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
846
|
-
- `options.context` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Request context
|
|
847
|
-
|
|
848
|
-
Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)<RequestResponse, RequestError>** A promise
|
|
849
|
-
|
|
850
|
-
### sendPublicKey
|
|
851
|
-
|
|
852
|
-
[src/Particle.js:875-889](https://github.com/particle-iot/particle-api-js/blob/c3b9ce2826acb6e82333287cafc0fa1b75dc16d6/src/Particle.js#L875-L889 "Source code on GitHub")
|
|
853
|
-
|
|
854
|
-
Send a new device public key to the Particle Cloud
|
|
855
|
-
|
|
856
|
-
**Parameters**
|
|
857
|
-
|
|
858
|
-
- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Options for this API call
|
|
859
|
-
- `options.deviceId` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Device ID or Name
|
|
860
|
-
- `options.key` **([String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) \| [Buffer](https://nodejs.org/api/buffer.html))** Public key contents
|
|
861
|
-
- `options.algorithm` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Algorithm used to generate the public key. Valid values are `rsa` or `ecc`. (optional, default `rsa`)
|
|
862
|
-
- `options.auth` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** The access token. Can be ignored if provided in constructor
|
|
863
|
-
- `options.headers` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
864
|
-
- `options.context` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Request context
|
|
865
|
-
|
|
866
|
-
Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)** A promise
|
|
867
|
-
|
|
868
|
-
### callFunction
|
|
869
|
-
|
|
870
|
-
[src/Particle.js:903-908](https://github.com/particle-iot/particle-api-js/blob/c3b9ce2826acb6e82333287cafc0fa1b75dc16d6/src/Particle.js#L903-L908 "Source code on GitHub")
|
|
871
|
-
|
|
872
|
-
Call a device function
|
|
873
|
-
|
|
874
|
-
**Parameters**
|
|
875
|
-
|
|
876
|
-
- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Options for this API call
|
|
877
|
-
- `options.deviceId` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Device ID or Name
|
|
878
|
-
- `options.name` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Function name
|
|
879
|
-
- `options.argument` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Function argument
|
|
880
|
-
- `options.product` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** Device in this product ID or slug
|
|
881
|
-
- `options.auth` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** The access token. Can be ignored if provided in constructor
|
|
882
|
-
- `options.headers` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
883
|
-
- `options.context` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Request context
|
|
884
|
-
|
|
885
|
-
Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)** A promise
|
|
886
|
-
|
|
887
|
-
### getEventStream
|
|
888
|
-
|
|
889
|
-
[src/Particle.js:921-946](https://github.com/particle-iot/particle-api-js/blob/c3b9ce2826acb6e82333287cafc0fa1b75dc16d6/src/Particle.js#L921-L946 "Source code on GitHub")
|
|
890
|
-
|
|
891
|
-
Get a stream of events
|
|
892
|
-
|
|
893
|
-
**Parameters**
|
|
894
|
-
|
|
895
|
-
- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Options for this API call
|
|
896
|
-
- `options.deviceId` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** Device ID or Name, or `mine` to indicate only your devices.
|
|
897
|
-
- `options.name` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** Event Name
|
|
898
|
-
- `options.org` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** Organization Slug
|
|
899
|
-
- `options.product` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** Events for this product ID or slug
|
|
900
|
-
- `options.auth` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** The access token. Can be ignored if provided in constructor
|
|
901
|
-
|
|
902
|
-
Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)** If the promise resolves, the resolution value will be an EventStream object that will
|
|
903
|
-
emit 'event' events.
|
|
904
|
-
|
|
905
|
-
### publishEvent
|
|
906
|
-
|
|
907
|
-
[src/Particle.js:960-964](https://github.com/particle-iot/particle-api-js/blob/c3b9ce2826acb6e82333287cafc0fa1b75dc16d6/src/Particle.js#L960-L964 "Source code on GitHub")
|
|
908
|
-
|
|
909
|
-
Publish a event to the Particle Cloud
|
|
910
|
-
|
|
911
|
-
**Parameters**
|
|
912
|
-
|
|
913
|
-
- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Options for this API call
|
|
914
|
-
- `options.name` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Event name
|
|
915
|
-
- `options.data` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Event data
|
|
916
|
-
- `options.isPrivate` **[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Should the event be publicly available?
|
|
917
|
-
- `options.product` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** Event for this product ID or slug
|
|
918
|
-
- `options.auth` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** The access token. Can be ignored if provided in constructor
|
|
919
|
-
- `options.headers` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
920
|
-
- `options.context` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Request context
|
|
921
|
-
|
|
922
|
-
Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)** A promise
|
|
923
|
-
|
|
924
|
-
### Hook
|
|
925
|
-
|
|
926
|
-
[src/Particle.js:995-1017](https://github.com/particle-iot/particle-api-js/blob/c3b9ce2826acb6e82333287cafc0fa1b75dc16d6/src/Particle.js#L995-L1017 "Source code on GitHub")
|
|
927
|
-
|
|
928
|
-
Type: [Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)
|
|
929
|
-
|
|
930
|
-
**Parameters**
|
|
931
|
-
|
|
932
|
-
- `$0` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)**
|
|
933
|
-
- `$0.event`
|
|
934
|
-
- `$0.url`
|
|
935
|
-
- `$0.device`
|
|
936
|
-
- `$0.rejectUnauthorized`
|
|
937
|
-
- `$0.noDefaults`
|
|
938
|
-
- `$0.hook`
|
|
939
|
-
- `$0.product`
|
|
940
|
-
- `$0.auth`
|
|
941
|
-
- `$0.headers`
|
|
942
|
-
- `$0.context`
|
|
943
|
-
|
|
944
|
-
**Properties**
|
|
945
|
-
|
|
946
|
-
- `method` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** Type of web request triggered by the Webhook (GET, POST, PUT, or DELETE)
|
|
947
|
-
- `auth` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Auth data like `{ user: 'me', pass: '1234' }` for basic auth or `{ bearer: 'token' }` to send with the Webhook request
|
|
948
|
-
- `headers` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Additional headers to add to the Webhook like `{ 'X-ONE': '1', X-TWO: '2' }`
|
|
949
|
-
- `query` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Query params to add to the Webhook request like `{ foo: 'foo', bar: 'bar' }`
|
|
950
|
-
- `json` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** JSON data to send with the Webhook request - sets `Content-Type` to `application/json`
|
|
951
|
-
- `form` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Form data to send with the Webhook request - sets `Content-Type` to `application/x-www-form-urlencoded`
|
|
952
|
-
- `body` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** Custom body to send with the Webhook request
|
|
953
|
-
- `responseTemplate` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Template to use to customize the Webhook response body
|
|
954
|
-
- `responseEvent` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** The Webhook response event name that your devices can subscribe to
|
|
955
|
-
- `errorResponseEvent` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** The Webhook error response event name that your devices can subscribe to
|
|
956
|
-
|
|
957
|
-
### createWebhook
|
|
958
|
-
|
|
959
|
-
[src/Particle.js:995-1017](https://github.com/particle-iot/particle-api-js/blob/c3b9ce2826acb6e82333287cafc0fa1b75dc16d6/src/Particle.js#L995-L1017 "Source code on GitHub")
|
|
960
|
-
|
|
961
|
-
Create a webhook
|
|
962
|
-
|
|
963
|
-
**Parameters**
|
|
964
|
-
|
|
965
|
-
- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Options for this API call
|
|
966
|
-
- `options.event` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** The name of the Particle event that should trigger the Webhook
|
|
967
|
-
- `options.url` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** The web address that will be targeted when the Webhook is triggered
|
|
968
|
-
- `options.device` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** Trigger Webhook only for this device ID or Name
|
|
969
|
-
- `options.rejectUnauthorized` **[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)?** Set to `false` to skip SSL certificate validation of the target URL
|
|
970
|
-
- `options.noDefaults` **[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)?** Don't include default event data in the webhook request
|
|
971
|
-
- `options.hook` **Hook?** Webhook configuration settings
|
|
972
|
-
- `options.product` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** Webhook for this product ID or slug
|
|
973
|
-
- `options.auth` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** The access token. Can be ignored if provided in constructor
|
|
974
|
-
- `options.headers` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
975
|
-
- `options.context` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Request context
|
|
976
|
-
|
|
977
|
-
Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)** A promise
|
|
978
|
-
|
|
979
|
-
### deleteWebhook
|
|
980
|
-
|
|
981
|
-
[src/Particle.js:1029-1032](https://github.com/particle-iot/particle-api-js/blob/c3b9ce2826acb6e82333287cafc0fa1b75dc16d6/src/Particle.js#L1029-L1032 "Source code on GitHub")
|
|
982
|
-
|
|
983
|
-
Delete a webhook
|
|
984
|
-
|
|
985
|
-
**Parameters**
|
|
986
|
-
|
|
987
|
-
- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Options for this API call
|
|
988
|
-
- `options.hookId` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Webhook ID
|
|
989
|
-
- `options.product` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** Webhook for this product ID or slug
|
|
990
|
-
- `options.auth` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** The access token. Can be ignored if provided in constructor
|
|
991
|
-
- `options.headers` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
992
|
-
- `options.context` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Request context
|
|
993
|
-
|
|
994
|
-
Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)** A promise
|
|
995
|
-
|
|
996
|
-
### listWebhooks
|
|
997
|
-
|
|
998
|
-
[src/Particle.js:1043-1046](https://github.com/particle-iot/particle-api-js/blob/c3b9ce2826acb6e82333287cafc0fa1b75dc16d6/src/Particle.js#L1043-L1046 "Source code on GitHub")
|
|
999
|
-
|
|
1000
|
-
List all webhooks owned by the account or product
|
|
1001
|
-
|
|
1002
|
-
**Parameters**
|
|
1003
|
-
|
|
1004
|
-
- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Options for this API call
|
|
1005
|
-
- `options.product` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** Webhooks for this product ID or slug
|
|
1006
|
-
- `options.auth` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** The access token. Can be ignored if provided in constructor
|
|
1007
|
-
- `options.headers` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
1008
|
-
- `options.context` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Request context
|
|
1009
|
-
|
|
1010
|
-
Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)** A promise
|
|
1011
|
-
|
|
1012
|
-
### createIntegration
|
|
1013
|
-
|
|
1014
|
-
[src/Particle.js:1063-1067](https://github.com/particle-iot/particle-api-js/blob/c3b9ce2826acb6e82333287cafc0fa1b75dc16d6/src/Particle.js#L1063-L1067 "Source code on GitHub")
|
|
1015
|
-
|
|
1016
|
-
Create an integration to send events to an external service
|
|
1017
|
-
|
|
1018
|
-
See the API docs for details <https://docs.particle.io/reference/api/#integrations-webhooks->
|
|
1019
|
-
|
|
1020
|
-
**Parameters**
|
|
1021
|
-
|
|
1022
|
-
- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Options for this API call
|
|
1023
|
-
- `options.event` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Event that triggers the integration
|
|
1024
|
-
- `options.settings` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Settings specific to that integration type
|
|
1025
|
-
- `options.deviceId` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** Trigger integration only for this device ID or Name
|
|
1026
|
-
- `options.product` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** Integration for this product ID or slug
|
|
1027
|
-
- `options.auth` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** The access token. Can be ignored if provided in constructor
|
|
1028
|
-
- `options.headers` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
1029
|
-
- `options.context` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Request context
|
|
1030
|
-
|
|
1031
|
-
Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)** A promise
|
|
1032
|
-
|
|
1033
|
-
### editIntegration
|
|
1034
|
-
|
|
1035
|
-
[src/Particle.js:1085-1089](https://github.com/particle-iot/particle-api-js/blob/c3b9ce2826acb6e82333287cafc0fa1b75dc16d6/src/Particle.js#L1085-L1089 "Source code on GitHub")
|
|
1036
|
-
|
|
1037
|
-
Edit an integration to send events to an external service
|
|
1038
|
-
|
|
1039
|
-
See the API docs for details <https://docs.particle.io/reference/api/#integrations-webhooks->
|
|
1040
|
-
|
|
1041
|
-
**Parameters**
|
|
1042
|
-
|
|
1043
|
-
- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Options for this API call
|
|
1044
|
-
- `options.integrationId` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** The integration to edit
|
|
1045
|
-
- `options.event` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** Change the event that triggers the integration
|
|
1046
|
-
- `options.settings` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Change the settings specific to that integration type
|
|
1047
|
-
- `options.deviceId` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** Trigger integration only for this device ID or Name
|
|
1048
|
-
- `options.product` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** Integration for this product ID or slug
|
|
1049
|
-
- `options.auth` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** The access token. Can be ignored if provided in constructor
|
|
1050
|
-
- `options.headers` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
1051
|
-
- `options.context` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Request context
|
|
1052
|
-
|
|
1053
|
-
Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)** A promise
|
|
1054
|
-
|
|
1055
|
-
### deleteIntegration
|
|
1056
|
-
|
|
1057
|
-
[src/Particle.js:1102-1105](https://github.com/particle-iot/particle-api-js/blob/c3b9ce2826acb6e82333287cafc0fa1b75dc16d6/src/Particle.js#L1102-L1105 "Source code on GitHub")
|
|
1058
|
-
|
|
1059
|
-
Delete an integration to send events to an external service
|
|
1060
|
-
|
|
1061
|
-
**Parameters**
|
|
1062
|
-
|
|
1063
|
-
- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Options for this API call
|
|
1064
|
-
- `options.integrationId` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** The integration to remove
|
|
1065
|
-
- `options.product` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** Integration for this product ID or slug
|
|
1066
|
-
- `options.auth` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** The access token. Can be ignored if provided in constructor
|
|
1067
|
-
- `options.headers` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
1068
|
-
- `options.context` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Request context
|
|
1069
|
-
|
|
1070
|
-
Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)** A promise
|
|
1071
|
-
|
|
1072
|
-
### listIntegrations
|
|
1073
|
-
|
|
1074
|
-
[src/Particle.js:1116-1119](https://github.com/particle-iot/particle-api-js/blob/c3b9ce2826acb6e82333287cafc0fa1b75dc16d6/src/Particle.js#L1116-L1119 "Source code on GitHub")
|
|
1075
|
-
|
|
1076
|
-
List all integrations owned by the account or product
|
|
1077
|
-
|
|
1078
|
-
**Parameters**
|
|
1079
|
-
|
|
1080
|
-
- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Options for this API call
|
|
1081
|
-
- `options.product` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** Integrations for this product ID or slug
|
|
1082
|
-
- `options.auth` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** The access token. Can be ignored if provided in constructor
|
|
1083
|
-
- `options.headers` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
1084
|
-
- `options.context` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Request context
|
|
1085
|
-
|
|
1086
|
-
Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)** A promise
|
|
1087
|
-
|
|
1088
|
-
### getUserInfo
|
|
1089
|
-
|
|
1090
|
-
[src/Particle.js:1129-1131](https://github.com/particle-iot/particle-api-js/blob/c3b9ce2826acb6e82333287cafc0fa1b75dc16d6/src/Particle.js#L1129-L1131 "Source code on GitHub")
|
|
1091
|
-
|
|
1092
|
-
Get details about the current user
|
|
1093
|
-
|
|
1094
|
-
**Parameters**
|
|
1095
|
-
|
|
1096
|
-
- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Options for this API call
|
|
1097
|
-
- `options.auth` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** The access token. Can be ignored if provided in constructor
|
|
1098
|
-
- `options.headers` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
1099
|
-
- `options.context` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Request context
|
|
1100
|
-
|
|
1101
|
-
Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)** A promise
|
|
1102
|
-
|
|
1103
|
-
### setUserInfo
|
|
1104
|
-
|
|
1105
|
-
[src/Particle.js:1142-1145](https://github.com/particle-iot/particle-api-js/blob/c3b9ce2826acb6e82333287cafc0fa1b75dc16d6/src/Particle.js#L1142-L1145 "Source code on GitHub")
|
|
1106
|
-
|
|
1107
|
-
Set details on the current user
|
|
1108
|
-
|
|
1109
|
-
**Parameters**
|
|
1110
|
-
|
|
1111
|
-
- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Options for this API call
|
|
1112
|
-
- `options.accountInfo` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Set user's extended info fields (name, business account, company name, etc)
|
|
1113
|
-
- `options.auth` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** The access token. Can be ignored if provided in constructor
|
|
1114
|
-
- `options.headers` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
1115
|
-
- `options.context` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Request context
|
|
1116
|
-
|
|
1117
|
-
Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)** A promise
|
|
1118
|
-
|
|
1119
|
-
### changeUsername
|
|
1120
|
-
|
|
1121
|
-
[src/Particle.js:1158-1166](https://github.com/particle-iot/particle-api-js/blob/c3b9ce2826acb6e82333287cafc0fa1b75dc16d6/src/Particle.js#L1158-L1166 "Source code on GitHub")
|
|
1122
|
-
|
|
1123
|
-
Change username (i.e, email)
|
|
1124
|
-
|
|
1125
|
-
**Parameters**
|
|
1126
|
-
|
|
1127
|
-
- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Options for this API call
|
|
1128
|
-
- `options.currentPassword` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Current password
|
|
1129
|
-
- `options.username` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** New email
|
|
1130
|
-
- `options.invalidateTokens` **[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Should all tokens be invalidated (optional, default `false`)
|
|
1131
|
-
- `options.auth` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** The access token. Can be ignored if provided in constructor
|
|
1132
|
-
- `options.headers` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
1133
|
-
- `options.context` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Request context
|
|
1134
|
-
|
|
1135
|
-
Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)** A promise
|
|
1136
|
-
|
|
1137
|
-
### changeUserPassword
|
|
1138
|
-
|
|
1139
|
-
[src/Particle.js:1179-1187](https://github.com/particle-iot/particle-api-js/blob/c3b9ce2826acb6e82333287cafc0fa1b75dc16d6/src/Particle.js#L1179-L1187 "Source code on GitHub")
|
|
1140
|
-
|
|
1141
|
-
Change user's password
|
|
1142
|
-
|
|
1143
|
-
**Parameters**
|
|
1144
|
-
|
|
1145
|
-
- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Options for this API call
|
|
1146
|
-
- `options.currentPassword` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Current password
|
|
1147
|
-
- `options.password` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** New password
|
|
1148
|
-
- `options.invalidateTokens` **[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Should all tokens be invalidated (optional, default `false`)
|
|
1149
|
-
- `options.auth` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** The access token. Can be ignored if provided in constructor
|
|
1150
|
-
- `options.headers` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
1151
|
-
- `options.context` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Request context
|
|
1152
|
-
|
|
1153
|
-
Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)** A promise
|
|
1154
|
-
|
|
1155
|
-
### listSIMs
|
|
1156
|
-
|
|
1157
|
-
[src/Particle.js:1203-1207](https://github.com/particle-iot/particle-api-js/blob/c3b9ce2826acb6e82333287cafc0fa1b75dc16d6/src/Particle.js#L1203-L1207 "Source code on GitHub")
|
|
1158
|
-
|
|
1159
|
-
List SIM cards owned by a user or product
|
|
1160
|
-
|
|
1161
|
-
**Parameters**
|
|
1162
|
-
|
|
1163
|
-
- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Options for this API call
|
|
1164
|
-
- `options.iccid` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** (Product only) Filter to SIM cards matching this ICCID
|
|
1165
|
-
- `options.deviceId` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** (Product only) Filter to SIM cards matching this device ID
|
|
1166
|
-
- `options.deviceName` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** (Product only) Filter to SIM cards matching this device name
|
|
1167
|
-
- `options.page` **[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)?** (Product only) Current page of results
|
|
1168
|
-
- `options.perPage` **[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)?** (Product only) Records per page
|
|
1169
|
-
- `options.product` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** SIM cards for this product ID or slug
|
|
1170
|
-
- `options.auth` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** The access token. Can be ignored if provided in constructor
|
|
1171
|
-
- `options.headers` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
1172
|
-
- `options.context` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Request context
|
|
1173
|
-
|
|
1174
|
-
Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)** A promise
|
|
1175
|
-
|
|
1176
|
-
### getSIMDataUsage
|
|
1177
|
-
|
|
1178
|
-
[src/Particle.js:1219-1225](https://github.com/particle-iot/particle-api-js/blob/c3b9ce2826acb6e82333287cafc0fa1b75dc16d6/src/Particle.js#L1219-L1225 "Source code on GitHub")
|
|
1179
|
-
|
|
1180
|
-
Get data usage for one SIM card for the current billing period
|
|
1181
|
-
|
|
1182
|
-
**Parameters**
|
|
1183
|
-
|
|
1184
|
-
- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Options for this API call
|
|
1185
|
-
- `options.iccid` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** ICCID of the SIM card
|
|
1186
|
-
- `options.product` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** SIM card for this product ID or slug
|
|
1187
|
-
- `options.auth` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** The access token. Can be ignored if provided in constructor
|
|
1188
|
-
- `options.headers` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
1189
|
-
- `options.context` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Request context
|
|
1190
|
-
|
|
1191
|
-
Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)** A promise
|
|
1192
|
-
|
|
1193
|
-
### getFleetDataUsage
|
|
1194
|
-
|
|
1195
|
-
[src/Particle.js:1236-1243](https://github.com/particle-iot/particle-api-js/blob/c3b9ce2826acb6e82333287cafc0fa1b75dc16d6/src/Particle.js#L1236-L1243 "Source code on GitHub")
|
|
1196
|
-
|
|
1197
|
-
Get data usage for all SIM cards in a product the current billing period
|
|
1198
|
-
|
|
1199
|
-
**Parameters**
|
|
1200
|
-
|
|
1201
|
-
- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Options for this API call
|
|
1202
|
-
- `options.product` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** SIM cards for this product ID or slug
|
|
1203
|
-
- `options.auth` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** The access token. Can be ignored if provided in constructor
|
|
1204
|
-
- `options.headers` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
1205
|
-
- `options.context` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Request context
|
|
1206
|
-
|
|
1207
|
-
Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)** A promise
|
|
1208
|
-
|
|
1209
|
-
### checkSIM
|
|
1210
|
-
|
|
1211
|
-
[src/Particle.js:1254-1256](https://github.com/particle-iot/particle-api-js/blob/c3b9ce2826acb6e82333287cafc0fa1b75dc16d6/src/Particle.js#L1254-L1256 "Source code on GitHub")
|
|
1212
|
-
|
|
1213
|
-
Check SIM status
|
|
1214
|
-
|
|
1215
|
-
**Parameters**
|
|
1216
|
-
|
|
1217
|
-
- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Options for this API call
|
|
1218
|
-
- `options.iccid` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** ICCID of the SIM card
|
|
1219
|
-
- `options.auth` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** The access token. Can be ignored if provided in constructor
|
|
1220
|
-
- `options.headers` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
1221
|
-
- `options.context` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Request context
|
|
1222
|
-
|
|
1223
|
-
Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)** A promise
|
|
1224
|
-
|
|
1225
|
-
### activateSIM
|
|
1226
|
-
|
|
1227
|
-
[src/Particle.js:1271-1281](https://github.com/particle-iot/particle-api-js/blob/c3b9ce2826acb6e82333287cafc0fa1b75dc16d6/src/Particle.js#L1271-L1281 "Source code on GitHub")
|
|
1228
|
-
|
|
1229
|
-
Activate and add SIM cards to an account or product
|
|
1230
|
-
|
|
1231
|
-
**Parameters**
|
|
1232
|
-
|
|
1233
|
-
- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Options for this API call
|
|
1234
|
-
- `options.iccid` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** ICCID of the SIM card
|
|
1235
|
-
- `options.iccids` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)>** (Product only) ICCID of multiple SIM cards to import
|
|
1236
|
-
- `options.country` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** The ISO country code for the SIM cards
|
|
1237
|
-
- `options.promoCode` **any?**
|
|
1238
|
-
- `options.product` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** SIM cards for this product ID or slug
|
|
1239
|
-
- `options.auth` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** The access token. Can be ignored if provided in constructor
|
|
1240
|
-
- `options.headers` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
1241
|
-
- `options.context` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Request context
|
|
1242
|
-
|
|
1243
|
-
Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)** A promise
|
|
1244
|
-
|
|
1245
|
-
### deactivateSIM
|
|
1246
|
-
|
|
1247
|
-
[src/Particle.js:1293-1297](https://github.com/particle-iot/particle-api-js/blob/c3b9ce2826acb6e82333287cafc0fa1b75dc16d6/src/Particle.js#L1293-L1297 "Source code on GitHub")
|
|
1248
|
-
|
|
1249
|
-
Deactivate a SIM card so it doesn't incur data usage in future months.
|
|
1250
|
-
|
|
1251
|
-
**Parameters**
|
|
1252
|
-
|
|
1253
|
-
- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Options for this API call
|
|
1254
|
-
- `options.iccid` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** ICCID of the SIM card
|
|
1255
|
-
- `options.product` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** SIM cards for this product ID or slug
|
|
1256
|
-
- `options.auth` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** The access token. Can be ignored if provided in constructor
|
|
1257
|
-
- `options.headers` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
1258
|
-
- `options.context` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Request context
|
|
1259
|
-
|
|
1260
|
-
Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)** A promise
|
|
1261
|
-
|
|
1262
|
-
### reactivateSIM
|
|
1263
|
-
|
|
1264
|
-
[src/Particle.js:1310-1314](https://github.com/particle-iot/particle-api-js/blob/c3b9ce2826acb6e82333287cafc0fa1b75dc16d6/src/Particle.js#L1310-L1314 "Source code on GitHub")
|
|
1265
|
-
|
|
1266
|
-
Reactivate a SIM card the was deactivated or unpause a SIM card that was automatically paused
|
|
1267
|
-
|
|
1268
|
-
**Parameters**
|
|
1269
|
-
|
|
1270
|
-
- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Options for this API call
|
|
1271
|
-
- `options.iccid` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** ICCID of the SIM card
|
|
1272
|
-
- `options.mbLimit` **[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)?** New monthly data limit. Necessary if unpausing a SIM card
|
|
1273
|
-
- `options.product` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** SIM cards for this product ID or slug
|
|
1274
|
-
- `options.auth` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** The access token. Can be ignored if provided in constructor
|
|
1275
|
-
- `options.headers` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
1276
|
-
- `options.context` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Request context
|
|
1277
|
-
|
|
1278
|
-
Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)** A promise
|
|
1279
|
-
|
|
1280
|
-
### updateSIM
|
|
1281
|
-
|
|
1282
|
-
[src/Particle.js:1327-1331](https://github.com/particle-iot/particle-api-js/blob/c3b9ce2826acb6e82333287cafc0fa1b75dc16d6/src/Particle.js#L1327-L1331 "Source code on GitHub")
|
|
1283
|
-
|
|
1284
|
-
Update SIM card data limit
|
|
1285
|
-
|
|
1286
|
-
**Parameters**
|
|
1287
|
-
|
|
1288
|
-
- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Options for this API call
|
|
1289
|
-
- `options.iccid` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** ICCID of the SIM card
|
|
1290
|
-
- `options.mbLimit` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)** Data limit in megabyte for the SIM card
|
|
1291
|
-
- `options.product` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** SIM cards for this product ID or slug
|
|
1292
|
-
- `options.auth` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** The access token. Can be ignored if provided in constructor
|
|
1293
|
-
- `options.headers` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
1294
|
-
- `options.context` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Request context
|
|
1295
|
-
|
|
1296
|
-
Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)** A promise
|
|
1297
|
-
|
|
1298
|
-
### removeSIM
|
|
1299
|
-
|
|
1300
|
-
[src/Particle.js:1343-1346](https://github.com/particle-iot/particle-api-js/blob/c3b9ce2826acb6e82333287cafc0fa1b75dc16d6/src/Particle.js#L1343-L1346 "Source code on GitHub")
|
|
1301
|
-
|
|
1302
|
-
Remove a SIM card from an account so it can be activated by a different account
|
|
1303
|
-
|
|
1304
|
-
**Parameters**
|
|
1305
|
-
|
|
1306
|
-
- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Options for this API call
|
|
1307
|
-
- `options.iccid` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** ICCID of the SIM card
|
|
1308
|
-
- `options.product` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** SIM cards for this product ID or slug
|
|
1309
|
-
- `options.auth` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** The access token. Can be ignored if provided in constructor
|
|
1310
|
-
- `options.headers` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
1311
|
-
- `options.context` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Request context
|
|
1312
|
-
|
|
1313
|
-
Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)** A promise
|
|
1314
|
-
|
|
1315
|
-
### listBuildTargets
|
|
1316
|
-
|
|
1317
|
-
[src/Particle.js:1357-1360](https://github.com/particle-iot/particle-api-js/blob/c3b9ce2826acb6e82333287cafc0fa1b75dc16d6/src/Particle.js#L1357-L1360 "Source code on GitHub")
|
|
1318
|
-
|
|
1319
|
-
List valid build targets to be used for compiling
|
|
1320
|
-
|
|
1321
|
-
**Parameters**
|
|
1322
|
-
|
|
1323
|
-
- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Options for this API call
|
|
1324
|
-
- `options.onlyFeatured` **[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Only list featured build targets (optional, default `false`)
|
|
1325
|
-
- `options.auth` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** The access token. Can be ignored if provided in constructor
|
|
1326
|
-
- `options.headers` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
1327
|
-
- `options.context` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Request context
|
|
1328
|
-
|
|
1329
|
-
Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)** A promise
|
|
1330
|
-
|
|
1331
|
-
### listLibraries
|
|
1332
|
-
|
|
1333
|
-
[src/Particle.js:1386-1403](https://github.com/particle-iot/particle-api-js/blob/c3b9ce2826acb6e82333287cafc0fa1b75dc16d6/src/Particle.js#L1386-L1403 "Source code on GitHub")
|
|
1334
|
-
|
|
1335
|
-
List firmware libraries
|
|
1336
|
-
|
|
1337
|
-
**Parameters**
|
|
1338
|
-
|
|
1339
|
-
- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Options for this API call
|
|
1340
|
-
- `options.page` **[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** Page index (default, first page)
|
|
1341
|
-
- `options.limit` **[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** Number of items per page
|
|
1342
|
-
- `options.filter` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Search term for the libraries
|
|
1343
|
-
- `options.sort` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Ordering key for the library list
|
|
1344
|
-
- `options.architectures` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)>** List of architectures to filter
|
|
1345
|
-
- `options.category` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Category to filter
|
|
1346
|
-
- `options.scope` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** The library scope to list. Default is 'all'. Other values are
|
|
1347
|
-
\- 'all' - list public libraries and my private libraries
|
|
1348
|
-
\- 'public' - list only public libraries
|
|
1349
|
-
\- 'private' - list only my private libraries
|
|
1350
|
-
\- 'mine' - list my libraries (public and private)
|
|
1351
|
-
\- 'official' - list only official libraries
|
|
1352
|
-
\- 'verified' - list only verified libraries
|
|
1353
|
-
\- 'featured' - list only featured libraries
|
|
1354
|
-
- `options.excludeScopes` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** list of scopes to exclude
|
|
1355
|
-
- `options.auth` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** The access token. Can be ignored if provided in constructor
|
|
1356
|
-
- `options.headers` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
1357
|
-
- `options.context` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Request context
|
|
1358
|
-
|
|
1359
|
-
Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)** A promise
|
|
1360
|
-
|
|
1361
|
-
### getLibrary
|
|
1362
|
-
|
|
1363
|
-
[src/Particle.js:1419-1427](https://github.com/particle-iot/particle-api-js/blob/c3b9ce2826acb6e82333287cafc0fa1b75dc16d6/src/Particle.js#L1419-L1427 "Source code on GitHub")
|
|
1364
|
-
|
|
1365
|
-
Get firmware library details
|
|
1366
|
-
|
|
1367
|
-
**Parameters**
|
|
1368
|
-
|
|
1369
|
-
- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Options for this API call
|
|
1370
|
-
- `options.name` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Name of the library to fetch
|
|
1371
|
-
- `options.version` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Version of the library to fetch (default: latest)
|
|
1372
|
-
- `options.auth` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** The access token. Can be ignored if provided in constructor
|
|
1373
|
-
- `options.headers` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
1374
|
-
- `options.context` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Request context
|
|
1375
|
-
|
|
1376
|
-
Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)** A promise
|
|
1377
|
-
|
|
1378
|
-
### getLibraryVersions
|
|
1379
|
-
|
|
1380
|
-
[src/Particle.js:1440-1448](https://github.com/particle-iot/particle-api-js/blob/c3b9ce2826acb6e82333287cafc0fa1b75dc16d6/src/Particle.js#L1440-L1448 "Source code on GitHub")
|
|
1381
|
-
|
|
1382
|
-
Firmware library details for each version
|
|
1383
|
-
|
|
1384
|
-
**Parameters**
|
|
1385
|
-
|
|
1386
|
-
- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Options for this API call
|
|
1387
|
-
- `options.name` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Name of the library to fetch
|
|
1388
|
-
- `options.page` **[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** Page index (default, first page)
|
|
1389
|
-
- `options.limit` **[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** Number of items per page
|
|
1390
|
-
- `options.auth` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** The access token. Can be ignored if provided in constructor
|
|
1391
|
-
- `options.headers` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
1392
|
-
- `options.context` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Request context
|
|
1393
|
-
|
|
1394
|
-
Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)** A promise
|
|
1395
|
-
|
|
1396
|
-
### contributeLibrary
|
|
1397
|
-
|
|
1398
|
-
[src/Particle.js:1460-1473](https://github.com/particle-iot/particle-api-js/blob/c3b9ce2826acb6e82333287cafc0fa1b75dc16d6/src/Particle.js#L1460-L1473 "Source code on GitHub")
|
|
1399
|
-
|
|
1400
|
-
Contribute a new library version from a compressed archive
|
|
1401
|
-
|
|
1402
|
-
**Parameters**
|
|
1403
|
-
|
|
1404
|
-
- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Options for this API call
|
|
1405
|
-
- `options.archive` **([String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) \| [Buffer](https://nodejs.org/api/buffer.html))** Compressed archive file containing the library sources
|
|
1406
|
-
Either a path or Buffer of the file contents in Node, or a File or Blob in the browser.
|
|
1407
|
-
- `options.auth` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** The access token. Can be ignored if provided in constructor
|
|
1408
|
-
- `options.headers` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
1409
|
-
- `options.context` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Request context
|
|
1410
|
-
|
|
1411
|
-
Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)** A promise
|
|
1412
|
-
|
|
1413
|
-
### publishLibrary
|
|
1414
|
-
|
|
1415
|
-
[src/Particle.js:1484-1493](https://github.com/particle-iot/particle-api-js/blob/c3b9ce2826acb6e82333287cafc0fa1b75dc16d6/src/Particle.js#L1484-L1493 "Source code on GitHub")
|
|
1416
|
-
|
|
1417
|
-
Publish the latest version of a library to the public
|
|
1418
|
-
|
|
1419
|
-
**Parameters**
|
|
1420
|
-
|
|
1421
|
-
- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Options for this API call
|
|
1422
|
-
- `options.name` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Name of the library to publish
|
|
1423
|
-
- `options.auth` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** The access token. Can be ignored if provided in constructor
|
|
1424
|
-
- `options.headers` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
1425
|
-
- `options.context` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Request context
|
|
1426
|
-
|
|
1427
|
-
Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)** A promise
|
|
1428
|
-
|
|
1429
|
-
### deleteLibrary
|
|
1430
|
-
|
|
1431
|
-
[src/Particle.js:1505-1513](https://github.com/particle-iot/particle-api-js/blob/c3b9ce2826acb6e82333287cafc0fa1b75dc16d6/src/Particle.js#L1505-L1513 "Source code on GitHub")
|
|
1432
|
-
|
|
1433
|
-
Delete one version of a library or an entire private library
|
|
1434
|
-
|
|
1435
|
-
**Parameters**
|
|
1436
|
-
|
|
1437
|
-
- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Options for this API call
|
|
1438
|
-
- `options.name` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Name of the library to remove
|
|
1439
|
-
- `options.force` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Key to force deleting a public library
|
|
1440
|
-
- `options.auth` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** The access token. Can be ignored if provided in constructor
|
|
1441
|
-
- `options.headers` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
1442
|
-
- `options.context` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Request context
|
|
1443
|
-
|
|
1444
|
-
Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)** A promise
|
|
1445
|
-
|
|
1446
|
-
### downloadFile
|
|
1447
|
-
|
|
1448
|
-
[src/Particle.js:1523-1525](https://github.com/particle-iot/particle-api-js/blob/c3b9ce2826acb6e82333287cafc0fa1b75dc16d6/src/Particle.js#L1523-L1525 "Source code on GitHub")
|
|
1449
|
-
|
|
1450
|
-
Download an external file that may not be on the API
|
|
1451
|
-
|
|
1452
|
-
**Parameters**
|
|
1453
|
-
|
|
1454
|
-
- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Options for this API call
|
|
1455
|
-
- `options.uri` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** URL of the file.
|
|
1456
|
-
- `options.headers` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
1457
|
-
- `options.context` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Request context
|
|
1458
|
-
|
|
1459
|
-
Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)** Resolves to a buffer with the file data
|
|
1460
|
-
|
|
1461
|
-
### listOAuthClients
|
|
1462
|
-
|
|
1463
|
-
[src/Particle.js:1536-1539](https://github.com/particle-iot/particle-api-js/blob/c3b9ce2826acb6e82333287cafc0fa1b75dc16d6/src/Particle.js#L1536-L1539 "Source code on GitHub")
|
|
1464
|
-
|
|
1465
|
-
List OAuth client created by the account
|
|
1466
|
-
|
|
1467
|
-
**Parameters**
|
|
1468
|
-
|
|
1469
|
-
- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Options for this API call
|
|
1470
|
-
- `options.product` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** List clients for this product ID or slug
|
|
1471
|
-
- `options.auth` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** The access token. Can be ignored if provided in constructor
|
|
1472
|
-
- `options.headers` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
1473
|
-
- `options.context` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Request context
|
|
1474
|
-
|
|
1475
|
-
Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)** A promise
|
|
1476
|
-
|
|
1477
|
-
### createOAuthClient
|
|
1478
|
-
|
|
1479
|
-
[src/Particle.js:1554-1558](https://github.com/particle-iot/particle-api-js/blob/c3b9ce2826acb6e82333287cafc0fa1b75dc16d6/src/Particle.js#L1554-L1558 "Source code on GitHub")
|
|
1480
|
-
|
|
1481
|
-
Create an OAuth client
|
|
1482
|
-
|
|
1483
|
-
**Parameters**
|
|
1484
|
-
|
|
1485
|
-
- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Options for this API call
|
|
1486
|
-
- `options.name` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Name of the OAuth client
|
|
1487
|
-
- `options.type` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** web, installed or web
|
|
1488
|
-
- `options.redirect_uri` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** URL to redirect after OAuth flow. Only for type web.
|
|
1489
|
-
- `options.scope` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Limits what the access tokens created by this client can do.
|
|
1490
|
-
- `options.product` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** Create client for this product ID or slug
|
|
1491
|
-
- `options.auth` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** The access token. Can be ignored if provided in constructor
|
|
1492
|
-
- `options.headers` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
1493
|
-
- `options.context` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Request context
|
|
1494
|
-
|
|
1495
|
-
Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)** A promise
|
|
1496
|
-
|
|
1497
|
-
### updateOAuthClient
|
|
1498
|
-
|
|
1499
|
-
[src/Particle.js:1572-1576](https://github.com/particle-iot/particle-api-js/blob/c3b9ce2826acb6e82333287cafc0fa1b75dc16d6/src/Particle.js#L1572-L1576 "Source code on GitHub")
|
|
1500
|
-
|
|
1501
|
-
Update an OAuth client
|
|
1502
|
-
|
|
1503
|
-
**Parameters**
|
|
1504
|
-
|
|
1505
|
-
- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Options for this API call
|
|
1506
|
-
- `options.clientId` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** The OAuth client to update
|
|
1507
|
-
- `options.name` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** New Name of the OAuth client
|
|
1508
|
-
- `options.scope` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** New scope of the OAuth client
|
|
1509
|
-
- `options.product` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** Update client linked to this product ID or slug
|
|
1510
|
-
- `options.auth` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** The access token. Can be ignored if provided in constructor
|
|
1511
|
-
- `options.headers` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
1512
|
-
- `options.context` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Request context
|
|
1513
|
-
|
|
1514
|
-
Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)** A promise
|
|
1515
|
-
|
|
1516
|
-
### deleteOAuthClient
|
|
1517
|
-
|
|
1518
|
-
[src/Particle.js:1588-1591](https://github.com/particle-iot/particle-api-js/blob/c3b9ce2826acb6e82333287cafc0fa1b75dc16d6/src/Particle.js#L1588-L1591 "Source code on GitHub")
|
|
1519
|
-
|
|
1520
|
-
Delete an OAuth client
|
|
1521
|
-
|
|
1522
|
-
**Parameters**
|
|
1523
|
-
|
|
1524
|
-
- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Options for this API call
|
|
1525
|
-
- `options.clientId` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** The OAuth client to update
|
|
1526
|
-
- `options.product` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** OAuth client linked to this product ID or slug
|
|
1527
|
-
- `options.auth` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** The access token. Can be ignored if provided in constructor
|
|
1528
|
-
- `options.headers` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
1529
|
-
- `options.context` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Request context
|
|
1530
|
-
|
|
1531
|
-
Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)** A promise
|
|
1532
|
-
|
|
1533
|
-
### listProducts
|
|
1534
|
-
|
|
1535
|
-
[src/Particle.js:1601-1603](https://github.com/particle-iot/particle-api-js/blob/c3b9ce2826acb6e82333287cafc0fa1b75dc16d6/src/Particle.js#L1601-L1603 "Source code on GitHub")
|
|
1536
|
-
|
|
1537
|
-
List products the account has access to
|
|
1538
|
-
|
|
1539
|
-
**Parameters**
|
|
1540
|
-
|
|
1541
|
-
- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Options for this API call
|
|
1542
|
-
- `options.auth` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** The access token. Can be ignored if provided in constructor
|
|
1543
|
-
- `options.headers` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
1544
|
-
- `options.context` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Request context
|
|
1545
|
-
|
|
1546
|
-
Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)** A promise
|
|
1547
|
-
|
|
1548
|
-
### getProduct
|
|
1549
|
-
|
|
1550
|
-
[src/Particle.js:1614-1616](https://github.com/particle-iot/particle-api-js/blob/c3b9ce2826acb6e82333287cafc0fa1b75dc16d6/src/Particle.js#L1614-L1616 "Source code on GitHub")
|
|
1551
|
-
|
|
1552
|
-
Get detailed information about a product
|
|
1553
|
-
|
|
1554
|
-
**Parameters**
|
|
1555
|
-
|
|
1556
|
-
- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Options for this API call
|
|
1557
|
-
- `options.product` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Product ID or slug
|
|
1558
|
-
- `options.auth` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** The access token. Can be ignored if provided in constructor
|
|
1559
|
-
- `options.headers` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
1560
|
-
- `options.context` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Request context
|
|
1561
|
-
|
|
1562
|
-
Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)** A promise
|
|
1563
|
-
|
|
1564
|
-
### listProductFirmware
|
|
1565
|
-
|
|
1566
|
-
[src/Particle.js:1627-1629](https://github.com/particle-iot/particle-api-js/blob/c3b9ce2826acb6e82333287cafc0fa1b75dc16d6/src/Particle.js#L1627-L1629 "Source code on GitHub")
|
|
1567
|
-
|
|
1568
|
-
List product firmware versions
|
|
1569
|
-
|
|
1570
|
-
**Parameters**
|
|
1571
|
-
|
|
1572
|
-
- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Options for this API call
|
|
1573
|
-
- `options.product` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Firmware for this product ID or slug
|
|
1574
|
-
- `options.auth` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** The access token. Can be ignored if provided in constructor
|
|
1575
|
-
- `options.headers` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
1576
|
-
- `options.context` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Request context
|
|
1577
|
-
|
|
1578
|
-
Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)** A promise
|
|
1579
|
-
|
|
1580
|
-
### uploadProductFirmware
|
|
1581
|
-
|
|
1582
|
-
[src/Particle.js:1645-1661](https://github.com/particle-iot/particle-api-js/blob/c3b9ce2826acb6e82333287cafc0fa1b75dc16d6/src/Particle.js#L1645-L1661 "Source code on GitHub")
|
|
1583
|
-
|
|
1584
|
-
List product firmware versions
|
|
1585
|
-
|
|
1586
|
-
**Parameters**
|
|
1587
|
-
|
|
1588
|
-
- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Options for this API call
|
|
1589
|
-
- `options.file` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Path or Buffer of the new firmware file
|
|
1590
|
-
Either a path or Buffer of the file contents in Node, or a File or Blob in the browser.
|
|
1591
|
-
- `options.version` **[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** Version number of new firmware
|
|
1592
|
-
- `options.title` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Short identifier for the new firmware
|
|
1593
|
-
- `options.description` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** Longer description for the new firmware
|
|
1594
|
-
- `options.product` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Firmware for this product ID or slug
|
|
1595
|
-
- `options.auth` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** The access token. Can be ignored if provided in constructor
|
|
1596
|
-
- `options.headers` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
1597
|
-
- `options.context` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Request context
|
|
1598
|
-
|
|
1599
|
-
Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)** A promise
|
|
1600
|
-
|
|
1601
|
-
### getProductFirmware
|
|
1602
|
-
|
|
1603
|
-
[src/Particle.js:1673-1680](https://github.com/particle-iot/particle-api-js/blob/c3b9ce2826acb6e82333287cafc0fa1b75dc16d6/src/Particle.js#L1673-L1680 "Source code on GitHub")
|
|
1604
|
-
|
|
1605
|
-
Get information about a product firmware version
|
|
1606
|
-
|
|
1607
|
-
**Parameters**
|
|
1608
|
-
|
|
1609
|
-
- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Options for this API call
|
|
1610
|
-
- `options.version` **[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** Version number of firmware
|
|
1611
|
-
- `options.product` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Firmware for this product ID or slug
|
|
1612
|
-
- `options.auth` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** The access token. Can be ignored if provided in constructor
|
|
1613
|
-
- `options.headers` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
1614
|
-
- `options.context` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Request context
|
|
1615
|
-
|
|
1616
|
-
Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)** A promise
|
|
1617
|
-
|
|
1618
|
-
### updateProductFirmware
|
|
1619
|
-
|
|
1620
|
-
[src/Particle.js:1694-1697](https://github.com/particle-iot/particle-api-js/blob/c3b9ce2826acb6e82333287cafc0fa1b75dc16d6/src/Particle.js#L1694-L1697 "Source code on GitHub")
|
|
1621
|
-
|
|
1622
|
-
Update information for a product firmware version
|
|
1623
|
-
|
|
1624
|
-
**Parameters**
|
|
1625
|
-
|
|
1626
|
-
- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Options for this API call
|
|
1627
|
-
- `options.version` **[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** Version number of new firmware
|
|
1628
|
-
- `options.title` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** New title
|
|
1629
|
-
- `options.description` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** New description
|
|
1630
|
-
- `options.product` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Firmware for this product ID or slug
|
|
1631
|
-
- `options.auth` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** The access token. Can be ignored if provided in constructor
|
|
1632
|
-
- `options.headers` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
1633
|
-
- `options.context` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Request context
|
|
1634
|
-
|
|
1635
|
-
Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)** A promise
|
|
1636
|
-
|
|
1637
|
-
### downloadProductFirmware
|
|
1638
|
-
|
|
1639
|
-
[src/Particle.js:1709-1718](https://github.com/particle-iot/particle-api-js/blob/c3b9ce2826acb6e82333287cafc0fa1b75dc16d6/src/Particle.js#L1709-L1718 "Source code on GitHub")
|
|
1640
|
-
|
|
1641
|
-
Download a product firmware binary
|
|
1642
|
-
|
|
1643
|
-
**Parameters**
|
|
1644
|
-
|
|
1645
|
-
- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Options for this API call
|
|
1646
|
-
- `options.version` **[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** Version number of new firmware
|
|
1647
|
-
- `options.product` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Firmware for this product ID or slug
|
|
1648
|
-
- `options.auth` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** The access token. Can be ignored if provided in constructor
|
|
1649
|
-
- `options.headers` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
1650
|
-
- `options.context` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Request context
|
|
1651
|
-
|
|
1652
|
-
Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)<RequestResponse, RequestError>** A promise that resolves with either the requested data or an error object
|
|
1653
|
-
|
|
1654
|
-
### downloadManufacturingBackup
|
|
1655
|
-
|
|
1656
|
-
[src/Particle.js:1729-1738](https://github.com/particle-iot/particle-api-js/blob/c3b9ce2826acb6e82333287cafc0fa1b75dc16d6/src/Particle.js#L1729-L1738 "Source code on GitHub")
|
|
1657
|
-
|
|
1658
|
-
Download a tachyon manufacturing backup files
|
|
1659
|
-
|
|
1660
|
-
**Parameters**
|
|
1661
|
-
|
|
1662
|
-
- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Options for this API call
|
|
1663
|
-
- `options.deviceId` **[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** Device ID
|
|
1664
|
-
- `options.auth` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** The access token. Can be ignored if provided in constructor
|
|
1665
|
-
- `options.headers` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
1666
|
-
- `options.context` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Request context
|
|
1667
|
-
|
|
1668
|
-
Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)<RequestResponse, RequestError>** A promise with a zip file that contains all manufacturing backup files for the specific device.
|
|
1669
|
-
|
|
1670
|
-
### releaseProductFirmware
|
|
1671
|
-
|
|
1672
|
-
[src/Particle.js:1750-1753](https://github.com/particle-iot/particle-api-js/blob/c3b9ce2826acb6e82333287cafc0fa1b75dc16d6/src/Particle.js#L1750-L1753 "Source code on GitHub")
|
|
1673
|
-
|
|
1674
|
-
Release a product firmware version as the default version
|
|
1675
|
-
|
|
1676
|
-
**Parameters**
|
|
1677
|
-
|
|
1678
|
-
- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Options for this API call
|
|
1679
|
-
- `options.version` **[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** Version number of new firmware
|
|
1680
|
-
- `options.product` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Firmware for this product ID or slug
|
|
1681
|
-
- `options.auth` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** The access token. Can be ignored if provided in constructor
|
|
1682
|
-
- `options.headers` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
1683
|
-
- `options.context` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Request context
|
|
1684
|
-
|
|
1685
|
-
Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)** A promise
|
|
1686
|
-
|
|
1687
|
-
### listTeamMembers
|
|
1688
|
-
|
|
1689
|
-
[src/Particle.js:1764-1771](https://github.com/particle-iot/particle-api-js/blob/c3b9ce2826acb6e82333287cafc0fa1b75dc16d6/src/Particle.js#L1764-L1771 "Source code on GitHub")
|
|
1690
|
-
|
|
1691
|
-
List product team members
|
|
1692
|
-
|
|
1693
|
-
**Parameters**
|
|
1694
|
-
|
|
1695
|
-
- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Options for this API call
|
|
1696
|
-
- `options.product` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Team for this product ID or slug
|
|
1697
|
-
- `options.auth` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** The access token. Can be ignored if provided in constructor
|
|
1698
|
-
- `options.headers` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
1699
|
-
- `options.context` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Request context
|
|
1700
|
-
|
|
1701
|
-
Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)** A promise
|
|
1702
|
-
|
|
1703
|
-
### inviteTeamMember
|
|
1704
|
-
|
|
1705
|
-
[src/Particle.js:1783-1791](https://github.com/particle-iot/particle-api-js/blob/c3b9ce2826acb6e82333287cafc0fa1b75dc16d6/src/Particle.js#L1783-L1791 "Source code on GitHub")
|
|
1706
|
-
|
|
1707
|
-
Invite Particle user to a product team
|
|
1708
|
-
|
|
1709
|
-
**Parameters**
|
|
1710
|
-
|
|
1711
|
-
- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Options for this API call
|
|
1712
|
-
- `options.username` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Username for the Particle account
|
|
1713
|
-
- `options.product` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Team for this product ID or slug
|
|
1714
|
-
- `options.auth` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** The access token. Can be ignored if provided in constructor
|
|
1715
|
-
- `options.headers` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
1716
|
-
- `options.context` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Request context
|
|
1717
|
-
|
|
1718
|
-
Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)** A promise
|
|
1719
|
-
|
|
1720
|
-
### removeTeamMember
|
|
1721
|
-
|
|
1722
|
-
[src/Particle.js:1803-1810](https://github.com/particle-iot/particle-api-js/blob/c3b9ce2826acb6e82333287cafc0fa1b75dc16d6/src/Particle.js#L1803-L1810 "Source code on GitHub")
|
|
1723
|
-
|
|
1724
|
-
Remove Particle user to a product team
|
|
1725
|
-
|
|
1726
|
-
**Parameters**
|
|
1727
|
-
|
|
1728
|
-
- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Options for this API call
|
|
1729
|
-
- `options.username` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Username for the Particle account
|
|
1730
|
-
- `options.product` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Team for this product ID or slug
|
|
1731
|
-
- `options.auth` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** The access token. Can be ignored if provided in constructor
|
|
1732
|
-
- `options.headers` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
1733
|
-
- `options.context` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Request context
|
|
1734
|
-
|
|
1735
|
-
Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)** A promise
|
|
1736
|
-
|
|
1737
|
-
### lookupSerialNumber
|
|
1738
|
-
|
|
1739
|
-
[src/Particle.js:1821-1828](https://github.com/particle-iot/particle-api-js/blob/c3b9ce2826acb6e82333287cafc0fa1b75dc16d6/src/Particle.js#L1821-L1828 "Source code on GitHub")
|
|
1740
|
-
|
|
1741
|
-
Fetch details about a serial number
|
|
1742
|
-
|
|
1743
|
-
**Parameters**
|
|
1744
|
-
|
|
1745
|
-
- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Options for this API call
|
|
1746
|
-
- `options.serialNumber` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** The serial number printed on the barcode of the device packaging
|
|
1747
|
-
- `options.auth` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** The access token. Can be ignored if provided in constructor
|
|
1748
|
-
- `options.headers` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
1749
|
-
- `options.context` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Request context
|
|
1750
|
-
|
|
1751
|
-
Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)** A promise
|
|
1752
|
-
|
|
1753
|
-
### createMeshNetwork
|
|
1754
|
-
|
|
1755
|
-
[src/Particle.js:1841-1849](https://github.com/particle-iot/particle-api-js/blob/c3b9ce2826acb6e82333287cafc0fa1b75dc16d6/src/Particle.js#L1841-L1849 "Source code on GitHub")
|
|
1756
|
-
|
|
1757
|
-
Create a mesh network
|
|
1758
|
-
|
|
1759
|
-
**Parameters**
|
|
1760
|
-
|
|
1761
|
-
- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Options for this API call
|
|
1762
|
-
- `options.name` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Network name
|
|
1763
|
-
- `options.deviceId` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Gateway device ID
|
|
1764
|
-
- `options.iccid` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** ICCID of the active SIM card (only for cellular gateway devices)
|
|
1765
|
-
- `options.auth` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** The access token. Can be ignored if provided in constructor
|
|
1766
|
-
- `options.headers` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
1767
|
-
- `options.context` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Request context
|
|
1768
|
-
|
|
1769
|
-
Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)<[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)>** A promise
|
|
1770
|
-
|
|
1771
|
-
### removeMeshNetwork
|
|
1772
|
-
|
|
1773
|
-
[src/Particle.js:1860-1862](https://github.com/particle-iot/particle-api-js/blob/c3b9ce2826acb6e82333287cafc0fa1b75dc16d6/src/Particle.js#L1860-L1862 "Source code on GitHub")
|
|
1774
|
-
|
|
1775
|
-
Remove a mesh network.
|
|
1776
|
-
|
|
1777
|
-
**Parameters**
|
|
1778
|
-
|
|
1779
|
-
- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Options for this API call
|
|
1780
|
-
- `options.networkId` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Network ID or name
|
|
1781
|
-
- `options.auth` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** The access token. Can be ignored if provided in constructor
|
|
1782
|
-
- `options.headers` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
1783
|
-
- `options.context` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Request context
|
|
1784
|
-
|
|
1785
|
-
Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)<[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)>** A promise
|
|
1786
|
-
|
|
1787
|
-
### listMeshNetworks
|
|
1788
|
-
|
|
1789
|
-
[src/Particle.js:1874-1877](https://github.com/particle-iot/particle-api-js/blob/c3b9ce2826acb6e82333287cafc0fa1b75dc16d6/src/Particle.js#L1874-L1877 "Source code on GitHub")
|
|
1790
|
-
|
|
1791
|
-
List all mesh networks
|
|
1792
|
-
|
|
1793
|
-
**Parameters**
|
|
1794
|
-
|
|
1795
|
-
- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Options for this API call
|
|
1796
|
-
- `options.page` **[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)?** Current page of results
|
|
1797
|
-
- `options.perPage` **[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)?** Records per page
|
|
1798
|
-
- `options.auth` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** The access token. Can be ignored if provided in constructor
|
|
1799
|
-
- `options.headers` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
1800
|
-
- `options.context` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Request context
|
|
1801
|
-
|
|
1802
|
-
Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)<[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)>** A promise
|
|
1803
|
-
|
|
1804
|
-
### getMeshNetwork
|
|
1805
|
-
|
|
1806
|
-
[src/Particle.js:1888-1890](https://github.com/particle-iot/particle-api-js/blob/c3b9ce2826acb6e82333287cafc0fa1b75dc16d6/src/Particle.js#L1888-L1890 "Source code on GitHub")
|
|
1807
|
-
|
|
1808
|
-
Get information about a mesh network.
|
|
1809
|
-
|
|
1810
|
-
**Parameters**
|
|
1811
|
-
|
|
1812
|
-
- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Options for this API call
|
|
1813
|
-
- `options.networkId` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Network ID or name
|
|
1814
|
-
- `options.auth` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** The access token. Can be ignored if provided in constructor
|
|
1815
|
-
- `options.headers` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
1816
|
-
- `options.context` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Request context
|
|
1817
|
-
|
|
1818
|
-
Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)<[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)>** A promise
|
|
1819
|
-
|
|
1820
|
-
### updateMeshNetwork
|
|
1821
|
-
|
|
1822
|
-
[src/Particle.js:1903-1911](https://github.com/particle-iot/particle-api-js/blob/c3b9ce2826acb6e82333287cafc0fa1b75dc16d6/src/Particle.js#L1903-L1911 "Source code on GitHub")
|
|
1823
|
-
|
|
1824
|
-
Modify a mesh network.
|
|
1825
|
-
|
|
1826
|
-
**Parameters**
|
|
1827
|
-
|
|
1828
|
-
- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Options for this API call
|
|
1829
|
-
- `options.networkId` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Network ID or name
|
|
1830
|
-
- `options.action` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** 'add-device', 'remove-device', 'gateway-enable' or 'gateway-disable'
|
|
1831
|
-
- `options.deviceId` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Device ID
|
|
1832
|
-
- `options.auth` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** The access token. Can be ignored if provided in constructor
|
|
1833
|
-
- `options.headers` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
1834
|
-
- `options.context` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Request context
|
|
1835
|
-
|
|
1836
|
-
Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)<[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)>** A promise
|
|
1837
|
-
|
|
1838
|
-
### addMeshNetworkDevice
|
|
1839
|
-
|
|
1840
|
-
[src/Particle.js:1923-1932](https://github.com/particle-iot/particle-api-js/blob/c3b9ce2826acb6e82333287cafc0fa1b75dc16d6/src/Particle.js#L1923-L1932 "Source code on GitHub")
|
|
1841
|
-
|
|
1842
|
-
Add a device to a mesh network.
|
|
1843
|
-
|
|
1844
|
-
**Parameters**
|
|
1845
|
-
|
|
1846
|
-
- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Options for this API call
|
|
1847
|
-
- `options.networkId` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Network ID or name
|
|
1848
|
-
- `options.deviceId` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Device ID
|
|
1849
|
-
- `options.auth` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** The access token. Can be ignored if provided in constructor
|
|
1850
|
-
- `options.headers` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
1851
|
-
- `options.context` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Request context
|
|
1852
|
-
|
|
1853
|
-
Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)<[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)>** A promise
|
|
1854
|
-
|
|
1855
|
-
### removeMeshNetworkDevice
|
|
1856
|
-
|
|
1857
|
-
[src/Particle.js:1944-1960](https://github.com/particle-iot/particle-api-js/blob/c3b9ce2826acb6e82333287cafc0fa1b75dc16d6/src/Particle.js#L1944-L1960 "Source code on GitHub")
|
|
1858
|
-
|
|
1859
|
-
Remove a device from a mesh network.
|
|
1860
|
-
|
|
1861
|
-
**Parameters**
|
|
1862
|
-
|
|
1863
|
-
- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Options for this API call
|
|
1864
|
-
- `options.networkId` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** Network ID or name
|
|
1865
|
-
- `options.deviceId` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Device ID
|
|
1866
|
-
- `options.auth` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** The access token. Can be ignored if provided in constructor
|
|
1867
|
-
- `options.headers` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
1868
|
-
- `options.context` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Request context
|
|
1869
|
-
|
|
1870
|
-
Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)<[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)>** A promise
|
|
1871
|
-
|
|
1872
|
-
### listMeshNetworkDevices
|
|
1873
|
-
|
|
1874
|
-
[src/Particle.js:1974-1983](https://github.com/particle-iot/particle-api-js/blob/c3b9ce2826acb6e82333287cafc0fa1b75dc16d6/src/Particle.js#L1974-L1983 "Source code on GitHub")
|
|
1875
|
-
|
|
1876
|
-
List all devices of a mesh network.
|
|
1877
|
-
|
|
1878
|
-
**Parameters**
|
|
1879
|
-
|
|
1880
|
-
- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Options for this API call
|
|
1881
|
-
- `options.networkId` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Network ID or name
|
|
1882
|
-
- `options.role` **[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)?** Device role: 'gateway' or 'node'
|
|
1883
|
-
- `options.page` **[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)?** Current page of results
|
|
1884
|
-
- `options.perPage` **[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)?** Records per page
|
|
1885
|
-
- `options.auth` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** The access token. Can be ignored if provided in constructor
|
|
1886
|
-
- `options.headers` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
1887
|
-
- `options.context` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Request context
|
|
1888
|
-
|
|
1889
|
-
Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)<[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)>** A promise
|
|
1890
|
-
|
|
1891
|
-
### getProductConfiguration
|
|
1892
|
-
|
|
1893
|
-
[src/Particle.js:1994-2001](https://github.com/particle-iot/particle-api-js/blob/c3b9ce2826acb6e82333287cafc0fa1b75dc16d6/src/Particle.js#L1994-L2001 "Source code on GitHub")
|
|
1894
|
-
|
|
1895
|
-
Get product configuration
|
|
1896
|
-
|
|
1897
|
-
**Parameters**
|
|
1898
|
-
|
|
1899
|
-
- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Options for this API call
|
|
1900
|
-
- `options.auth` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** The access token. Can be ignored if provided in constructor
|
|
1901
|
-
- `options.product` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Config for this product ID or slug
|
|
1902
|
-
- `options.headers` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
1903
|
-
- `options.context` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Request context
|
|
1904
|
-
|
|
1905
|
-
Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)** A promise
|
|
1906
|
-
|
|
1907
|
-
### getProductConfigurationSchema
|
|
1908
|
-
|
|
1909
|
-
[src/Particle.js:2012-2020](https://github.com/particle-iot/particle-api-js/blob/c3b9ce2826acb6e82333287cafc0fa1b75dc16d6/src/Particle.js#L2012-L2020 "Source code on GitHub")
|
|
1910
|
-
|
|
1911
|
-
Get product configuration schema
|
|
1912
|
-
|
|
1913
|
-
**Parameters**
|
|
1914
|
-
|
|
1915
|
-
- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Options for this API call
|
|
1916
|
-
- `options.auth` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** The access token. Can be ignored if provided in constructor
|
|
1917
|
-
- `options.product` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Config for this product ID or slug
|
|
1918
|
-
- `options.headers` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers. (optional, default `{}`)
|
|
1919
|
-
- `options.context` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Request context
|
|
1920
|
-
|
|
1921
|
-
Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)** A promise
|
|
1922
|
-
|
|
1923
|
-
### getProductDeviceConfiguration
|
|
1924
|
-
|
|
1925
|
-
[src/Particle.js:2032-2039](https://github.com/particle-iot/particle-api-js/blob/c3b9ce2826acb6e82333287cafc0fa1b75dc16d6/src/Particle.js#L2032-L2039 "Source code on GitHub")
|
|
1926
|
-
|
|
1927
|
-
Get product device's configuration
|
|
1928
|
-
|
|
1929
|
-
**Parameters**
|
|
1930
|
-
|
|
1931
|
-
- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Options for this API call
|
|
1932
|
-
- `options.auth` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** The access token. Can be ignored if provided in constructor
|
|
1933
|
-
- `options.product` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Config for this product ID or slug
|
|
1934
|
-
- `options.deviceId` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Device ID to access
|
|
1935
|
-
- `options.headers` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
1936
|
-
- `options.context` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Request context
|
|
1937
|
-
|
|
1938
|
-
Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)** A promise
|
|
1939
|
-
|
|
1940
|
-
### getProductDeviceConfigurationSchema
|
|
1941
|
-
|
|
1942
|
-
[src/Particle.js:2051-2059](https://github.com/particle-iot/particle-api-js/blob/c3b9ce2826acb6e82333287cafc0fa1b75dc16d6/src/Particle.js#L2051-L2059 "Source code on GitHub")
|
|
1943
|
-
|
|
1944
|
-
Get product device's configuration schema
|
|
1945
|
-
|
|
1946
|
-
**Parameters**
|
|
1947
|
-
|
|
1948
|
-
- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Options for this API call
|
|
1949
|
-
- `options.auth` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** The access token. Can be ignored if provided in constructor
|
|
1950
|
-
- `options.product` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Config for this product ID or slug
|
|
1951
|
-
- `options.deviceId` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Device ID to access
|
|
1952
|
-
- `options.headers` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
1953
|
-
- `options.context` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Request context
|
|
1954
|
-
|
|
1955
|
-
Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)** A promise
|
|
1956
|
-
|
|
1957
|
-
### setProductConfiguration
|
|
1958
|
-
|
|
1959
|
-
[src/Particle.js:2071-2079](https://github.com/particle-iot/particle-api-js/blob/c3b9ce2826acb6e82333287cafc0fa1b75dc16d6/src/Particle.js#L2071-L2079 "Source code on GitHub")
|
|
1960
|
-
|
|
1961
|
-
Set product configuration
|
|
1962
|
-
|
|
1963
|
-
**Parameters**
|
|
1964
|
-
|
|
1965
|
-
- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Options for this API call
|
|
1966
|
-
- `options.auth` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** The access token. Can be ignored if provided in constructor
|
|
1967
|
-
- `options.product` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Config for this product ID or slug
|
|
1968
|
-
- `options.config` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Product configuration to update
|
|
1969
|
-
- `options.headers` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
1970
|
-
- `options.context` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Request context
|
|
1971
|
-
|
|
1972
|
-
Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)** A promise
|
|
1973
|
-
|
|
1974
|
-
### setProductDeviceConfiguration
|
|
1975
|
-
|
|
1976
|
-
[src/Particle.js:2092-2100](https://github.com/particle-iot/particle-api-js/blob/c3b9ce2826acb6e82333287cafc0fa1b75dc16d6/src/Particle.js#L2092-L2100 "Source code on GitHub")
|
|
1977
|
-
|
|
1978
|
-
Set product configuration for a specific device within the product
|
|
1979
|
-
|
|
1980
|
-
**Parameters**
|
|
1981
|
-
|
|
1982
|
-
- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Options for this API call
|
|
1983
|
-
- `options.auth` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** The access token. Can be ignored if provided in constructor
|
|
1984
|
-
- `options.product` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Config for this product ID or slug
|
|
1985
|
-
- `options.deviceId` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Device ID to access
|
|
1986
|
-
- `options.config` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Product configuration to update
|
|
1987
|
-
- `options.headers` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
1988
|
-
- `options.context` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Request context
|
|
1989
|
-
|
|
1990
|
-
Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)** A promise
|
|
1991
|
-
|
|
1992
|
-
### getProductLocations
|
|
1993
|
-
|
|
1994
|
-
[src/Particle.js:2119-2136](https://github.com/particle-iot/particle-api-js/blob/c3b9ce2826acb6e82333287cafc0fa1b75dc16d6/src/Particle.js#L2119-L2136 "Source code on GitHub")
|
|
1995
|
-
|
|
1996
|
-
Query location for devices within a product
|
|
1997
|
-
|
|
1998
|
-
**Parameters**
|
|
1999
|
-
|
|
2000
|
-
- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Options for this API call
|
|
2001
|
-
- `options.auth` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** The access token. Can be ignored if provided in constructor
|
|
2002
|
-
- `options.product` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Locations for this product ID or slug
|
|
2003
|
-
- `options.dateRange` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Start and end date in ISO8601 format, separated by comma, to query
|
|
2004
|
-
- `options.rectBl` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Bottom left of the rectangular bounding box to query. Latitude and longitude separated by comma
|
|
2005
|
-
- `options.rectTr` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Top right of the rectangular bounding box to query. Latitude and longitude separated by comma
|
|
2006
|
-
- `options.deviceId` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Device ID prefix to include in the query
|
|
2007
|
-
- `options.deviceName` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Device name prefix to include in the query
|
|
2008
|
-
- `options.groups` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Array of group names to include in the query
|
|
2009
|
-
- `options.page` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Page of results to display. Defaults to 1
|
|
2010
|
-
- `options.perPage` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Number of results per page. Defaults to 20. Maximum of 100
|
|
2011
|
-
- `options.headers` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
2012
|
-
- `options.context` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Request context
|
|
2013
|
-
|
|
2014
|
-
Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)** A promise
|
|
2015
|
-
|
|
2016
|
-
### getProductDeviceLocations
|
|
2017
|
-
|
|
2018
|
-
[src/Particle.js:2153-2165](https://github.com/particle-iot/particle-api-js/blob/c3b9ce2826acb6e82333287cafc0fa1b75dc16d6/src/Particle.js#L2153-L2165 "Source code on GitHub")
|
|
2019
|
-
|
|
2020
|
-
Query location for one device within a product
|
|
2021
|
-
|
|
2022
|
-
**Parameters**
|
|
2023
|
-
|
|
2024
|
-
- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Options for this API call
|
|
2025
|
-
- `options.auth` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** The access token. Can be ignored if provided in constructor
|
|
2026
|
-
- `options.product` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Locations for this product ID or slug
|
|
2027
|
-
- `options.dateRange` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Start and end date in ISO8601 format, separated by comma, to query
|
|
2028
|
-
- `options.rectBl` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Bottom left of the rectangular bounding box to query. Latitude and longitude separated by comma
|
|
2029
|
-
- `options.rectTr` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Top right of the rectangular bounding box to query. Latitude and longitude separated by comma
|
|
2030
|
-
- `options.deviceId` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Device ID to query
|
|
2031
|
-
- `options.headers` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
2032
|
-
- `options.context` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Request context
|
|
2033
|
-
|
|
2034
|
-
Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)** A promise
|
|
2035
|
-
|
|
2036
|
-
### executeLogic
|
|
2037
|
-
|
|
2038
|
-
[src/Particle.js:2181-2189](https://github.com/particle-iot/particle-api-js/blob/c3b9ce2826acb6e82333287cafc0fa1b75dc16d6/src/Particle.js#L2181-L2189 "Source code on GitHub")
|
|
2039
|
-
|
|
2040
|
-
Executes the provided logic function once and returns the result. No logs, runs, etc are saved
|
|
2041
|
-
|
|
2042
|
-
NOTE: Any external interactions such as Particle.publish will actually occur when the logic is executed.
|
|
2043
|
-
|
|
2044
|
-
**Parameters**
|
|
2045
|
-
|
|
2046
|
-
- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** The options for creating the logic function.
|
|
2047
|
-
- `options.auth` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** The access token. Can be ignored if provided in constructor
|
|
2048
|
-
- `options.org` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** The Organization ID or slug. If not provided, the request will go to your sandbox account.
|
|
2049
|
-
- `options.logic` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** The logic "function" which will be executed once
|
|
2050
|
-
- `options.headers` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
2051
|
-
- `options.context` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Request context
|
|
2052
|
-
|
|
2053
|
-
Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)<RequestResponse>** A promise that resolves to the created logic function data.
|
|
2054
|
-
|
|
2055
|
-
### createLogicFunction
|
|
2056
|
-
|
|
2057
|
-
[src/Particle.js:2209-2217](https://github.com/particle-iot/particle-api-js/blob/c3b9ce2826acb6e82333287cafc0fa1b75dc16d6/src/Particle.js#L2209-L2217 "Source code on GitHub")
|
|
2058
|
-
|
|
2059
|
-
Creates a new logic function in the specified organization or sandbox using the provided function data.
|
|
2060
|
-
|
|
2061
|
-
When you create a logic function with Event logic triggers, events will immediately
|
|
2062
|
-
start being handled by the function code.
|
|
2063
|
-
|
|
2064
|
-
When you create a Scheduled logic trigger, it will immediately be scheduled at the next time
|
|
2065
|
-
according to the cron and start_at properties.
|
|
2066
|
-
|
|
2067
|
-
**Parameters**
|
|
2068
|
-
|
|
2069
|
-
- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** The options for creating the logic function.
|
|
2070
|
-
- `options.auth` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** The access token. Can be ignored if provided in constructor
|
|
2071
|
-
- `options.org` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** The Organization ID or slug. If not provided, the request will go to your sandbox account.
|
|
2072
|
-
- `options.logicFunction` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** The logic function object containing the function details.
|
|
2073
|
-
- `options.headers` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
2074
|
-
- `options.context` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Request context
|
|
2075
|
-
|
|
2076
|
-
Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)<RequestResponse>** A promise that resolves to the created logic function data.
|
|
2077
|
-
|
|
2078
|
-
### getLogicFunction
|
|
2079
|
-
|
|
2080
|
-
[src/Particle.js:2231-2238](https://github.com/particle-iot/particle-api-js/blob/c3b9ce2826acb6e82333287cafc0fa1b75dc16d6/src/Particle.js#L2231-L2238 "Source code on GitHub")
|
|
2081
|
-
|
|
2082
|
-
Get a logic function in the specified organization or sandbox by logic function ID.
|
|
2083
|
-
|
|
2084
|
-
**Parameters**
|
|
2085
|
-
|
|
2086
|
-
- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** The options for the logic function.
|
|
2087
|
-
- `options.auth` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** The access token. Can be ignored if provided in constructor
|
|
2088
|
-
- `options.org` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** The Organization ID or slug. If not provided, the request will go to your sandbox account.
|
|
2089
|
-
- `options.logicFunctionId` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** The ID of the logic function to retrieve.
|
|
2090
|
-
- `options.headers` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
2091
|
-
- `options.context` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Request context
|
|
2092
|
-
|
|
2093
|
-
Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)<RequestResponse>** A promise that resolves to the specified logic function data.
|
|
2094
|
-
|
|
2095
|
-
### updateLogicFunction
|
|
2096
|
-
|
|
2097
|
-
[src/Particle.js:2255-2263](https://github.com/particle-iot/particle-api-js/blob/c3b9ce2826acb6e82333287cafc0fa1b75dc16d6/src/Particle.js#L2255-L2263 "Source code on GitHub")
|
|
2098
|
-
|
|
2099
|
-
Updates an existing logic function in the specified organization or sandbox using the provided function data.
|
|
2100
|
-
|
|
2101
|
-
If you include an id on a logic trigger, it will update the logic trigger in place.
|
|
2102
|
-
|
|
2103
|
-
**Parameters**
|
|
2104
|
-
|
|
2105
|
-
- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** The options for updating the logic function.
|
|
2106
|
-
- `options.auth` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** The access token. Can be ignored if provided in constructor
|
|
2107
|
-
- `options.org` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** The Organization ID or slug. If not provided, the request will go to your sandbox account.
|
|
2108
|
-
- `options.logicFunctionId` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** The ID of the logic function to update.
|
|
2109
|
-
- `options.logicFunction` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** The logic function object containing the logic function details.
|
|
2110
|
-
- `options.headers` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
2111
|
-
- `options.context` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Request context.
|
|
2112
|
-
|
|
2113
|
-
Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)<RequestResponse>** A promise that resolves to the updated logic function data.
|
|
2114
|
-
|
|
2115
|
-
### deleteLogicFunction
|
|
2116
|
-
|
|
2117
|
-
[src/Particle.js:2277-2284](https://github.com/particle-iot/particle-api-js/blob/c3b9ce2826acb6e82333287cafc0fa1b75dc16d6/src/Particle.js#L2277-L2284 "Source code on GitHub")
|
|
2118
|
-
|
|
2119
|
-
Deletes a logic function in the specified organization or sandbox by logic function ID.
|
|
2120
|
-
|
|
2121
|
-
**Parameters**
|
|
2122
|
-
|
|
2123
|
-
- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** The options for deleting the logic function.
|
|
2124
|
-
- `options.auth` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** The access token. Can be ignored if provided in constructor
|
|
2125
|
-
- `options.org` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** The Organization ID or slug. If not provided, the request will go to your sandbox account.
|
|
2126
|
-
- `options.logicFunctionId` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** The ID of the logic function to delete.
|
|
2127
|
-
- `options.headers` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
2128
|
-
- `options.context` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Request context.
|
|
2129
|
-
|
|
2130
|
-
Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)<RequestResponse>** A promise that resolves to an object containing the deleted logic function ID.
|
|
2131
|
-
|
|
2132
|
-
### listLogicFunctions
|
|
2133
|
-
|
|
2134
|
-
[src/Particle.js:2298-2308](https://github.com/particle-iot/particle-api-js/blob/c3b9ce2826acb6e82333287cafc0fa1b75dc16d6/src/Particle.js#L2298-L2308 "Source code on GitHub")
|
|
2135
|
-
|
|
2136
|
-
Lists all logic functions in the specified organization or sandbox.
|
|
2137
|
-
|
|
2138
|
-
**Parameters**
|
|
2139
|
-
|
|
2140
|
-
- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** The options for listing logic functions.
|
|
2141
|
-
- `options.auth` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** The access token. Can be ignored if provided in constructor
|
|
2142
|
-
- `options.org` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** The Organization ID or slug. If not provided, the request will go to your sandbox account.
|
|
2143
|
-
- `options.todayStats` **[boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)?** Whether to include today's stats in the response
|
|
2144
|
-
- `options.headers` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
2145
|
-
- `options.context` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Request context.
|
|
2146
|
-
|
|
2147
|
-
Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)<RequestResponse>** A promise that resolves to an array of logic functions data.
|
|
2148
|
-
|
|
2149
|
-
### listLogicRuns
|
|
2150
|
-
|
|
2151
|
-
[src/Particle.js:2322-2329](https://github.com/particle-iot/particle-api-js/blob/c3b9ce2826acb6e82333287cafc0fa1b75dc16d6/src/Particle.js#L2322-L2329 "Source code on GitHub")
|
|
2152
|
-
|
|
2153
|
-
Lists all logic runs for the specified logic function in the specified organization or sandbox.
|
|
2154
|
-
|
|
2155
|
-
**Parameters**
|
|
2156
|
-
|
|
2157
|
-
- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** The options for the request.
|
|
2158
|
-
- `options.auth` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** The access token. Can be ignored if provided in constructor
|
|
2159
|
-
- `options.org` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** The Organization ID or slug. If not provided, the request will go to your sandbox account.
|
|
2160
|
-
- `options.logicFunctionId` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** The ID of the logic function for which to retrieve the logic runs.
|
|
2161
|
-
- `options.headers` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
2162
|
-
- `options.context` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Request context
|
|
2163
|
-
|
|
2164
|
-
Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)<RequestResponse>** A promise that resolves to an array of logic run data.
|
|
2165
|
-
|
|
2166
|
-
### getLogicRun
|
|
2167
|
-
|
|
2168
|
-
[src/Particle.js:2344-2351](https://github.com/particle-iot/particle-api-js/blob/c3b9ce2826acb6e82333287cafc0fa1b75dc16d6/src/Particle.js#L2344-L2351 "Source code on GitHub")
|
|
2169
|
-
|
|
2170
|
-
Retrieves a logic run by its ID for the specified logic function in the specified organization or sandbox.
|
|
2171
|
-
|
|
2172
|
-
**Parameters**
|
|
2173
|
-
|
|
2174
|
-
- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** The options for the request.
|
|
2175
|
-
- `options.auth` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** The access token. Can be ignored if provided in constructor
|
|
2176
|
-
- `options.org` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** The Organization ID or slug. If not provided, the request will go to your sandbox account.
|
|
2177
|
-
- `options.logicFunctionId` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** The ID of the logic function for which to retrieve the logic run.
|
|
2178
|
-
- `options.logicRunId` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** The ID of the logic run to retrieve.
|
|
2179
|
-
- `options.headers` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
2180
|
-
- `options.context` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Request context
|
|
2181
|
-
|
|
2182
|
-
Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)<RequestResponse>** A promise that resolves to an array of logic run data for the specified logic run ID.
|
|
2183
|
-
|
|
2184
|
-
### getLogicRunLogs
|
|
2185
|
-
|
|
2186
|
-
[src/Particle.js:2366-2373](https://github.com/particle-iot/particle-api-js/blob/c3b9ce2826acb6e82333287cafc0fa1b75dc16d6/src/Particle.js#L2366-L2373 "Source code on GitHub")
|
|
2187
|
-
|
|
2188
|
-
Retrieves the logs for a logic run by its ID for the specified logic function in the specified organization or sandbox.
|
|
2189
|
-
|
|
2190
|
-
**Parameters**
|
|
2191
|
-
|
|
2192
|
-
- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** The options for the request.
|
|
2193
|
-
- `options.auth` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** The access token. Can be ignored if provided in constructor
|
|
2194
|
-
- `options.org` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** The unique identifier of the organization.
|
|
2195
|
-
- `options.logicFunctionId` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** The ID of the logic function for which to retrieve the logic run logs.
|
|
2196
|
-
- `options.logicRunId` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** The ID of the logic run for which to retrieve the logs.
|
|
2197
|
-
- `options.headers` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
2198
|
-
- `options.context` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Request context
|
|
2199
|
-
|
|
2200
|
-
Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)<RequestResponse>** A promise that resolves to the logs for the specified logic run ID.
|
|
2201
|
-
|
|
2202
|
-
### createLedger
|
|
2203
|
-
|
|
2204
|
-
[src/Particle.js:2387-2395](https://github.com/particle-iot/particle-api-js/blob/c3b9ce2826acb6e82333287cafc0fa1b75dc16d6/src/Particle.js#L2387-L2395 "Source code on GitHub")
|
|
2205
|
-
|
|
2206
|
-
Creates a new ledger definition in the specified organization or sandbox.
|
|
2207
|
-
|
|
2208
|
-
**Parameters**
|
|
2209
|
-
|
|
2210
|
-
- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** The options for creating the ledger definition.
|
|
2211
|
-
- `options.auth` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** The access token. Can be ignored if provided in constructor
|
|
2212
|
-
- `options.org` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** The Organization ID or slug. If not provided, the request will go to your sandbox account.
|
|
2213
|
-
- `options.ledger` **[object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** The ledger definition object.
|
|
2214
|
-
- `options.headers` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
2215
|
-
- `options.context` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Request context
|
|
2216
|
-
|
|
2217
|
-
Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)<RequestResponse>** A promise that resolves to the created ledger definition data.
|
|
2218
|
-
|
|
2219
|
-
### getLedger
|
|
2220
|
-
|
|
2221
|
-
[src/Particle.js:2409-2416](https://github.com/particle-iot/particle-api-js/blob/c3b9ce2826acb6e82333287cafc0fa1b75dc16d6/src/Particle.js#L2409-L2416 "Source code on GitHub")
|
|
2222
|
-
|
|
2223
|
-
Get a ledger definition in the specified organization or sandbox by ledger name.
|
|
2224
|
-
|
|
2225
|
-
**Parameters**
|
|
2226
|
-
|
|
2227
|
-
- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** The options for the ledger definition.
|
|
2228
|
-
- `options.auth` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** The access token. Can be ignored if provided in constructor
|
|
2229
|
-
- `options.org` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** The Organization ID or slug. If not provided, the request will go to your sandbox account.
|
|
2230
|
-
- `options.ledgerName` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** The ID of the ledger definition to retrieve.
|
|
2231
|
-
- `options.headers` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
2232
|
-
- `options.context` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Request context
|
|
2233
|
-
|
|
2234
|
-
Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)<RequestResponse>** A promise that resolves to the specified ledger definition data.
|
|
2235
|
-
|
|
2236
|
-
### updateLedger
|
|
2237
|
-
|
|
2238
|
-
[src/Particle.js:2431-2439](https://github.com/particle-iot/particle-api-js/blob/c3b9ce2826acb6e82333287cafc0fa1b75dc16d6/src/Particle.js#L2431-L2439 "Source code on GitHub")
|
|
2239
|
-
|
|
2240
|
-
Updates an existing ledger definition in the specified organization or sandbox.
|
|
2241
|
-
|
|
2242
|
-
**Parameters**
|
|
2243
|
-
|
|
2244
|
-
- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** The options for updating the ledger definition.
|
|
2245
|
-
- `options.auth` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** The access token. Can be ignored if provided in constructor
|
|
2246
|
-
- `options.org` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** The Organization ID or slug. If not provided, the request will go to your sandbox account.
|
|
2247
|
-
- `options.ledgerName` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Name of the ledger definition to update.
|
|
2248
|
-
- `options.ledger` **[object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** The ledger definition object.
|
|
2249
|
-
- `options.headers` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
2250
|
-
- `options.context` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Request context.
|
|
2251
|
-
|
|
2252
|
-
Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)<RequestResponse>** A promise that resolves to the updated ledger definition data.
|
|
2253
|
-
|
|
2254
|
-
### archiveLedger
|
|
2255
|
-
|
|
2256
|
-
[src/Particle.js:2453-2460](https://github.com/particle-iot/particle-api-js/blob/c3b9ce2826acb6e82333287cafc0fa1b75dc16d6/src/Particle.js#L2453-L2460 "Source code on GitHub")
|
|
2257
|
-
|
|
2258
|
-
Archives a ledger definition in the specified organization or sandbox by ledger name.
|
|
2259
|
-
|
|
2260
|
-
**Parameters**
|
|
2261
|
-
|
|
2262
|
-
- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** The options for archiving the ledger definition.
|
|
2263
|
-
- `options.auth` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** The access token. Can be ignored if provided in constructor
|
|
2264
|
-
- `options.org` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** The Organization ID or slug. If not provided, the request will go to your sandbox account.
|
|
2265
|
-
- `options.ledgerName` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Name of the ledger definition to archive.
|
|
2266
|
-
- `options.headers` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
2267
|
-
- `options.context` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Request context.
|
|
2268
|
-
|
|
2269
|
-
Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)<RequestResponse>** A promise that resolves to an object confirming the ledger definition was archived.
|
|
2270
|
-
|
|
2271
|
-
### Scope
|
|
2272
|
-
|
|
2273
|
-
[src/Particle.js:2481-2494](https://github.com/particle-iot/particle-api-js/blob/c3b9ce2826acb6e82333287cafc0fa1b75dc16d6/src/Particle.js#L2481-L2494 "Source code on GitHub")
|
|
2274
|
-
|
|
2275
|
-
Type: (`"Owner"` \| `"Product"` \| `"Device"`)
|
|
2276
|
-
|
|
2277
|
-
**Parameters**
|
|
2278
|
-
|
|
2279
|
-
- `$0` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)**
|
|
2280
|
-
- `$0.auth`
|
|
2281
|
-
- `$0.org`
|
|
2282
|
-
- `$0.scope`
|
|
2283
|
-
- `$0.page`
|
|
2284
|
-
- `$0.perPage`
|
|
2285
|
-
- `$0.archived`
|
|
2286
|
-
- `$0.headers`
|
|
2287
|
-
- `$0.context`
|
|
2288
|
-
|
|
2289
|
-
### listLedgers
|
|
2290
|
-
|
|
2291
|
-
[src/Particle.js:2481-2494](https://github.com/particle-iot/particle-api-js/blob/c3b9ce2826acb6e82333287cafc0fa1b75dc16d6/src/Particle.js#L2481-L2494 "Source code on GitHub")
|
|
2292
|
-
|
|
2293
|
-
Lists all ledger definitions in the specified organization or sandbox.
|
|
2294
|
-
|
|
2295
|
-
**Parameters**
|
|
2296
|
-
|
|
2297
|
-
- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** The options for listing ledger definitions.
|
|
2298
|
-
- `options.auth` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** The access token. Can be ignored if provided in constructor
|
|
2299
|
-
- `options.org` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** The Organization ID or slug. If not provided, the request will go to your sandbox account.
|
|
2300
|
-
- `options.scope` **Scope?** Filter to show only ledgers of the specified scope
|
|
2301
|
-
- `options.page` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)?** Page of results to display
|
|
2302
|
-
- `options.perPage` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)?** Number of results per page. Default is 100
|
|
2303
|
-
- `options.archived` **[boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)?** Filter to show only archived ledger or non-archived ledgers. If not provided, all ledgers are returned.
|
|
2304
|
-
- `options.headers` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
2305
|
-
- `options.context` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Request context.
|
|
2306
|
-
|
|
2307
|
-
Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)<RequestResponse>** A promise that resolves to an array of ledger definition data.
|
|
2308
|
-
|
|
2309
|
-
### getLedgerInstance
|
|
2310
|
-
|
|
2311
|
-
[src/Particle.js:2509-2516](https://github.com/particle-iot/particle-api-js/blob/c3b9ce2826acb6e82333287cafc0fa1b75dc16d6/src/Particle.js#L2509-L2516 "Source code on GitHub")
|
|
2312
|
-
|
|
2313
|
-
Get ledger instance data.
|
|
2314
|
-
|
|
2315
|
-
**Parameters**
|
|
2316
|
-
|
|
2317
|
-
- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** The options for the ledger instance.
|
|
2318
|
-
- `options.auth` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** The access token. Can be ignored if provided in constructor
|
|
2319
|
-
- `options.org` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** The Organization ID or slug. If not provided, the request will go to your sandbox account.
|
|
2320
|
-
- `options.ledgerName` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Ledger name.
|
|
2321
|
-
- `options.scopeValue` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Scope value.
|
|
2322
|
-
- `options.headers` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
2323
|
-
- `options.context` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Request context
|
|
2324
|
-
|
|
2325
|
-
Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)<RequestResponse>** A promise that resolves to the specified ledger instance data.
|
|
2326
|
-
|
|
2327
|
-
### SetMode
|
|
2328
|
-
|
|
2329
|
-
[src/Particle.js:2537-2548](https://github.com/particle-iot/particle-api-js/blob/c3b9ce2826acb6e82333287cafc0fa1b75dc16d6/src/Particle.js#L2537-L2548 "Source code on GitHub")
|
|
2330
|
-
|
|
2331
|
-
Type: (`"Replace"` \| `"Merge"`)
|
|
2332
|
-
|
|
2333
|
-
**Parameters**
|
|
2334
|
-
|
|
2335
|
-
- `$0` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)**
|
|
2336
|
-
- `$0.auth`
|
|
2337
|
-
- `$0.org`
|
|
2338
|
-
- `$0.ledgerName`
|
|
2339
|
-
- `$0.scopeValue`
|
|
2340
|
-
- `$0.instance`
|
|
2341
|
-
- `$0.setMode`
|
|
2342
|
-
- `$0.headers`
|
|
2343
|
-
- `$0.context`
|
|
2344
|
-
|
|
2345
|
-
### setLedgerInstance
|
|
2346
|
-
|
|
2347
|
-
[src/Particle.js:2537-2548](https://github.com/particle-iot/particle-api-js/blob/c3b9ce2826acb6e82333287cafc0fa1b75dc16d6/src/Particle.js#L2537-L2548 "Source code on GitHub")
|
|
2348
|
-
|
|
2349
|
-
Set ledger instance data.
|
|
2350
|
-
|
|
2351
|
-
**Parameters**
|
|
2352
|
-
|
|
2353
|
-
- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** The options for updating the ledger instance.
|
|
2354
|
-
- `options.auth` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** The access token. Can be ignored if provided in constructor
|
|
2355
|
-
- `options.org` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** The Organization ID or slug. If not provided, the request will go to your sandbox account.
|
|
2356
|
-
- `options.ledgerName` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Ledger name.
|
|
2357
|
-
- `options.scopeValue` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Scope value.
|
|
2358
|
-
- `options.instance` **[object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** The instance with the data
|
|
2359
|
-
- `options.setMode` **SetMode?** How the data should be set with existing data. Default is "Replace"
|
|
2360
|
-
- `options.headers` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
2361
|
-
- `options.context` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Request context.
|
|
2362
|
-
|
|
2363
|
-
Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)<RequestResponse>** A promise that resolves to the updated ledger instance data.
|
|
2364
|
-
|
|
2365
|
-
### deleteLedgerInstance
|
|
2366
|
-
|
|
2367
|
-
[src/Particle.js:2563-2570](https://github.com/particle-iot/particle-api-js/blob/c3b9ce2826acb6e82333287cafc0fa1b75dc16d6/src/Particle.js#L2563-L2570 "Source code on GitHub")
|
|
2368
|
-
|
|
2369
|
-
Delete a ledger instance in the specified organization or sandbox by ledger name.
|
|
2370
|
-
|
|
2371
|
-
**Parameters**
|
|
2372
|
-
|
|
2373
|
-
- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** The options for archiving the ledger instance.
|
|
2374
|
-
- `options.auth` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** The access token. Can be ignored if provided in constructor
|
|
2375
|
-
- `options.org` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** The Organization ID or slug. If not provided, the request will go to your sandbox account.
|
|
2376
|
-
- `options.ledgerName` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Name of the ledger instance to archive.
|
|
2377
|
-
- `options.scopeValue` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Scope value.
|
|
2378
|
-
- `options.headers` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
2379
|
-
- `options.context` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Request context.
|
|
2380
|
-
|
|
2381
|
-
Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)<RequestResponse>** A promise that resolves to an object confirming the ledger instance was deleted.
|
|
2382
|
-
|
|
2383
|
-
### listLedgerInstances
|
|
2384
|
-
|
|
2385
|
-
[src/Particle.js:2586-2597](https://github.com/particle-iot/particle-api-js/blob/c3b9ce2826acb6e82333287cafc0fa1b75dc16d6/src/Particle.js#L2586-L2597 "Source code on GitHub")
|
|
2386
|
-
|
|
2387
|
-
Lists ledger instances in the specified organization or sandbox.
|
|
2388
|
-
|
|
2389
|
-
**Parameters**
|
|
2390
|
-
|
|
2391
|
-
- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** The options for listing ledger instances.
|
|
2392
|
-
- `options.auth` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** The access token. Can be ignored if provided in constructor
|
|
2393
|
-
- `options.org` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** The unique identifier of the organization.
|
|
2394
|
-
- `options.ledgerName` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Name of the ledger instance to archive.
|
|
2395
|
-
- `options.page` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)?** Page of results to display
|
|
2396
|
-
- `options.perPage` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)?** Number of results per page. Default is 100
|
|
2397
|
-
- `options.headers` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
2398
|
-
- `options.context` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Request context.
|
|
2399
|
-
|
|
2400
|
-
Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)<RequestResponse>** A promise that resolves to an array of ledger instance data.
|
|
2401
|
-
|
|
2402
|
-
### listLedgerInstanceVersions
|
|
2403
|
-
|
|
2404
|
-
[src/Particle.js:2614-2625](https://github.com/particle-iot/particle-api-js/blob/c3b9ce2826acb6e82333287cafc0fa1b75dc16d6/src/Particle.js#L2614-L2625 "Source code on GitHub")
|
|
2405
|
-
|
|
2406
|
-
List ledger instance versions
|
|
2407
|
-
|
|
2408
|
-
**Parameters**
|
|
2409
|
-
|
|
2410
|
-
- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** The options for the ledger instance.
|
|
2411
|
-
- `options.auth` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** The access token. Can be ignored if provided in constructor
|
|
2412
|
-
- `options.org` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** The Organization ID or slug. If not provided, the request will go to your sandbox account.
|
|
2413
|
-
- `options.ledgerName` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Ledger name.
|
|
2414
|
-
- `options.scopeValue` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Scope value.
|
|
2415
|
-
- `options.replacedBefore` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** ISO date string to filter to instances replaced before this time
|
|
2416
|
-
- `options.replacedAfter` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** ISO date string to filter to instances replaced after this time
|
|
2417
|
-
- `options.headers` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
2418
|
-
- `options.context` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Request context
|
|
2419
|
-
|
|
2420
|
-
Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)<RequestResponse>** A promise that resolves to an array of ledger instance data.
|
|
2421
|
-
|
|
2422
|
-
### getLedgerInstanceVersion
|
|
2423
|
-
|
|
2424
|
-
[src/Particle.js:2641-2648](https://github.com/particle-iot/particle-api-js/blob/c3b9ce2826acb6e82333287cafc0fa1b75dc16d6/src/Particle.js#L2641-L2648 "Source code on GitHub")
|
|
2425
|
-
|
|
2426
|
-
Get specific ledger instance version
|
|
2427
|
-
|
|
2428
|
-
**Parameters**
|
|
2429
|
-
|
|
2430
|
-
- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** The options for the ledger instance.
|
|
2431
|
-
- `options.auth` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** The access token. Can be ignored if provided in constructor
|
|
2432
|
-
- `options.org` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** The Organization ID or slug. If not provided, the request will go to your sandbox account.
|
|
2433
|
-
- `options.ledgerName` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Ledger name.
|
|
2434
|
-
- `options.scopeValue` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Scope value.
|
|
2435
|
-
- `options.version` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Version of the ledger instance
|
|
2436
|
-
- `options.headers` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
2437
|
-
- `options.context` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Request context
|
|
2438
|
-
|
|
2439
|
-
Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)<RequestResponse>** A promise that resolves to the specified ledger instance data.
|
|
2440
|
-
|
|
2441
|
-
### listDeviceOsVersions
|
|
2442
|
-
|
|
2443
|
-
[src/Particle.js:2664-2679](https://github.com/particle-iot/particle-api-js/blob/c3b9ce2826acb6e82333287cafc0fa1b75dc16d6/src/Particle.js#L2664-L2679 "Source code on GitHub")
|
|
2444
|
-
|
|
2445
|
-
List Device OS versions
|
|
2446
|
-
|
|
2447
|
-
**Parameters**
|
|
2448
|
-
|
|
2449
|
-
- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Options for this API call
|
|
2450
|
-
- `options.platformId` **[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)?** Platform ID to filter Device OS versions
|
|
2451
|
-
- `options.internalVersion` **[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)?** Internal version number to filter Device OS versions
|
|
2452
|
-
- `options.page` **[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)?** Page number for pagination
|
|
2453
|
-
- `options.perPage` **[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)?** Number of items per page
|
|
2454
|
-
- `options.auth` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** The access token. Can be ignored if provided in constructor
|
|
2455
|
-
- `options.headers` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
2456
|
-
- `options.context` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Request context
|
|
2457
|
-
|
|
2458
|
-
Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)<RequestResponse>** A promise that resolves to the list of Device OS versions.
|
|
2459
|
-
|
|
2460
|
-
### getDeviceOsVersion
|
|
2461
|
-
|
|
2462
|
-
[src/Particle.js:2693-2702](https://github.com/particle-iot/particle-api-js/blob/c3b9ce2826acb6e82333287cafc0fa1b75dc16d6/src/Particle.js#L2693-L2702 "Source code on GitHub")
|
|
2463
|
-
|
|
2464
|
-
Get a specific Device OS version
|
|
2465
|
-
|
|
2466
|
-
**Parameters**
|
|
2467
|
-
|
|
2468
|
-
- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Options for this API call
|
|
2469
|
-
- `options.version` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Version of the Device OS
|
|
2470
|
-
- `options.platformId` **[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)?** Optional platform ID to filter Device OS version
|
|
2471
|
-
- `options.auth` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** The access token. Can be ignored if provided in constructor
|
|
2472
|
-
- `options.headers` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
2473
|
-
- `options.context` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Request context
|
|
2474
|
-
|
|
2475
|
-
Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)<RequestResponse>** A promise that resolves to the specified Device OS version data.
|
|
2476
|
-
|
|
2477
|
-
### setDefaultAuth
|
|
2478
|
-
|
|
2479
|
-
[src/Particle.js:2709-2715](https://github.com/particle-iot/particle-api-js/blob/c3b9ce2826acb6e82333287cafc0fa1b75dc16d6/src/Particle.js#L2709-L2715 "Source code on GitHub")
|
|
2480
|
-
|
|
2481
|
-
Set default auth token that will be used in each method if `auth` is not provided
|
|
2482
|
-
|
|
2483
|
-
**Parameters**
|
|
2484
|
-
|
|
2485
|
-
- `auth` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** The access token
|
|
2486
|
-
|
|
2487
|
-
|
|
2488
|
-
- Throws **[Error](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error)** When not auth string is provided
|
|
2489
|
-
|
|
2490
|
-
### get
|
|
2491
|
-
|
|
2492
|
-
[src/Particle.js:2765-2769](https://github.com/particle-iot/particle-api-js/blob/c3b9ce2826acb6e82333287cafc0fa1b75dc16d6/src/Particle.js#L2765-L2769 "Source code on GitHub")
|
|
2493
|
-
|
|
2494
|
-
Make a GET request
|
|
2495
|
-
|
|
2496
|
-
**Parameters**
|
|
2497
|
-
|
|
2498
|
-
- `params` **[object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)**
|
|
2499
|
-
- `params.uri` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** The URI to request
|
|
2500
|
-
- `params.auth` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** Authorization token to use
|
|
2501
|
-
- `params.headers` **[object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
2502
|
-
- `params.query` **[object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Key/Value pairs of query params or a correctly formatted string
|
|
2503
|
-
- `params.context` **[object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** The invocation context, describing the tool and project
|
|
2504
|
-
|
|
2505
|
-
Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)<RequestResponse, RequestError>** A promise that resolves with either the requested data or an error object
|
|
2506
|
-
|
|
2507
|
-
### head
|
|
2508
|
-
|
|
2509
|
-
[src/Particle.js:2781-2785](https://github.com/particle-iot/particle-api-js/blob/c3b9ce2826acb6e82333287cafc0fa1b75dc16d6/src/Particle.js#L2781-L2785 "Source code on GitHub")
|
|
2510
|
-
|
|
2511
|
-
Make a HEAD request
|
|
2512
|
-
|
|
2513
|
-
**Parameters**
|
|
2514
|
-
|
|
2515
|
-
- `params` **[object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)**
|
|
2516
|
-
- `params.uri` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** The URI to request
|
|
2517
|
-
- `params.auth` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** Authorization token to use
|
|
2518
|
-
- `params.headers` **[object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
2519
|
-
- `params.query` **[object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Key/Value pairs of query params or a correctly formatted string
|
|
2520
|
-
- `params.context` **[object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** The invocation context, describing the tool and project
|
|
2521
|
-
|
|
2522
|
-
Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)<RequestResponse, RequestError>** A promise that resolves with either the requested data or an error object
|
|
2523
|
-
|
|
2524
|
-
### post
|
|
2525
|
-
|
|
2526
|
-
[src/Particle.js:2797-2801](https://github.com/particle-iot/particle-api-js/blob/c3b9ce2826acb6e82333287cafc0fa1b75dc16d6/src/Particle.js#L2797-L2801 "Source code on GitHub")
|
|
2527
|
-
|
|
2528
|
-
Make a POST request
|
|
2529
|
-
|
|
2530
|
-
**Parameters**
|
|
2531
|
-
|
|
2532
|
-
- `params` **[object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)**
|
|
2533
|
-
- `params.uri` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** The URI to request
|
|
2534
|
-
- `params.auth` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** Authorization token to use
|
|
2535
|
-
- `params.headers` **[object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
2536
|
-
- `params.data` **[object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Object to send as JSON data in the body.
|
|
2537
|
-
- `params.context` **[object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** The invocation context, describing the tool and project
|
|
2538
|
-
|
|
2539
|
-
Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)<RequestResponse, RequestError>** A promise that resolves with either the requested data or an error object
|
|
2540
|
-
|
|
2541
|
-
### put
|
|
2542
|
-
|
|
2543
|
-
[src/Particle.js:2814-2818](https://github.com/particle-iot/particle-api-js/blob/c3b9ce2826acb6e82333287cafc0fa1b75dc16d6/src/Particle.js#L2814-L2818 "Source code on GitHub")
|
|
2544
|
-
|
|
2545
|
-
Make a PUT request
|
|
2546
|
-
|
|
2547
|
-
**Parameters**
|
|
2548
|
-
|
|
2549
|
-
- `params` **[object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)**
|
|
2550
|
-
- `params.uri` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** The URI to request
|
|
2551
|
-
- `params.auth` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** Authorization token to use
|
|
2552
|
-
- `params.headers` **[object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
2553
|
-
- `params.data` **[object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Object to send as JSON data in the body.
|
|
2554
|
-
- `params.query` **[object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Key/Value pairs of query params or a correctly formatted string
|
|
2555
|
-
- `params.context` **[object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** The invocation context, describing the tool and project
|
|
2556
|
-
|
|
2557
|
-
Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)<RequestResponse, RequestError>** A promise that resolves with either the requested data or an error object
|
|
2558
|
-
|
|
2559
|
-
### delete
|
|
2560
|
-
|
|
2561
|
-
[src/Particle.js:2830-2834](https://github.com/particle-iot/particle-api-js/blob/c3b9ce2826acb6e82333287cafc0fa1b75dc16d6/src/Particle.js#L2830-L2834 "Source code on GitHub")
|
|
2562
|
-
|
|
2563
|
-
Make a DELETE request
|
|
2564
|
-
|
|
2565
|
-
**Parameters**
|
|
2566
|
-
|
|
2567
|
-
- `params` **[object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)**
|
|
2568
|
-
- `params.uri` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** The URI to request
|
|
2569
|
-
- `params.auth` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** Authorization token to use
|
|
2570
|
-
- `params.headers` **[object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
2571
|
-
- `params.data` **[object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Object to send as JSON data in the body.
|
|
2572
|
-
- `params.context` **[object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** The invocation context, describing the tool and project
|
|
2573
|
-
|
|
2574
|
-
Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)<RequestResponse, RequestError>** A promise that resolves with either the requested data or an error object
|
|
2575
|
-
|
|
2576
|
-
### request
|
|
2577
|
-
|
|
2578
|
-
[src/Particle.js:2851-2855](https://github.com/particle-iot/particle-api-js/blob/c3b9ce2826acb6e82333287cafc0fa1b75dc16d6/src/Particle.js#L2851-L2855 "Source code on GitHub")
|
|
2579
|
-
|
|
2580
|
-
**Parameters**
|
|
2581
|
-
|
|
2582
|
-
- `args` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** An obj with all the possible request configurations
|
|
2583
|
-
- `args.uri` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** The URI to request
|
|
2584
|
-
- `args.method` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** The method used to request the URI, should be in uppercase.
|
|
2585
|
-
- `args.headers` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
2586
|
-
- `args.data` **[object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Object to send as JSON data in the body.
|
|
2587
|
-
- `args.auth` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** Authorization
|
|
2588
|
-
- `args.query` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Query parameters
|
|
2589
|
-
- `args.form` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Form fields
|
|
2590
|
-
- `args.files` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Array of file names and file content
|
|
2591
|
-
- `args.context` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** The invocation context, describing the tool and project.
|
|
2592
|
-
- `args.isBuffer` **[boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)?** Indicate if the response should be treated as Buffer instead of JSON
|
|
2593
|
-
|
|
2594
|
-
Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)<RequestResponse, RequestError>** A promise that resolves with either the requested data or an error object
|