API to fetch the Product Reviews
http
GET https://services.leadconnectorhq.com/products/reviewsAuthorization
| 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. |
Query parameters
| Name | Type | Required | Example | Description |
|---|---|---|---|---|
altId | string | Yes | 6578278e879ad2646715ba9c | Account Id or Agency Id |
altType | string | Yes | ||
limit | number | No | 20 | The maximum number of items to be included in a single page of results |
offset | number | No | 0 | The starting index of the page, indicating the position from which the results should be retrieved. |
sortField | string | No | rating | The field upon which the sort should be applied |
sortOrder | string | No | desc | The order of sort which should be applied for the sortField |
rating | number | No | 4 | Key to filter the ratings |
startDate | string | No | 2023-01-01T00:00:00Z | The start date for filtering reviews |
endDate | string | No | 2023-12-31T23:59:59Z | The end date for filtering reviews |
productId | string | No | 60d21b4667d0d8992e610c88,60d21b4667d0d8992e610c89,60d21b4667d0d8992e610c8a | Comma-separated list of product IDs |
storeId | string | No | 60d21b4667d0d8992e610c85,60d21b4667d0d8992e610c86,60d21b4667d0d8992e610c87 | Comma-separated list of store IDs |
Responses
200 - Successful response
data(array[], required): Array of Collectionstotal(number, required): The total count of the collections present, which is useful to calculate the pagination
json
{
"data": [
[]
],
"total": 0
}400 - Bad Request
json
{}422 - Unprocessable Entity
json
{}Example
curl -X GET 'https://services.leadconnectorhq.com/products/reviews' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Version: 2021-07-28'const response = await fetch('https://services.leadconnectorhq.com/products/reviews', {
method: 'GET',
headers: {
Authorization: `Bearer ${process.env.LEADWAY_TOKEN}`,
Version: '2021-07-28',
},
});
const data = await response.json();import os, requests
response = requests.request(
'GET',
'https://services.leadconnectorhq.com/products/reviews',
headers={
'Authorization': f"Bearer {os.environ['LEADWAY_TOKEN']}",
'Version': '2021-07-28',
},
)
data = response.json()<?php
$ch = curl_init('https://services.leadconnectorhq.com/products/reviews');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('LEADWAY_TOKEN'),
'Version: 2021-07-28',
],
]);
$data = json_decode(curl_exec($ch), true);