Post-Call quickstart

In about 10 minutes you'll go from client_id and client_secret to a SIPREC INVITE landing on your SRS. Sandbox values throughout.

Prerequisites

  • client_id, client_secret, experienceId from Alianza onboarding.
  • A test phone number eligible for your Experience.
  • An SRS reachable from Alianza's sandbox IPs.

Use sandbox: https://api.b2.alianza.com.

1. Get a token (Client Credentials)

curl -X POST https://auth.beta.alianza.com/oauth/token \
  -H "Content-Type: application/x-www-form-urlencoded" \
  -d "grant_type=client_credentials" \
  -d "client_id=$CLIENT_ID" \
  -d "client_secret=$CLIENT_SECRET" \
  -d "scope=experience-assignability:check"

Response includes access_token — export as $TOKEN.

2. Check eligibility

curl -G "https://api.b2.alianza.com/experiences/$EXPERIENCE_ID/assignability" \
  -H "Authorization: Bearer $TOKEN" \
  --data-urlencode "targetType=PHONE_NUMBER" \
  --data-urlencode "targetValue=+14155551234"

Expect {"assignable": true, ...}.

3. Get a user-context token

For the next three calls you act on behalf of a user. Run the Authorization Code + PKCE flow end-to-end and export the resulting access token as $USER_TOKEN. Required scopes: experience-connections:manage experience-assignments:manage.

4. Create an Experience Connection

curl -X POST "https://api.b2.alianza.com/experience-connections?tn=+14155551234" \
  -H "Authorization: Bearer $USER_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"experienceId":"'"$EXPERIENCE_ID"'","state": "INACTIVE"}'

Expect 201. Save the response id as $CONNECTION_ID and accountId as $ACCOUNT_ID.

5. Assign to the account

For Post-Call, target the account:

curl -X POST https://api.b2.alianza.com/experience-assignments \
  -H "Authorization: Bearer $USER_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"experienceId":"'"$EXPERIENCE_ID"'","accountId":"'"$ACCOUNT_ID"'","targetType":"ACCOUNT","targetValue":"'"$ACCOUNT_ID"'"}'

Expect 201.

6. Activate the connection

curl -X PUT "https://api.b2.alianza.com/experience-connections/$CONNECTION_ID" \
  -H "Authorization: Bearer $USER_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"id":"'"$CONNECTION_ID"'","accountId":"'"$ACCOUNT_ID"'","experienceId":"'"$EXPERIENCE_ID"'","state":"ACTIVE"}'

Expect 200 with state: ACTIVE.

7. Place a test call

Place a call to or from a user in $ACCOUNT_ID. Within seconds, your SRS should receive a SIPREC INVITE per RFC 7866. See Receive SIPREC for what to expect on the wire.

What's next

  • Read the full Post-Call journey before going to production — error handling, edge cases, transfer behaviour.
  • Building Virtual Agent instead? See the Virtual Agent quickstart. The differences from above: target a phone number in step 5 (not an account) and your endpoint receives a SIP INVITE instead of SIPREC.