Create

Create Request

Used to create new email requests. Must be a POST request with a JSON-formatted list of the following parameters as the request body. The ID of the created request(s) will be returned after a successful call - see Create Response below.

Tripadvisor allows each JSON-formatted body to have a maximum of 10,000 characters.

  • location_id - string
    [Required] Your internal hotel location ID which has been mapped through your TripConnect or Review Express Connectivity mapping. If you are a connectivity partner (e.g. internet booking engine), this will not be the same as the TA location ID. Other types of partner (e.g. wifi providers) may not have their own identifiers for properties and choose to map TA location ID to TA location ID - this is fine. Either way, the property needs to have been added to your mapping before you can send any create requests. 
  • partner_request_id - string(64)
    [Optional] Partner-defined ID for the email request, e.g. a booking ID. May be used instead of the request_id field (the Tripadvisor email request ID as returned by this call) to cancel or update the request in future calls.
  • recipient - string(128)
    [Required] Recipient for the email request. Must contain an @ symbol and at least one period. Must not end in a period. Only a short form email address like mme.toutlemonde@example.fr will be accepted — "Madame Toutlemonde" <mme.toutlemonde@example.fr> would not be accepted.
  • checkout - string(10)
    [Required] Check-out date for related booking or reservation. The Review Express email will be sent to the guest email address 2 days after this date. Must be in ISO-8601 YYYY-MM-DD format. The Review Express API will accept a request at any time prior to the day after the check-out date; a request with a check-out date earlier than yesterday will be rejected, as the e-mail queue for that day will already have been processed.
  • language - string(5)
    [Optional] Language which will be used in the email. See supported languages.
  • country - string(2)
    [Required] 2-letter country code for email recipient’s home country. Because email marketing and privacy regulations vary by country, Tripadvisor requires that guest country of residence be captured with each email request. Must be a valid ISO 3166-1 alpha-2 code.

Example Request

POST
https://api.tripadvisor.com/api/partner/1.0/email_requests
BODY
[
  {
    "recipient": "john@example.com",
    "location_id": "h89575",
    "checkout": "2014-12-31",
    "country": "US"
  },
  {
    "partner_request_id": "745C6BFF-F0C7-401F-A691-4407F78DC96C",
    "location_id": "h89575",
    "recipient": "mme.toutlemonde@example.fr",
    "checkin": "2014-11-07",
    "checkout": "2014-11-12",
    "language": "fr",
    "country": "FR"
  }
]

Create Response

Return value from creating new email requests.

  • request_id - integer
    Tripadvisor ID for the email request. May be used in subsequent update or cancel calls.
  • partner_request_id - string(64)
    [Optional] Partner-defined ID for the email request, e.g. a booking ID. May be used instead of the request_id field (the Tripadvisor email request ID as returned by this call) to cancel or update the request in future calls.
  • status - string(10)
    Status of the email request — will always be "queued", for a new request, may be "sent" or "canceled" when listing requests.
  • errors - array of errors
    [Optional] Array of errors.

Example Response

BODY
[
  {
    "status": "queued",
    "request_id": 7,
    "partner_request_id": null
  },
  {
    "status": "queued",
    "request_id": 8,
    "partner_request_id": "745C6BFF-F0C7-401F-A691-4407F78DC96C"
  }
]