How to create Service Review Invitation and Product Review Invitation API links
If you're a Trustpilot business user looking to invite your customers to review your service and products through an invitation link, you can achieve this using the Trustpilot API. This guide will walk you through the steps to set this up using Trustpilot's private API. For more information on getting started with Trustpilot's private API, be sure to refer to our guide.
Prerequisites
To create service review and product review API links, you'll need the following:
Trustpilot business account - create one here
Trustpilot API and Secret Key - API key management can be found in the Trustpilot business portal. Integrations > Developers > APIs> Create Application
Trustpilot Business Unit ID - Using the API key and the Find a business unit API, you will be able to enter a string with your company’s domain i.e (trustpilotdemo.com) under the param “name” and it will return a response with an id string. This is your unique alpha-numeric identifier specific to your domain as assigned by Trustpilot. Video demo
Example:
https://api.trustpilot.com/v1/business-units/find?apikey={{api_key}}&name=trustpilotdemo.com
Trustpilot access token - Trustpilot APIs contain private resources and use OAuth 2.0 authentication. In order to access private resources, you need an access token. The guide to how to generate an access token with oAuth 2.0 here.
Trustpilot Connect add-on Module/ Enterprise plan - get the module here or reach out to your Customer Success Manager to upgrade your plan.
API client - optional (we would recommend Postman)
Creating a Product Review Invitation API Link
Our Product Reviews API allows you to generate a product review invitation link for one or more of your products. To view a video walkthrough of the Product API link creation please see this video by Jeremy Robinson. This API call gathers information about the customer and the product(s) purchased, then generates a link that can be sent to the customer to request a review. To create the Product Review Invitation API link you’ll need to do the following:
Step 1: Find your Business Unit ID
Step 2: Generate an access token with oAuth 2.0
Step 3: Make a POST request to Trustpilot endpoint:
https://api.trustpilot.com/v1/private/product-reviews/business-units/{{businessUnitId}}/invitation-links
Step 4: Include a valid access token associated with your businessUnitID in the request as shown below. For more information on getting an access token, be sure to refer to our guide.
In the payload the following parameters are mandatory and are required for one product review invitation link per customer:
- `email`- Customer’s email address
- `name`- Customer’s name
- `referenceId` - The customer’s internal reference number
- `locale` - Landing page country domain. See list of all locales
- Products - These can be either a list of `productIds` (Payload A) or a list of `products` with each product URL, name, SKU code, image-URL, and brand (Payload B). The image-URL and brand are optional, but recommended for the best user experience.
Payload A
If you've already upserted your batch catalogue either via the API or via the business portal you can add the payload like this where you reference the productIds. These can be found by making a call to the Get Products API.
Minimum payload:
{
"consumer": {
"email": "johndoe@somewhere.com",
"name": "John Doe"
},
"referenceId": "123ABC",
"locale": "en-US",
"productIds": [
"507f191e810c19729de860ea",
"507f191e810c19729de860eb",
"507f191e810c19729de860ec"
]
}
Payload B:
Minimum payload:
{
"consumer": {
"email": "johndoe@somewhere.com",
"name": "John Doe"
},
"referenceId": "123ABC",
"locale": "en-US",
"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"
}
],
}
In both examples, the response to the API call will include a reviewUrl
If you'd like to redirect the customer to our product review form after writing the service review, include the optional redirect-URI parameter.
Creating a Service Review Invitation API Link
Our Service Reviews API generates a unique invitation link that can be sent to a consumer by email or website, requesting a review of your services. To create the Service Review Invitation API link you’ll need to do the following:
Step 1: Find your Business Unit ID
Step 2: Generate an access token with oAuth 2.0
Step 3: Make a POST request to Trustpilot endpoint
https://invitations-api.trustpilot.com/v1/private/business-units/{businessUnitId}/invitation-links
In the payload, the following parameters are mandatory and are required for one service review invitation link per customer:
- `referenceId` - The customer’s internal reference number
- `email` - Customer’s email address
- `name` - Customer’s name
- `locale` - Landing page country domain
The response to the API call will include a reviewUrl
Combining Service Review Invitation and Product Review Invitation into a single API link
If you are looking to simplify the review process for your customers and encourage them to complete a service review before the product review, you may want to consider generating a single API link. This is achievable by including the product review link into the optional redirect-URI parameter.
By doing this, you'll generate a single service review invitation API link that allows users the option to complete both the service review and the product review.
When your service review invitation link is clicked, the key difference is that there will be an additional tab for reviewing the product as well as the option to skip to product review.
If the user submits the review, they will still be redirected to the product review afterwards.
Product review window:
With the API you can simplify the process and give your customers an easy way to leave feedback on their experience. Trustpilot's Private API makes this process easy and efficient, so don't hesitate to get started today. For further guidance and more information on working with Trustpilot's APIs, be sure to check out our documentation.
0 comments
Sort by