REST API

D:Signage have a generic parser for JSON. By generic we mean that we normally do not require the data to setup with specific structure and can use most used existing data formats. These types of data are supported by default:

1. Generic key/value structure.
2. A generic collection of items ([]) or a generic JSON structure with an collection node ({ values: [] }).

Example of how we parse an collection:

{
   Customers: [{
      "name": "My name"
      "address": {
         "address": "My street 1",
         "zip": "1234"
      },
      "orders": [{
         "orderId": "10000",
         "orderId": "10001"
      }]
   }]
}

This JSON example will enumerated as a flat list of fields:
  • name
  • address_address
  • address_zip
  • orders

For subcollections, like "orders" in this example, can setup an seperate enumeration.


JSON PULL

We can PULL JSON data using regular HTTP(S) requests (GET, POST etc). The request can have custom headers and a body (For authentication etc).


JSON PUSH

There is also an option to PUSH data to the api using a POST request. There are two endpoints for this:

1. "POST /api/push/keyvalues/{id}". Allows you to push a flat key/value json structure where only the values conained in the POST is updated.

2. "POST /api/pish/data/{ID}". Pushes a custom JSON to a preselected ID.