### Get Batch Product Reviews Summaries Request (CURL) Source: https://developers.trustpilot.com/product-reviews-api Example CURL command to send a POST request for batch product review summaries. Ensure to replace placeholders with your actual API key and business unit ID. ```curl curl -X POST "https://api.trustpilot.com/v1/product-reviews/business-units/{businessUnitId}/batch-summaries" \ -H "Content-Type: application/json" \ -d '{ "skus": [ "ABCD-1234", "ACDC-4321" ] }' \ -H "apikey: YOUR-API-KEY-HERE" ``` -------------------------------- ### Get Product Reviews Summary (GET) Source: https://developers.trustpilot.com/product-reviews-api Retrieve a summary for a single or multiple product SKUs using a GET request. This provides an overview of review counts and average star ratings. ```curl curl -X GET "https://api.trustpilot.com/v1/product-reviews/business-units/{businessUnitId}" \ -G \ --data-urlencode "sku=[ "ABCD-1234", "ACDC-4321" ]" \ -H "apikey: YOUR-API-KEY-HERE" ``` -------------------------------- ### Refresh Access Token Request Example Source: https://developers.trustpilot.com/authentication This example shows how to refresh an access token using the POST method and specific URL. It includes the required payload parameters. ```http https://api.trustpilot.com/v1/oauth/oauth-business-users-for-applications/refresh grant_type=refresh_token&refresh_token=RefreshToken ``` -------------------------------- ### Domain Availability Response Example Source: https://developers.trustpilot.com/business-signup-api This is an example of the JSON response when checking domain availability. 'domainIsAvailable' will be true if the domain is unclaimed, and false otherwise. ```json { "domainIsAvailable": false } ``` -------------------------------- ### Get Trustpilot Icon Image Response Source: https://developers.trustpilot.com/resources-api Example response for retrieving Trustpilot icon images, showing the available sizes and their URLs. ```json { "image230x230": { "url": "//trustpilot.com/image.jpg", "width": "400", "height": "300" } } ``` -------------------------------- ### Example API Response Structure Source: https://developers.trustpilot.com/business-units-api This is an example of the JSON response you can expect when querying the Business Units API for reviews. It includes details about reviews, company replies, consumers, and business units. ```json { "links": [ { "href": "", "method": "", "rel": "" } ], "reviews": [ { "id": null, "stars": 0, "title": null, "text": null, "language": null, "createdAt": "2023-01-01T12:00:00Z", "experiencedAt": "2023-01-01T12:00:00Z", "updatedAt": "2023-01-01T12:00:00Z", "numberOfLikes": 0, "isVerified": false, "status": null, "companyReply": { "text": "This is our reply.", "createdAt": "2013-09-07T13:37:00.000Z", "updatedAt": "2013-09-07T13:37:00.000Z" }, "consumer": { "displayLocation": "Frederiksberg, DK", "numberOfReviews": 1, "displayName": "John Doe", "id": "507f191e810c19729de860ea", "links": [ { "href": "", "method": "", "rel": "" } ] }, "businessUnit": { "identifyingName": "trustpilot.com", "displayName": "Trustpilot", "id": "507f191e810c19729de860ea", "links": [ { "href": "", "method": "", "rel": "" } ] }, "location": { "id": "43f51215-a1fc-4c60-b6dd-e4afb6d7b831", "name": "Pilestraede 58", "urlFormattedName": "Pilestraede58" }, "countsTowardsTrustScore": false, "countsTowardsLocationTrustScore": false, "links": [ { "href": "", "method": "", "rel": "" } ], "reportData": { "source": "Trustpilot", "publicComment": "This review contains sensitive information.", "createdAt": "2013-09-07T13:37:00.000Z", "reasons": [ "sensitiveInformation", "consumerIsCompetitor" ], "reason": "consumer_is_competitor", "reviewVisibility": "hidden" }, "complianceLabels": [ null ], "invitation": { "businessUnitId": "507f191e810c19729de860ea" }, "businessUnitHistory": [ { "businessUnitId": "507f191e810c19729de860ea", "identifyingName": "example.com", "displayName": "Example Inc.", "changeDate": "2013-09-07T13:37:00.000Z" } ], "reviewVerificationLevel": null } ] } ``` -------------------------------- ### Access Token Response Example Source: https://developers.trustpilot.com/grant-type-client-credentials This is an example of a successful response when requesting an access token using the Client Credentials grant type. The response includes the access token and its expiration time in seconds. ```json { access_token: "AccessToken", expires_in: "359999" } ``` -------------------------------- ### Example Private Product Review Response Source: https://developers.trustpilot.com/product-reviews-api This is an example JSON response for a private product review. It contains detailed information about the review, product, and consumer, including private fields like email and reference ID. ```json { "links": [ { "href": "", "method": "", "rel": "" } ], "productReviews": [ { "id": "507f191e810c19729de860ea", "createdAt": "2013-09-07T13:37:00", "updatedAt": "2013-09-07T13:37:00", "businessUnitId": "507f191e810c19729de860ea", "stars": 4, "content": "This product was nice, but slightly too soft.", "product": { "id": "507f191e810c19729de860ea", "productUrl": "http://www.mycompanystore.com/products/12345.htm", "productImages": [ { "type": "100pxWide", "url": "http://www.mycompanystore.com/products/images/12345.jpg" } ], "name": "Metal Toy Car", "sku": "ABC-1234", "gtin": "01234567890", "mpn": "7TX1641", "brand": "Acme" }, "consumer": { "id": "507f191e810c19729de860ea", "email": "johndoe@somewhere.com", "name": "John Doe" }, "referenceId": "123ABC", "locale": "en-US", "language": "en", "redirectUri": "https://www.example.com", "state": "published", "hasModerationHistory": true, "conversationId": "507f191e810c19729de860ea", "attributeRatings": [ { "attributeId": "attributes.default.quality", "attributeName": "Quality", "rating": 4 } ], "attachments": [ { "id": "507f191e810c19729de860ea", "state": "Published", "processedFiles": [ { "dimension": "1024pxWide", "mimeType": "image/png", "url": "https://productreviews-attachments.trustpilot.com/507f191e810c19729de860ea_1024pxWide.png" } ] } ] } ], "total": 0 } ``` -------------------------------- ### Get Product Reviews (GET) Source: https://developers.trustpilot.com/product-reviews-api Fetch individual product reviews. This endpoint can be filtered by SKU, product URL, language, star rating, and locale. Requires either SKU or product URL to be specified. ```curl curl -X GET "https://api.trustpilot.com/v1/product-reviews/business-units/{businessUnitId}/reviews" \ -H "apikey: YOUR-API-KEY-HERE" ``` -------------------------------- ### Get Invitation Templates Source: https://developers.trustpilot.com/invitations-api-overview Retrieves a list of all available invitation templates for your business unit. ```APIDOC ## GET /v1/private/business-units/{businessUnitId}/templates ### Description Retrieves a list of all available invitation templates for your business unit. ### Method GET ### Endpoint https://invitations-api.trustpilot.com/v1/private/business-units/{businessUnitId}/templates ### Parameters #### Path Parameters - **businessUnitId** (string) - Required - Your Business Unit ID. ``` -------------------------------- ### Get business unit promotion box image Source: https://developers.trustpilot.com/business-units-api Retrieves the promotion box image URL for a specific business unit. ```APIDOC ## GET /v1/business-units/{businessUnitId}/images/promotion-box ### Description Retrieves the promotion box image URL for a specific business unit. ### Method GET ### Endpoint https://api.trustpilot.com/v1/business-units/{businessUnitId}/images/promotion-box ### Parameters #### Path Parameters - **businessUnitId** (string) - Required - The id of the business unit. ### Response #### Success Response (200) - **promotionBoxUrl** (string) - The URL of the promotion box image, or null if not available. ### Response Example ```json { "promotionBoxUrl": null } ``` ``` -------------------------------- ### Get business unit promotion box Source: https://developers.trustpilot.com/business-units-api Retrieves the company promotion box for a specific business unit. ```APIDOC ## Get business unit company promotion box ### Description Get the company promotion box for a specific business unit. ### Method GET ### Endpoint https://api.trustpilot.com/v1/business-units/{businessUnitId}/images/promotion-box ### Parameters #### Path Parameters - **businessUnitId** (string) - Required - The id of the business unit. ### Request Example ```curl curl -X GET "https://api.trustpilot.com/v1/business-units/{businessUnitId}/images/promotion-box" \ -H "apikey: YOUR-API-KEY-HERE" ``` ### Response #### Success Response (200) - **links** (array) - Contains links for related resources. ### Response Example ```json { "links": [ { "href": "", "method": "", "rel": "" } ] } ``` ``` -------------------------------- ### Get products Source: https://developers.trustpilot.com/private-products-api Retrieves a list of products associated with a specific business unit. Supports filtering by SKUs, group ID, and pagination. ```APIDOC ## GET /v1/private/business-units/{businessUnitId}/products ### Description Get a list of products by business unit. Supports optional filtering by SKUs, group ID, page number, items per page, and locale. ### Method GET ### Endpoint https://api.trustpilot.com/v1/private/business-units/{businessUnitId}/products ### Parameters #### Path Parameters - **businessUnitId** (string) - Required - The BusinessUnitId that owns the products. #### Query Parameters - **skus** (array) - Optional - Optional sku filter for products. - **groupId** (string) - Optional - Optional group id filter for products. When sku filter is given, the group id filter is ignored. - **page** (integer) - Optional - The page to retrieve. - **perPage** (integer) - Optional - The number of products to retrieve per page. - **locale** (string) - Optional - The language in which the attributes attached to the products, if any, are returned. ### Request Example ```curl curl -X GET "https://api.trustpilot.com/v1/private/business-units/{businessUnitId}/products" \ -H "Authorization: Bearer YOUR-ACCESS-TOKEN" ``` ### Response #### Success Response (200) - **products** (array) - List of product objects. - **isLastPage** (boolean) - Indicates if this is the last page of results. #### Response Example ```json { "products": [ { "id": "507f191e810c19729de860ea", "sku": "Prod123", "googleMerchantCenterProductId": "Product_DK_1007653571_2874605123", "title": "Toy car", "link": "http://myshop.com/products/toy-car", "imageLink": "http://myshop.com/products/images/toy-car.jpg", "processedImages": [ { "type": "100pxWide", "url": "https://product-reviews-images.trustpilot.com/5837640412df3f0aabf9989a_100pxWide.png" } ], "businessUnitId": "507f191e810c19729de860ea", "price": "99.95", "gtin": "3200000003774", "mpn": "HSC0424PP", "brand": "ToyProducer", "currency": "EUR", "description": "A metal toy car", "productCategory": { "id": "507f191e810c19729de860ea", "name": "Clothing" }, "attributes": [ { "id": "attributes-default-comfort", "name": "Comfort" } ], "groupId": "123456", "variationAttributes": { "color": "blue", "pattern": "striped", "material": "suede", "ageGroup": "adult", "gender": "female", "size": "XS" } } ], "isLastPage": false } ``` ``` -------------------------------- ### Get navigational links to all image resources Source: https://developers.trustpilot.com/resources-api Provides navigational links to all available image resources. No parameters are required for this request. ```APIDOC ## Contains navigational links to all image resources ### Description Get navigational links to all available image resources. ### Method GET ### Endpoint https://api.trustpilot.com/v1/resources/images ### Parameters No parameters required ### Request Example ```bash curl -X GET "https://api.trustpilot.com/v1/resources/images" \ -H "apikey: YOUR-API-KEY-HERE" ``` ### Response #### Success Response (200) - **links** (array) - List of link objects, each containing href, method, and rel. #### Response Example ```json { "links": [ { "href": "", "method": "", "rel": "" } ] } ``` ``` -------------------------------- ### Get Conversation Response Body Source: https://developers.trustpilot.com/product-reviews-api Example response when retrieving a conversation. It includes conversation details and a list of comments. ```json { "id": "507f191e810c19729de860ea", "businessUnitId": "507f191e810c19729de860ea", "consumerId": "507f191e810c19729de860ea", "source": "Product reviews", "sourceId": "507f191e810c19729de860ea", "state": "public", "comments": [ { "commentId": "507f191e810c19729de860ea", "createdAt": "2013-09-07T13:37:00", "author": { "id": "507f191e810c19729de860ea", "type": "businessUser" }, "content": "Thank you for you kind words, we really appreciate it." } ] } ``` -------------------------------- ### Get comment Source: https://developers.trustpilot.com/product-reviews-api Get a single comment by ID. ```APIDOC ## GET /v1/private/conversations/{conversationId}/comments/{commentId} ### Description Get a single comment by ID. ### Method GET ### Endpoint https://api.trustpilot.com/v1/private/conversations/{conversationId}/comments/{commentId} ### Parameters #### Path Parameters - **conversationId** (string) - Required - The ID of the conversation the comment to retrieve is part of - **commentId** (string) - Required - The ID of the comment to retrieve ### Response #### Success Response (200) - **commentId** (string) - Description - **createdAt** (string) - Description - **author** (object) - Description - **id** (string) - Description - **type** (string) - Description - **content** (string) - Description #### Response Example ```json { "commentId": "507f191e810c19729de860ea", "createdAt": "2013-09-07T13:37:00", "author": { "id": "507f191e810c19729de860ea", "type": "businessUser" }, "content": "Thank you for you kind words, we really appreciate it." } ``` ``` -------------------------------- ### Get conversation Source: https://developers.trustpilot.com/product-reviews-api Get a conversation and related comments by ID. ```APIDOC ## GET /v1/private/conversations/{conversationId} ### Description Get a conversation and related comments by ID. ### Method GET ### Endpoint https://api.trustpilot.com/v1/private/conversations/{conversationId} ### Parameters #### Path Parameters - **conversationId** (string) - Required - The ID of the conversation to retrieve ### Response #### Success Response (200) - **id** (string) - Description - **businessUnitId** (string) - Description - **consumerId** (string) - Description - **source** (string) - Description - **sourceId** (string) - Description - **state** (string) - Description - **comments** (array) - Description - **commentId** (string) - Description - **createdAt** (string) - Description - **author** (object) - Description - **id** (string) - Description - **type** (string) - Description - **content** (string) - Description #### Response Example ```json { "id": "507f191e810c19729de860ea", "businessUnitId": "507f191e810c19729de860ea", "consumerId": "507f191e810c19729de860ea", "source": "Product reviews", "sourceId": "507f191e810c19729de860ea", "state": "public", "comments": [ { "commentId": "507f191e810c19729de860ea", "createdAt": "2013-09-07T13:37:00", "author": { "id": "507f191e810c19729de860ea", "type": "businessUser" }, "content": "Thank you for you kind words, we really appreciate it." } ] } ``` ``` -------------------------------- ### Get Batch Product Reviews Summaries (POST) Source: https://developers.trustpilot.com/product-reviews-api Use this endpoint to retrieve summaries for multiple product SKUs in a single request. The response includes star distribution and average ratings. ```json { "skus": [ "ABCD-1234", "ACDC-4321" ] } ``` -------------------------------- ### Get customer guarantee of business unit Source: https://developers.trustpilot.com/business-units-api-%28public%29 Get the company's Guarantee Box information for a specific business unit. ```APIDOC ## GET /v1/business-units/{businessUnitId}/customerguarantee ### Description Get the company's Guarantee Box information for a specific business unit. ### Method GET ### Endpoint https://api.trustpilot.com/v1/business-units/{businessUnitId}/customerguarantee ### Parameters #### Path Parameters - **businessUnitId** (string) - Required - The id of the business unit. ### Request Example ```curl curl -X GET "https://api.trustpilot.com/v1/business-units/{businessUnitId}/customerguarantee" \ -H "apikey: YOUR-API-KEY-HERE" ``` ### Response #### Success Response (200) (Response schema not provided in the source text.) ``` -------------------------------- ### Product Response Example Source: https://developers.trustpilot.com/private-products-api This JSON object represents a typical response from the Private Products API, detailing a specific product with its attributes and variations. ```json { "products": [ { "id": "507f191e810c19729de860ea", "sku": "Prod123", "googleMerchantCenterProductId": "Product_DK_1007653571_2874605123", "title": "Toy car", "description": "A metal toy car", "link": "http://myshop.com/products/toy-car", "imageLink": "http://myshop.com/products/images/toy-car.jpg", "processedImages": [ { "type": "100pxWide", "url": "https://product-reviews-images.trustpilot.com/5837640412df3f0aabf9989a_100pxWide.png" } ], "price": "99.95", "currency": "EUR", "gtin": "3200000003774", "mpn": "HSC0424PP", "brand": "ToyProducer", "businessUnitId": "507f191e810c19729de860ea", "categoryId": "507f191e810c19729de860ea", "groupId": "123456", "variationAttributes": { "color": "blue", "pattern": "striped", "material": "suede", "ageGroup": "adult", "gender": "female", "size": "XS" } } ] } ``` -------------------------------- ### Example Product Reviews Response Source: https://developers.trustpilot.com/product-reviews-api This JSON object represents a typical response when retrieving product reviews. It includes review details, consumer information, and attachment data. ```json { "productReviews": [ { "id": "507f191e810c19729de860ea", "createdAt": "2013-09-07T13:37:00", "stars": 4, "content": "This product was nice, but slightly too soft.", "consumer": { "id": "507f191e810c19729de860ea", "displayName": "John Doe" }, "language": "en", "attributeRatings": [ { "attributeId": "attributes.default.quality", "attributeName": "Quality", "rating": 4 } ], "attachments": [ { "id": "507f191e810c19729de860ea", "state": "Published", "processedFiles": [ { "dimension": "1024pxWide", "mimeType": "image/png", "url": "https://productreviews-attachments.trustpilot.com/507f191e810c19729de860ea_1024pxWide.png" } ] } ], "firstCompanyComment": { "comment": "Thank you for your review", "createdAt": "2013-09-07T13:37:00" } } ], "links": [ { "href": "", "method": "", "rel": "" } ] } ``` -------------------------------- ### Revoke Refresh Token Example Source: https://developers.trustpilot.com/authentication This example demonstrates how to revoke a refresh token by sending a POST request with the token in the payload. A successful revocation returns a 200 status code. ```http token=7Xu4MQ9xsvUA0Tard2bIofnLjacrw7RL ``` -------------------------------- ### Business Unit Response Example Source: https://developers.trustpilot.com/data-solutions-how-to A typical JSON response when finding a Business Unit ID, containing the 'id', 'displayName', and address details. ```json { "businessUnits": [ { "id": "507f191e810c19729de860ea", "displayName": "Trustpilot", "name": { "referring": [ "Trustpilot" ], "identifying": "Trustpilot" }, "address": { "countryCode": "GB" } } ] } ``` -------------------------------- ### List All Categories (cURL) Source: https://developers.trustpilot.com/categories-api Use this endpoint to retrieve a list of all available categories. Authentication is required via an API key. ```bash curl -X GET "https://api.trustpilot.com/v1/categories" \ -H "apikey: YOUR-API-KEY-HERE" ``` -------------------------------- ### Get Private Product Reviews using CURL Source: https://developers.trustpilot.com/product-reviews-api Use this cURL command to make a GET request to retrieve private product reviews. Ensure you replace placeholders with your actual business unit ID and access token. ```curl curl -X GET "https://api.trustpilot.com/v1/private/product-reviews/business-units/{businessUnitId}/reviews" \ -H "Authorization: Bearer YOUR-ACCESS-TOKEN" ``` -------------------------------- ### 1. Get an authorization code Source: https://developers.trustpilot.com/grant-type-auth-code Initiates the login process by redirecting the user to Trustpilot to authenticate. Upon successful authentication, the user is redirected back with an authorization code. ```APIDOC ## GET https://authenticate.trustpilot.com ### Description Redirects the user to Trustpilot for authentication to obtain an authorization code. ### Method GET ### Endpoint https://authenticate.trustpilot.com ### Parameters #### Query Parameters - **client_id** (string) - Required - The API key. - **redirect_uri** (string) - Required - The client's site URL. Must be HTTPS. - **response_type** (string) - Required - Value must be set to `code`. ### Request Example ``` https://authenticate.trustpilot.com?client_id=APIKey&redirect_uri=https://www.clientsSite.com&response_type=code ``` ### Response Redirects back to the `redirect_uri` with a `code` query parameter. #### Success Response (302 Found) - **Location** (string) - The redirect URI with the authorization code appended, e.g., `https://www.clientsSite.com/?code=Code` ``` -------------------------------- ### Get Service Reviews using CURL Source: https://developers.trustpilot.com/data-solutions-how-to Use the Get service reviews endpoint to access a Business Unit’s reviews by providing its ID as a path parameter. Ensure you have access to the Insights API and replace 'YOUR-API-KEY-HERE' with your actual API key. ```curl curl -X GET "https://datasolutions.trustpilot.com/v1/business-units/507f191e810c19729de860ea/reviews" \ -H "apikey: YOUR-API-KEY-HERE" ``` -------------------------------- ### Get Consumer Reviews with API Key Source: https://developers.trustpilot.com/consumer-api Use this CURL command to retrieve reviews for a specific consumer. Replace YOUR-API-KEY-HERE with your actual API key. ```curl curl -X GET "https://api.trustpilot.com/v1/consumers/{consumerId}/reviews" \ -H "apikey: YOUR-API-KEY-HERE" ``` -------------------------------- ### Get list of tags for a review Source: https://developers.trustpilot.com/service-reviews-api Retrieves all tags associated with a given service review. ```APIDOC ## GET /v1/private/reviews/{reviewId}/tags ### Description This method will get all tags of a given service review ### Method GET ### Endpoint https://api.trustpilot.com/v1/private/reviews/{reviewId}/tags ### Parameters #### Path Parameters - **reviewId** (string) - Required - The id of the review. ### Response #### Success Response (200) - **tags** (array) - An array of tag objects, each with 'group' and 'value'. ### Response Example ```json { "tags": [ { "group": "generic", "value": "Computers" } ] } ``` ``` -------------------------------- ### Get batch product reviews summaries Source: https://developers.trustpilot.com/product-reviews-api Retrieves summaries of product reviews for multiple SKUs. The summaries include information about stars average, distribution, and count. ```APIDOC ## POST /v1/product-reviews/business-units/{businessUnitId}/batch-summaries ### Description Get summaries of product reviews for multiple SKUs. The summaries contain information about stars average, distribution and count. ### Method POST ### Endpoint https://api.trustpilot.com/v1/product-reviews/business-units/{businessUnitId}/batch-summaries ### Parameters #### Path Parameters - **businessUnitId** (string) - Required - The id of the business unit. #### Request Body - **skus** (array) - Required - A list of SKUs for which to retrieve summaries. - Example: [ "ABCD-1234", "ACDC-4321" ] ### Request Example ```json { "skus": [ "ABCD-1234", "ACDC-4321" ] } ``` ### Response #### Success Response (200) - **summaries** (array) - A list of review summaries for the requested SKUs. - **sku** (string) - The SKU of the product. - **numberOfReviews** (object) - An object containing the total number of reviews and their distribution by star rating. - **total** (integer) - The total number of reviews. - **oneStar** (integer) - The number of 1-star reviews. - **twoStars** (integer) - The number of 2-star reviews. - **threeStars** (integer) - The number of 3-star reviews. - **fourStars** (integer) - The number of 4-star reviews. - **fiveStars** (integer) - The number of 5-star reviews. - **starsAverage** (number) - The average star rating for the product. #### Response Example ```json { "summaries": [ { "sku": "ABCD-1234", "numberOfReviews": { "total": 14, "oneStar": 2, "twoStars": 3, "threeStars": 2, "fourStars": 5, "fiveStars": 2 }, "starsAverage": 3.1 } ] } ``` ``` -------------------------------- ### Get Product Reviews Summaries List Source: https://developers.trustpilot.com/product-reviews-api Fetch a paginated list of product review summaries for a given business unit. Optional parameters include 'page' and 'perPage' for controlling the results. ```curl curl -X GET "https://api.trustpilot.com/v1/private/product-reviews/business-units/{businessUnitId}/summaries" \ -H "Authorization: Bearer YOUR-ACCESS-TOKEN" ``` -------------------------------- ### Get Public Conversation Source: https://developers.trustpilot.com/product-reviews-api Retrieves a public conversation and its associated comments using the conversation ID. ```APIDOC ## GET /v1/conversations/{conversationId} ### Description Get a public conversation and related comments by ID. ### Method GET ### Endpoint /v1/conversations/{conversationId} ### Parameters #### Path Parameters - **conversationId** (string) - Required - The ID of the conversation to retrieve ### Response #### Success Response (200) - **id** (string) - The ID of the conversation - **businessUnitId** (string) - The ID of the business unit associated with the conversation - **consumerId** (string) - The ID of the consumer who initiated the conversation - **comments** (array) - A list of comments within the conversation - **commentId** (string) - The ID of the comment - **createdAt** (string) - The timestamp when the comment was created - **author** (object) - Information about the author of the comment - **id** (string) - The ID of the author - **type** (string) - The type of the author (e.g., 'businessUser') - **content** (string) - The content of the comment #### Response Example ```json { "id": "507f191e810c19729de860ea", "businessUnitId": "507f191e810c19729de860ea", "consumerId": "507f191e810c19729de860ea", "comments": [ { "commentId": "507f191e810c19729de860ea", "createdAt": "2013-09-07T13:37:00", "author": { "id": "507f191e810c19729de860ea", "type": "businessUser" }, "content": "Thank you for you kind words, we really appreciate it." } ] } ``` ``` -------------------------------- ### Example API Response for Reviews Source: https://developers.trustpilot.com/business-units-api This JSON structure represents a typical response when fetching reviews for a business unit. It includes details about each review and pagination information. ```json { "reviews": [ { "id": null, "stars": 0, "title": null, "text": null, "language": null, "createdAt": "2023-01-01T12:00:00Z", "updatedAt": "2023-01-01T12:00:00Z", "experiencedAt": "2023-01-01T12:00:00Z", "isVerified": false, "companyReply": { "text": "This is our reply.", "createdAt": "2013-09-07T13:37:00", "updatedAt": "2013-09-07T13:37:00" }, "consumer": { "displayLocation": "Frederiksberg DK", "displayName": "John Doe", "id": "507f191e810c19729de860ea" }, "location": { "id": "43f51215-a1fc-4c60-b6dd-e4afb6d7b831", "name": "Pilestraede 58" } } ], "nextPageToken": "MjAxMy0wNS0wM1QxMDowMzo0MS4wMDBafDUxODM4YjdkMDAwMDY0MDAwMjQ0MTQyZA" } ``` -------------------------------- ### Get a review's likes Source: https://developers.trustpilot.com/service-reviews-api This method retrieves a list of consumers who have liked a specific review. ```APIDOC ## Get a review's likes This method gets the list of consumers who have liked the review ### Method GET ### Endpoint https://api.trustpilot.com/v1/reviews/{reviewId}/likes ### Parameters #### Path Parameters - **reviewId** (string) - Required - The id of the review. ### Request Example ```bash curl -X GET "https://api.trustpilot.com/v1/reviews/{reviewId}/likes" \ -H "apikey: YOUR-API-KEY-HERE" ``` ### Response #### Success Response (200) - **likes** (array) - A list of consumers who liked the review. - **consumer** (object) - Information about the consumer. - **id** (string) - The ID of the consumer. - **displayName** (string) - The display name of the consumer. ### Response Example ```json { "likes": [ { "consumer": { "id": null, "displayName": null } } ] } ``` ``` -------------------------------- ### Create Comment Response Body Source: https://developers.trustpilot.com/product-reviews-api Example response after successfully creating a comment. It includes the new comment's ID, creation timestamp, author details, and content. ```json { "commentId": "507f191e810c19729de860ea", "createdAt": "2013-09-07T13:37:00", "author": { "id": "507f191e810c19729de860ea", "type": "businessUser" }, "content": "Thank you for you kind words, we really appreciate it." } ``` -------------------------------- ### Check Customer Permissions Source: https://developers.trustpilot.com/build-a-partner-integration This GET request checks if a customer has the necessary permissions to use your integration. Replace placeholders with your Partner ID and the customer's Business Unit ID. ```curl curl -X GET " https://api.trustpilot.com/v1/private/partners//check/" ``` -------------------------------- ### Get business unit profile image Source: https://developers.trustpilot.com/business-units-api Retrieves the company profile image for a specific business unit. ```APIDOC ## Get business unit's profile image ### Description Get the company profile image for a specific business unit. ### Method GET ### Endpoint https://api.trustpilot.com/v1/business-units/{businessUnitId}/images ### Parameters #### Path Parameters - **businessUnitId** (string) - Required - The id of the business unit. ### Request Example ```curl curl -X GET "https://api.trustpilot.com/v1/business-units/{businessUnitId}/images" \ -H "apikey: YOUR-API-KEY-HERE" ``` ### Response #### Success Response (200) - **links** (array) - Contains links for related resources. - **profileImage** (object) - Contains different sizes of the profile image. - **image57x43** (object) - **url** (string) - The URL for the image. - **width** (string) - The width of the image. - **height** (string) - The height of the image. - **image118x89** (object) - **url** (string) - The URL for the image. - **width** (string) - The width of the image. - **height** (string) - The height of the image. - **image198x149** (object) - **url** (string) - The URL for the image. - **width** (string) - The width of the image. - **height** (string) - The height of the image. ### Response Example ```json { "links": [ { "href": "", "method": "", "rel": "" } ], "profileImage": { "image57x43": { "url": "", "width": "", "height": "" }, "image118x89": { "url": "", "width": "", "height": "" }, "image198x149": { "url": "", "width": "", "height": "" } } } ``` ``` -------------------------------- ### Example Web Links Response JSON Source: https://developers.trustpilot.com/service-reviews-api This JSON object illustrates the structure of the response when requesting web links for a review, including the resource URL, HTTP method, and relation type. ```json { "links": { "href": "", "method": "", "rel": "" }, "locale": null, "reviewUrl": null } ``` -------------------------------- ### Get categories Source: https://developers.trustpilot.com/data-solutions-api Retrieves a list of categories. Filtering is available by country code and parent category ID. ```APIDOC ## GET /v1/categories ### Description Get categories with optional filtering by country and parent category. ### Method GET ### Endpoint https://datasolutions.trustpilot.com/v1/categories ### Parameters #### Query Parameters - **countryCode** (string) - Optional - Country code for filtering categories (ISO 3166-1 alpha-2) Example: ?countryCode=US - **parentId** (string) - Optional - Parent category identifier for filtering subcategories Example: ?parentId=restaurants_bars ### Request Example ```curl curl -X GET "https://datasolutions.trustpilot.com/v1/categories" \ -H "apikey: YOUR-API-KEY-HERE" ``` ### Response #### Success Response (200) - **totalNumberOfCategories** (number) - Total count of categories available. - **categories** (array) - List of category objects. - **categoryId** (string) - Unique identifier for the category. - **parentId** (string) - Identifier of the parent category. - **childrenCategories** (array) - List of child category identifiers. - **numberOfBusinessUnits** (number) - Count of business units within this category. #### Response Example ```json { "totalNumberOfCategories": 150, "categories": [ { "categoryId": "restaurant", "parentId": "restaurants_bars", "childrenCategories": [ "italian_restaurant", "pizza_restaurant" ], "numberOfBusinessUnits": 1234 } ] } ``` ``` -------------------------------- ### Create Product Review Invitation Link (CURL) Source: https://developers.trustpilot.com/product-reviews-api Generate a unique invitation link for consumers to submit a product review. This endpoint requires a Business user OAuth Token for authentication and accepts product details or product IDs. Ensure either product details or product IDs are provided, but not both. ```curl curl -X POST "https://api.trustpilot.com/v1/private/product-reviews/business-units/{businessUnitId}/invitation-links" \ -H "Content-Type: application/json" \ -d '{ "consumer": { "email": "johndoe@somewhere.com", "name": "John Doe" }, "referenceId": "123ABC", "locale": "en-US", "redirectUri": "https://www.example.com", "products": [ { "productUrl": "http://www.mycompanystore.com/products/12345.htm", "imageUrl": "http://www.mycompanystore.com/products/images/12345.jpg", "name": "Metal Toy Car", "sku": "ABC-1234", "gtin": "01234567890", "mpn": "7TX1641", "brand": "Acme" } ], "productIds": [ "507f191e810c19729de860ea", "507f191e810c19729de860eb", "507f191e810c19729de860ec" ]' }' \ -H "Authorization: Bearer YOUR-ACCESS-TOKEN" ```