Reviews

All reviews endpoints have path prefix /reviews-service.

User's API

Create Document

Endpoint for create new document based on scan_id.

Team members of the product owner participant will receive notification emails when new reviews are added for the product. Notifications will be sent only if team member users have notifications_recipient role from the product owner participant.

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”.

Review documents are split into chunks. The response has id (current chunk identifier) and next (identifier of the next chunk of review documents, will be null if there are no more chunks) chunk related fields. Use id parameter (in the query string for GET method or in the request body for POST method) to request a particular review documents chunk.

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
id string Chunk identifier
Example Response
{
    "id": "17f509b1-05ca-4ce5-b080-eb4fe42d857f",
    "next": null,
    "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"
        }
    ]
}

Read Documents by API Key and Tag

Public endpoint to read approved review documents. Participant API key must be specified. Only reviews for products of this participant which were tagged with the specified tag will be selected.

The tag is optional, and tags part may be ommitted from the request URL. The review documents tags are not checked in this case.

Response has only the limited number (100 by default) of newest reviews in reviews field.

Origin header is required in calls to this endpoint. Origin is compared to the list of participant's API domains on OPTIONS requests.

This API may be called by a signed in participant to retrieve latest reviews for participant products. api_key and tag must be omitted in this case. Origin header isn't required for such request.

GET /reviews-service/reviews/:api_key
GET /reviews-service/reviews/:api_key/tags/:tag
Parameters
Name Type Description
api_key string Participant API key
tag string Select only reviews tagged with this string
limit number Limit the number of returned reviews
Example Response
{
  "reviews": [
    {
      "counters": {
        "dislikes": 0,
        "likes": 0
      },
      "first_name": "Роза",
      "id": "urn:authenticateit:review_doc:123293617430188",
      "images": [
        {
          "url": "https://dev-cdn.shping.com/2018/12/4/9848fdbb-fa48-4703-8d38-65779b8f8ffe"
        }
      ],
      "last_name": "Ковалева",
      "level_icon": "https://cdn.shping.com/2017/11/22/2f98de94-73bf-4b40-9490-e4a8a714264c.png",
      "product": {
        "counters": {
          "user_reviews": 37,
          "user_reviews_rate": 4.5676,
          "user_scans": 265
        },
        "id": "09212345874678",
        "name": "Варенье Ратибор Вишня 400 г"
      },
      "rate": 4,
      "reviews_karma": 1,
      "text": "Текст",
      "ts": "2018-12-04T12:33:34Z",
      "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 list

POST /reviews-service/review_docs
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
page number Page of docs. Value >= 0
limit number the number of elements on the page
countries array::string Countries filter
languages array::string Languages filter
statuses array::string Statuses 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
tags list Select only documents with the specified tags

statuses filter accepts list of values ["open","approve","reject","report","delete"].

Example Request
{
  "limit":10,
  "page":0,
  "statuses":["approve", "report"],
  "tags": [
    "model2000"
  ]
}
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",
            "tags": ["bestreviews", "model2000"],
            "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",
            "tags": ["bestreviews", "model2000"],
            "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”.

A list of tags may be attached to a review using tags parameter.

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)
tags list Optional list of tags to attach.
Example Response
{
  "status": "approve",
  "tags": [
    "bestreviews",
    "model2000"
  ]
}

Update Review Tags

Endpoint for review admins to update review document tags. Accepts list of tags in the request body.

PUT /reviews-service/review_docs/:id/tags
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
id string Review identifier
tags list List of tags for the review
Example Request
{
  "tags": [
    "bestreviews",
    "model2000",
    "witty"
  ]
}

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.

Create Batch Review Task

Multiple reviews may be approved or rejected using this endpoint. Accepts list of review_docs identifiers to be reviewed and status (approve or reject). List of arbitrary tags may be attached to reviews. Initiates a backround task and responds with the id of the task. Task status may be queried using this id.

POST /reviews-service/review/tasks
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
Example Request
{
  "review_docs": [
    "urn:authenticateit:review_doc:598568744187626",
    "urn:authenticateit:review_doc:000000000000000",
    "urn:authenticateit:review_doc:804612316302535"
  ],
  "status": "approve",
  "tags": [
    "bestreviews",
    "model2000"
  ]
}
Example Response
{
  "id": "532a5a66-4463-475d-91f8-3e08a1cfa10d"
}

Status of Batch Review Task

Endpoint to query status of a batch review task. Response will have the following fields:

  • id — task identifier.
  • status — task status (started after the task creation, finished once all documents are processed).
  • num_total, num_processed — total number of review documents and the number of already processed documents.
  • started, finished — time at which the task was started and finished.
  • errors — list of errors occured during the batch review. Each entry has review_doc document identifier and error_id identifier of the corresponding error. Possible errors are the same as for the Review Document endpoint.

Status for the finished tasks will be kept for at least 12 hours after the completion.

GET /reviews-service/review/tasks/:id
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
id string Task identifier.
Example Response
{
  "errors": [
    {
      "error_id": "reviews-no_doc",
      "review_doc": "urn:authenticateit:review_doc:000000000000000"
    }
  ],
  "finished": "2019-04-28T07:02:12Z",
  "id": "532a5a66-4463-475d-91f8-3e08a1cfa10d",
  "num_processed": 3,
  "num_total": 3,
  "started": "2019-04-28T07:02:11Z",
  "status": "finished"
}

Status of All Batch Review Tasks

Get status of all batch review tasks for the participant. Response has list of tasks. Each entry represents a single task (see Task Status endpoint for task representation).

GET /reviews-service/review/tasks
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
Example Response
{
  "tasks": [
    {
      "errors": [
        {
          "error_id": "reviews-no_doc",
          "review_doc": "urn:authenticateit:review_doc:000000000000000"
        }
      ],
      "finished": "2019-04-28T07:02:12Z",
      "id": "532a5a66-4463-475d-91f8-3e08a1cfa10d",
      "num_processed": 3,
      "num_total": 3,
      "started": "2019-04-28T07:02:11Z",
      "status": "finished"
    }
  ]
}

Review Templates

Participant endpoints for review templates require reviews_admin role.

Create Template

Create review template for participant. Accepts JSON representation of a template, which consists of the following fields:

  • name — template name.
  • active — template will be set as active, if true. The field is optional and is false by default. Onle one review template may be active. If active set to true, previously active template will be deactivated.
  • steps — non-empty list of review steps (see below for description).

Review steps are the same as the steps in ToDo cards (see ToDo Cards API for details) with new step type video and minor differences regarding step of type question.

Step type may be video. No other fields are defined for such step. User will be asked to upload a video file to complete the step.

Unlike questions in ToDo cards, review questions don't have correct answers (there is no correct field in answers). Questions in reviews may be of either single or multiple choice (field choice in the step of type question may have value single or multiple).

POST /reviews-service/templates
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
Example Request
{
  "name": "Template 1",
  "active": true,
  "steps": [
    {
      "type": "text",
      "title": "Some Text",
      "text": "More details."
    },
    {
      "type": "textbox",
      "title": "Enter Text"
    },
    {
      "type": "rating",
      "title": "Rate this product"
    },
    {
      "type": "question",
      "title": "Question 1",
      "choice": "single",
      "question": "Choose one item",
      "answers": [
        {
          "answer": "A"
        },
        {
          "answer": "B"
        },
        {
          "answer": "C"
        }
      ]
    },
    {
      "type": "question",
      "title": "Question 2",
      "choice": "multiple",
      "question": "Choose one or more items",
      "answers": [
        {
          "answer": "A"
        },
        {
          "answer": "B"
        },
        {
          "answer": "C"
        }
      ]
    },
    {
      "type": "image",
      "title": "Upload the photo"
    },
    {
      "type": "video",
      "title": "Upload video review of the product"
    }
  ]
}
Example Response
{
  "id": "urn:authenticateit:participant:576318441844504:review_template:019112033518702",
  "active": true,
  "name": "Template 1",
  "owner": "urn:authenticateit:participant:576318441844504",
  "steps": [
    {
      "text": "More details.",
      "title": "Some Text",
      "type": "text"
    },
    {
      "title": "Enter Text",
      "type": "textbox"
    },
    {
      "title": "Rate this product",
      "type": "rating"
    },
    {
      "answers": [
        {
          "answer": "A"
        },
        {
          "answer": "B"
        },
        {
          "answer": "C"
        }
      ],
      "choice": "single",
      "question": "Choose one item",
      "title": "Question 1",
      "type": "question"
    },
    {
      "answers": [
        {
          "answer": "A"
        },
        {
          "answer": "B"
        },
        {
          "answer": "C"
        }
      ],
      "choice": "multiple",
      "question": "Choose one or more items",
      "title": "Question 2",
      "type": "question"
    },
    {
      "title": "Upload the photo",
      "type": "image"
    },
    {
      "type": "video",
      "title": "Upload video review of the product"
    }
  ]
}

Read Templates

Read all review templates for the participant. Response has templates list. Each list entry is a review template JSON representation.

GET /reviews-service/templates
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
Example Response
{
  "templates": [
    {
      "active": true,
      "id": "urn:authenticateit:participant:576318441844504:review_template:019112033518702",
      "name": "Template 1",
      "owner": "urn:authenticateit:participant:576318441844504",
      "steps": [
        {
          "text": "More details.",
          "title": "Some Text",
          "type": "text"
        },
        {
          "title": "Enter Text",
          "type": "textbox"
        },
        {
          "title": "Rate this product",
          "type": "rating"
        },
        {
          "answers": [
            {
              "answer": "A"
            },
            {
              "answer": "B"
            },
            {
              "answer": "C"
            }
          ],
          "choice": "single",
          "question": "Choose one item",
          "title": "Question 1",
          "type": "question"
        },
        {
          "answers": [
            {
              "answer": "A"
            },
            {
              "answer": "B"
            },
            {
              "answer": "C"
            }
          ],
          "choice": "multiple",
          "question": "Choose one or more items",
          "title": "Question 2",
          "type": "question"
        },
        {
          "title": "Upload the photo",
          "type": "image"
        },
        {
          "type": "video",
          "title": "Upload video review of the product"
        }
      ]
    }
  ]
}

Update Template

Update specified review template. The endpoint can be used to update name or steps of the template. Also review template may be activated (set active to true) or deactivated (set active to false). Only one review template may be active. If some template is activated, previously active template will be deactivated.

PUT /reviews-service/templates/:id
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
id string Template identifier
Example Request
{
  "name": "Template One",
  "active": false
}
Example Response
{
  "active": false,
  "id": "urn:authenticateit:participant:576318441844504:review_template:019112033518702",
  "name": "Template One",
  "owner": "urn:authenticateit:participant:576318441844504",
  "steps": [
    {
      "text": "More details.",
      "title": "Some Text",
      "type": "text"
    },
    {
      "title": "Enter Text",
      "type": "textbox"
    },
    {
      "title": "Rate this product",
      "type": "rating"
    },
    {
      "answers": [
        {
          "answer": "A"
        },
        {
          "answer": "B"
        },
        {
          "answer": "C"
        }
      ],
      "choice": "single",
      "question": "Choose one item",
      "title": "Question 1",
      "type": "question"
    },
    {
      "answers": [
        {
          "answer": "A"
        },
        {
          "answer": "B"
        },
        {
          "answer": "C"
        }
      ],
      "choice": "multiple",
      "question": "Choose one or more items",
      "title": "Question 2",
      "type": "question"
    },
    {
      "title": "Upload the photo",
      "type": "image"
    },
    {
      "type": "video",
      "title": "Upload video review of the product"
    }
  ]
}

Delete Template

Delete the requested review template.

DELETE /reviews-service/templates/:id
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
id string Template identifier

Start Template-Based Review

Endpoint for user to start a template-based review for the specified scanned product.

Request body must include scan_id with the scan identifier.

Responds with unfilled review representation, if scanned product has reviews enabled, and participant related to the product has an active review template. Otherwise responds with reviews-no_active_template error.

Unfilled review has an id and a list of steps from the template to be completed. For details on steps representation see Create Template endpoint description.

POST /reviews-service/templates/reviews/start
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
Example Request
{
  "scan_id": "9e79347e-12cf-4f26-9f76-c9c00649352d"
}
Example Response (there is an active template for the product)
{
  "id": "urn:authenticateit:review_doc:745047469332036",
  "steps": [
    {
      "text": "More details.",
      "title": "Some Text",
      "type": "text"
    },
    {
      "title": "Enter Text",
      "type": "textbox"
    },
    {
      "title": "Rate this product",
      "type": "rating"
    },
    {
      "answers": [
        {
          "answer": "A"
        },
        {
          "answer": "B"
        },
        {
          "answer": "C"
        }
      ],
      "choice": "single",
      "question": "Choose one item",
      "title": "Question 1",
      "type": "question"
    },
    {
      "answers": [
        {
          "answer": "A"
        },
        {
          "answer": "B"
        },
        {
          "answer": "C"
        }
      ],
      "choice": "multiple",
      "question": "Choose one or more items",
      "title": "Question 2",
      "type": "question"
    },
    {
      "title": "Upload the photo",
      "type": "image"
    },
    {
      "type": "video",
      "title": "Upload video review of the product"
    }
  ]
}
Example Response (there is no active template)
{
  "error": "Product owner doesn't have an active review template.",
  "error_data": null,
  "error_id": "reviews-no_active_template",
  "error_object": null
}

Finish Template-Based Review

Endpoint for user to complete template-based review.

Request body must contain id of the review document created with the Start Review endpoint and list of completed review steps from template.

Completed review steps are the same as the completed steps in ToDo cards (see ToDo Cards API for details) with minor differences regarding step of type question. Also there may be step of type video.

Step of type video must have url field (URL of the uploaded video).

Completed review questions may be of either single or multiple choice (depending on the choice field in the corresponding template). For single choice questions answer_index must be single integer index. For multiple choice questions answer_index must be list of integer indices (see example response below).

POST /reviews-service/templates/reviews/finish
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
Example Request
{
  "id": "urn:authenticateit:review_doc:745047469332036",
  "steps": [
    {
      "type": "text"
    },
    {
      "type": "textbox",
      "text": "A, B and C."
    },
    {
      "type": "rating",
      "rating": 3
    },
    {
      "type": "question",
      "answer_index": 1
    },
    {
      "type": "question",
      "answer_index": [
        1,
        2
      ]
    },
    {
      "type": "image",
      "url": "http://example.org/1.jpg"
    },
    {
      "type": "video",
      "url": "http://example.org/2.mp4"
    }
  ]
}
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"
}

results matching ""

    No results matching ""