Quickstart

Getting started

Three APIs, two authentication schemes, one base URL. Here is a working call to each, in under a minute.

All APIs are served from https://api.kongapj.com.

1. Get an SMS API key

The SMS Messaging API is self-service. Create your own credential in three steps:

Sign up

Create a developer account from the Sign up button. Approval is automatic — you are in immediately.

Create an application

Open My apps and create one. It represents the client you are building, and this is where you pick a plan.

Register it against the SMS API

From the SMS Messaging API page, choose Register. You are issued an API key — copy it now, it is shown once.

2. Call the SMS Messaging API

Send your key in the apikey header:

curl -s -X POST https://api.kongapj.com/sms/v1/messages \
  -H "apikey: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"to":"+61400000000","from":"Optus","message":"Hi"}'
{
  "id": "msg_7Gk2xQ2eZvKYlo2C",
  "status": "queued"
}

Without the key you get a 401:

curl -i -X POST https://api.kongapj.com/sms/v1/messages
# HTTP/1.1 401 Unauthorized

Check delivery with the returned id:

curl -s https://api.kongapj.com/sms/v1/messages/msg_7Gk2xQ2eZvKYlo2C \
  -H "apikey: YOUR_API_KEY"
{
  "id": "msg_7Gk2xQ2eZvKYlo2C",
  "status": "delivered"
}

3. Call the Number Verification API

The Number Verification API uses OpenID Connect. Get a token from the Optus token endpoint using the client credentials grant, requesting the verify:manage scope:

TOKEN=$(curl -s https://keycloak.kongapj.com/realms/optus/protocol/openid-connect/token \
  -d grant_type=client_credentials \
  -d client_id=optus-verify-demo \
  -d client_secret=optus-verify-secret \
  -d "scope=openid verify:manage" \
  | jq -r .access_token)

Start a verification by presenting the token as a bearer:

curl -s -X POST https://api.kongapj.com/verify/v1/verifications \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"to":"+61400000000","channel":"sms"}'
{
  "id": "ver_3Nk2xQ2eZvKYlo2C",
  "status": "pending"
}

Confirm the code the user received:

curl -s -X POST https://api.kongapj.com/verify/v1/verifications/ver_3Nk2xQ2eZvKYlo2C \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"code":"123456"}'
{
  "id": "ver_3Nk2xQ2eZvKYlo2C",
  "status": "approved"
}

4. Call the Messaging API (WhatsApp / RCS)

The Messaging API is also OIDC-secured. Request a token with the messaging:send scope:

TOKEN=$(curl -s https://keycloak.kongapj.com/realms/optus/protocol/openid-connect/token \
  -d grant_type=client_credentials \
  -d client_id=optus-verify-demo \
  -d client_secret=optus-verify-secret \
  -d "scope=openid messaging:send" \
  | jq -r .access_token)

Send a WhatsApp message:

curl -s -X POST https://api.kongapj.com/messaging/v1/messages \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"to":"+61400000000","channel":"whatsapp","type":"text","content":"Hi"}'
{
  "id": "msg_9Zk2xQ2eZvKYlo2C",
  "status": "sent"
}

5. Explore the reference

Open any API from the APIs catalog. Each one ships with a complete reference, and the console lets you call endpoints without leaving the page — paste your key or token into the auth field first.

Next