NUTRINTG WayIn
General flow:
Maintenance:
New ASC naming policy [for STAGE and PROD]:
ASC = 3-letter country ISO code + 3-letter brandcode + CHEETAH + #### (increasing number)
Example:
Brand: Durex
Country Poland
ASC for Cheetah (previously WayIn) first campaign: POLDURCHEETAH0001
ASC for Cheetah (previously WayIn) second campaign: POLDURCHEETAH0002
Mapping values policy:
Accept-language: According to the country / language
Brand-org-code: RB + 3-letter ISO country code + 3-letter brandcode, example: RBPOLDUR
Program-code: exaclty as Brand-Org-Code
Sourcecode: Brand-Org-Code + “WEB”, example: RBPOLDURWEB
TierCode: Brand-Org-Code + “TIER1”, example: RBPOLDURTIER1
Account-source: according to above
General info:
WayIn sends profile data to CDS via WayIn webhook
WayIn sends only registration profiles (there is no update, orders, etc)
WayIn payload structure is mostly constant, with exception of the “data” section which will be custom for each campaign:
{
"entryId": "b96f651c-d2e0-47f1-9b23-bac64bfeebb9",
"accountId": 6945,
" [...]
"entryType": "standard",
"mode": "stage",
"data": {
"firstname": "Gurdeep",
"lastname": "Rooprai",
"email": "grooprai@gmail.com",
[...]
WayIn webhook documentation:
Authentication and security:
Basic - WayIn will pass a username and password in a basic format
IP whitelisting, since the authentication is poor, we will whitelist WayIn IP for that service
HTTPS only
Endpoint:
No schema validation on the endpoint required
Endpoint proposition:
Production Service URL: https://api.cdp-rb.com/agencies/wayin/profile
UAT Service URL: https://api.cdp-rb.com/test/agencies/wayin/profile
3. Extract agreements:
WayIn sends URLs to download the file from LDS as lds_url_01 / lds_url_02 / …
"lds_url_01": "http://digital-lds-application-web-production.frankfurt.rbdigitalcloud.com/r/download/ST-O-BR-pt-Finish-Contest_Rules/body/5aafa29c5348d40001fb99ca?bodyContentType=pdf", "lds_url_01_ConsentAccepted": true, "lds_url_01_MandatoryInd":true, "lds_url_01_ConsentDesc":"example description"
WayIn should always send URLs in exactly the same way
From each URL service needs to extract the data so that later on they will be put to the proper CDP request structure
URL example:
http//digital-lds-application-web-production.frankfurt.rbdigitalcloud.com/r/download/ST-O-BR-pt-Finish-Contest_Rules/body/5aafa29c5348d40001fb99ca?bodyContentType=pdf
green – LDS document BusinessId
blue – LDS document revisionId
The URL structure is always: […]/download/XX-YY-ZZ-vv-Qqqq[...]-rrrrrr[...]/body…
More details about businessId: https://rb-digital.atlassian.net/wiki/spaces/DCP/pages/704937993
4. Extract headers:
Based on the AccountSourceCode (sent in “data” section):
Get a mapping of Metadata (headers) from … (MongoDB?)
5. Rearrange request
a. Append headers accordingly to the mapping:
Accept-language
Brand-org-code
Program-code
Sourcecode
Account-source
b. Map Country ISO codes
The LDS country code is 2-letters and MW needs to have 3-letter ISO code. The mapping of country codes in the mapping file below
c. Map Payload:
All data from “data” section will go to the unmapped attributes section
Excel file with mapping attached:
If “
addSubscription
“ field is sent with value “true”, then to profile payload is added ProfileSubscriptions object. The fields and their values are kept in DB or hardcoded. There can be one subscription per one Account Source. Available subscription ChannelCodes are: ‘DM’ and ‘EM’. In order to integrate new Accoutn Source from Wayin, we need to know if the subscription is allowed and got all details: subscriptionId and channel codeNotice:
Some fields are mapped from WayIn original payload
Some need to be extra added by the service
Sending data to the router
6. Ready payload should be sent to the CDP-PROFILE_SERVICE
Integration should be done via internal network so that no authorization to CDP-PROFILE-SERVICE is required
--------------------------------------------------------------------------
Other tasks to be created:
Configure the router to send data to CDS
Test data:
Example payload from WayIn:
{
"entryId": "b96f651c-d2e0-47f1-9b23-bac64bfeebb9",
"accountId": 6945,
"accountName": "Reckitt Benckiser: Finish Brazil",
"campaignId": 128175,
"campaignName": "Water Saving Day Registration",
"externalRef": "Finish_Brazil",
"userId": "01af614851f2acf336695a321079b2af",
"sourceUserId": "",
"firstname": "Gurdeep",
"lastname": "Rooprai",
"email": "grooprai@gmail.com",
"dateEntered": "2018-03-19 14:51:23",
"dateCreated": "2018-03-19 14:51:23",
"timeZone": "America/Argentina/Buenos_Aires",
"source": "web",
"medium": "direct",
"channel": "website",
"network": "web",
"optin": true,
"eventType": "registration",
"entryType": "standard",
"mode": "stage",
"addSubscription": "true",
"data": {
"AccountSourceCode":"TestAccountsourceCode",
"firstname": "Gurdeep",
"lastname": "Rooprai",
"email": "grooprai@gmail.com",
"sourceUserId": "",
"sourceUserName": "",
"sourceUserAvatar": "",
"sourceUserLink": "",
"ugcOriginLink": "",
"ugcImage": "",
"ugcThumbnail": "",
"ugcComment": "",
"quizScore": "",
"quizCategory": "",
"couponCode": "",
"brandOptIn": false,
"groupOptIn": false,
"thirdPartyOptIn": false,
"termsAndConditions": true,
"address_Address1": "Rua General Osório",
"address_Address2": "Centro",
"address_City": "Campinas",
"address_State": "SP",
"address_Zip": "13010-111",
"ApartamentoCasa": "Casa",
"CPF": "32536616878",
"lds_url_01": "http://digital-lds-application-web-production.frankfurt.rbdigitalcloud.com/r/download/ST-O-BR-pt-Finish-Contest_Rules/body/5aafa29c5348d40001fb99ca?bodyContentType=pdf",
"lds_url_01_ConsentAccepted": true,
"lds_url_01_MandatoryInd":true,
"lds_url_01_ConsentDesc":"example description"
},
"request": {
"ip": "80.87.30.98",
"userAgent": ""
}
}