Guest API: Preferences
The user’s topics and channels, and their consent to offers.
| What it does | Route |
|---|---|
| Read the user’s consent to offers by push | GET /guest/v1/consent |
| Set the user’s consent to offers by push | PUT /guest/v1/consent |
| Read the user’s preferences | GET /guest/v1/preferences |
| Change the user’s preferences | PUT /guest/v1/preferences |
Read the user’s consent to offers by push
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
| Status | Body | Meaning |
|---|---|---|
| 200 | Consent | OK |
| 400 | problem | The request could not be read: the problem names the field. |
| 401 | problem | No credential, or one that is not right. |
| 403 | problem | Refused: the app is switched off, or this is not allowed. |
| 429 | problem | Too many requests: wait for Retry-After. |
Set the user’s consent to offers by push
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
| Field | Type | Description |
|---|---|---|
offers_by_push | boolean | The guest agreeing to offers by push: a marketing push goes only to a guest who has. |
Answers
| Status | Body | Meaning |
|---|---|---|
| 200 | Consent | OK |
| 400 | problem | The request could not be read: the problem names the field. |
| 401 | problem | No credential, or one that is not right. |
| 403 | problem | Refused: the app is switched off, or this is not allowed. |
| 429 | problem | Too many requests: wait for Retry-After. |
Read the user’s preferences
Section titled “Read the user’s preferences”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
| Status | Body | Meaning |
|---|---|---|
| 200 | Preferences | OK |
| 400 | problem | The request could not be read: the problem names the field. |
| 401 | problem | No credential, or one that is not right. |
| 403 | problem | Refused: the app is switched off, or this is not allowed. |
| 429 | problem | Too many requests: wait for Retry-After. |
Change the user’s preferences
Section titled “Change the user’s preferences”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
| Field | Type | Description |
|---|---|---|
all_off | boolean | |
choices | array of PreferenceChoice | |
wording | string |
Answers
| Status | Body | Meaning |
|---|---|---|
| 200 | Preferences | OK |
| 400 | problem | The request could not be read: the problem names the field. |
| 401 | problem | No credential, or one that is not right. |
| 403 | problem | Refused: the app is switched off, or this is not allowed. |
| 429 | problem | Too many requests: wait for Retry-After. |