Sending a message
Inbound Message API
The Inbound Message API allows organizations to send messages through various communication channels (e.g., SMS). This API processes and publishes messages, ensuring they are sent correctly and validated against the organization's credentials.
API Base URL: https://api.ubiqio.com/
Authentication
All API requests must be authenticated using a Bearer token. Obtain a JWT token by authenticating with your clientId and clientSecret.
Get a JWT Token
Endpoint: POST /mvapi/auth/token
Request Body (JSON)
Field | Type | Required | Description |
|---|---|---|---|
| string | ✅ | Your unique account identifier |
| string | ✅ | Your secret key associated with the account |
Example Request
Success Response
Error Response
Once obtained, include the token in the Authorization header:
Endpoints
POST /send
Send a message through a specified communication channel. This endpoint validates the message, checks the organization's credentials, and publishes the message.
URL:
https://api.ubiqio.com/mvapi/message/sendMethod:
POSTAuth: Bearer token required
Content-Type:
application/json
Request Body (JSON)
Field | Type | Required | Description |
|---|---|---|---|
| string | ✅ | Unique identifier for the account |
| string | ✅ | Recipient phone number |
| string | ✅ | Content of the message |
| string | ✅ | Template ID for the message |
| int | ✅ | Priority level. Set to |
| string | ✅ |
|
| string | — | Image URL (MMS only) |
| string | — | Image caption (MMS only) |
| string | — | Client reference for additional identification |
Example Request
Success Response
Validation Error Response
Unauthorized Error Response
Response Codes
Code | Status | Description |
|---|---|---|
| OK | Message was successfully processed |
| Bad Request | Invalid parameters (e.g., malformed phone numbers or UUIDs) |
| Unauthorized | Bearer token was missing or invalid |
| Internal Server Error | Unexpected error during processing |
SendMessageRequest Object
Field | Type | Required | Description |
|---|---|---|---|
| string | ✅ | Unique identifier for the account |
| string | ✅ | Recipient phone number |
| string | ✅ | Content of the message |
| string | ✅ | Template ID for the message |
| int | — | Priority level. |
| string | ✅ |
|
| string | — | URL for status callbacks |
| int | — | Retry count (internal use only) |
| string | — | Image URL (MMS only) |
| string | — | Image caption (MMS only) |
| string | — | Client reference |
Webhooks
Webhooks are sent to the URL specified in the template for both status updates and inbound messages.
Status Webhook
Inbound Webhook
Best Practices
Secure your JWT Tokens — Never expose Bearer tokens in public repositories or client-side code.
Validate Request Parameters — Ensure all required fields (
accountId,channel,toNumber) are properly formatted before sending.Idempotency — Send each request only once per message, or implement your own idempotency mechanism to prevent duplicate processing.
