Senquip Cloud API Documentation

Senquip Support: support@senquip.com

Terms of Service

The Senquip Cloud API allows 3rd party access to data collected by the Senquip Portal. The API does not fully replace the Senquip Portal, which can still be used to view and configure device information.

Note

The Senquip Cloud API and documentation is under development. More features and better documentation will be available soon.

Versioning

API releases follow the version numbering system: MAJOR.MINOR.PATCH

MAJOR version for incompatible changes,
MINOR version for backwards compatible functionality, and
PATCH version for backwards compatible bug fixes.

Authorization

The API is secured using HTTPS and OAuth 2.0 client_credentials grant type.

The following authorization information is available once the account is setup on the Senquip system.

  • Token URL

  • Client ID

  • Client Secret

  • Endpoint URL

Authorization Flow

  1. End application makes a request to the Token URL. In order to indicate that the app is authorized to make the request, the Authorization header for this request is set as Basic BASE64(CLIENT_ID:CLIENT_SECRET), where BASE64(CLIENT_ID:CLIENT_SECRET) is the base64 representation of the Client ID and Client secret, concatenated with a colon.

Test Command: curl -i -H 'Content-Type: application/x-www-form-urlencoded' -X POST 'TOKEN URL' -d 'grant_type=client_credentials' -H 'Authorization: Basic BASE64(CLIENT_ID:CLIENT_SECRET)'

  1. If the access token request is valid, the authorization server returns a JSON object with the following keys:

    • access_token – A valid access token.

    • expires_in – The length of time (in seconds) that the provided access token is valid for.

    • token_type – Set to “Bearer”.

  2. The app uses the access token in the Authorization header when making requests to the Endpoint URL.

Test Command: curl -X GET 'ENDPOINT URL' -H 'Content-Type: application/json' -H 'Authorization: TOKEN'


Endpoints

GET /get-data/{query}

get-data

Retrieves data for a given device by returning an array of datapoints for the provided Device ID. The number of datapoints returned, and a time range can be specified. If the ‘from’ and ‘to’ parameters are omitted, the latest ‘datapoints’ are returned.

Parameters
  • deviceid (string) – Senquip Device ID for which data is requested.

Query Parameters
  • datapoints (string) – Requested number of data entries to return. Optional - Default (1)

  • from (string) – Starting timestamp. Optional.

  • to (string) – Ending timestamp. Optional.

Status Codes
GET /get-device-summary

get-device-summary

Retrieves a summary of devices associated with the API account.

Status Codes