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.",
  "status_i18n_id": "reviews-add_review-success"
}

Review actions

Endpoint provide to take some actions with the review for mobile user.

PUT /reviews-service/review_doc/:id/action
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
id string Required: Review ID
report string Text report
state string Current user review state (enum "like","dislike","none")
action string Next user review state (enum "like","dislike","none")
hide string Hide reviews option (enum "product", "owner", "all")
Example Request
{
    "report": "Report Text",
    "state": "none",
    "action": "dislike",
    "hide": "product"
}
Example Response (if hide opt was set)
{
    "hide_all": false,
    "owners": [
        {
            "first_name": "Ethertest3",
            "id": "urn:authenticateit:user:email:ethertest3@mailinator.com",
            "last_name": "Ethertest3",
            "photo": "https://photo_url"
        }
    ],
    "products": [
        {
            "id": "00498765432233",
            "name": "Test"
        }
    ]
}

Get current settings

GET /reviews-service/settings
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
Example Response
{
    "hide_all": false,
    "owners": [
        {
            "first_name": "Ethertest3",
            "id": "urn:authenticateit:user:email:ethertest3@mailinator.com",
            "last_name": "Ethertest3",
            "photo": "https://photo_url"
        }
    ],
    "products": [
        {
            "id": "00498765432233",
            "name": "Test"
        }
    ]
}

Update settings

PUT /reviews-service/settings
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
hide_all boolean hide_all option
owners list List of values which must be filtered
products list List of values which must be filtered
Example Request
{
    "hide_all": false,
    "owners": ["urn:authenticateit:user:email:ethertest3@mailinator.com"],
    "products": ["00498765432998"]
}
Example Response
{
    "hide_all": false,
    "owners": [],
    "products": []
}

Read Documents

Endpoint for users to read approved documents. Filtering documents based on scan fields “country” and “language”

POST /reviews-service/review_docs/:scan_id
GET /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": [
        {
            "counters": {
                "dislikes": 2,
                "likes": 0
            },
            "first_name": "First Name",
            "id": "urn:authenticateit:review_doc:582061257997819",
            "images": [
                {
                    "url": "https://dev-cdn.shping.com/2018/12/28/c0047931-24b9-4568-bc60-3dc7af4c92b3"
                },
                {
                    "url": "https://dev-cdn.shping.com/2018/12/28/01d8408f-8346-4010-ade8-525277d60aa6"
                }
            ],
            "last_name": "Last Name",
            "level_icon": "https://cdn.shping.com/2017/11/22/2f98de94-73bf-4b40-9490-e4a8a714264c.png",
            "product": {
                "name": "Test",
                "id": "00498765432233"
            },
            "rate": 5,
            "text": "Great product",
            "ts": "2018-12-28T00:47:59Z",
        "reviews_karma": 0,
            "user_icon": null,
            "user_like_option": "none"
        }
    ]
}

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
statuses array::string List of statuses. ["open","approve","reject","report","delete"]
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 Request
{
  "limit":10,
  "page":0,
  "statuses":["approve", "report"]
}
Example Response
{
    "count": 2,
    "documents": [
        {
            "counters": {
                "dislikes": 7,
                "likes": 4
            },
            "country": "036",
            "id": "urn:authenticateit:review_doc:174863795027187",
            "images": [
                {
                    "url": "https://dev-cdn.shping.com/2018/10/5/8662ecc9-1111-4043-ad69-0fd428530d0f.jpg"
                }
            ],
            "language": "en",
            "lock": 1,
            "locked_by": "urn:authenticateit:user:email:ethertest3@mailinator.com",
            "owner": "urn:authenticateit:user:email:65qw@mailinator.com",
            "product_id": "00498765432998",
            "product_name": "Kellogg's Nutri Grain 805 g",
            "rate": 3,
            "reports": [
                {
                    "report": "Test",
                    "ts": "2019-01-04T03:36:54Z",
                    "user": {
                        "first_name": "Ethertest3",
                        "last_name": "Ethertest3",
                        "level": "basic",
                        "photo": null
                    }
                }
            ],
            "review_deleted": false,
            "status": "approve",
            "text": "65 test",
            "ts": "2018-10-15T14:24:36Z",
            "user_name": "SMARTY Fellow",
            "user_photo": "https://dev-cdn.shping.com/2018/8/1/9ee10d3a-ee36-43e3-8692-8df003629bb4"
        },
        {
            "counters": {
                "dislikes": 0,
                "likes": 1
            },
            "country": "036",
            "id": "urn:authenticateit:review_doc:538484402817957",
            "images": [
                {
                    "url": "https://dev-cdn.shping.com/2018/10/5/8662ecc9-1111-4043-ad69-0fd428530d0f.jpg"
                }
            ],
            "language": "en",
            "lock": 1,
            "locked_by": "urn:authenticateit:user:email:ethertest3@mailinator.com",
            "owner": "urn:authenticateit:user:email:ethertest3@mailinator.com",
            "product_id": "00498765432998",
            "product_name": "Kellogg's Nutri Grain 805 g",
            "rate": 3,
            "reports": [
                {
                    "report": "Erwerwerwerwerwerwe",
                    "ts": "2019-01-03T10:03:51Z",
                    "user": {
                        "first_name": "Ethertest3",
                        "last_name": "Ethertest3",
                        "level": "basic",
                        "photo": null
                    }
                }
            ],
            "review_deleted": false,
            "status": "approve",
            "text": "test",
            "ts": "2018-10-15T13:35:07Z",
            "user_name": "Ethertest3 Ethertest3",
            "user_photo": null
        }
    ]
}

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"
}

Mark approved document as deleted

DELETE /reviews-service/review_doc/:id
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
id url Document id
Example Response
{
    "review_deleted": true
}

Delete attached reports

DELETE /reviews-service/review_doc/:id/reports
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
id url Document id
Example Response
{
    "campaigns": [
        {
            "campaign": "urn:authenticateit:campaign:513678827290770",
            "claim_id": "39f8abcb-7ddd-4e22-8f86-f270f07c3b53"
        }
    ],
    "conditions": {
        "country": "036",
        "language": "en"
    },
    "data": {
        "images": [
            {
                "url": "https://dev-cdn.shping.com/2018/10/5/8662ecc9-1111-4043-ad69-0fd428530d0f.jpg"
            }
        ],
        "rate": 3,
        "text": "test"
    },
    "id": "urn:authenticateit:review_doc:538484402817957",
    "lock": true,
    "locked_by": "urn:authenticateit:user:email:ethertest3@mailinator.com",
    "owner": "urn:authenticateit:user:email:ethertest3@mailinator.com",
    "product_id": "00498765432998",
    "scan_id": "ea6fd894-c51c-4ef3-b05b-cf8f27b42697",
    "status": "approve",
    "ts": "2018-10-15T13:35:07Z",
    "type": "review_doc",
    "user_level": "basic"
}

Copy reviews from one product to another

This method for copy only approved reviews from source_product to target_product. source_product and target_product must be valid. If requester is system participant, all reviews will be copied.

PUT /reviews-service/review_docs/copy
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
source_product string Required: Source gtin
target_product string Required: Target gtin
Example Request
{
    "source_product": "02933451111118",
    "target_product": "02933451004427"
}
Example Response
[
    {
        "source_review": "urn:authenticateit:review_doc:620638059285116",
        "target_review": "urn:authenticateit:review_doc:797222039553212"
    },
    {
        "source_review": "urn:authenticateit:review_doc:102910629259831",
        "target_review": null
    },
    {
        "source_review": "urn:authenticateit:review_doc:401529747502451",
        "target_review": null
    }
]

If target_review=null it means that source_review was already copied.

results matching ""

    No results matching ""