Create
Creates a new product question and returns the created product question.
Request
URL
Name | Value |
Method | POST |
Endpoint |
Body
This API method accepts a JSON body in the request. The top-level JSON object should be a "Product question" object as described in the next section.
Product question
If "is_verified" property is false, we will send a verification email to the customer. If the customer verifies their email address through this email, or when you set "is_verified" to true (e.g. when you already have verified the email address), the question is visible in your inbox.
The "is_published" property determines if the question (and answer) is publicly available on our platform (for instance: in our product widget). This can only be true if an answer is also supplied.
Property | Allowed values | Required |
text | (A non-empty string, max 1000 characters) | yes |
answer | (A non-empty string, max 1000 characters) | no |
is_published | true, false | yes |
is_verified | true, false | yes |
customer | (A "Customer" object) | yes |
product | (A "Product" object) | yes |
Product
Name | Allowed values | Required |
external_id | (A non-empty string, max 250 characters) | Yes |
name | (A non-empty string, max 250 characters) | Yes |
url | (A valid url, max 2000 characters) | Yes |
sku | (A non-empty string, max 250 characters) | No |
gtin | (A valid GTIN-13 code) | No |
image_url | (A valid url, max 2000 characters) | No |
Customer
Name | Allowed values | Required |
(A valid email address, max 250 characters) | Yes | |
fullname | (A non-empty string, max 250 characters) | No |
Example
POST /api/v2/product-questions HTTP/1.1
Authorization: Bearer ...
{
"text": "Is this product washable?",
"answer": null,
"is_published": false,
"is_verified": true,
"product": {
"external_id": "tshirt055",
"name": "Pretty blue t-shirt (small)",
"url": "https://www.example.com/products/tshirt055",
"sku": "tshirt055"
},
"customer": {
"fullname": "Jane Applepie",
"email": "janeapplepie1995@example.com"
}
}
Response
Headers
Name | Value |
Status code | 201 |
Status message | Created |
Body
The created product question.
Example
HTTP/1.1 201 Created
{
"success": true,
"product_question": {
"id": 88,
"text": "Is this product washable?",
"answer": null,
"answered_at": null,
"is_published": false,
"published_at": null,
"created_at": "2018-09-09T09:09:09Z",
"updated_at": null,
"product_id": 1000105,
"customer_id": 3681500
}
}
List
Returns a list of product questions.
Request
URL
Name | Value |
Method | GET |
Endpoint |
Parameters
Name | Allowed values | Required |
page | (An integer greater than 0, default: 1) | No |
page_size | (An integer between 1 and 1000, default: 25) | No |
sort | (A valid sort value, see table below, default: "-created_at") | No |
Allowed sort values:
Value | Description |
created_at | Sorts on created datetime, ascending. |
-created_at | Sorts on created datetime, descending. |
product_name | Sorts on product name, ascending. |
-product_name | Sorts on product name, descending. |
Example
GET /api/v2/product-questions?sort=-created_at&page=1 HTTP/1.1
Authorization: Bearer ...
Response
Headers
Name | Value |
Status code | 200 |
Status message | OK |
Example
HTTP/1.1 200 OK
{
"meta": {
"count": 23
},
"success": true,
"product_questions": [{
"id": 88,
"text": "Is this product washable?",
"answer": null,
"answered_at": null,
"is_published": false,
"published_at": null,
"created_at": "2018-09-09T09:09:09Z",
"updated_at": null,
"product_id": 1000105,
"customer_id": 3681500
}, {
...
}]
}
Get
Returns a product question.
Request
URL
The endpoint for this API method contains an <id> placeholder. Replace it with the value of an actual product question id.
Name | Value |
Method | GET |
Endpoint |
Example
GET /api/v2/product-questions/88 HTTP/1.1
Authorization: Bearer ...
Response
Headers
Name | Value |
Status code | 200 |
Status message | OK |
Example
HTTP/1.1 200 OK
{
"success": true,
"product_question": {
"id": 88,
"text": "Is this product washable?",
"answer": null,
"answered_at": null,
"is_published": false,
"published_at": null,
"created_at": "2018-09-09T09:09:09Z",
"updated_at": null,
"product_id": 1000105,
"customer_id": 3681500
}
}
Update
Updates a product question and returns the updated version.
Request
URL
Name | Value |
Method | PATCH |
Endpoint |
Body
Only the properties that you want to update should be supplied, other properties are left untouched. The "is_published" property can only be set to true if the question has an answer.
Property | Allowed values | Required |
text | (A non-empty string, max 1000 characters) | No |
answer | (A non-empty string, max 1000 characters) | No |
is_published | true, false | No |
Example
PATCH /api/v2/product-questions/88 HTTP/1.1
Authorization: Bearer ...
{
"answer": "Yes you can!",
"is_published": true
}
Response
Headers
Name | Value |
Status code | 200 |
Status message | OK |
Example
HTTP/1.1 200 OK
{
"success": true,
"product_question": {
"id": 88,
"text": "Is this product washable?",
"answer": "Yes you can!",
"answered_at": "2018-10-10T10:10:10Z",
"is_published": true,
"published_at": "2018-10-10T10:10:10Z",
"created_at": "2018-09-09T09:09:09Z",
"updated_at": "2018-10-10T10:10:10Z",
"product_id": 1000105,
"customer_id": 3681500
}
}
Delete
Deletes a product question.
Request
URL
Name | Value |
Method | DELETE |
Endpoint |
Example
DELETE /api/v2/product-questions/88 HTTP/1.1
Authorization: Bearer ...
Response
Headers
Name | Value |
Status code | 200 |
Status message | OK |
Example
HTTP/1.1 200 OK
{
"success": true
}