Documentation Center

API Reference

Welcome to the relayr API reference! The relayr API provides complete programmatic access to every entity on the relayr platform. Below are instructions on how the relayr API works and links to documentation for each of the API entities.

How to use the API

relayr API calls can be made over HTTPS (calls made with just HTTP are not accepted). Our API documentation includes sample calls using cURL, but we also recommend using a program such as Postman, which is designed specifically for testing API calls.

In order to use the API, you will need to have registered for the Developer Dashboard. Once you have done so, you will need two pieces of information: your user ID and your authorization token. You can find both of these under the Account section of the Developer Dashboard, as shown below:

Account settings

Your authorization token, which consists of “Bearer” followed by a token string, must be supplied as the Authorization header for every API request. For example:

Authorization: Bearer K.OwjFjwQdm-67kc2AInfHngnB.tzXwh

The relayr API returns JSON objects for requests to access or modify resources in the cloud. For all entities except device-models and prototypes, supply the following header:

Content-Type: application/json

For device-models and prototypes, provide this instead:

Content-Type: application/hal+json

HTTP Status Codes & Errors

We use standard HTTP status codes in our API responses, which include the following:

  • 200 OK: The API call was successful. Includes a JSON body in the response.
  • 201 Created: A new object or entity was created. Returns a JSON schema of the new object/entity.
  • 204 No Content: An object or entity was successfully deleted from the relayr cloud.
  • 400 Bad Request: The request was improperly formatted. Some common causes of this error include:
    • Improper content-type header - check to see if the proper value is application/hal+json or application/json, for example;
    • Expired authorization token - check your Account page in the Developer Dashboard.
  • 401 Unauthorized: The request did not include the proper authorization token (see above).
  • 403 Forbidden: The request attempted to access a resource for which the user does not have permissions.
  • 404 Not Found: The resource could not be located.
  • 500 Internal Server Error: An error on relayr’s servers.

Cloud API

The Cloud includes the following core endpoints:

Services API

The relayr services include the following endpoints:

relayr Edge Agent API

The relayr Edge Agent uses the following endpoints:

© 2017 relayr · Imprint