Skip to main content

Instance Sandbox Actions

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.

Delete​

Deletes a sandbox user account

Method And Url​

DELETE https://api.losant.com/instances/INSTANCE_ID/sandboxes/INSTANCE_SANDBOX_ID

Authentication​

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.bounded, all.User, all.User.bounded, instanceSandbox.*, or instanceSandbox.delete.

Request Path Components​

Path ComponentDescriptionExample
INSTANCE_IDID associated with the instance575ec8687ae143cd83dc4a97
INSTANCE_SANDBOX_IDID associated with the sandbox user575ec8687ae143cd83dc4a97

Request Headers​

NameRequiredDescriptionDefault
AuthorizationYThe token for authenticating the request, prepended with Bearer

Curl Example​

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

Successful Responses​

CodeTypeDescription
200SuccessIf a sandbox was successfully deleted

Error Responses​

CodeTypeDescription
400ErrorError if malformed request
404ErrorError if sandbox or instance was not found

Device Counts​

Returns device counts by day for the time range specified for all applications the sandbox user owns

Method And Url​

GET https://api.losant.com/instances/INSTANCE_ID/sandboxes/INSTANCE_SANDBOX_ID/deviceCounts

Authentication​

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.bounded, all.Instance.read, all.User, all.User.bounded, all.User.read, instanceSandbox.*, or instanceSandbox.deviceCounts.

Request Path Components​

Path ComponentDescriptionExample
INSTANCE_IDID associated with the instance575ec8687ae143cd83dc4a97
INSTANCE_SANDBOX_IDID associated with the sandbox user575ec8687ae143cd83dc4a97

Request Query Parameters​

NameRequiredDescriptionDefaultExample
startNStart of range for device count query (ms since epoch)start=0
endNEnd of range for device count query (ms since epoch)end=1465790400000

Request Headers​

NameRequiredDescriptionDefault
AuthorizationYThe token for authenticating the request, prepended with Bearer

Curl Example​

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

Successful Responses​

CodeTypeDescription
200Device CountsDevice counts by day

Error Responses​

CodeTypeDescription
400ErrorError if malformed request
404ErrorError if sandbox or instance was not found

Get​

Returns a sandbox user

Method And Url​

GET https://api.losant.com/instances/INSTANCE_ID/sandboxes/INSTANCE_SANDBOX_ID

Authentication​

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.bounded, all.Instance.read, all.User, all.User.bounded, all.User.read, instanceSandbox.*, or instanceSandbox.get.

Request Path Components​

Path ComponentDescriptionExample
INSTANCE_IDID associated with the instance575ec8687ae143cd83dc4a97
INSTANCE_SANDBOX_IDID associated with the sandbox user575ec8687ae143cd83dc4a97

Request Query Parameters​

NameRequiredDescriptionDefaultExample
summaryExcludeNComma-separated list of summary fields to exclude from user summarysummaryExclude=payloadCount
summaryIncludeNComma-separated list of summary fields to include in user summarysummaryInclude=payloadCount

Request Headers​

NameRequiredDescriptionDefault
AuthorizationYThe token for authenticating the request, prepended with Bearer

Curl Example​

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

Successful Responses​

CodeTypeDescription
200Instance Sandbox UserA single sandbox user

Error Responses​

CodeTypeDescription
400ErrorError if malformed request
404ErrorError if sandbox or instance was not found

Notebook Minute Counts​

Returns notebook execution usage by day for the time range specified for all applications the sandbox user owns

Method And Url​

GET https://api.losant.com/instances/INSTANCE_ID/sandboxes/INSTANCE_SANDBOX_ID/notebookMinuteCounts

Authentication​

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.bounded, all.Instance.read, all.User, all.User.bounded, all.User.read, instanceSandbox.*, or instanceSandbox.notebookMinuteCounts.

Request Path Components​

Path ComponentDescriptionExample
INSTANCE_IDID associated with the instance575ec8687ae143cd83dc4a97
INSTANCE_SANDBOX_IDID associated with the sandbox user575ec8687ae143cd83dc4a97

Request Query Parameters​

NameRequiredDescriptionDefaultExample
startNStart of range for notebook execution query (ms since epoch)start=0
endNEnd of range for notebook execution query (ms since epoch)end=1465790400000

Request Headers​

NameRequiredDescriptionDefault
AuthorizationYThe token for authenticating the request, prepended with Bearer

Curl Example​

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

Successful Responses​

CodeTypeDescription
200Notebook Minute CountsNotebook usage information

Error Responses​

CodeTypeDescription
400ErrorError if malformed request
404ErrorError if sandbox or instance was not found

Payload Counts​

Returns payload counts for the time range specified for all applications the sandbox user owns

Method And Url​

GET https://api.losant.com/instances/INSTANCE_ID/sandboxes/INSTANCE_SANDBOX_ID/payloadCounts

Authentication​

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.bounded, all.Instance.read, all.User, all.User.bounded, all.User.read, instanceSandbox.*, or instanceSandbox.payloadCounts.

Request Path Components​

Path ComponentDescriptionExample
INSTANCE_IDID associated with the instance575ec8687ae143cd83dc4a97
INSTANCE_SANDBOX_IDID associated with the sandbox user575ec8687ae143cd83dc4a97

Request Query Parameters​

NameRequiredDescriptionDefaultExample
startNStart of range for payload count query (ms since epoch)start=0
endNEnd of range for payload count query (ms since epoch)end=1465790400000
asBytesNIf the resulting stats should be returned as bytesfalseasBytes=true

Request Headers​

NameRequiredDescriptionDefault
AuthorizationYThe token for authenticating the request, prepended with Bearer

Curl Example​

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

Successful Responses​

CodeTypeDescription
200Payload StatsPayload counts, by type and source

Error Responses​

CodeTypeDescription
400ErrorError if malformed request
404ErrorError if sandbox or instance was not found

Payload Counts Breakdown​

Returns payload counts per resolution in the time range specified for all applications the sandbox user owns

Method And Url​

GET https://api.losant.com/instances/INSTANCE_ID/sandboxes/INSTANCE_SANDBOX_ID/payloadCountsBreakdown

Authentication​

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.bounded, all.Instance.read, all.User, all.User.bounded, all.User.read, instanceSandbox.*, or instanceSandbox.payloadCountsBreakdown.

Request Path Components​

Path ComponentDescriptionExample
INSTANCE_IDID associated with the instance575ec8687ae143cd83dc4a97
INSTANCE_SANDBOX_IDID associated with the sandbox user575ec8687ae143cd83dc4a97

Request Query Parameters​

NameRequiredDescriptionDefaultExample
startNStart of range for payload count query (ms since epoch)start=0
endNEnd of range for payload count query (ms since epoch)end=1465790400000
resolutionNResolution in milliseconds. Accepted values are: 86400000, 360000086400000resolution=86400000
asBytesNIf the resulting stats should be returned as bytesfalseasBytes=true
includeNonBillableNIf non-billable payloads should be included in the resultfalseincludeNonBillable=true

Request Headers​

NameRequiredDescriptionDefault
AuthorizationYThe token for authenticating the request, prepended with Bearer

Curl Example​

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

Successful Responses​

CodeTypeDescription
200Payload Counts BreakdownSum of payload counts by date

Error Responses​

CodeTypeDescription
400ErrorError if malformed request
404ErrorError if sandbox or instance was not found

Undelete​

Restores a sandbox user account

Method And Url​

PATCH https://api.losant.com/instances/INSTANCE_ID/sandboxes/INSTANCE_SANDBOX_ID/undelete

Authentication​

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.bounded, all.User, all.User.bounded, instanceSandbox.*, or instanceSandbox.undelete.

Request Path Components​

Path ComponentDescriptionExample
INSTANCE_IDID associated with the instance575ec8687ae143cd83dc4a97
INSTANCE_SANDBOX_IDID associated with the sandbox user575ec8687ae143cd83dc4a97

Request Query Parameters​

NameRequiredDescriptionDefaultExample
summaryExcludeNComma-separated list of summary fields to exclude from user summarysummaryExclude=payloadCount
summaryIncludeNComma-separated list of summary fields to include in user summarysummaryInclude=payloadCount

Request Headers​

NameRequiredDescriptionDefault
AuthorizationYThe token for authenticating the request, prepended with Bearer

Curl Example​

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

Successful Responses​

CodeTypeDescription
200Instance Sandbox UserA single restored sandbox user

Error Responses​

CodeTypeDescription
400ErrorError if malformed request
404ErrorError if sandbox or instance was not found

Schemas​

Device Counts​

Schema for the result of a device counts request

Device Counts Schema​

  • ▶
    {} 3 keys
    • "http://json-schema.org/draft-07/schema#"
    • "object"
    • ▶
      {} 3 keys
      • ▶
        {} 2 keys
        • ▶
          {} 2 keys
          • ▶
            {} 2 keys

        Device Counts Example​

        • ▶
          {} 3 keys
          • "1999-05-20T05:00:00.000Z"
          • "1999-06-20T04:59:59.999Z"
          • ▶
            [] 1 item

          Error​

          Schema for errors returned by the API

          Error Schema​

          • ▶
            {} 3 keys
            • "http://json-schema.org/draft-07/schema#"
            • "object"
            • ▶
              {} 3 keys
              • ▶
                {} 1 key
                • ▶
                  {} 1 key
                  • ▶
                    {} 2 keys

                Error Example​

                • ▶
                  {} 2 keys
                  • "NotFound"
                  • "Application was not found"

                Instance Sandbox User​

                Schema for information about a sandbox user within an instance domain

                Instance Sandbox User Schema​

                • ▶
                  {} 3 keys
                  • "http://json-schema.org/draft-07/schema#"
                  • "object"
                  • ▶
                    {} 33 keys
                    • ▶
                      {} 2 keys
                      • ▶
                        {} 2 keys
                        • ▶
                          {} 2 keys
                          • ▶
                            {} 2 keys
                            • ▶
                              {} 2 keys
                              • ▶
                                {} 2 keys
                                • ▶
                                  {} 2 keys
                                  • ▶
                                    {} 2 keys
                                    • ▶
                                      {} 2 keys
                                      • ▶
                                        {} 2 keys
                                        • ▶
                                          {} 1 key
                                          • ▶
                                            {} 2 keys
                                            • ▶
                                              {} 3 keys
                                              • ▶
                                                {} 3 keys
                                                • ▶
                                                  {} 2 keys
                                                  • ▶
                                                    {} 2 keys
                                                    • ▶
                                                      {} 2 keys
                                                      • ▶
                                                        {} 2 keys
                                                        • ▶
                                                          {} 2 keys
                                                          • ▶
                                                            {} 2 keys
                                                            • ▶
                                                              {} 2 keys
                                                              • ▶
                                                                {} 1 key
                                                                • ▶
                                                                  {} 1 key
                                                                  • ▶
                                                                    {} 1 key
                                                                    • ▶
                                                                      {} 1 key
                                                                      • ▶
                                                                        {} 1 key
                                                                        • ▶
                                                                          {} 3 keys
                                                                          • ▶
                                                                            {} 3 keys
                                                                            • ▶
                                                                              {} 2 keys
                                                                              • ▶
                                                                                {} 2 keys
                                                                                • ▶
                                                                                  {} 2 keys
                                                                                  • ▶
                                                                                    {} 1 key
                                                                                    • ▶
                                                                                      {} 2 keys

                                                                                  Instance Sandbox User Example​

                                                                                  • ▶
                                                                                    {} 18 keys
                                                                                    • "575ed70c7ae143cd83dc4aa9"
                                                                                    • "575ed70c7ae143cd83dc4aa9"
                                                                                    • "575ed70c7ae143cd83dc4aa9"
                                                                                    • "2016-06-13T04:00:00.000Z"
                                                                                    • "2016-06-13T04:00:00.000Z"
                                                                                    • "2016-06-13T04:00:00.000Z"
                                                                                    • "email@example.com"
                                                                                    • "Example"
                                                                                    • "Name"
                                                                                    • "Example, Inc."
                                                                                    • "https://example.com"
                                                                                    • true
                                                                                    • false
                                                                                    • false
                                                                                    • "Example Name"
                                                                                    • ▶
                                                                                      {} 8 keys
                                                                                      • ▶
                                                                                        [] 1 item
                                                                                        • false

                                                                                      Notebook Minute Counts​

                                                                                      Schema for the result of a notebook minute counts request

                                                                                      Notebook Minute Counts Schema​

                                                                                      • ▶
                                                                                        {} 3 keys
                                                                                        • "http://json-schema.org/draft-07/schema#"
                                                                                        • "object"
                                                                                        • ▶
                                                                                          {} 3 keys
                                                                                          • ▶
                                                                                            {} 2 keys
                                                                                            • ▶
                                                                                              {} 2 keys
                                                                                              • ▶
                                                                                                {} 2 keys

                                                                                            Notebook Minute Counts Example​

                                                                                            • ▶
                                                                                              {} 3 keys
                                                                                              • "1999-05-20T05:00:00.000Z"
                                                                                              • "1999-06-20T04:59:59.999Z"
                                                                                              • ▶
                                                                                                [] 1 item

                                                                                              Payload Counts Breakdown​

                                                                                              Schema for the result of a payload counts breakdown request

                                                                                              Payload Counts Breakdown Schema​

                                                                                              • ▶
                                                                                                {} 3 keys
                                                                                                • "http://json-schema.org/draft-07/schema#"
                                                                                                • "object"
                                                                                                • ▶
                                                                                                  {} 3 keys
                                                                                                  • ▶
                                                                                                    {} 2 keys
                                                                                                    • ▶
                                                                                                      {} 2 keys
                                                                                                      • ▶
                                                                                                        {} 2 keys

                                                                                                    Payload Counts Breakdown Example​

                                                                                                    • ▶
                                                                                                      {} 3 keys
                                                                                                      • "1999-05-20T05:00:00.000Z"
                                                                                                      • "1999-06-20T04:59:59.999Z"
                                                                                                      • ▶
                                                                                                        [] 1 item

                                                                                                      Payload Stats​

                                                                                                      Schema for the result of a payload stats request

                                                                                                      Payload Stats Schema​

                                                                                                      • ▶
                                                                                                        {} 3 keys
                                                                                                        • "http://json-schema.org/draft-07/schema#"
                                                                                                        • "object"
                                                                                                        • ▶
                                                                                                          {} 19 keys
                                                                                                          • ▶
                                                                                                            {} 2 keys
                                                                                                            • ▶
                                                                                                              {} 2 keys
                                                                                                              • ▶
                                                                                                                {} 2 keys
                                                                                                                • ▶
                                                                                                                  {} 2 keys
                                                                                                                  • ▶
                                                                                                                    {} 2 keys
                                                                                                                    • ▶
                                                                                                                      {} 2 keys
                                                                                                                      • ▶
                                                                                                                        {} 2 keys
                                                                                                                        • ▶
                                                                                                                          {} 2 keys
                                                                                                                          • ▶
                                                                                                                            {} 2 keys
                                                                                                                            • ▶
                                                                                                                              {} 2 keys
                                                                                                                              • ▶
                                                                                                                                {} 2 keys
                                                                                                                                • ▶
                                                                                                                                  {} 2 keys
                                                                                                                                  • ▶
                                                                                                                                    {} 2 keys
                                                                                                                                    • ▶
                                                                                                                                      {} 2 keys
                                                                                                                                      • ▶
                                                                                                                                        {} 2 keys
                                                                                                                                        • ▶
                                                                                                                                          {} 2 keys
                                                                                                                                          • ▶
                                                                                                                                            {} 2 keys
                                                                                                                                            • ▶
                                                                                                                                              {} 2 keys
                                                                                                                                              • ▶
                                                                                                                                                {} 2 keys

                                                                                                                                            Payload Stats Example​

                                                                                                                                            • ▶
                                                                                                                                              {} 6 keys
                                                                                                                                              • ▶
                                                                                                                                                {} 1 key
                                                                                                                                                • ▶
                                                                                                                                                  {} 2 keys
                                                                                                                                                  • ▶
                                                                                                                                                    {} 1 key
                                                                                                                                                    • ▶
                                                                                                                                                      {} 1 key
                                                                                                                                                      • ▶
                                                                                                                                                        {} 1 key
                                                                                                                                                        • ▶
                                                                                                                                                          {} 1 key

                                                                                                                                                        Success​

                                                                                                                                                        Schema for reporting a successful operation

                                                                                                                                                        Success Schema​

                                                                                                                                                        • ▶
                                                                                                                                                          {} 3 keys
                                                                                                                                                          • "http://json-schema.org/draft-07/schema#"
                                                                                                                                                          • "object"
                                                                                                                                                          • ▶
                                                                                                                                                            {} 1 key
                                                                                                                                                            • ▶
                                                                                                                                                              {} 2 keys

                                                                                                                                                          Success Example​

                                                                                                                                                          • ▶
                                                                                                                                                            {} 1 key
                                                                                                                                                            • true

                                                                                                                                                          Was this page helpful?


                                                                                                                                                          Still looking for help? You can also search the Losant Forums or submit your question there.