Skip to content

Guest API: Preferences

The user’s topics and channels, and their consent to offers.

What it doesRoute
Read the user’s consent to offers by pushGET /guest/v1/consent
Set the user’s consent to offers by pushPUT /guest/v1/consent
Read the user’s preferencesGET /guest/v1/preferences
Change the user’s preferencesPUT /guest/v1/preferences
Section titled “Read the user’s consent to offers by push”

GET /guest/v1/consent

Needs: the app key (X-CRM-App-Key) and the signed-in user’s token (Authorization: Bearer …), or their id for an app with unverified sign-in. See From a website or web app.

Answers

StatusBodyMeaning
200ConsentOK
400problemThe request could not be read: the problem names the field.
401problemNo credential, or one that is not right.
403problemRefused: the app is switched off, or this is not allowed.
429problemToo many requests: wait for Retry-After.
Section titled “Set the user’s consent to offers by push”

PUT /guest/v1/consent

Needs: the app key (X-CRM-App-Key) and the signed-in user’s token (Authorization: Bearer …), or their id for an app with unverified sign-in. See From a website or web app.

Body (application/json): ConsentBody

FieldTypeDescription
offers_by_pushbooleanThe guest agreeing to offers by push: a marketing push goes only to a guest who has.

Answers

StatusBodyMeaning
200ConsentOK
400problemThe request could not be read: the problem names the field.
401problemNo credential, or one that is not right.
403problemRefused: the app is switched off, or this is not allowed.
429problemToo many requests: wait for Retry-After.

GET /guest/v1/preferences

The app’s topics, the channels each goes by, and whether the user hears of each by each channel.

Needs: the app key (X-CRM-App-Key) and the signed-in user’s token (Authorization: Bearer …), or their id for an app with unverified sign-in. See From a website or web app.

Answers

StatusBodyMeaning
200PreferencesOK
400problemThe request could not be read: the problem names the field.
401problemNo credential, or one that is not right.
403problemRefused: the app is switched off, or this is not allowed.
429problemToo many requests: wait for Retry-After.

PUT /guest/v1/preferences

Needs: the app key (X-CRM-App-Key) and the signed-in user’s token (Authorization: Bearer …), or their id for an app with unverified sign-in. See From a website or web app.

Body (application/json): PreferencesBody

FieldTypeDescription
all_offboolean
choicesarray of PreferenceChoice
wordingstring

Answers

StatusBodyMeaning
200PreferencesOK
400problemThe request could not be read: the problem names the field.
401problemNo credential, or one that is not right.
403problemRefused: the app is switched off, or this is not allowed.
429problemToo many requests: wait for Retry-After.