Pixel Server

Pixel server is a microservice to manage publisher pixels and do callbacks

DB Scheme

CREATE TABLE IF NOT EXISTS pixel (
  id VARCHAR(64) NOT NULL,
  status INTEGER NULL DEFAULT NULL,
  timestamp INTEGER NOT NULL,
  PRIMARY KEY (id)
);`

The API

Pixel server implements the following RPC Methods

Pixel

  • Create
  • Read
  • Update
  • Delete
  • Search
  • Send

Pixel.About

curl -X GET 'http://xmp.vostok.linkit360.com:9011/api/v1/pixels/'
{
  "message": "XMP 3.0 Pixel v1.0"
}

Pixel.Create

curl -X POST \
  -H "X-Parse-Application-Id: ${APPLICATION_ID}" \
  -H "X-Parse-REST-API-Key: ${REST_API_KEY}" \
  -H "Content-Type: application/json" \
  http://xmp.vostok.linkit360.com:9011/api/v1/pixels/create/{pixel}'
{
  "message": "OK"
}

Pixel.Read

curl -X GET \
  -H "X-Parse-Application-Id: ${APPLICATION_ID}" \
  -H "X-Parse-REST-API-Key: ${REST_API_KEY}" \
  http://xmp.vostok.linkit360.com:9011/api/v1/pixels/read/{pixel}'
{
  "id": "123",
  "timestamp": 1458037433
}

Pixel.Update

curl -X PUT \
  -H "X-Parse-Application-Id: ${APPLICATION_ID}" \
  -H "X-Parse-REST-API-Key: ${REST_API_KEY}" \
  -H "Content-Type: application/json" \
  -d '{"timestamp":1458037433, "status":1}' \
  http://xmp.vostok.linkit360.com:9011/api/v1/pixels/update/{pixel}'
{
  "message": "OK"
}

Pixel.Delete

curl -X DELETE \
  -H "X-Parse-Application-Id: ${APPLICATION_ID}" \
  -H "X-Parse-REST-API-Key: ${REST_API_KEY}" \
  -H "Content-Type: application/json" \
  http://xmp.vostok.linkit360.com:9011/api/v1/pixels/delete/{pixel}'
{
  "message": "OK"
}

Pixel.Search

curl -X POST \
  -H "X-Parse-Application-Id: ${APPLICATION_ID}" \
  -H "X-Parse-REST-API-Key: ${REST_API_KEY}" \
  -H "Content-Type: application/json" \
  -d '{"from":1458030000, "to":1458037434, "status":1, "limit":5, "offset":0, "reverse":0}' \
  http://xmp.vostok.linkit360.com:9011/api/v1/pixels/search/{pixel}'
[
  {
   "id": "123",
   "status": 1,
   "timestamp": 1458037433
  },
  {
   "id": "457",
   "status": 1,
   "timestamp": 1458037433
  }
 ]

Pixel.Send

curl -X POST \
  -H "X-Parse-Application-Id: ${APPLICATION_ID}" \
  -H "X-Parse-REST-API-Key: ${REST_API_KEY}" \
  -H "Content-Type: application/json" \
  http://xmp.vostok.linkit360.com:9011/api/v1/pixels/send/{pixel}'
{
  "message": "OK"
}