Invitations API overview
The invitations API enables you to send service and product review invitations to customers. Use the Invitations API to create and delete email invitations, generate a service review link and get a list of existing invitation templates.
To create and send a basic service review invitation, you’ll need to include the following information:
Your Business Unit ID. You’ll need to include this in the URL. To find your Business Unit ID, refer to Business Units overview.
- The customer’s email address and name.
- The customer’s locale.
- Your internal reference number for the customer.
- The template ID for the invitation template you want to send.
- (Optional) A preferred send time.
To get a list of templates available to you, use the following call:
curl -X GET "https://invitations-api.trustpilot.com/v1/private/business-units/{businessUnitId}/templates"
Example
If you’re not sure where to start, refer to the following example:
curl -X POST "https://invitations-api.trustpilot.com/v1/private/business-units/{businessUnitId}/email-invitations"\ -H"Content-Type: application/json""Authorization: Bearer <token>"\ -d '<request data below>'
Use the following request data to generate your invitation:
{ "replyTo": "john.doe@trustpilot.com", "locale": "en-US", "senderName": "John Doe", "senderEmail": "john.doe@trustpilot.com", "referenceNumber": "inv00001", "consumerName": "John Doe", "consumerEmail": "john.doe@trustpilot.com", "type": "email", "serviceReviewInvitation": { "templateId": "507f191e810c19729de860ea", "preferredSendTime": "09/07/2013 13:37:00", "redirectUri": "http://trustpilot.com", },}
If you want to send a product review invitation with your service review request, add the following request data:
"productReviewInvitation": { "templateId": "507f191e810c19729de860ea", "preferredSendTime": "09/07/2013 13:37:00", "redirectUri": "http://trustpilot.com", "products": [ { "sku": "ABC-1234", "name": "Metal Toy Car", "mpn": "7TX1641", "brand": "ACME", "imageUrl": "http://www.mycompanystore.com/products/images/12345.jpg", "productUrl": "http://www.mycompanystore.com/products/12345.htm", "gtin": "01234567890", "productCategoryGoogleId": "1267" } ], "productSkus": [ "sku1", "sku2" ] }