Create a connected app and authenticate
The Ingestion API is server-to-server, so it authenticates with OAuth through a connected app (a Salesforce record that represents your backend and issues it credentials) rather than a user login. You create the app, trade its credentials for a token in two hops, then send that token on every API call.
Create the connected app
- From Setup, open App Manager and create a New Connected App.
- Turn on Enable OAuth Settings.
- Add the scopes your backend needs:
cdp_ingest_api,api, andrefresh_token/offline_access(see note below for what each covers). - Save, then open the app to copy its Consumer Key and Consumer Secret.
Exchange credentials for a Data Cloud token
Calling the Ingestion API takes two token requests, not one: first you get a standard Salesforce OAuth token for your org, then you exchange that for a Data Cloud-specific token the Ingestion API actually accepts.
- 1 Connected app Consumer Key + Secret
- 2 Org OAuth token JWT bearer grant
- 3 Data Cloud token token exchange (a360)
- 4 Ingestion API call Bearer header
- Request an org access token from your org’s token endpoint (
/services/oauth2/token) using the JWT bearer grant type. - From that response, keep the org
access_tokenandinstance_url. - Send a second request to the Data Cloud token-exchange endpoint (
/services/a360/token), passing the org token as thesubject_token. - From that response, keep the new Data Cloud
access_tokenand tenant-specificinstance_url— this is the token the Ingestion API expects. - Send that Data Cloud token as a
Bearerheader on every Ingestion API request.
Discussion
Comments are not configured for local development. They appear once the site owner connects GitHub Discussions (Giscus).