Creates a confirmed marketing consent with a state
of CONFIRMED
.
Required fields:
details.type
.details.email
OR details.phone
.lastConfirmationActivity
.To create a marketing consent with a different state, use Upsert Marketing Consent, or Bulk Upsert Marketing Consent.
You can only call this method when authenticated as a Wix app or Wix user identity.
Marketing consent to create.
Newly created marketing consent.
Marketing consent confirmation link.
curl -X POST \
'https://www.wixapis.com/marketing-consent/v1/marketing-consent' \
-H 'Authorization: <AUTH>'
--data-binary '{
"marketingConsent": {
"details": {
"type": "PHONE",
"phone": "+19172222222"
},
"lastConfirmationActivity": {
"source": "LINK_CONFIRMATION",
"description": "Law requires double confirmation.",
"optInLevel": "DOUBLE_CONFIRMATION"
}
}
}'
{
"marketingConsent": {
"id": "aa8a62f5-9a79-4b21-b1a4-5c835c08d937",
"revision": "1",
"details": {
"type": "PHONE",
"phone": "+19172222222"
},
"state": "CONFIRMED",
"lastConfirmationActivity": {
"source": "LINK_CONFIRMATION",
"description": "Law requires double confirmation",
"updatedDate": "2023-05-13T00:00:00Z",
"optInLevel": "DOUBLE_CONFIRMATION"
},
"extendedFields": {},
"created_date": "2022-11-16T14:07:50.150Z",
"updated_date": "2022-11-16T14:07:50.150Z"
},
"link": {
"type": "REVOKE_CONFIRMATION",
"url": "https://some-domain/_manage-consent/unsubscribe?token=JWE.eyJhbGciOiJBMTI4S1ciLCJlbmMiOiJBMTI4Q0JDLUhTMjU2Iiwia2lkIjoiZkhJbFA4M1cifQ.RakF3_XlktSPIDsOmq3lt2RsP4PxxXe3UAxQNirF1IWGmrrfgc7jnw.tuqC5Sep852Xuu_P_b8g-w.Ogg8m7mo5Lyg2Ee36xFdoszktS2RrIWq0z1ziW4M_zfx0yDyMcCCiUWScd1tm_BP0xxHtfPw2dInZCFNR2GhhelA5c2Qvlpu8fUZgHg-gnWKvMf_OZDu2GeaRaTJuGOp6T27cF6t9EThyyy1gxsyBiQk_r4tH6WoFcKAJhH1dec7L0L7i3Cu3fQ7frFgbadKX4PYx1-llqaeKVw9gwfQdvI5Aj1n95AMIHfnwZpi1MqU-zPq8xPDU9HSP5ZH1RELmeQJqWbl-n_0Q7NdhO9NQw.h7Wn-AACmFkHIPMDJlJTRQ"
}
}
This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.