OVERVIEW
This service should be used by a Partner to retrieve personal (name, email,...) and loyalty (loyalty card number, point balance,...) Customers information.
In order to retrieve Customer information, you just have to follow 2 steps :
- The Customer has to be authenticated (see Authentication API)
- Use the authentication token to retrieve Customer information
REQUEST
Type | Endpoint |
---|---|
GET | /customer/v1/contacts/me |
HEADER
Type | Description | Mandatory | Example |
---|---|---|---|
Authorization |
Bearer token. See access token on Authentication API | Y | |
x-traceid |
use a recognizable, unique id from your own system - for debugging purposes |
Y |
$sessionId |
x-origin |
use a recognizable, unique name - for debugging purposes |
Y | PartnerName.com |
apikey |
apikey given by Accor |
Y |
PARAMETERS
Name | Type | Description | Mandatory | Example |
---|---|---|---|---|
geocoding |
query |
Country codes and State codes will be returned in ISO or GEO format |
N | ISO/GEO |
language |
query |
labels will be returned in the specified languages |
N | es |
delegate |
query |
default : false |
N | true |
reachableFilter |
query |
default : false |
N | false |
oldPref |
query |
default : false |
N | true |
filter |
query |
See Filters section below |
N | - |
fields |
query |
See Masks section below |
N | - |
FILTERS
Filters can be used when retrieving contacts to eliminate certain values within lists.
Example : if a contact has multiple newletter subscriptions, a filter can allow you to only retrieve the ones that are optin.
Therefore, you don't need to apply this filter on the client side.
Difference with the search option : While the search option is used to retrieve a specific contact, the filter option will filter the output of an already retrieved contact, based on the filter conditions described below.
Note : Filters can optionnaly be used conjointly with the search feature but it is not recommanded for performance reasons. For this use case, it is recommanded to first search the contact, and once a specific contact has been found, call getContactTraveler once again to filter on the desired objects.
Filter playground :
Description | Filter |
---|---|
In the list of loyalty and subscription cards, I want to only retrieve the last active cards |
loyalty.loyaltyCards.card:isLastActiveCard=true; loyalty.subscriptionCards.card:isLastActiveCard=true |
In the list of awards, I want to only retrieve the ones with a status that starts with "REDEEM", ie: REDEEMABLE or REDEEMED | loyalty.awardTypes.awardType.awards.award:status=REDEEM.* |
In the list of awards, I want to only retrieve the ones with a status that starts with "REDEEMED" OR "BOOKED" but only if it's not the FIRST award | loyalty.awardTypes.awardType.awards.award:(status=REDEEMABLE)|(status=BOOKED+awardId!=.*FIRST) |
In the list of subscriptions, I want to only retrieve the ones that are optin | individual.individualSubscriptions.individualSubscription:optin=true |
I want to combine those 2 filters | loyalty.awardTypes.awardType.awards.award:(status=REDEEMABLE)|(status=BOOKED+awardId!=.*FIRST);individual.individualSubscriptions.individualSubscription:optin=true |
In the list of loyalty cards, i only want to retrieve the active one at a specific date | loyalty.loyaltyCards.card:(beginDate=<2019-05-28+endDate>2019-05-28) |
In the list of preferences, i only want to retrieve the preferences which where created by a specific hotel, or, if the preference is not specific to any hotel, it needs to be defined for the brand of the hotel | individual.individualPreferenceFamilies.individualPreferenceFamily.individualPreferences.individualPreference:(preferenceValues.preferenceValue.brandSegment.brands.code[=]IBI+preferenceValues.preferenceValue.nature=Non Specifique Hotel)|preferenceValues.preferenceValue.createdByHotelCode=A316|preferenceValues.preferenceValue.favoriteHotels.favoriteHotel.hotelCode[=]A316 |
Filters detailed specifications
URL parameter :
filter
Global syntax :
filter=
List_To_Filter_1 : Criteria_A Comparison_Operator Filtered_Value_A
[ Logical_Operator Criteria_B Comparison_Operator Filtered_Value_B ]
[ ; List_to_filter_2 : Criteria_C Comparison_Operator Filtered_Value_C ]
...
with :
- ":" seperator between the list to filter and the criterias to be compared with primitive values
(booleans, strings, dates, integers) - ";" seperator between several filters. Each filter can only apply to one list.
List_To_Filter
You can apply a filter on any list of the getContactTraveler's output as long as it is a list [].
To specify the list, simply follow its path in the output json.
Examples :
List to filter | Syntax |
---|---|
Loyalty Awards | loyalty.awardTypes.awardType.awards.award |
Individual Subscriptions (Subscribed Newsletters) |
individual.individualSubscriptions.individualSubscription |
Individual Preferences | individual.individualPreferenceFamilies.individualPreferenceFamily.individualPreferences.individualPreference |
note : the syntax for specifying the list is case insensitive.
Criteria
The attribute in the list on which you want to apply the filter.
It can be at any level down the list, just use the dot "." notation to go down any level (object or list)
Examples :
- loyalty.awardTypes.awardType.awards.award:status
- individual.individualSubscriptions.individualSubscription:optin
Comparison_Operator
The operator to compare the list's attribute with a primitive value within the list (or sub-object/list).
supported values :
- boolean
- string
- date
- integer
- [null]
- [empty]
Note : the compared value can be in a nested object or a nested list.
in the specific case of a list, the compared value needs to be suffixed with {}
Available operators :
Operator | Description |
---|---|
= | Equality operator - can be used with .* as a wildcard if comparing with a string |
!= | Inequality operator - can be used with .* as a wildcard if comparing with a string If comparing to a nested list, will be true if the compared value is not within the list |
< | Inferiority operator - for dates and numbers only |
=< | Inferiority or equality operator - for dates and numbers only |
> | Superiority operator - for dates and numbers only |
>= | Superiority or equality operator - for dates and numbers only |
[=] | Inclusion operator - can be used with .* as a wildcard if comparing with a string to use when the Criteria is within a list inside the List_To_Filter, will return only results which contain the Criteria within the nested list |
[!=] | Exclusion operator - can be used with .* as a wildcard if comparing with a string to use when the Criteria is within a list inside the List_To_Filter, will return only results which do not contain the Criteria within the nested list (empty lists will be matched) |
Logical_Operator
The operator to compare logically with multiple criterias within the same list.
Available operators :
Operator | Description |
---|---|
( | start of a comparison of a criteria |
) | end of a comparison of a criteria |
| | logical operator "OR" between groups of criterias |
+ | logical operator "AND" between groups of criterias. Beware : the "+" sign needs to be url_encoded (or just use "%2B" instead) |
^ | logical operator "XOR" between groups of criterias |
URI encode
It is recommended to apply a "URI encode" function to the filter parameter before sending the request. Otherwise, some characters, such as "+" won't work.
MASKS
Masks can be used to show or exclude the desired objects from the getContactTraveler's output.
URL parameter : fields
For a complete documentation of all possibilities, visit squiggly's documentation
Mask playground :
Description | Mask |
---|---|
** | Retrieve All Fields |
loyalty.loyaltyCards,loyalty.subscriptionCards | Retrieve Loyalty and subscription cards Only |
**,-contactMediums | Retrieve everything except contactMediums |
EXAMPLE REQUEST
curl --location --request GET 'https://rec-api.accor.com/customer/v1/contacts/me' \
--header 'apikey: $APIKEY$' \
--header 'x-origin: BOOKING_FUNNEL' \
--header 'x-traceid: 51061e39-f563-4c7e-bf2d-38e7489e4a2f' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer eyJhbGciOiJSUzI1NiIsImtpZCI6IkJnUUNMOUhhU3FHU0liMURRRUJBUVVBTUlHZk1BMEdDQTJHTkFEQ0JpUUsiLCJwaS5hdG0iOiJ2aWk0In0.eyJzY3AiOiIiLCJjbGllbnRJZCI6IndjYy5hY2NvciIsInBtaWQiOiIyMDI3MDM3QSIsImNvbnRhY3RJZCI6IjEwMDAwMTEyMDQxMzExMiIsInRva2VuX3VzZSI6ImFjY2VzcyIsImV4cCI6MTYxNDk2NzA0OX0.QOT7UHswKHuGZoPbyR_1AkQYvLWie3f5yPPWvG9zMDlsuE05pCqN2-VY3B4Ku3CWXRr37Kg_7Fm1Nk6y42lPPkKCVuQ4EImUyiYzFPcF5ctSZiJV3HrsCryOj4MPVy8KRMbGx8mtyntEozJG5eEPQ-9CODC74nlc59PppKQ7g_H6losvJnR8QEE5otwiP-CtY1ZX00mOaeZNHSt9FKkKA2WB9_M1s5-CpaQSYoQNyJGndb6BahtJXQB6aIXcMt8io0aOkXRSMC7nebxirzpWBjkFVhm9b-U4J4LCsZYfZ7L-5FQ1VMg4uk5c6xqHsk988OI8QfW94KdVtFnMFrYQFg'
EXAMPLE RESPONSE
{
"id": "100001120413112",
"internalId": "",
"creationDate": "2021-03-05T17:27:03Z",
"creationSourceSystem": "150",
"status": "Active",
"partyType": "Individual",
"externalSystems": {
"externalSystem": [
{
"systemCode": "10",
"externalId": "2-1I0QRMX",
"updateDate": "2021-03-05T17:27:04Z"
}
]
},
"individual": {
"pmid": "2027037A",
"uaUserId": "1c58fe8c26e123d44850f66e07cf25e868fe5512c62b0f08004c8031c19cb728",
"gender": "",
"birthDate": "1901-01-01",
"placeOfBirth": "",
"nationality": "",
"jobTitle": "",
"vipCode": "",
"language": "pt-br",
"isConcur": false,
"registrationChannel": "WEB",
"isReachable": true,
"isRelevant": false,
"individualSubscriptions": {
"individualSubscription": []
},
"individualName": {
"title": "",
"civility": "MR",
"lastName": "Golding",
"firstName": "Pierre",
"middleName": "",
"suffix": ""
},
"individualLegalIdentifications": {},
"optOut": {
"isOptOutTotal": false
},
"hasWallet": false,
"isLoyaltyMember": false,
"hasLoyaltyCard": false,
"hasSubscriptionCard": false,
"isMerged": false,
"hasSegment": false,
"hasPassword": true,
"hasPreference": false,
"hasBooking": false,
"hasBrandFavorite": false,
"hasDestinationFavorite": false,
"hasHotelFavorite": false,
"mustUpdatePassword": false,
"isHighValueContact": false
},
"contactMediums": {
"contactMedium": [
{
"id": "100001120413107",
"isOptOut": false,
"isNpai": false,
"status": "",
"rnvpType": "ORIGINAL",
"isQualified": false,
"contextType": "1",
"mediumUsages": {
"mediumUsage": [
{
"isOptOut": false,
"usageType": "Communication"
}
]
},
"postalAddress": {
"address1": "4 RUE DE PARIS",
"address2": "",
"address3": "",
"address4": "",
"zipCode": "75004",
"zipCodeExtension": "",
"city": "GIBRALTARR",
"countryCode": "BR",
"isPrimary": true,
"isAsBilling": false,
"intraCommunityVat": ""
}
},
{
"id": "100001120413110",
"isOptOut": false,
"isNpai": false,
"contextType": "Professional",
"mediumUsages": {
"mediumUsage": [
{
"isOptOut": false,
"usageType": "Communication"
}
]
},
"emailContact": {
"email": "pg4-wcc-set-7700612363@yopmail.com",
"isPrimary": false,
"emailRequested": {
"status": ""
}
}
},
{
"id": "100001120413109",
"isOptOut": false,
"isNpai": false,
"contextType": "Personal",
"mediumUsages": {
"mediumUsage": [
{
"isOptOut": false,
"usageType": "Communication"
}
]
},
"emailContact": {
"email": "pg4-wcc-0723350158@yopmail.com",
"isPrimary": true,
"emailRequested": {
"status": ""
}
}
},
{
"id": "100001120413108",
"isOptOut": false,
"isNpai": false,
"status": "",
"contextType": "Professional",
"mediumUsages": {
"mediumUsage": [
{
"isOptOut": false,
"usageType": "Cell"
}
]
},
"telephoneNumber": {
"isPrimary": true,
"phoneNumber": "618674280",
"phonePrefix": "33",
"phoneType": "Professional",
"phoneExtension": ""
}
}
]
}
}
RESPONSE FORMAT
Please refer to Customer Canonical Format.
ERRORS
error Code |
http Status |
Message | description | subSystem ErrorCode |
comment |
---|---|---|---|---|---|
9999 | 500 | WCC_TECHNICAL_ERROR | -unpredictable- | N/A | Happens when WCC has an unexpected failure (usually a null pointer exception). Contact WCC team if you experience this type of issue. |
1111 | 404 | CONTACT_NOT_FOUND_IN_MDM | Contact not found in MDM | 8 | Contact was not found in ACCOR's customer referential (MDM) |