REST API

POS offers REST APIs to be on a par with CLI commands to ease integration efforts. d-agent is POS management process that translates HTTP requests into POS CLI commands and communicates directly witih POS CLI server. The REST endpoint is hosted on Nginx with the default configuration of (port=80, timeout = 30 seconds). The schema of expected HTTP requests is as follows.

Request Header

KeyValueSample
X-Request-Id{uuid4}44f1280b-982e-4d2e-ab14-fe9eb2022045
ts{unix_timestamp}1566287153702
Content-Typeapplication/jsonapplication/json

Request Body

All API has common request scheme except GET method.

REST request schema

{
  "param":{
    // Ref. each command
}

Response Header

KeyValueSample
X-Request-Id{the same as request’s}44f1280b-982e-4d2e-ab14-fe9eb2022045
Content-Typeapplication/jsonapplication/json
Content-Length{length}97

Response Body

All API has common response scheme.

REST response schema

{
   "result":{
    "status":{
      "code":0,
      "description":"Some Message"
    },
    "data":{ // Optional
      // Ref. each command
    } 
  },
  "info": { // Optional
      "state": "OFFLINE",
      "situation": "DEFAULT",
      "rebuliding_progress": 0,
      "capacity": 0,
      "used": 0
  }
}

SEE ALSO


Samsung Electronics © 2022. All rights reserved.