Skip to main content

ConnectAPI Documentation

Welcome to the Connect API documentation. This API allows you to establish a connection and push environmental data from sensors and devices into Cannavigia.

Authentication

To access the Connect API, you need to include an API token in the request header.

CODE
Authorization: Bearer YOUR_API_TOKEN

Follow the instructions here to generate your API token.

Base URL

The base URL for all API requests is:

CODE
https://connectapi.iot.cannavigia.io/v1

Support endpoints

Temperature - c

/iot_temp

Humidity (relative) - %

/iot_humidity

co2 - ppm

/iot_co2

Connect and Push Data

  1. Endpoint: /iot_co2

  2. Method: POST

  3. Description: Establish a connection and push environmental data from sensors/devices into Cannavigia.

  4. Payload: JSON formatted body

Parameters

  • sensor_guid (required): Unique identifier for sensor

  • sensor_timestamp (required): Timestamp value in UTC format

  • sensor_value (required): Value of sensor

Response

Returns a http code with result

Example

Request:

CODE
POST /iot_co2

Response:

CODE
"Payload received successfully"

Errors

This API uses the following error codes:

  • 400 Bad Request: Invalid payload. Please provide a valid JSON object.

  • 401 Unauthorized: The API key provided was invalid or missing.

  • 404 Not Found: The requested resource was not found.

  • 500 Internal Server Error: An unexpected error occurred on the server.

Rate Limiting

To ensure fair usage, the Connect API has rate limits. Exceeding these limits will result in a 429 Too Many Requests response.

  • Limit: 1000 requests per minute

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.