forked from clairton/unoapi-cloud
-
Notifications
You must be signed in to change notification settings - Fork 3
COMPAT_ODOO
wiki-bot edited this page May 3, 2026
·
1 revision
This guide explains how to run UNO in Graph/Cloud-compatible mode for the official Odoo connector while preserving legacy behavior.
For WhatsApp Embedded/Chatwoot-focused setup, use docs/WHATSAPP_EMBEDDED.md.
Important: UNO emulates Graph-like API calls, but it does not replace the real Meta/Facebook Embedded Signup popup. If the client uses the official Embedded UI, App ID, App Secret, Configuration ID, and API version still come from Meta unless that client is patched for a UNO-specific fake flow.
-
phoneNumberIdremains the value you already use today (for example:5566996269251). - UNO does not auto-change
phoneNumberId. - Legacy routes remain available.
-
businessAccountId(WABA ID) is auto-generated when missing. - Generation is deterministic per session (stable over time).
- This also applies to existing sessions loaded from Redis.
- If
webhookForward.businessAccountIdis empty:- UNO generates a numeric Meta-like ID;
- stores mapping for internal routing;
- keeps
phoneNumberIdunchanged.
- UNO with
REDIS_URLconfigured (recommended for session mappings). - Session already registered in UNO.
- Session auth token or
UNOAPI_AUTH_TOKEN.
curl -X POST "https://uno.yourdomain.com/v19.0/5566996269251/register" \
-H "Authorization: your_admin_token" \
-H "Content-Type: application/json" \
-d '{
"authToken": "client_token",
"webhookForward": {
"version": "v19.0",
"phoneNumberId": "5566996269251",
"token": "client_token",
"timeoutMs": 6000
}
}'Notes:
-
businessAccountIdcan be omitted. - UNO will generate it automatically when needed.
GET /:version/debug_tokenGET /:version/me/whatsapp_business_accountsGET /:version/:business_account_id/phone_numbersGET /:version/:business_account_id/message_templatesPOST /:version/:business_account_id/message_templatesDELETE /:version/:business_account_id/message_templates/:templateIdPOST /:version/:phone_number_id/messagesGET /:version/:media_id-
GET /sessions/meta/mappings(administrative; auth required)
Webhook:
-
GET /webhooks/whatsapp(verify token/challenge) -
POST /webhooks/whatsapp(receive payload)
Set variables:
UNO_BASE="https://uno.yourdomain.com"
TOKEN="client_token"
PHONE_NUMBER_ID="5566996269251"- Validate token:
curl -sS -H "Authorization: Bearer $TOKEN" \
"$UNO_BASE/v19.0/debug_token?input_token=$TOKEN"- Get WABA IDs:
curl -sS -H "Authorization: Bearer $TOKEN" \
"$UNO_BASE/v19.0/me/whatsapp_business_accounts"Example:
{
"data": [
{
"id": "154253852486255",
"name": "Minha Loja"
}
]
}Use returned id as WABA_ID.
2.1) Inspect resolved mapping (support/admin):
curl -sS -H "Authorization: Bearer $TOKEN" \
"$UNO_BASE/sessions/meta/mappings"Example:
{
"data": [
{
"session_phone": "5566996269251",
"phone_number_id": "5566996269251",
"business_account_id": "154253852486255"
}
]
}- List WABA phone numbers:
curl -sS -H "Authorization: Bearer $TOKEN" \
"$UNO_BASE/v19.0/<WABA_ID>/phone_numbers"- Send message via
phone_number_id:
curl -sS -X POST \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
"$UNO_BASE/v19.0/$PHONE_NUMBER_ID/messages" \
-d '{
"messaging_product": "whatsapp",
"to": "5566999999999",
"type": "text",
"text": { "body": "UNO + Odoo test" }
}'In Odoo WhatsApp connector (Enterprise):
- API token: same token configured in UNO.
-
Phone Number ID: use your session value (legacy behavior preserved), example5566996269251. -
WABA ID: use the value returned by:GET /v19.0/me/whatsapp_business_accounts
- Webhook callback:
https://uno.yourdomain.com/webhooks/whatsapp
- Verify token:
-
UNOAPI_AUTH_TOKEN(or equivalent verify token).
-
-
Cloud phone_number_idis only saved when explicitly filled/imported. -
Business Account IDcan stay empty. - On save, UNO auto-generates a stable
businessAccountIdwhen missing.
- Call
debug_tokento validate token. - Discover
WABA_IDfromme/whatsapp_business_accounts. - Use
WABA_IDonphone_numbersandmessage_templates. - Use
phone_number_idonmessages. - Configure webhook on
/webhooks/whatsapp.
- Route not found on
/{waba_id}/...:- Ensure you are using
WABA_IDreturned by UNO.
- Ensure you are using
- Empty
WABA_ID:- force session load (
/sessionsor/:version/:phone) and retry. - check
GET /sessions/meta/mappings.
- force session load (
- Send failure with token:
- confirm
Authorization: Bearer <token>and sessionauthToken.
- confirm