All the methods and filters available for working with contacts can be consulted here.
In this article we focus on the following:
- GET: Query of data from one or more contacts
- POST: Creating a new contact
- PATCH: Updating the data of an existing contact
Parameter table:
| | | |
| | | Contact email, single field, used as a contact identifier. |
| | | Status of the email. - 0= New
- 1= Valid
- 2= Verified
- 3= Bounced
- 4= Hard bounced
|
| | | Two options: - Identifier of the label already created.
- Name of the label. The system creates it if there is none with that name
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | Gender: - 0 = not specified (default)
- 1 = man
- 2 = woman
- 3 =non-binary
- 4 = gfluid
- 5 = prefers not to say so
|
language language language | | | |
| | | Two options: - Identifier of the province already created.
- Name of province. The system creates it if there is none with that name
|
| | | Two options: - Identifier of the city already created.
- Name of the city. The system creates it if there is none with that name
|
| | | Two options: - Identifier of the area already created.
- Name of the area. The system creates it if there is none with that name
|
| | | |
| | | |
| | | |
| | | Origin of contact. - 0 = Pms
- 1 = Wifi Login
- 2 = Facebook
- 3 = Web or Booking Engine
- 4 = Other
- 5 = Importation
- 6 = Form Newsletter
- 7 = Contact form
- 8 = Guest Portal
- 9 = Pre-Checkin
- 10 = Chatbot
- 11 = Concierge
- 12 = Call Center
|
| | | |
| | | |
| | | |
| | | |
| | | |
identification_document_type | | | Type of identity card. - 0= Other
- 1= Id
- 2= Nie
- 3= Passport
|
| | | Identity document number. |
| | | Indicates whether the contact is subscribed to receive mailing. - True = Subscribed
- False = Not subscribed (default)
|
| | | Indicates whether the contact has been deleted from Fideltour's DB. |
| | | Reason for subscription. - 1 = Incorrect email address
- 2 = Own request (Contact)
- 3 = Manager's request (Account)
|
Examples:
Here are some examples of creating, updating and viewing contacts.
Petition (POST-PATCH):
The following example shows a request to register (POST) or update (PATCH) the contactpablo@hdh.com.
Protocol: Http/1.1
Method: Post/Patch
Host/endpoint: https://app.hoteldatahub.io/api/v1/contacts/
Headers:
- Content-type: application/json
- Authorization: Token xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
BODY: An example is added below.
- { {
- "email":"pablo@hdh.com",
- "email_status":0,
- "birthday":"1976-04-18",
- "phone1":"651442233",
- "phone2":"12323",
- "gender":2,
- "address":"Calle the olive trees",
- "province":"Madrid",
- "town":"Madrid",
- "zone":"Sun",
- "post_code":"28013",
- "language":"Es",
- "country":"Es",
- "name":"Pablo",
- "surname":"Look",
- "identification_document_type":1 1 1,
- "identification_number":"01234567Z",
- "source":1 1 1,
- "notes":"Very demanding",
- "work_place":"Palma",
- "bussiness_name":"Customia",
- "bussiness_address":"Street of industrial solutions 25",
- "Fiscal_address":"Street of industrial solutions 25",
- "custom_tags":[ [ [" VIP client","Tourist"],
- "subscribed":false,
- "is_active":true
- }
Note: true and false Boolean values can also be sent as Integers 1 and 0.
Answer (POST/PATCH):
In casa of a 200 or 201 response, JSON received has the following structure
- { {
- "id":9999999,
- "business_name":null,
- "work_place":"Madrid",
- "business_address":null,
- "Fiscal_address":"Street of industrial solutions 25",
- "language":"Es",
- "country":"Es",
- "created_at":"2022-01-01T12:12:12.654321",
- "level_name":"",
- "loyalty_card_number":null,
- "name":"Pablo",
- "surname":"Look",
- "email":"pablo@hdh.com",
- "email_status":0,
- "phone1":"651442233",
- "phone2":"12323",
- "gender":2,
- "identification_document_type":1 1 1,
- "identification_number":"01234567Z",
- "birthday":"1976-04-18",
- "address":"Calle the olive trees",
- "post_code":"07006",
- "source":1 1 1,
- "notes":"Very demanding",
- "photo":null,
- "subscribed":false,
- "unsubscribe_reason":null,
- "date_subscribed":"2022-01-01T12:12:12.654321",
- "modification_date_subscribed":null,
- "is_active":true,
- "points":0,
- "value":0,
- "review":null,
- "total_bookings":0,
- "level_points":0,
- "loyalty_custom_tag_timestamp":null,
- "is_profile_completed":false,
- "last_level_review":null,
- "kicked_out_loyalty":null,
- "province":1 1 1,
- "town":2,
- "zone":3,
- "level":null,
- "custom_tags":[ [ [4,5],
- "hotels":[]
- }
Request (GET):
The GET method allows the following:
Protocol: http/1.1
Method: get
Host/endpoint: https://app.hoteldatahub.io/api/v1/contacts/?email__iexact=pablo@hdh.com
Headers:
- Authorization: Token xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Body:In this case, as a GET-type method, we do not include data in the body of the request, as they are included in the URL.
Answer (GET):