Invitation API
-
Delete invitation data
When providing a list of email addresses, all invitations data related to the specified consumer email addresses will be deleted. When providing a date, all invitations data older than the specified date will be deleted. It is not possible to specify a list of email addresses and a date at the same time. This is not reversible.
HTTP method: POST
Authentication: Business user OAuth Token
URL: https://invitations-api.trustpilot.com/v1/private/business-units/{businessUnitId}/invitation-data/delete
Parameters
-
businessUnitId, Required string
The ID of the business unit.
Example: .../v1/private/business-units/{businessUnitId}/invitation-data/delete
-
x-business-user-id, Optional string
The ID of the business user on behalf of who to delete invitation data. Should be provided when access token is obtained using client_credentials grant type. User's id can be found in business application's user profile page, and the user must have either Admin or Manager role.
Example: x-business-user-id: {x-business-user-id}
curl -X POST "https://invitations-api.trustpilot.com/v1/private/business-units/{businessUnitId}/invitation-data/delete" \-H "x-business-user-id: example" \-H "Content-Type: application/json" \-d '{"customerEmails": ["joe@example.com","jane@example.com"],"deleteOlderThan": "09/07/2013 13:37:00"}' \-H "Authorization: Bearer YOUR-ACCESS-TOKEN"Request Body
{"customerEmails": ["joe@example.com","jane@example.com"],"deleteOlderThan": "09/07/2013 13:37:00"} -
-
Generate service review invitation link
Generate a unique invitation link that can be sent to a consumer by email or website. Use the request parameter called redirectURI to take the user to a product review link after the user has left a service review.
HTTP method: POST
Authentication: Business user OAuth Token
URL: https://invitations-api.trustpilot.com/v1/private/business-units/{businessUnitId}/invitation-links
Parameters
-
businessUnitId, Required string
The ID of the business unit.
Example: .../v1/private/business-units/{businessUnitId}/invitation-links
curl -X POST "https://invitations-api.trustpilot.com/v1/private/business-units/{businessUnitId}/invitation-links" \-H "Content-Type: application/json" \-d '{"locationId": "ABC123","referenceId": "inv00001","email": "john.doe@trustpilot.com","name": "John Doe","locale": "en-US","tags": ["tag1","tag2"],"redirectUri": "http://trustpilot.com"}' \-H "Authorization: Bearer YOUR-ACCESS-TOKEN"Request Body
{"locationId": "ABC123","referenceId": "inv00001","email": "john.doe@trustpilot.com","name": "John Doe","locale": "en-US","tags": ["tag1","tag2"],"redirectUri": "http://trustpilot.com"}Response
{"id": "9ee95945f2aa3a748301efdc6b8b51d7","url": "https://www.trustpilot.com/evaluate-link/9ee95945f2aa3a748301efdc6b8b51d7"} -
-
Create invitation(s)
This API endpoint triggers email invitation(s). You can create both service review invitations and product review invitations using this endpoint. If you only want to create a service review invitation, you can omit the productReviewInvitation section. When you specify the productReviewInvitation you must include either the products or the productSkus field - but not both. If you include the productSkus field, you must upload your product catalog before you schedule invitations. The preferredSendTime must be in UTC if specified. If preferredSendTime is specified for both the serviceReviewInvitation and productReviewInvitation, then the serviceReviewInvitation must precede the productReviewInvitation.
HTTP method: POST
Authentication: Business user OAuth Token
URL: https://invitations-api.trustpilot.com/v1/private/business-units/{businessUnitId}/email-invitations
Parameters
-
businessUnitId, Required string
The ID of the business unit.
Example: .../v1/private/business-units/{businessUnitId}/email-invitations
-
x-business-user-id, Optional string
The ID of the business user on behalf of who to create invitation. Should be provided when access token is obtained using client_credentials grant type. User's id can be found in business application's user profile page, and the user must have either Admin or Manager role.
Example: x-business-user-id: {x-business-user-id}
curl -X POST "https://invitations-api.trustpilot.com/v1/private/business-units/{businessUnitId}/email-invitations" \-H "x-business-user-id: example" \-H "Content-Type: application/json" \-d '{"replyTo": "john.doe@trustpilot.com","locale": "en-US","senderName": "John Doe","senderEmail": "john.doe@trustpilot.com","source": "Shopify","locationId": "ABC123","referenceNumber": "inv00001","consumerName": "John Doe","consumerEmail": "john.doe@trustpilot.com","phoneNumber": "+4589888472","type": "email","serviceReviewInvitation": {"templateId": "507f191e810c19729de860ea","preferredSendTime": "09/07/2013 13:37:00","redirectUri": "http://trustpilot.com","tags": ["tag1","tag2"]},"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"]}}' \-H "Authorization: Bearer YOUR-ACCESS-TOKEN"Request Body
{"replyTo": "john.doe@trustpilot.com","locale": "en-US","senderName": "John Doe","senderEmail": "john.doe@trustpilot.com","source": "Shopify","locationId": "ABC123","referenceNumber": "inv00001","consumerName": "John Doe","consumerEmail": "john.doe@trustpilot.com","phoneNumber": "+4589888472","type": "email","serviceReviewInvitation": {"templateId": "507f191e810c19729de860ea","preferredSendTime": "09/07/2013 13:37:00","redirectUri": "http://trustpilot.com","tags": ["tag1","tag2"]},"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"]}} -
-
Get list of invitation templates
Returns a list of ID and Names of the templates available to be used in invitations. Includes both default/optimized and custom templates.
HTTP method: GET
Authentication: Business user OAuth Token
URL: https://invitations-api.trustpilot.com/v1/private/business-units/{businessUnitId}/templates
Parameters
-
businessUnitId, Required string
The ID of the business unit.
Example: .../v1/private/business-units/{businessUnitId}/templates
-
types, Optional array
One or more types of templates to search for (Default: ServiceReview)
Example: ?types={types}
curl -X GET "https://invitations-api.trustpilot.com/v1/private/business-units/{businessUnitId}/templates" \-H "Authorization: Bearer YOUR-ACCESS-TOKEN"Response
{"templates": [{"id": "507f191e810c19729de860ea","name": "Standard template for English","isDefaultTemplate": true,"locale": "da-DK","type": "ServiceReview"}]} -