Status: Controlled Availability (please inquire with your contact).
For Guest Profile, Guest Check-in, Room-Ready, Guest Check-Out and similar use-cases, the Contact and Contact Event integration points are used to tell Loop about a specific Contact and to trigger behaviour (respectively) based on events in that Contact's journey.
The following APIs extend the Loop Rest API Specification (V1); please reference this document for a complete API reference.
<> Contact
Insert a new or Update a current Contact of an account. The result of the call will be JSON containing a status and unique identifier for the Contact record.
No workflow rules are triggered based on this activity - please see ContactEvent for triggering specific events.
POST /api/<version>/Contact DELETE /api/<version>/Contact |
The request body shall be a JSON object containing the following fields (except for version which is in the URL):
Parameter |
Description |
version |
API version, currently v1 |
foreignId |
(optional) A unique foreign key for this record. Three cases exist for the behaviour of the operation based on the foreignId value:
|
locationId |
(optional) The ID or short code of the Location to which this Contact is associated. |
area |
(optional) The ID or short code of the Internal Location to which this Contact is associated. |
title |
(optional) Contact’s title |
firstname |
(optional) Contact’s first name |
lastname |
(optional) Contact’s last name |
|
(optional) Contact’s email address |
mobile |
(optional) Contact’s mobile phone number (international format). |
language |
(optional) Contact’s preferred language, ISO two-character code (e.g. “en” by default). |
arrivalTime |
(optional) An RFC2822 or ISO 8601 date string representing the time the contact arrived (e.g. check-in). If omitted, the arrival time will be set to the current time. |
departureTime |
(optional) An RFC2822 or ISO 8601 date string representing the time the contact will depart (e.g. check-out). If omitted, the departure time will be set to 24-hours following arrival. |
checkedInStatus |
(optional) TRUE if the contact is checked-in. |
room |
(required for Insert operations) The contacts current Room number. |
vipStatus |
(optional) A value representing the contact’s status as a VIP to be displayed in the Contact Profile. |
groupName |
(optional) A group name associated to this guest. |
customFields |
(optional) An array of additional fields stored as key-value pairs ({<key>:<value>}). These are fields customized to a particular account. For example, the room number.
The key is the ID of the custom field. Use GET /customfields or GET /customfields/<shortcode> to lookup configured fields, where shortcode is a human-friendly string used to identify the specific custom field configured for the account. Value is a free-form string value. |
Insert a Keyed Contact: Example
$ curl -i -X POST -HContent-type:application/json --data '{ "foreignId":"abc123", "locationId":"529652b0121d5fa206011a79", "firstname":"Rick", "lastname":"Sanchez", "email":"rs@abc.com", "mobile":"16135551234", "language":"en", "arrivalTime":"2018-02-01T11:00:00.000Z", "departureTime":"2018-02-04T13:15:00.000Z", "checkedInStatus":"false", "vipStatus":"Gold", "groupName":"Rick&Morty", "customFields": [ {"guestID": "188551"}, {"loyalty": "3883882"} ] }' https://sunnyclear.blazeloop.net/api/v1/Contact?authToken=xxxx |
Sample Response
{ "status":"Success", "id":"4f1927a407caf1f0500002733" } |
Update a Keyed Contact: Example
$ curl -i -X POST -HContent-type:application/json --data '{ "foreignId":"abc123", "checkedInStatus":"true", "room":"4101", "mobile":"16135551233" }' https://sunnyclear.blazeloop.net/api/v1/Contact?authToken=xxxx |
Sample Response
{ "status":"Success", "id":"4f1927a407caf1f0500002733" } |
<> ContactEvent
Register an Event for a specific Contact, which will trigger workflow rules such as sending a welcome message. The result of the call will be JSON containing a status.
POST /api/<version>/ContactEvent |
The request body shall be a JSON object containing the following fields (except for version which is in the URL):
Parameter |
Description |
version |
API version, currently v1 |
event |
One of the following: - “checkin” - “checkout” - “roomready” |
One of the following optional fields: |
|
foreignId |
(optional) The foreignId of the existing Contact to be checked-in. |
contactId |
(optional) The ID of the existing Contact to be checked-in. |
contact |
(optional) The Contact. A side-effect of this option will be to update the referenced contact (by foreignID or ID) or create a new contact record based on the Contact details (see <> Contact for definition). |
ContactEvent by Reference: Example
$ curl -i -X POST -HContent-type:application/json --data '{ "event":"checkin", "foreignId":"abc123" }' https://sunnyclear.blazeloop.net/api/v1/ContactEvent?authToken=xxxx
$ curl -i -X POST -HContent-type:application/json --data '{ "Event":"checkout", "contactId":"4f1927a407caf1f0500002733” }' https://sunnyclear.blazeloop.net/api/v1/ContactEvent?authToken=xxxx |
Sample Response
{ "status":"Success" } |
ContactEvent by Inclusion: Example
$ curl -i -X POST -HContent-type:application/json --data '{ "event":"roomready", "foreignId":"abc123", "location":"529652b0121d5fa206011a79", "name":"Rick Sanchez", "email":"rs@abc.com", "mobile":"16135551234", "language":"en", "arrivalTime":"2018-02-01T11:00:00.000Z", "departureTime":"2018-02-04T13:15:00.000Z", "checkedInStatus":"false", "vipStatus":"Gold", "groupName":"Rick&Morty", "customFields": [ {"guestID": "188551"}, {"loyalty": "3883882"} ] }' https://sunnyclear.blazeloop.net/api/v1/ContactEvent?authToken=xxxx
|
Sample Response
{ "status":"Success" } |
Comments
0 comments
Article is closed for comments.