Reviews

All reviews endpoints have path prefix /reviews-service.

User's API

Create Document

Endpoint for create new document based on scan_id.

POST /reviews-service/review_doc
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
scan_id string Required: Scan Id
rate number Required: User rate
text string Required: Text description
images array::object List of image objects e.g. [{url: "someurl"}]
Example Response
{
  "status": "Thank you! We are processing information you provided. You will be granted coins once we approve it."
}

Read Documents

Endpoint for users to read approved documents. Filtering documents based on fields “country” and “language” (must be presented in scan_id)

POST /reviews-service/review_docs/:scan_id
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
scan_id url Required: Scan Id
Example Response
{
  "reviews": [
    {
      "first_name": "65",
      "images": [
        {
          "url": "https://www.foo.com/image.jpg"
        },
        {
          "url": "https://www.foo.com/image2.jpg"
        },
        {
          "url": "1"
        }
      ],
      "last_name": "65",
      "level_icon": "http://dev-cdn.shping.com.s3.amazonaws.com/2017/5/24/d37edf9d-6faa-43c4-915c-a414b8547f75-Platinum.png",
      "rate": 5,
      "text": "Some text",
      "ts": "2017-08-23T08:00:51Z"
    }
  ]
}

Admin's API

Endpoint for reviews_admin to read list of documents. Roles required: “reviews_admin”

Read documents

POST /reviews-service/review_docs
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
page number Page of docs - non_neg_intege
limit number the number of elements on the page
countries array:string Countries filter
languages array::string Languages filter
lock boolean select only unlocked documents or documents locked by current admin
gtin string Select only documents related to the specified GTIN
user_name string Select only documents related to the specified user
Example Response
{
  "count": 13,
  "documents": [
    {
      "country": "643",
      "id": "urn:authenticateit:review_doc:474228022877598",
      "language": "ru",
      "lock": 0,
      "locked_by": null,
      "product_id": "04324654768588",
      "status": "open",
      "ts": "2017-08-23T08:05:24Z"
    },
    {
      "country": "643",
      "id": "urn:authenticateit:review_doc:307274164862979",
      "language": "ru",
      "lock": 0,
      "locked_by": null,
      "product_id": "04324654768588",
      "status": "open",
      "ts": "2017-08-23T08:00:51Z"
    }
  ]
}

Lock (read) document

Endpoint for admins to lock the document. Roles required: “reviews_admin”

PUT /reviews-service/review_doc/lock/:id
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
id url Document id
Example Response
{
  "conditions": {
    "country": "643",
    "language": "ru"
  },
  "data": {
    "images": [
      {
        "url": "https://www.foo.com/image.jpg"
      },
      {
        "url": "https://www.foo.com/image2.jpg"
      },
      {
        "url": "1"
      }
    ],
    "rate": 5,
    "text": "Some text"
  },
  "id": "urn:authenticateit:review_doc:307274164862979",
  "lock": true,
  "locked_by": "urn:authenticateit:user:email:65qw@mailinator.com",
  "owner": "urn:authenticateit:user:email:65qw@mailinator.com",
  "product_id": "04324654768588",
  "scan_id": "0b46d928-fcbe-4ee3-b9ea-54c7f7a01cde",
  "status": "open",
  "ts": "2017-08-23T08:00:51Z",
  "type": "review_doc",
  "user_level": "platinum"
}

Unlock document

Endpoint for admins to unlock the document. Roles required: “reviews_admin”

PUT /reviews-service/review_doc/unlock/:id
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
id url Document id
Example Response
{
  "conditions": {
    "country": "643",
    "language": "ru"
  },
  "data": {
    "images": [
      {
        "url": "https://www.foo.com/image.jpg"
      },
      {
        "url": "https://www.foo.com/image2.jpg"
      },
      {
        "url": "1"
      }
    ],
    "rate": 5,
    "text": "Some text"
  },
  "id": "urn:authenticateit:review_doc:307274164862979",
  "owner": "urn:authenticateit:user:email:65qw@mailinator.com",
  "product_id": "04324654768588",
  "scan_id": "0b46d928-fcbe-4ee3-b9ea-54c7f7a01cde",
  "status": "open",
  "ts": "2017-08-23T08:00:51Z",
  "type": "review_doc",
  "user_level": "platinum"
}

Review document

Endpoint for admins for accept or reject previously locked unreviewed document. Roles required: “reviews_admin”

PUT /reviews-service/review_doc/review/:id
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
id url Document id
status string New status (approve or reject)
Example Response
{
  "status": "approve"
}

results matching ""

    No results matching ""