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 timeline feed

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": [
       {
           "claim_id": "8c8c34cb-c03a-4905-969e-ce7a765c0899",
           "coins": "5000000000000000000",
           "scan_id": "c5460863-e15b-40c7-abf1-8f1b21214f4c",
           "status": "approved",
           "text": "Earned from <b>System campaign</b> per scan and view info of <b>Bellagio Wine Bianco 750ml</b>.",
           "ts": "2018-03-15T13:03:05Z",
           "type": "coins"
       },
       {
           "coins": "5000000000000000000",
           "earned_coins": "5000000000000000000",
           "image_url": "https://cdn.shping.com/2018/1/28/a759926f-0826-4d90-9d62-61aa4d202d56.png",
           "max_coins": "5000000000000000000",
           "product_name": "Bellagio Wine Bianco 750ml",
           "scan_id": "c5460863-e15b-40c7-abf1-8f1b21214f4c",
           "text": "Bellagio Wine Bianco 750ml",
           "ts": "2018-03-15T13:01:42Z",
           "type": "scan"
       },
       {
           "rule_id": "scan_interval",
           "scan_id": "c5460863-e15b-40c7-abf1-8f1b21214f4c",
           "campaign_id": "urn:authenticateit:campaign:006501147548377",
           "is_blocked_notification": true,
           "text": "You have been temporarily blocked from earning coins for 1 hour",
           "ts": "2018-03-15T12:01:42Z",
           "type": "notification"
       },
       {
           "text": "65 65 poked you: \"Hey, you are my Shping Buddy. Please scan more so we could faster get our rewards!\"",
           "ts": "2018-01-18T22:07:55Z",
           "type": "notification"
       }
  ],
  "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 ""