https:// api.losant.com/instances/INSTANCE_ID
/sandboxes/INSTANCE_SANDBOX_ID
Below are the various requests that can be performed against the
Instance Sandbox resource, as well as the expected
parameters and the potential responses.
Deletes a sandbox user account
DELETE https:// api.losant.com/instances/INSTANCE_ID
/sandboxes/INSTANCE_SANDBOX_ID
A valid API access token is required to access this endpoint. The token must
include at least one of the following scopes:
all.Instance
, all.User
, instanceSandbox.*
, or instanceSandbox.delete
.
Path Component Description Example INSTANCE_ID ID associated with the instance 575ec8687ae143cd83dc4a97 INSTANCE_SANDBOX_ID ID associated with the sandbox user 575ec8687ae143cd83dc4a97
Name Required Description Default Authorization Y The token for authenticating the request, prepended with Bearer
curl -H 'Content-Type: application/json' \ -H 'Accept: application/json' \ -H 'Authorization: Bearer YOUR_API_ACCESS_TOKEN' \ -X DELETE \ https://api.losant.com/instances/INSTANCE_ID/sandboxes/INSTANCE_SANDBOX_ID
Code Type Description 200 Success If a sandbox was successfully deleted
Code Type Description 400 Error Error if malformed request 404 Error Error if sandbox or instance was not found
Returns device counts by day for the time range specified for all applications the sandbox user owns
GET https:// api.losant.com/instances/INSTANCE_ID
/sandboxes/INSTANCE_SANDBOX_ID
/deviceCounts
A valid API access token is required to access this endpoint. The token must
include at least one of the following scopes:
all.Instance
, all.Instance.read
, all.User
, all.User.read
, instanceSandbox.*
, or instanceSandbox.deviceCounts
.
Path Component Description Example INSTANCE_ID ID associated with the instance 575ec8687ae143cd83dc4a97 INSTANCE_SANDBOX_ID ID associated with the sandbox user 575ec8687ae143cd83dc4a97
Name Required Description Default Example start N Start of range for device count query (ms since epoch) start=0
end N End of range for device count query (ms since epoch) end=1465790400000
Name Required Description Default Authorization Y The token for authenticating the request, prepended with Bearer
curl -H 'Content-Type: application/json' \ -H 'Accept: application/json' \ -H 'Authorization: Bearer YOUR_API_ACCESS_TOKEN' \ -X GET \ https://api.losant.com/instances/INSTANCE_ID/sandboxes/INSTANCE_SANDBOX_ID/deviceCounts
Code Type Description 400 Error Error if malformed request 404 Error Error if sandbox or instance was not found
Returns a sandbox user
GET https:// api.losant.com/instances/INSTANCE_ID
/sandboxes/INSTANCE_SANDBOX_ID
A valid API access token is required to access this endpoint. The token must
include at least one of the following scopes:
all.Instance
, all.Instance.read
, all.User
, all.User.read
, instanceSandbox.*
, or instanceSandbox.get
.
Path Component Description Example INSTANCE_ID ID associated with the instance 575ec8687ae143cd83dc4a97 INSTANCE_SANDBOX_ID ID associated with the sandbox user 575ec8687ae143cd83dc4a97
Name Required Description Default Example summaryExclude N Comma-separated list of summary fields to exclude from user summary summaryExclude=payloadCount
summaryInclude N Comma-separated list of summary fields to include in user summary summaryInclude=payloadCount
Name Required Description Default Authorization Y The token for authenticating the request, prepended with Bearer
curl -H 'Content-Type: application/json' \ -H 'Accept: application/json' \ -H 'Authorization: Bearer YOUR_API_ACCESS_TOKEN' \ -X GET \ https://api.losant.com/instances/INSTANCE_ID/sandboxes/INSTANCE_SANDBOX_ID
Code Type Description 400 Error Error if malformed request 404 Error Error if sandbox or instance was not found
Returns notebook execution usage by day for the time range specified for all applications the sandbox user owns
GET https:// api.losant.com/instances/INSTANCE_ID
/sandboxes/INSTANCE_SANDBOX_ID
/notebookMinuteCounts
A valid API access token is required to access this endpoint. The token must
include at least one of the following scopes:
all.Instance
, all.Instance.read
, all.User
, all.User.read
, instanceSandbox.*
, or instanceSandbox.notebookMinuteCounts
.
Path Component Description Example INSTANCE_ID ID associated with the instance 575ec8687ae143cd83dc4a97 INSTANCE_SANDBOX_ID ID associated with the sandbox user 575ec8687ae143cd83dc4a97
Name Required Description Default Example start N Start of range for notebook execution query (ms since epoch) start=0
end N End of range for notebook execution query (ms since epoch) end=1465790400000
Name Required Description Default Authorization Y The token for authenticating the request, prepended with Bearer
curl -H 'Content-Type: application/json' \ -H 'Accept: application/json' \ -H 'Authorization: Bearer YOUR_API_ACCESS_TOKEN' \ -X GET \ https://api.losant.com/instances/INSTANCE_ID/sandboxes/INSTANCE_SANDBOX_ID/notebookMinuteCounts
Code Type Description 400 Error Error if malformed request 404 Error Error if sandbox or instance was not found
Returns payload counts for the time range specified for all applications the sandbox user owns
GET https:// api.losant.com/instances/INSTANCE_ID
/sandboxes/INSTANCE_SANDBOX_ID
/payloadCounts
A valid API access token is required to access this endpoint. The token must
include at least one of the following scopes:
all.Instance
, all.Instance.read
, all.User
, all.User.read
, instanceSandbox.*
, or instanceSandbox.payloadCounts
.
Path Component Description Example INSTANCE_ID ID associated with the instance 575ec8687ae143cd83dc4a97 INSTANCE_SANDBOX_ID ID associated with the sandbox user 575ec8687ae143cd83dc4a97
Name Required Description Default Example start N Start of range for payload count query (ms since epoch) start=0
end N End of range for payload count query (ms since epoch) end=1465790400000
asBytes N If the resulting stats should be returned as bytes false asBytes=true
Name Required Description Default Authorization Y The token for authenticating the request, prepended with Bearer
curl -H 'Content-Type: application/json' \ -H 'Accept: application/json' \ -H 'Authorization: Bearer YOUR_API_ACCESS_TOKEN' \ -X GET \ https://api.losant.com/instances/INSTANCE_ID/sandboxes/INSTANCE_SANDBOX_ID/payloadCounts
Code Type Description 200 Payload Stats Payload counts, by type and source
Code Type Description 400 Error Error if malformed request 404 Error Error if sandbox or instance was not found
Returns payload counts per resolution in the time range specified for all applications the sandbox user owns
GET https:// api.losant.com/instances/INSTANCE_ID
/sandboxes/INSTANCE_SANDBOX_ID
/payloadCountsBreakdown
A valid API access token is required to access this endpoint. The token must
include at least one of the following scopes:
all.Instance
, all.Instance.read
, all.User
, all.User.read
, instanceSandbox.*
, or instanceSandbox.payloadCountsBreakdown
.
Path Component Description Example INSTANCE_ID ID associated with the instance 575ec8687ae143cd83dc4a97 INSTANCE_SANDBOX_ID ID associated with the sandbox user 575ec8687ae143cd83dc4a97
Name Required Description Default Example start N Start of range for payload count query (ms since epoch) start=0
end N End of range for payload count query (ms since epoch) end=1465790400000
resolution N Resolution in milliseconds. Accepted values are: 86400000, 3600000 86400000 resolution=86400000
asBytes N If the resulting stats should be returned as bytes false asBytes=true
includeNonBillable N If non-billable payloads should be included in the result false includeNonBillable=true
Name Required Description Default Authorization Y The token for authenticating the request, prepended with Bearer
curl -H 'Content-Type: application/json' \ -H 'Accept: application/json' \ -H 'Authorization: Bearer YOUR_API_ACCESS_TOKEN' \ -X GET \ https://api.losant.com/instances/INSTANCE_ID/sandboxes/INSTANCE_SANDBOX_ID/payloadCountsBreakdown
Code Type Description 400 Error Error if malformed request 404 Error Error if sandbox or instance was not found
Restores a sandbox user account
PATCH https:// api.losant.com/instances/INSTANCE_ID
/sandboxes/INSTANCE_SANDBOX_ID
/undelete
A valid API access token is required to access this endpoint. The token must
include at least one of the following scopes:
all.Instance
, all.User
, instanceSandbox.*
, or instanceSandbox.undelete
.
Path Component Description Example INSTANCE_ID ID associated with the instance 575ec8687ae143cd83dc4a97 INSTANCE_SANDBOX_ID ID associated with the sandbox user 575ec8687ae143cd83dc4a97
Name Required Description Default Example summaryExclude N Comma-separated list of summary fields to exclude from user summary summaryExclude=payloadCount
summaryInclude N Comma-separated list of summary fields to include in user summary summaryInclude=payloadCount
Name Required Description Default Authorization Y The token for authenticating the request, prepended with Bearer
curl -H 'Content-Type: application/json' \ -H 'Accept: application/json' \ -H 'Authorization: Bearer YOUR_API_ACCESS_TOKEN' \ -X PATCH \ https://api.losant.com/instances/INSTANCE_ID/sandboxes/INSTANCE_SANDBOX_ID/undelete
Code Type Description 400 Error Error if malformed request 404 Error Error if sandbox or instance was not found
Schema for the result of a device counts request
root: {} 3 keys$schema: "http://json-schema.org/draft-07/schema#" type: "object" properties: {} 3 keysstart: {} 2 keysend: {} 2 keyscounts: {} 2 keys
root: {} 3 keysstart: "1999-05-20T05:00:00.000Z" end: "1999-06-20T04:59:59.999Z" counts: [] 1 item
Schema for errors returned by the API
root: {} 3 keys$schema: "http://json-schema.org/draft-07/schema#" type: "object" properties: {} 2 keystype: {} 1 keymessage: {} 1 key
root: {} 2 keystype: "NotFound" message: "Application was not found"
Schema for information about a sandbox user within an instance domain
root: {} 3 keys$schema: "http://json-schema.org/draft-07/schema#" type: "object" properties: {} 32 keysid: {} 2 keysinstanceSandboxId: {} 2 keysinstanceId: {} 2 keyscreationDate: {} 2 keyspermanentDeletion: {} 2 keysdataDeletion: {} 2 keyslastUpdated: {} 2 keyslastSuccessfulLogin: {} 2 keyslastFailedLogin: {} 2 keysfailedLoginCount: {} 1 keypasswordLastUpdated: {} 2 keysemail: {} 3 keysfirstName: {} 3 keyslastName: {} 2 keyscompanyName: {} 2 keystitle: {} 2 keysphoneNumber: {} 2 keyslocation: {} 2 keysurl: {} 2 keystokenCutoff: {} 2 keysemailVerified: {} 1 keyneedsToVerifyEmail: {} 1 keytwoFactorAuthEnabled: {} 1 keyfullName: {} 1 keygithubName: {} 1 keyavatarUrl: {} 3 keyslimits: {} 3 keyssummary: {} 2 keyscurrentPeriodStart: {} 2 keyscurrentPeriodEnd: {} 2 keysssoLinked: {} 1 keyorgs: {} 2 keys
root: {} 18 keysid: "575ed70c7ae143cd83dc4aa9" instanceId: "575ed70c7ae143cd83dc4aa9" instanceSandboxId: "575ed70c7ae143cd83dc4aa9" creationDate: "2016-06-13T04:00:00.000Z" lastUpdated: "2016-06-13T04:00:00.000Z" passwordLastUpdated: "2016-06-13T04:00:00.000Z" email: "email@example.com" firstName: "Example" lastName: "Name" companyName: "Example, Inc." url: "https://example.com" emailVerified: true needsToVerifyEmail: false twoFactorAuthEnabled: false fullName: "Example Name" summary: {} 8 keysorgs: [] 1 itemssoLinked: false
Schema for the result of a notebook minute counts request
root: {} 3 keys$schema: "http://json-schema.org/draft-07/schema#" type: "object" properties: {} 3 keysstart: {} 2 keysend: {} 2 keyscounts: {} 2 keys
root: {} 3 keysstart: "1999-05-20T05:00:00.000Z" end: "1999-06-20T04:59:59.999Z" counts: [] 1 item
Schema for the result of a payload counts breakdown request
root: {} 3 keys$schema: "http://json-schema.org/draft-07/schema#" type: "object" properties: {} 3 keysstart: {} 2 keysend: {} 2 keyscounts: {} 2 keys
root: {} 3 keysstart: "1999-05-20T05:00:00.000Z" end: "1999-06-20T04:59:59.999Z" counts: [] 1 item
Schema for the result of a payload stats request
root: {} 3 keys$schema: "http://json-schema.org/draft-07/schema#" type: "object" properties: {} 19 keysappFile: {} 2 keysdataTable: {} 2 keysdeviceCreate: {} 2 keysdeviceCommand: {} 2 keysdeviceConnect: {} 2 keysdeviceDisconnect: {} 2 keysdeviceState: {} 2 keysendpoint: {} 2 keysevent: {} 2 keysflowError: {} 2 keysinboundEmail: {} 2 keysintegration: {} 2 keysmqttIn: {} 2 keysmqttOut: {} 2 keysnotebook: {} 2 keysresourceJob: {} 2 keystimer: {} 2 keysvirtualButton: {} 2 keyswebhook: {} 2 keys
root: {} 6 keystimer: {} 1 keydeviceState: {} 2 keysmqttOut: {} 1 keywebhook: {} 1 keydeviceConnect: {} 1 keydeviceDisconnect: {} 1 key
Schema for reporting a successful operation
root: {} 3 keys$schema: "http://json-schema.org/draft-07/schema#" type: "object" properties: {} 1 key