About Our REST API

Our REST API enables custom middleware and integrations. You can use the REST API to update Data on a Panel by Panel basis.

Note: The REST API is free to use for all users.

</br>

Core Concepts

  • Authentication - API key using the 'x-api-key' header value. API key is unique on a Dashboard by Dashboard basis.
  • Panel Data - Required Data is different depending on Panel Type. The API will return error messages if you are trying to set data incorrectly.
  • Setup - Dashifi can generate a <a href="https://www.postman.com/" target="_blank">Postman</a> Collection for your Dashboard with examples of what data is required for each panel.
  • Mapping Data - There is no need to do any additional mapping when using the REST API.

<img src="/assets/images/RestApi/enabling.png" alt="Enabling the REST API" width="800" />

</br>

Getting Started

This assumes you have <a href="https://www.postman.com/" target="_blank">Postman</a> installed. If you need to learn more about Postman, visit <a href="https://learning.postman.com/" target="_blank">Learning Postman</a>.

  1. Setup your Dashboard with Panels
  2. Download the example Postman Collection using the 'Get Example Postman' button
  3. Import the downloaded file into Postman using the 'Import' button
  4. Open the imported example

Note: At this point you will see the 'x-api-key' header set in the 'Headers' tab in Postman.

  1. View the Request Body in the 'Body' tab, you will see an example of how to set data for each Panel with the 'Data Source' set to REST API
  2. Send. This request is ready to send out of box

<img src="/assets/images/RestApi/postman.png" alt="Enabling the REST API" width="800" />

Tip: The 'code' button in Postman gives some examples of how to use this request in different languages.

  1. View your new Data on through a Share or by enabling 'Live Data' in the 'Data' tab.

</br>

Common Error Messages

Status Code Message Reason
200 OK Valid Request
501 Unauthorised Invalid Credentials
400 REST API is not enabled for this Dashboard REST API is not enabled
400 Invalid Data in Panel... Invalid Data for Panel with ID