Update status, reply, etc of a particular review
http
PUT https://services.leadconnectorhq.com/products/reviews/{reviewId}Authorization
| Name | Type | Required | Example | Description |
|---|---|---|---|---|
Authorization | string | Yes | Bearer token generated from the Leadway portal. See Authentication. | |
Version | string | Yes | 2021-07-28 | API version. |
Path parameters
| Name | Type | Required | Example | Description |
|---|---|---|---|---|
reviewId | string | Yes | 6578278e879ad2646715ba9c | Review Id |
Body
| Name | Type | Required | Example | Description |
|---|---|---|---|---|
altId | string | Yes | 6578278e879ad2646715ba9c | Account Id or Agency Id |
altType | string | Yes | Possible values: 'account' | |
productId | string | Yes | 6578278e879ad2646715ba9c | Product Id |
status | string | Yes | approved | Status of the review |
reply(object[]): Reply of the reviewheadline(string, required): Headline of the Review Example:Amazing product with great qualitycomment(string, required): Detailed Review of the product Example:This product exceeded my expectations in terms of quality and performance. Highly recommended!user(object, required): User who is giving the review/reply
| Name | Type | Required | Example | Description |
|---|---|---|---|---|
rating | number | No | 4.5 | Rating of the product |
headline | string | No | Amazing product with great quality | Headline of the Review |
detail | string | No | The product is for sure a must and recommended buy | Detailed Review of the product |
Responses
200 - Successful response
status(boolean, required): Status of api action Example:Truemessage(string): Success message Example:Successfully created
json
{
"status": true,
"message": "Successfully created"
}400 - Bad Request
json
{}422 - Unprocessable Entity
json
{}Example
curl -X PUT 'https://services.leadconnectorhq.com/products/reviews/YOUR_reviewId' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Version: 2021-07-28' \
-H 'Content-Type: application/json' \
-d '{
"altId": "6578278e879ad2646715ba9c",
"altType": "account",
"productId": "6578278e879ad2646715ba9c",
"status": "approved",
"reply": [
{
"headline": "Amazing product with great quality",
"comment": "This product exceeded my expectations in terms of quality and performance. Highly recommended!"
}
],
"rating": "4.5",
"headline": "Amazing product with great quality",
"detail": "The product is for sure a must and recommended buy"
}'const response = await fetch('https://services.leadconnectorhq.com/products/reviews/YOUR_reviewId', {
method: 'PUT',
headers: {
Authorization: `Bearer ${process.env.LEADWAY_TOKEN}`,
Version: '2021-07-28',
'Content-Type': 'application/json',
},
body: JSON.stringify({"altId": "6578278e879ad2646715ba9c", "altType": "account", "productId": "6578278e879ad2646715ba9c", "status": "approved", "reply": [{"headline": "Amazing product with great quality", "comment": "This product exceeded my expectations in terms of quality and performance. Highly recommended!"}], "rating": "4.5", "headline": "Amazing product with great quality", "detail": "The product is for sure a must and recommended buy"}),
});
const data = await response.json();import os, requests
response = requests.request(
'PUT',
'https://services.leadconnectorhq.com/products/reviews/YOUR_reviewId',
headers={
'Authorization': f"Bearer {os.environ['LEADWAY_TOKEN']}",
'Version': '2021-07-28',
'Content-Type': 'application/json',
},
json={"altId": "6578278e879ad2646715ba9c", "altType": "account", "productId": "6578278e879ad2646715ba9c", "status": "approved", "reply": [{"headline": "Amazing product with great quality", "comment": "This product exceeded my expectations in terms of quality and performance. Highly recommended!"}], "rating": "4.5", "headline": "Amazing product with great quality", "detail": "The product is for sure a must and recommended buy"},
)
data = response.json()<?php
$ch = curl_init('https://services.leadconnectorhq.com/products/reviews/YOUR_reviewId');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'PUT',
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('LEADWAY_TOKEN'),
'Version: 2021-07-28',
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode({'altId': '6578278e879ad2646715ba9c', 'altType': 'account', 'productId': '6578278e879ad2646715ba9c', 'status': 'approved', 'reply': [{'headline': 'Amazing product with great quality', 'comment': 'This product exceeded my expectations in terms of quality and performance. Highly recommended!'}], 'rating': '4.5', 'headline': 'Amazing product with great quality', 'detail': 'The product is for sure a must and recommended buy'}),
]);
$data = json_decode(curl_exec($ch), true);