> ## Documentation Index
> Fetch the complete documentation index at: https://developers.leadwaycrm.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Fetch Product Reviews

> API to fetch the Product Reviews

API to fetch the Product Reviews

```http theme={null}
GET https://services.leadconnectorhq.com/products/reviews
```

## Autorización

<ParamField header="Authorization" type="string" required>
  Bearer token generado desde el portal Leadway. Ver [Autenticación](/authentication).
</ParamField>

<ParamField header="Version" type="string" required default="2021-07-28">
  Versión de la API.
</ParamField>

## Query parameters

<ParamField query="altId" type="string" required default="6578278e879ad2646715ba9c">
  Account Id or Agency Id
</ParamField>

<ParamField query="altType" type="string" required />

<ParamField query="limit" type="number" default="20">
  The maximum number of items to be included in a single page of results
</ParamField>

<ParamField query="offset" type="number" default="0">
  The starting index of the page, indicating the position from which the results should be retrieved.
</ParamField>

<ParamField query="sortField" type="string" default="rating">
  The field upon which the sort should be applied
</ParamField>

<ParamField query="sortOrder" type="string" default="desc">
  The order of sort which should be applied for the sortField
</ParamField>

<ParamField query="rating" type="number" default="4">
  Key to filter the ratings
</ParamField>

<ParamField query="startDate" type="string" default="2023-01-01T00:00:00Z">
  The start date for filtering reviews
</ParamField>

<ParamField query="endDate" type="string" default="2023-12-31T23:59:59Z">
  The end date for filtering reviews
</ParamField>

<ParamField query="productId" type="string" default="60d21b4667d0d8992e610c88,60d21b4667d0d8992e610c89,60d21b4667d0d8992e610c8a">
  Comma-separated list of product IDs
</ParamField>

<ParamField query="storeId" type="string" default="60d21b4667d0d8992e610c85,60d21b4667d0d8992e610c86,60d21b4667d0d8992e610c87">
  Comma-separated list of store IDs
</ParamField>

## Respuestas

<Accordion title="200 - Successful response">
  <ResponseField name="data" type="array[]" required>
    Array of Collections
  </ResponseField>

  <ResponseField name="total" type="number" required>
    The total count of the collections present, which is useful to calculate the pagination
  </ResponseField>

  ```json theme={null}
  {
    "data": [
      []
    ],
    "total": 0
  }
  ```
</Accordion>

<Accordion title="400 - Bad Request">
  ```json theme={null}
  {}
  ```
</Accordion>

<Accordion title="401 - Unauthorized">
  ```json theme={null}
  {}
  ```
</Accordion>

<Accordion title="422 - Unprocessable Entity">
  ```json theme={null}
  {}
  ```
</Accordion>

## Ejemplo

<CodeGroup>
  ```bash cURL theme={null}
  curl -X GET 'https://services.leadconnectorhq.com/products/reviews' \
    -H 'Authorization: Bearer YOUR_TOKEN' \
    -H 'Version: 2021-07-28'
  ```

  ```javascript Node.js theme={null}
  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();
  ```

  ```python Python theme={null}
  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 PHP theme={null}
  <?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);
  ```
</CodeGroup>
