Use OAuth when another product should connect a CRM Messaging account with one Authorize click — no API key for the end user to copy.
After the user authorizes your app, your server exchanges the code for a Bearer token and calls the same messaging APIs as Send SMS and Message History API.
Register your app: Portal → Developer Console → OAuth apps → Create OAuth app.
Endpoints
Authorize URL
https://app.crm-messaging.cloud/index.php/oauth/authorize
Token URL
https://app.crm-messaging.cloud/index.php/oauth/token
1. Create an OAuth app
- Sign in to CRM Messaging as account admin.
- Open Developer Console → OAuth apps → Create OAuth app.
- Enter an app name (shown on the consent screen) and one or more redirect URIs (one per line).
- Redirect URIs must be
https://(orhttp://localhost/http://127.0.0.1for local testing). Matching is exact. - Copy Client ID and Client secret immediately — the secret is shown only once.
2. Send the user to Authorize
Redirect the user to the Authorize URL with these query parameters:
response_type=code(required)client_id— your Client ID (required)redirect_uri— must match a registered URI exactly (required)state— optional opaque value you verify on return
https://app.crm-messaging.cloud/index.php/oauth/authorize?response_type=code&client_id=YOUR_CLIENT_ID&redirect_uri=https%3A%2F%2Fyour-product.example%2Foauth%2Fcallback&state=RANDOM_STATE
The user signs in if needed, then chooses Authorize or Deny. Authorize redirects to your callback with code (and state). Deny returns error=access_denied. Codes expire in about 10 minutes and can be used once.
3. Exchange the code for a token
POST form-urlencoded to the Token URL:
curl --location --request POST 'https://app.crm-messaging.cloud/index.php/oauth/token' \ --header 'Content-Type: application/x-www-form-urlencoded' \ --data-urlencode 'grant_type=authorization_code' \ --data-urlencode 'code=AUTHORIZATION_CODE' \ --data-urlencode 'redirect_uri=https://your-product.example/oauth/callback' \ --data-urlencode 'client_id=YOUR_CLIENT_ID' \ --data-urlencode 'client_secret=YOUR_CLIENT_SECRET'
Success response
{
"access_token": "ACCOUNT_API_TOKEN",
"token_type": "Bearer",
"expires_in": null
}
expires_in is null — the token does not auto-expire. Store it on your server only. It is the connected account’s API token (same power as the Developer Console key).
Common errors: invalid_client, invalid_grant (expired/used code or redirect mismatch), unsupported_grant_type, invalid_request.
4. Call messaging APIs
Authorization: Bearer ACCESS_TOKEN
Send SMS / WhatsApp:
curl --location --request POST 'https://app.crm-messaging.cloud/index.php/Api/sendMsg' \ --header 'Authorization: Bearer ACCESS_TOKEN' \ --form 'to="PHONE_WITH_COUNTRY_CODE"' \ --form 'msg="Your invoice is unpaid."' \ --form 'channel="sms"'
See also Send SMS and Message History API.
Limits
- Up to 10 active OAuth apps per account, 10 redirect URIs per app.
- Deactivating an app stops new Authorizes; it does not rotate the account API key.
- Standard team members cannot open Developer Console — account admin registers the app.
+1 302 486 0000
+61 2 5129 0955
+44 7828 573520