Xeelo Endpoints

Xeelo Endpoints is a group of REST APIs which enables uploading or downloading various types of data directly into Xeelo Admin database. Such data are then stored and accessible until they are explicitly deleted by a client.

Endpoints are created dynamically and set up by a Xeelo administrator via web interface. Depending on their definition, endpoints accept one of the following data formats in a request body:

  • JSON,
  • Base64,
  • XML.

Optionally, access to the endpoints can be limited by using an authorization token which can be passed in two ways:

  • As a parameter in the endpoint URL.
    • https://<Xeelo_URL>/api/Endpoint/<endpoint_name>?access_token=<access_token>
  • In a HTTP request header.
    • Authorization: Bearer <access_token>

Each request type can have different token (GET, POST, DELETE). It is possible to forbid DELETE request overall:

Uploading data into the endpoint

Each endpoint accepts data of preconfigured data type via POST Request.

POST https://<Xeelo_URL>/api/Endpoint/<endpoint_name>

Depending on result, one of the following HTTP status codes is returned:

  • 201 – data was accepted and stored into the database.
    • Response body {"ID":<id>, "Created": "<CreatedDate>"}
  • 400 – data format does not correspond to the endpoint definition.
  • 500 – data could not be stored. For detail information, contact Xeelo administrator, which can provide logs.

Getting data from endpoint

All uploaded data from endpoint can be received via:

GET https://<Xeelo_URL>/api/Endpoint/<endpoint_name>

or via

GET https://<Xeelo_URL>/api/Endpoint/<endpoint_name>?since=<datetime>

for getting only data uploaded after specified date in ISO format. When success, data is returned as JSON array of following objects:

{
  "Created": <DateTime>,
  "Data": <Base64>,
  "ID": <Int>
}

where:

  • Created - date and time when data was uploaded into the Xeelo,
  • Data – Base64 encoded entire request body,
  • ID – internal unique identifier under which the data is stored (required for deleting).

Deleting data from endpoint

DELETE https://<Xeelo_URL>/api/Endpoint/<endpoint_name>/<id>

where ID is an internal identifier returned together with data. Depending on result, one of the following HTTP status codes is returned:

  • 200 – data was deleted and removed from database,
  • 403 – unauthorized attempt for deleting endpoint data,
  • 500 – data could not be deleted. For detail information, contact Xeelo administrator, which can provide logs.

Producer - Consumer Example

Let’s have two systems which need to exchange data through Xeelo Endpoints. Producer is simple and does not care whether consumer processes the data. Producer and Consumer have of course agreement on exchanged data structures.

Producer

  • Every minute pushes new data by POST /api/endpoint/<endpointName>.

Consumer

  • Every hour consumes data by GET /api/Endpoint/<endpointName>,
  • processes data,
  • takes care of deleting by DELETE /api/Endpoint/<endpointName>/<ID>.

In case you do not want/need to remove after processing, consumer can remember current date as <previousDate> and ask for data using GET /api/Endpoint/<endpointName>?since=<previousDate>.

In case producer was interested about consumer’s result, you may create another endpoint, where consumer will store processed results and producer will pick them up.