GET/PUT Consents / preferences

Get/put user consent stored in DataCommander

get
User Consents

https://api.commander1.com/engage/user/
This endpoint allows you to get categorie's consent for one specific user
Request
Response
Request
Query Parameters
token
required
string
Security token
user_id
required
string
ID of the user
site
required
integer
ID of the site
Response
200: OK
Consent successfully retrieved.
{
"user_privacy_optin": 1,
"user_privacy_categories": [
"11",
"12",
"13"
]
}
404: Not Found
Could not find a user matching this query.
{
"message": "Person not found"
}

get
Visitor Consents

https://api.commander1.com/v1.0/engage/visitors/
This endpoint allows you to get categorie's consent for one specific visitor
Request
Response
Request
Query Parameters
callback
optional
string
(optional) Callback for jsonp request
token
required
string
Security token
site
required
integer
ID of the site
tcid
optional
string
ID the user (if cookie is not available)
Response
200: OK
Example with optin response
{
"user_privacy_optin": 1,
"user_privacy_categories": [
"11",
"12",
"13"
]
}
202: Accepted
Example with optout response
{
"user_privacy_optin": 0,
"user_privacy_categories": []
}
404: Not Found
{
"message": "visitor not found"
}

put
User

https://api.commander1.com/engage/user/
Insert or update a preference in the database (require to have the DataCommander module activated)
Request
Response
Request
Query Parameters
site
required
string
Id of the site (account)
user_id
required
string
Id of the user. Required if tc_id parameter is not set
tc_id
optional
string
Optional. Cookie id of the user
token
optional
string
Security token
Response
200: OK
{"success":true}

Example Request

PUT

https://api.commander1.com/engage/user/?site=1234&user_id=1234&tc_id=1234&token=WvNIX8955cnZ7WF0f632s0Wb99Ql3rtA

{
"preferences.channel":"email",
"preference.frequency":"30d",
...
}