Consents
Table of contents¶
Introduction¶
This article covers the API requests related to the mandatory consents under data protection regulations (GDPR), and how to manage them on contacts.
- Create consents for a contact
- List and filter consents for one or more contacts
A consent is understood as: a granted permission, accepted terms or communications, or other similar concepts, where the guest decides whether to authorize the company to send them communications.
Fideltour supports the following consents:
- Terms and conditions (
T) - Marketing communications (
C) - Personalized marketing communications (
P) - WhatsApp marketing communications (
WC) - WhatsApp enabled (
WE) - SMS marketing communications (
SC)
Endpoint: https://app.hoteldatahub.io/api/v1/consents/
Swagger documentation: https://app.hoteldatahub.io/swagger/#/consents
Use cases¶
This endpoint is necessary to comply with GDPR and to manage the different types of consent for contacts in Fideltour. The consent management endpoint requires contacts to already exist, and lets you query and add new consents to your contacts.
Important: A consent is always associated with a contact.
It's important to comply with GDPR, so whenever you have the information or data indicating whether a contact has accepted or declined one of the consents listed above, you should add the appropriate consent to the contact.
This way, you ensure that the customer stays GDPR-compliant while using Fideltour, and that communications aren't sent to contacts who haven't authorized them.
Available methods¶
All the methods and filters available for working with contacts can be found in the Swagger documentation. This article focuses on the following:
- GET: Retrieve data for one or more consents
- POST: Create a new consent
Parameter table¶
| Field | Type | Required | Description |
|---|---|---|---|
contact |
Integer | Yes | Contact ID in Fideltour |
subscription_type |
String | Yes | Consent type: • T = Terms and conditions• C = Marketing communications• P = Personalized marketing communications• WC = WhatsApp marketing communications• WE = WhatsApp enabled• SC = SMS marketing communications |
change_type |
Integer | Yes | Consent status from HDH's perspective: • 1 = Accepts• 0 = Does not accept> Note: the value is inverted internally before being sent to Fideltour. The response returns the value stored in Fideltour (0=accepts, 1=declines), which is the opposite of what was sent. |
source |
Integer | Yes | Consent source: • 1 = Web / Booking Engine• 2 = Wifi Login• 3 = Guest Portal / Concierge• 5 = PMS• 6 = Import• 8 = Form (contact form, newsletter, landing)• 11 = Chatbot• 14 = Other (Call Center, PMS Restaurant, PMS SPA, Intranet) |
unsubscribe_reason |
Integer | No | Unsubscribe reason (when change_type=0):• 1 = Reason 1• 2 = Reason 2• 3 = Reason 3• 4 = Reason 4• 5 = Reason 5 |
ip |
String | No | IP address from which the consent was recorded |
opt_in |
String | No | Opt-in type: • S = Simple opt-in• D = Double opt-in• P = Double opt-in pending |
doble_opt_in_timestamp |
Datetime | No | Double opt-in confirmation date. Format: YYYY-MM-DDTHH:MM:SS |
doble_opt_in_ip |
String | No | Double opt-in confirmation IP |
Examples¶
Below are some examples of creating and listing consents.
Request (POST): Create a consent¶
Create a consent for a Fideltour contact
PROTOCOL: HTTP/1.1
METHOD: POST
HOST/ENDPOINT: https://app.hoteldatahub.io/api/v1/consents/
HEADERS:
Content-type: application/json
Authorization: Token xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
BODY:
{
"contact": 11602828,
"subscription_type": "C",
"change_type": 1,
"source": 1
}
Response:
For a 201 response, you receive the following JSON:
{
"id": 6069294,
"timestamp": "2023-11-13T13:29:15.469910",
"change_type": 0,
"subscription_type": "C",
"unsubscribe_reason": null,
"source": 0,
"ip": null,
"opt_in": "S",
"doble_opt_in_timestamp": null,
"doble_opt_in_ip": null,
"contact": 11602828
}
Request (GET): List a contact's consents¶
List a contact's consents
PROTOCOL: HTTP/1.1
METHOD: GET
HOST/ENDPOINT: https://app.hoteldatahub.io/api/v1/consents/?contact=11602828
HEADERS:
Content-type: application/json
Authorization: Token xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
QUERY: The contact's ID must be sent via query string, using the contact attribute
Response:
For a 200 response, you receive the following JSON:
{
"count": 1,
"next": null,
"previous": null,
"results": [
{
"id": 6069294,
"timestamp": "2023-11-13T13:29:15.469910",
"change_type": 0,
"subscription_type": "C",
"unsubscribe_reason": null,
"source": 0,
"ip": null,
"opt_in": "S",
"doble_opt_in_timestamp": null,
"doble_opt_in_ip": null,
"contact": 11602828
}
]
}
Request (GET): Get a consent by ID¶
Get a consent by its ID
PROTOCOL: HTTP/1.1
METHOD: GET
HOST/ENDPOINT: https://app.hoteldatahub.io/api/v1/consents/<consent_id>/
HEADERS:
Content-type: application/json
Authorization: Token xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Response:
For a 200 response, you receive the following JSON:
{
"id": 6069294,
"timestamp": "2023-11-13T13:29:15.469910",
"change_type": 0,
"subscription_type": "C",
"unsubscribe_reason": null,
"source": 0,
"ip": null,
"opt_in": "S",
"doble_opt_in_timestamp": null,
"doble_opt_in_ip": null,
"contact": 11602828
}