Integration guide and sample code
Implementation requirements, OAuth, consent, events, profile reads, and TypeScript, Python, and cURL examples.
What this documentation covers
These guides are written for technical teams preparing an integration review or pilot.SDK and API integration
Implementation requirements, OAuth, consent, events, and sample code.
SDK versus API
Where the SDK adds capability beyond raw HTTP, and when to call the API directly.
Data collection
What the SDK observes, how it is collected, when it is sent, and what never leaves the device.
Outputs
Profiles, claims, and intent scores partners can read today.
Architecture and data flow
End-to-end path from a consumer action to a Swapnice output.
Sandbox and testing
Environments, credentials, and the expected implementation and test process.
Authentication
OAuth 2.1, PKCE, scopes, tokens, and the errors that usually block a first call.
Consent and linking
Partner customer vs Swapnice account, purposes in product language, revocation.
Events and intents
Event catalog, intent ontology, claims vs overwrites, and confidence guidance.
Catalog entries
How SKUs and collectibles become objects intents can attach to.
Example use cases
Worked partner scenarios for personalization, checkout, and catalog flows.
Request walkthrough
Ordered sandbox calls from authorize through profile read and revoke.
What a pilot enables
What integrating the SDK unlocks in the partner product.
API reference
OpenAPI playground for every Partner API route.
How the product is structured
1
Connect and consent
The partner creates a customer record, starts a connection session, and records a consent receipt for specific purposes such as
personalization or analytics.2
Ingest events
The SDK or API sends consented activity events. Swapnice accepts them quickly, preserves per-customer order, and archives them asynchronously.
3
Read intelligence
The partner backend reads a resolved profile, underlying claims, and intent scores for that customer and purpose. Reads are synchronous and consent-aware.
What is live in V1
CRUD endpoints are infrastructure. The product partners integrate for is consented profile intelligence: resolved facts, provenance, and intent scores on top of the same event stream.
Implementation requirements
A V1 integration needs:- A confidential partner backend that can store
client_idandclient_secret - HTTPS redirect URIs registered exactly (no production wildcards)
- PKCE (
S256) for authorization-code exchange - An idempotency key on every mutating request
- A consent receipt before events are accepted
- Scopes that match the calls you will make (
events:write,consent:write,profile:read, and so on)
Environments
Sandbox credentials and a test app are issued during onboarding. See sandbox and testing.
Related
- API overview and the generated API reference