mirror of
https://github.com/forcedotcom/afv-library.git
synced 2026-07-30 03:09:50 +08:00
| .. | ||
| .env.example | ||
| README.md | ||
| send-data.py | ||
Ingestion API example
This folder contains a minimal, public-safe example for sending records into Salesforce Data Cloud through the Ingestion API.
What this example assumes
Before running send-data.py, complete the connect/prepare setup steps:
- create an Ingestion API connector
- upload the schema with
sf data360 connection schema-upsert - create the corresponding data stream in the UI if your org requires that step
Related connector definitions live in:
- ../../../data360-connect/examples/connections/ingest-api-connection.json
- ../../../data360-connect/examples/connections/ingest-api-schema.json
Prerequisites
pip install PyJWT cryptography requests
Setup
cd skills/data360-prepare/examples/ingestion-api
cp .env.example .env
# edit .env with your values
python3 send-data.py
Environment variables
CONSUMER_KEY— external client app consumer keyCONSUMER_SECRET— external client app consumer secret if your auth flow needs itSF_USERNAME— Salesforce username used for JWT authSF_LOGIN_URL— login host such ashttps://login.salesforce.comTENANT_URL— Data Cloud tenant URL such ashttps://<tenant>.c360a.salesforce.comPRIVATE_KEY_FILE— path to the JWT private keyCONNECTOR_NAME— Ingestion API connector nameOBJECT_NAME— uploaded schema object name
Notes
- auth is a staged flow: JWT → Salesforce token → Data Cloud token
- the ingestion endpoint uses the Data Cloud tenant URL, not the Salesforce instance URL
202means the payload was accepted for processing- validation failures often appear in the Problem Records DLO family