┌────────┐ ┌────┐ ┌─────────────────────────────┐ ┌──────────────────────────┐ │Customer│ │SFMC│ │Customer Authorization Server│ │Customer Callback Endpoint│ └───┬────┘ └─┬──┘ └──────────────┬──────────────┘ └────────────┬─────────────┘ │ │ │ │ │ ╔════╧═══════════════════════════════════════╧════╗ │ ═════════════════════════════╪════════════════════════════════════════════════╣ Customer Setup: Create ENS Callback Auth Scheme ╠═════════════════════════════════╪════════════════════════════════════════════ │ ╚════╤═══════════════════════════════════════╤════╝ │ │ │ │ │ ╔════════════════════════╗│ │ │ │ ║**Customer to supply** ░║│ │ │ │ ║authType ║│ │ │ │ ║grantType ║│ 𝟏 POST /ens-authentications ┌┴┐ │ │ ║authEndpoint ║│ ──────────────────────────────────────────────────>│ │ │ │ ║clientId ║│ │ │ │ │ ║clientSecret ║│ │ │ │ │ ║username ║│ │ │ │ │ ║password ║│ │ │ │ │ ╚════════════════════════╝│ │ │ │ │ │ │ │𝟐 POST $authEndpoint eg /oauth/token ┌┴┐ ╔══════════════════════╗ │ │ │ │ ──────────────────────────────────> │ │ ║get token validation ░║ │ │ │ │ └┬┘ ╚══════════════════════╝ │ │ │ │ 𝟑 200 ok │ │ │ │ │ <─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ │ │ │ └┬┘ │ │ ╔═════════════════════════╗│ 𝟒 201 Created │ │ │ ║**Customer to capture** ░║│ <─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ │ │ ║authId ║│ │ │ │ ╚═════════════════════════╝│ │ │ │ │ │ │ │ │ │╔═════════════════════════════════════╗│ │ ═════════════════════════════╪═════════════════════════════════════════════════════╪╣ Customer Setup: Create ENS Callback ╠╪══════════════════════════════════════╪════════════════════════════════════════════ │ │╚═════════════════════════════════════╝│ │ │ │ │ │ ╔════════════════════════╗│ │ │ │ ║**Customer to supply** ░║│ 𝟓 POST /ens-callbacks ┌┴┐ │ │ ║url (aka callbackUrl) ║│ ──────────────────────────────────────────────────>│ │ │ │ ║authId ║│ │ │ │ │ ╚════════════════════════╝│ │ │ │ │ │ │ │ 𝟔 POST https:${callbackUrl} w/ verification key ┌┴┐ ╔═════════════════════════╗ │ │ │ ──────────────────────────────────────────────────────────────────────────>│ │ ║**Customer to capture** ░║ │ │ │ │ └┬┘ ║verificationKey ║ │ │ │ │ │ ╚═════════════════════════╝ │ │ │ 𝟕 200 ok │ │ │ │ <─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─│ │ └┬┘ │ │ ╔═════════════════════════╗│ 𝟖 201 Created │ │ │ ║**Customer to capture** ░║│ <─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ │ │ ║callbackId ║│ │ │ │ ╚═════════════════════════╝│ │ │ │ │ │ │ │ │ │╔═════════════════════════════════════╗│ │ ═════════════════════════════╪═════════════════════════════════════════════════════╪╣ Customer Setup: Verify ENS Callback ╠╪══════════════════════════════════════╪════════════════════════════════════════════ │ │╚═════════════════════════════════════╝│ │ │ │ │ │ ╔════════════════════════╗│ 𝟗 POST /ens-verify w/ verification key ┌┴┐ │ │ ║**Customer to supply** ░║│ ──────────────────────────────────────────────────>│ │ │ │ ║verificationKey ║│ └┬┘ │ │ ╚════════════════════════╝│ │ │ │ │ 𝟏𝟎 200 ok │ │ │ │ <─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ │ │ │ │ │ │ │ │ │ │ │ ╔╧═══════════════════════════════════════╧╗ │ ═════════════════════════════╪════════════════════════════════════════════════════╣ Customer Setup: Create ENS Subscription ╠═════════════════════════════════════╪════════════════════════════════════════════ │ ╚╤═══════════════════════════════════════╤╝ │ │ │ │ │ ╔════════════════════════╗│ │ │ │ ║**Customer to supply** ░║│ │ │ │ ║eventCategoryTypes ║│ 𝟏𝟏 POST /ens-subscriptions ┌┴┐ │ │ ║callbackId ║│ ──────────────────────────────────────────────────>│ │ │ │ ║ ║│ │ │ │ │ ║ ║│ │ │ │ │ ╚════════════════════════╝│ └┬┘ │ │ │ 𝟏𝟐 201 created │ │ │ │ <─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ │ │ │ │ │ │ │ │ │ │ │ │ ╔════════════════════════════╗ │ │ ═════════════════════════════╪═════════════════════════════════════════════════════╪════╣ SFMC ENS Stream Processing ╠═════╪══════════════════════════════════════╪════════════════════════════════════════════ │ │ ╚════════════════════════════╝ │ │ │ │ │ │ │ │ 𝟏𝟑 POST https:$callbackUrl w/ bearer access_token ┌┴┐ │ │ ───────────────────────────────────────────────────────────────────────────>│ │ │ │ │ │ │ │ │ │ │ │ │ ╔══════╤══════════════╪═══════════════════════════════════════╪═════════════════════════════════════╪═╪════════════════════════════════╗ │ ║ ALT │ 200 ok │ │ │ │ ║ │ ╟──────┘ │ │ │ │ ║ │ ║ │ 𝟏𝟒 ENS webhook request authorized and events received │ │ ║ │ ║ │ <─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─│ │ ║ │ ╠═════════════════════╪═══════════════════════════════════════╪═════════════════════════════════════╪═╪════════════════════════════════╣ │ ║ [400 or 401 token expired] │ │ │ ║ │ ║ │ 𝟏𝟓 400 or 401 e.g. Token Expired │ │ ║ │ ║ │ <─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─│ │ ║ │ ║ │ │ │ │ ║ │ ║ │ │ │ │ ║ │ ║ ╔═══════════╪══════════════╤════════════════════════╪═════════════════════════════════════╪═╪══════════════════════╗ ║ │ ║ ║ GET NEW TOKEN AND RETRY │ │ │ │ ║ ║ │ ║ ╟────────────𝟏𝟔 POST $authEndpoint eg /oauth/token ┌┴┐ │ │ ║ ║ │ ║ ║ │ ────────────────────────────────────>│ │ │ │ ║ ║ │ ║ ║ │ └┬┘ │ │ ║ ║ │ ║ ║ │ 𝟏𝟕 200 ok │ │ │ ║ ║ │ ║ ║ │ <─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─│ │ │ ║ ║ │ ║ ║ │ │ │ │ ║ ║ │ ║ ║ │ 𝟏𝟖 POST https:$callbackUrl w/ bearer access_token │ │ ║ ║ │ ║ ║ │ ───────────────────────────────────────────────────────────────────────────>│ │ ║ ║ │ ║ ║ │ │ └┬┘ ║ ║ │ ║ ║ │ 𝟏𝟗 ENS webhook request authorized and events received │ ║ ║ │ ║ ║ │ <─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ║ ║ │ ║ ╚═══════════╪═══════════════════════════════════════╪══════════════════════════════════════╪═══════════════════════╝ ║ │ ╚═════════════════════╪═══════════════════════════════════════╪══════════════════════════════════════╪═════════════════════════════════╝ │ │ │ │ │ │ │ │ │ ╔══════════╧═══════════════════════════════════════╧══════════╗ │ ═════════════════════════════╪══════════════════════════════════════════╣ Customer Maintenance: Update ENS Callback Auth Password/JWT ╠═══════════════════════════╪════════════════════════════════════════════ │ ╚══════════╤═══════════════════════════════════════╤══════════╝ │ │ │ │ │ │𝟐𝟎 PUT /ens-authentications w/ updates like password┌┴┐ │ │ │ ──────────────────────────────────────────────────>│ │ │ │ │ └┬┘ │ │ │ 𝟐𝟏 200 ok │ │ │ │ <─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ │ │ ┌───┴────┐ ┌─┴──┐ ┌──────────────┴──────────────┐ ┌────────────┴─────────────┐ │Customer│ │SFMC│ │Customer Authorization Server│ │Customer Callback Endpoint│ └────────┘ └────┘ └─────────────────────────────┘ └──────────────────────────┘