Send your first content
Start with a simple letter and the fictional recipient supplied for sandbox.
1. Authentication
Section titled “1. Authentication”Authenticate before making API requests:
BASE64_CREDENTIALS=$(printf '%s' "$KIVRA_CLIENT_ID:$KIVRA_CLIENT_SECRET" | base64)
curl -X POST \ "https://sender.sandbox-api.kivra.com/v1/auth" \ -H "Authorization: Basic $BASE64_CREDENTIALS" \ -H "Content-Type: application/x-www-form-urlencoded" \ -d "grant_type=client_credentials"2. Match the recipient
Section titled “2. Match the recipient”Use recipient matching with the recipient’s SSN, verified email, or VAT number to check that the recipient is eligible to receive content from your tenant. Send content only when the matching response includes the recipient’s identifier.
curl -X POST \ "https://sender.sandbox-api.kivra.com/v2/tenant/$KIVRA_TENANT_KEY/usermatch/ssn" \ -H "Authorization: Bearer $KIVRA_ACCESS_TOKEN" \ -H "Content-Type: application/json" \ -d '{"list":["YYYYMMDDNNNN"]}'3. Send content
Section titled “3. Send content”Create a JSON file with a PDF encoded as Base64:
{ "ssn": "YYYYMMDDNNNN", "subject": "Welcome to Example Energy", "type": "letter", "parts": [ { "name": "welcome-letter.pdf", "content_type": "application/pdf", "data": "BASE64_ENCODED_PDF" } ]}Send it to your sandbox tenant:
curl -X POST \ "https://sender.sandbox-api.kivra.com/v2/tenant/$KIVRA_TENANT_KEY/content" \ -H "Authorization: Bearer $KIVRA_ACCESS_TOKEN" \ -H "Content-Type: application/json" \ --data-binary @first-content.jsonKeep personal and sensitive information out of free-text metadata such as
subject. A successful request does not replace recipient-experience review.
Continue with Review content in sandbox and consult the
Send content API reference for
all supported fields.