Timeline

The end point /timeline-service/timeline provides 2 methods for creation the event on user's timeline and receiving chunk of timeline for user

Create an event

POST /timeline-service/timeline
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
type string Type of event e.g. "points"
product string Product name
scanid string Scan id

Get an event

GET /timeline-service/timeline
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
id string Event id
:empty: - returns main chunk
Example Response
{
  "id": "4eb1752fdd36a3415bce036478002b49",
  "records": [
    {
      "type": "points",
      "ts": "2016-10-19T02:20:20Z",
      "points": 10,
      "product": "Test product name 1",
      "scanid": "4eb1752fdd36a3415bce0364780032bc"
    },
    {
      "id": "c52a348e-f860-4c10-9b27-3e552d427efa",
      "image": "http://localhost/ie.png",
      "publish_date": "2012-10-20T02:15:21Z",
      "text": "**Markdown text**test",
      "title": "Australian news #6",
      "ts": "2016-11-15T07:41:00Z",
      "type": "news",
      "user_id": "foo@bar.com"
    }
  ],
  "next": "4eb1752fdd36a3415bce0364780032aa"
}

Newsline

The end point /newsline provides 4 methods for creating the news on global newsline, updating news in chunk, reading chunks of newsline and deleting news from chunk

Create news

POST /timeline-service/newsline
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
type string Type of event e.g. "points"
publish_date string Date e.g. "2016-10-20T02:15:21Z"
title string News title
text string Markdown text
image string Url (our S3 bucket)
tags object e.g. {"countries":["036","040"], "languages":"en"}

Read news

GET /timeline-service/newsline
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
chunk_id string Chunk id
:empty: - returns main chunk
Example Response
{
  "id": "4eb1752fdd36a3415bce036478002b49",
  "news": [
    {
      "id": "c0b5914a-8e08-45e5-a6db-a3b619502fd1",
      "image": "http://localhost/ie.png",
      "publish_date": "2016-10-20T02:15:21Z",
      "published": false,
      "tags": {
        "countries": [
          "036",
          "040"
        ],
        "languages": "en"
      },
      "text": "**Markdown text**test",
      "title": "Australian news #6",
      "ts": "2016-11-16T12:07:08Z",
      "type": "news",
      "user_id": "foo@bar.com"
    },
    {
      "id": "8d19212b-6e4c-463f-a92f-907a85873a57",
      "image": "http://localhost/ie.png",
      "publish_date": "2016-10-20T02:15:21Z",
      "published": false,
      "tags": {
        "countries": "036",
        "languages": "en"
      },
      "text": "**Markdown text**test",
      "title": "Australian news #6",
      "ts": "2016-11-16T12:06:30Z",
      "type": "news",
      "user_id": "foo@bar.com"
    },
    {
      "id": "684af08b-49d8-4c9b-ac80-4551c4689d68",
      "image": "http://localhost/ie.png",
      "publish_date": "2016-10-20T02:15:21Z",
      "published": true,
      "tags": {},
      "text": "**Markdown text**test",
      "title": "Australian news #3",
      "ts": "2016-11-15T20:26:39Z",
      "type": "news",
      "user_id": "foo@bar.com"
    }
  ],
  "next": "43597378-a437-4529-9cba-78a23df857d5",
  "prev": "02ae20b9-c9ca-4dec-9cdc-38a6444ca822",
  "type": "newslinechunk"
}

Delete news

DELETE /timeline-service/newsline
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
chunk_id string Chunk id

Update news

PUT /timeline-service/newsline
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
chunk_id string Chunk id
news_id string News id
type string Type of event e.g. "points"
publish_date string Date e.g. "2016-10-20T02:15:21Z"
title string News title
text string Markdown text
image string Url (our S3 bucket)
tags object e.g. {"countries":["036","040"], "languages":"en"}

Tags

The end point /tags provides method for counting user's profiles by tags

Count user profiles by tag

Requests Description
{“tags”:{“countries”:[“036”, “040”],“languages”:[“ru”, “en”]}} Count of users whose “country” field contains “036” or “040” and “language” field contains “ru” or “en”
{“tags”:{}} Count of users
{“tags”:{“countries”:“036”}} Count of users whose “country” field contains “036”
{“tags”:{“languages”:“ru”}} Count of users whose “language” field contains “ru”
POST /timeline-service/tags
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
Example Response
{
    “count”:1
}

results matching ""

    No results matching ""