In this article:
The Myriota Cloud APIs provide a RESTful interface to integrate your own web applications, analytics pipelines and visualisation platforms with the Myriota Network. The Cloud API's allow you to query and manage Access Times, Destinations and Modules.
The base URL of all public Myriota Cloud APIs is currently https://api.myriota.com/v1
. Paths corresponding to specific API endpoints e.g. /modules, must be appended to the base URL.
Documentation
Click on the API heading in the list below to access the API documentation pages.
- Access Times - get upcoming satellite pass information and access times for data transmission
- Destinations - configure how and where received message data is sent
- Modules - register and manage Myriota Modules on the Myriota Network, including routing of received messages
- Device Control Messages - send 20 Byte messages to your devices. See Device Control Messages section for overview.
Authentication
Access to the Myriota Cloud APIs are authenticated via a JSON Web Token (JWT). The JWT is passed using an Authorization
header, which must be included with all API requests. Furthermore, all API requests must be made via HTTPS. Any API request issued over plain HTTP will fail, as will API requests not including a valid token within the Authorization header.
Once you have successfully registered a Device Manager account, you can obtain a JWT by running the python script tools/myriota_auth.py
, which is included in the SDK. The script will print several tokens to stdout. Only the IdToken is required for API access
# you may be prompted for email and password inputs python tools/myriota_auth.py
Include the IdToken
within the Authorization
header of subsequent API requests, as the shown below.
curl --header "Authorization: <IdToken>" https://api.myriota.com/v1/modules
The token is only valid for 1 hour. A long term token suitable for server-to-server authentication can be created in Device Manager. Select "Tokens" from the left bar and click "Create" button, a new token will be generated after confirmation. Once created, immediately copy and securely store the generated token. For security reasons, tokens are not retained by Myriota and cannot be retrieved at any point.
Errors
Myriota's Cloud APIs use conventional HTTP response codes for indicating the success or failure of a given request. In general, response codes in the 2xx range indicate success, with typical responses provided within the API documentation. Response codes in the 4xx range indicate an invalid request, with some information provided within the response.
Lastly, response codes in the 5xx range indicate an error within the Myriota Cloud. These are rare, but if you encounter an error of this type, please let us know! You can report the error via Support and by doing so, you'll help us to continue improving the quality of our service.
Note that some APIs support bulk operations, in which case a 2xx response code may be returned even though individual items within the request may fail. In such cases, the API documentation describes how to identify errors.
Examples
View the API documentation and code examples for more information on the format and authentication of message data sent from the Myriota network to your HTTP and AWS Lambda Destination(s).