All the methods and filters available for working with contacts are available here.
In this article we focus on the following:
- GET: Query of data from one or more consent
- POST: Creating a newconsent
Parameter table:
| | | |
| | | |
| | | Type of consent:. - T= Terms and Conditions
- C= Commercial communications
- P=Com. custom commercial
|
| | | Status of consent: - 0= Does not accept
- 1= Accepts
|
| | | Origin of contact. - 1 = Web booking
- 2 = Wifi form
- 3 = Guest Portal
- 5 = Pms
- 6 = Import
- 8 = Contact form
|
| | | |
| | | Type of opt in: - S= Simple opt in
- D=Double opt in
- P= Double opt in pending
|
| Datetime Yyy-mm-ddthh:mm:ss
| | |
| | | |
Examples:
Here are some examples of creating and listing consent.
Request (POST)):
Creating a consent to 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: An example is added below.
- { {
- "contact":1160282828,
- "subscription_type":"C",
- "change_type":1 1 1,
- "source":0
- }
Answer:
In case of a 200 or 201 response, the following JSON is received:
- { {
- "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":1160282828
- }
Request (GET):
We list the consent of a contact
Protocol: http/1.1
Method: get
Host/endpoint: https://app.hoteldatahub.io/api/v1/consents?contact=1160282828
Headers:
- Content-type: application/json
- Authorization: Token xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
QUERY: it is mandatory to send the contact ID via the "contact" attribute
Answer:
In case of a 200 or 201 response, the following JSON is received:
- { {
- "count":1 1 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":1160282828
- }
- ],
- }
Request (GET):
We obtain a consent for your ID
Protocol: http/1.1
Method: get
Host/endpoint:https://app.hoteldatahub.io/api/v1/consents/
Headers:
- Content-type: application/json
- Authorization: Token xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Answer:
In the event of a 200 or 201 response, the following json is received:
- { {
- "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":1160282828
- }