2

I'm trying to get all 5 starts reviews starting from a specific date using Trustpiolt's business unit private reviews API call. Here is the API call documentation: https://documentation-apidocumentation.trustpilot.com/business-units-api#business-unit-private-reviews

I'm using the parameter "startDateTime" which is documented as follows: " startDateTime, Optional String Filter reviews by datetime range. If no time is specified than time is implicit 00:00:00 Example: ?startDateTime=2013-09-07T13:37:00 "

It fetches the 5 starts reviews successfully but the result also includes reviews with dates that are older than startDateTime.

Is this a bug?

Any help would be appreciated. Thanks

Sander van den Oord
  • 10,986
  • 5
  • 51
  • 96
Adar
  • 21
  • 2

1 Answers1

0

It is working, just tested it, here's a working python example:

import requests

# assumption is you already created your access token
access_token = "your access token"

# you need to know the business_unit_id of your company to get your reviews
business_unit_id = "your business unit id"


endpoint_private_reviews = f"https://api.trustpilot.com/v1/private/business-units/{business_unit_id}/reviews"

# get reviews filtering on startDateTime (amongst others)
params = "?perPage=100&orderBy=createdat.desc&startDateTime=2023-02-16&page=1&stars=5"

headers = {
    "Authorization": f"Bearer {access_token}",  # mandatory
}

response = requests.get(
    url=endpoint_private_reviews + params, 
    headers=headers,
).json()

response["reviews"]
Sander van den Oord
  • 10,986
  • 5
  • 51
  • 96