Chuyển tới nội dung chính

Chat OA open-api: OA broadcast API Documentation

Version: v2.0 Last Updated: February 09, 2026


Overview

This document describes the OA (Official Account) Push Message APIs, which allow OAs to send messages to users or broadcast to all followers.

Tài liệu này mô tả các API OA Push Message, cho phép OA gửi tin nhắn tới người dùng hoặc broadcast tới tất cả followers.

Integration Architecture

Direct Chat Service vs Mulesoft Gateway

UAT, PROD All traffic must be routed through Mulesoft Gateway for security, monitoring, and compliance purposes.

Key Features

FeatureV1 APIV2 API
Send to specific usersYesYes
Broadcast to all followersYesYes
Multi-language supportNoYes
User language preferenceNoYes

References docs templates & widgets

Authentication Chat OA OPEN API

All API requests require Bearer token authentication.

Tất cả API requests yêu cầu xác thực bằng Bearer token.

Headers:

Authorization: Bearer <your_access_token>
Content-Type: application/json

Authentication MULESOFT


CHAT Base URL

SIT: https://api.sit.vsf.services/chat/oa-service
UAT: https://api.uat.vsf.services/chat/oa-service

MULESOFT Base URL

UAT: https://test-api.vingroup.net:7445/common-service/chat/api/v1/oa/messages
UAT: https://test-api.vingroup.net:7445/common-service/chat/api/v2/oa/messages

PROD: https://api-cloud-internal.vingroup.net/common-service/chat/api/v1/oa/messages
PROD: https://api-cloud-internal.vingroup.net/common-service/chat/api/v2/oa/messages

Endpoints

V1 APIs (Single Language)

MethodEndpointDescription
POST/api/v1/oa/messagesSend message to specific users (sync)
POST/api/v1/oa/broadcastBroadcast to all followers (async)

V2 APIs (Multi-Language Support)

MethodEndpointDescription
POST/api/v2/oa/messagesSend multi-language message to specific users (sync)
POST/api/v2/oa/broadcastBroadcast multi-language message to all followers (async)

V1 API Reference

POST /api/v1/oa/messages

Send a template message to one or more users.

Gửi tin nhắn template tới một hoặc nhiều người dùng.

Request Body

FieldTypeRequiredDescription
request_idstringNoUnique request identifier (UUID format recommended)
message_typestringYesMust be "template"
template_idstringYesTemplate ID for the message widget
payloadobjectYesTemplate data containing noti_tag and content
user_uuidsarray[string]Yes*List of user UUIDs to receive the message

Note: API supports both user_uuids (UUID format) and user_ids. Maximum 1000 users per request.

Lưu ý: API hỗ trợ cả user_uuids (định dạng UUID) và user_ids. Tối đa 1000 users mỗi request.

Payload Structure

{
"noti_desc": "Message description for notification",
"noti_tag": <number>,
"id": "widget_template_id",
"noti_title": "Notification title",
"content": {
"description": "Content description",
"title": "Content title"
}
}
FieldTypeRequiredDescription
noti_descstringYesDescription shown in push notification
noti_tagnumberYesNotification tag for rate limiting (1-6)
idstringYesWidget template ID
noti_titlestringYesTitle shown in push notification
contentobjectYesContent object for widget rendering

Notification Tags (noti_tag)

IDNameDescriptionRate Limited
1TransactionTransaction info, invoices, billingNo
2ServiceService processing, operational notificationsNo
3ViolationWarnings, violation noticesNo
4PromotionPromotional campaignsYes (5/user/day)
5NewsNews and updatesYes (5/user/day)
6General InfoGeneral informationYes (5/user/day)

Example Request

{
"request_id": "7f5bb3d2-fa5c-40ce-95bc-15c260b77512",
"message_type": "template",
"template_id": "widget_campain_action",
"payload": {
"noti_desc": "Quá trình sạc đã bắt đầu vào lúc 08/12/2025 05:43.",
"noti_tag": 3,
"id": "widget_campain_action",
"noti_title": "Bắt đầu sạc pin",
"content": {
"description": "Quá trình sạc đã bắt đầu vào lúc 08/12/2025 05:43.",
"title": "Bắt đầu sạc pin"
}
},
"user_uuids": [
"7fa72ebe-ad73-45f2-84d4-02880c1d99ea",
"8ab83fcf-be84-46g3-95e5-13991d2e00fb"
]
}

Example cURL

curl --request POST \
--url https://api.dev.vsf.services/chat/oa-service/api/v1/oa/messages \
--header 'Authorization: Bearer <your_access_token>' \
--header 'Content-Type: application/json' \
--data '{
"request_id": "7f5bb3d2-fa5c-40ce-95bc-15c260b77512",
"message_type": "template",
"template_id": "widget_campain_action",
"payload": {
"noti_desc": "Quá trình sạc đã bắt đầu vào lúc 08/12/2025 05:43.",
"noti_tag": 3,
"id": "widget_campain_action",
"noti_title": "Bắt đầu sạc pin",
"content": {
"description": "Quá trình sạc đã bắt đầu vào lúc 08/12/2025 05:43.",
"title": "Bắt đầu sạc pin"
}
},
"user_uuids": ["7fa72ebe-ad73-45f2-84d4-02880c1d99ea"]
}'

Success Response (HTTP 200)

{
"status": "success",
"code": "OA-200",
"timestamp": 1737043200000,
"request_id": "7f5bb3d2-fa5c-40ce-95bc-15c260b77512",
"data": {
"total_sent": 2,
"total_skipped": 0
}
}

Response Fields

FieldTypeDescription
total_sentnumberNumber of users successfully sent
total_skippednumberNumber of users skipped (rate limited)
skipped_reasonstringReason for skipping (if any)

POST /api/v1/oa/broadcast

NOTICE (09/02/2026): Broadcast API is currently disabled. The API still accepts requests but will always return HTTP 202 with oa_status: "turned_off" without actually sending any broadcast messages.

THÔNG BÁO (09/02/2026): API Broadcast hiện đang bị tắt. API vẫn nhận request nhưng sẽ luôn trả về HTTP 202 với oa_status: "turned_off" mà không thực sự gửi broadcast.

Broadcast a template message to all OA followers. This is an asynchronous operation.

Broadcast tin nhắn template tới tất cả followers của OA. Đây là operation bất đồng bộ.

Request Body

FieldTypeRequiredDescription
request_idstringNoUnique request identifier
message_typestringYesMust be "template"
template_idstringYesTemplate ID for the message widget
payloadobjectYesTemplate data containing noti_tag and content

Note: No user list required - message will be sent to all followers.

Lưu ý: Không cần danh sách user - tin nhắn sẽ được gửi tới tất cả followers.

Example Request

{
"request_id": "7f5bb3d2-fa5c-40ce-95bc-15c260b77512",
"message_type": "template",
"template_id": "widget_campain_action",
"payload": {
"noti_desc": "Quá trình sạc đã bắt đầu vào lúc 08/12/2025 05:43.",
"noti_tag": 3,
"id": "widget_campain_action",
"noti_title": "Bắt đầu sạc pin",
"content": {
"description": "Quá trình sạc đã bắt đầu vào lúc 08/12/2025 05:43.",
"title": "Bắt đầu sạc pin"
}
}
}

Success Response (HTTP 202 Accepted)

{
"status": "success",
"code": "OA-200",
"timestamp": 1737043200000,
"request_id": "7f5bb3d2-fa5c-40ce-95bc-15c260b77512",
"data": {
"status": "accepted",
"message": "Broadcast request accepted and processing in background"
}
}

Important: HTTP 202 indicates the request has been accepted for processing. The broadcast will be executed asynchronously in the background.

Quan trọng: HTTP 202 cho biết request đã được chấp nhận xử lý. Broadcast sẽ được thực thi bất đồng bộ trong background.


V2 API Reference (Multi-Language)

Multi-Language Feature

V2 APIs support sending messages in multiple languages using the payloads array. The system automatically selects the appropriate language based on user preferences.

V2 APIs hỗ trợ gửi tin nhắn đa ngôn ngữ sử dụng mảng payloads. Hệ thống tự động chọn ngôn ngữ phù hợp dựa trên preference của user.

Language Selection Logic

ScenarioBehavior
Only Vietnamese payload in payloadsVietnamese message sent to all users
Only English payload in payloadsEnglish message sent to all users
Both Vietnamese and English in payloadsSystem checks user's preferred_language and sends accordingly (default: Vietnamese)

User Language Preference

ValueLanguage
"vi"Vietnamese (default)
"en"English

POST /api/v2/oa/messages

Send a multi-language template message to one or more users.

Gửi tin nhắn template đa ngôn ngữ tới một hoặc nhiều người dùng.

Request Body

FieldTypeRequiredDescription
request_idstringNoUnique request identifier
message_typestringYesMust be "template"
template_idstringYesTemplate ID for the message widget
payloadsarray[PayloadItem]YesArray of language-specific payloads
user_uuidsarray[string]Yes*List of user UUIDs to receive the message

Note: API supports both user_uuids and user_ids. Maximum 1000 users per request.

PayloadItem Structure

Each item in the payloads array must contain:

FieldTypeRequiredDescription
languagestringYesLanguage code: "vi" or "en"
noti_descstringYesDescription shown in push notification
noti_tagnumberYesNotification tag for rate limiting (1-6)
idstringYesWidget template ID
noti_titlestringYesTitle shown in push notification
contentobjectYesContent object for widget rendering

Content Object:

FieldTypeRequiredDescription
titlestringYesTitle displayed in widget
descriptionstringYesDescription displayed in widget

Example Request — Vietnamese Only

{
"request_id": "7f5bb3d2-fa5c-40ce-95bc-15c260b77512",
"message_type": "template",
"template_id": "widget_campain_action",
"payloads": [
{
"language": "vi",
"noti_desc": "Quá trình sạc đã bắt đầu vào lúc 08/12/2025 05:43.",
"noti_tag": 3,
"id": "widget_campain_action",
"noti_title": "Bắt đầu sạc pin",
"content": {
"description": "Quá trình sạc đã bắt đầu vào lúc 08/12/2025 05:43.",
"title": "Bắt đầu sạc pin"
}
}
],
"user_uuids": ["7fa72ebe-ad73-45f2-84d4-02880c1d99ea"]
}

Example Request — English Only

{
"request_id": "7f5bb3d2-fa5c-40ce-95bc-15c260b77512",
"message_type": "template",
"template_id": "widget_campain_action",
"payloads": [
{
"language": "en",
"noti_desc": "Charging process has started at 08/12/2025 05:43.",
"noti_tag": 3,
"id": "widget_campain_action",
"noti_title": "Charging Started",
"content": {
"description": "Charging process has started at 08/12/2025 05:43.",
"title": "Charging Started"
}
}
],
"user_uuids": ["7fa72ebe-ad73-45f2-84d4-02880c1d99ea"]
}

Example Request — Multi-Language (Vietnamese & English)

{
"request_id": "7f5bb3d2-fa5c-40ce-95bc-15c260b77512",
"message_type": "template",
"template_id": "widget_campain_action",
"payloads": [
{
"language": "vi",
"noti_desc": "Quá trình sạc đã bắt đầu vào lúc 08/12/2025 05:43.",
"noti_tag": 3,
"id": "widget_campain_action",
"noti_title": "Bắt đầu sạc pin",
"content": {
"description": "Quá trình sạc đã bắt đầu vào lúc 08/12/2025 05:43.",
"title": "Bắt đầu sạc pin"
}
},
{
"language": "en",
"noti_desc": "Charging process has started at 08/12/2025 05:43.",
"noti_tag": 3,
"id": "widget_campain_action",
"noti_title": "Charging Started",
"content": {
"description": "Charging process has started at 08/12/2025 05:43.",
"title": "Charging Started"
}
}
],
"user_uuids": [
"7fa72ebe-ad73-45f2-84d4-02880c1d99ea",
"8ab83fcf-be84-46g3-95e5-13991d2e00fb",
"9bc94gdg-cf95-57h4-06f6-24002e3f11gc"
]
}

Example cURL

curl --request POST \
--url https://api.dev.vsf.services/chat/oa-service/api/v2/oa/messages \
--header 'Authorization: Bearer <your_access_token>' \
--header 'Content-Type: application/json' \
--data '{
"request_id": "7f5bb3d2-fa5c-40ce-95bc-15c260b77512",
"message_type": "template",
"template_id": "widget_campain_action",
"payloads": [
{
"language": "vi",
"noti_desc": "Quá trình sạc đã bắt đầu vào lúc 08/12/2025 05:43.",
"noti_tag": 3,
"id": "widget_campain_action",
"noti_title": "Bắt đầu sạc pin",
"content": {
"description": "Quá trình sạc đã bắt đầu vào lúc 08/12/2025 05:43.",
"title": "Bắt đầu sạc pin"
}
},
{
"language": "en",
"noti_desc": "Charging process has started at 08/12/2025 05:43.",
"noti_tag": 3,
"id": "widget_campain_action",
"noti_title": "Charging Started",
"content": {
"description": "Charging process has started at 08/12/2025 05:43.",
"title": "Charging Started"
}
}
],
"user_uuids": ["7fa72ebe-ad73-45f2-84d4-02880c1d99ea"]
}'

Success Response (HTTP 200)

{
"status": "success",
"code": "OA-200",
"timestamp": 1737043200000,
"request_id": "7f5bb3d2-fa5c-40ce-95bc-15c260b77512",
"data": {
"total_sent": 3,
"total_skipped": 0,
"sent_by_language": {
"vi": 2,
"en": 1
}
}
}

Response Fields

FieldTypeDescription
total_sentnumberTotal users successfully sent
total_skippednumberNumber of users skipped
sent_by_languageobjectBreakdown of messages sent by language
sent_by_language.vinumberMessages sent in Vietnamese
sent_by_language.ennumberMessages sent in English

POST /api/v2/oa/broadcast

NOTICE (09/02/2026): Broadcast API is currently disabled. The API still accepts requests but will always return HTTP 202 with oa_status: "turned_off" without actually sending any broadcast messages.

THÔNG BÁO (09/02/2026): API Broadcast hiện đang bị tắt. API vẫn nhận request nhưng sẽ luôn trả về HTTP 202 với oa_status: "turned_off" mà không thực sự gửi broadcast.

Broadcast a multi-language template message to all OA followers. This is an asynchronous operation.

Broadcast tin nhắn template đa ngôn ngữ tới tất cả followers của OA. Đây là operation bất đồng bộ.

Request Body

FieldTypeRequiredDescription
request_idstringNoUnique request identifier
message_typestringYesMust be "template"
template_idstringYesTemplate ID for the message widget
payloadsarray[PayloadItem]YesArray of language-specific payloads

Note: No user list required - message will be sent to all followers based on their language preference.

Example Request — Multi-Language Broadcast

{
"request_id": "7f5bb3d2-fa5c-40ce-95bc-15c260b77512",
"message_type": "template",
"template_id": "widget_campain_action",
"payloads": [
{
"language": "vi",
"noti_desc": "Quá trình sạc đã bắt đầu vào lúc 08/12/2025 05:43.",
"noti_tag": 3,
"id": "widget_campain_action",
"noti_title": "Bắt đầu sạc pin",
"content": {
"description": "Quá trình sạc đã bắt đầu vào lúc 08/12/2025 05:43.",
"title": "Bắt đầu sạc pin"
}
},
{
"language": "en",
"noti_desc": "Charging process has started at 08/12/2025 05:43.",
"noti_tag": 3,
"id": "widget_campain_action",
"noti_title": "Charging Started",
"content": {
"description": "Charging process has started at 08/12/2025 05:43.",
"title": "Charging Started"
}
}
]
}

Response — Broadcast Disabled (HTTP 202 Accepted)

Since 09/02/2026, this is the only response returned. Broadcast is disabled and no messages are sent.

{
"status": "success",
"code": "OA-200",
"timestamp": 1737043200000,
"request_id": "7f5bb3d2-fa5c-40ce-95bc-15c260b77512",
"data": {
"status": "accepted",
"oa_status": "turned_off",
"message": "Broadcast is currently disabled since 09/02/2026, broadcast not sent"
}
}

Response — OA Turned Off (HTTP 202 Accepted)

When OA is turned off via OA status configuration:

{
"status": "success",
"code": "OA-200",
"timestamp": 1737043200000,
"request_id": "7f5bb3d2-fa5c-40ce-95bc-15c260b77512",
"data": {
"status": "accepted",
"oa_status": "turned_off",
"message": "OA is currently turned off, broadcast not sent"
}
}

Success Response (HTTP 202 Accepted) — When Broadcast is Enabled

Note: This response is currently not returned as broadcast is disabled since 09/02/2026.

{
"status": "success",
"code": "OA-200",
"timestamp": 1737043200000,
"request_id": "7f5bb3d2-fa5c-40ce-95bc-15c260b77512",
"data": {
"status": "accepted",
"message": "Broadcast request accepted and processing in background",
"multi_language": true,
"languages": ["vi", "en"]
}
}

Response Fields

FieldTypeDescription
statusstringRequest status ("accepted")
oa_statusstringOA status ("turned_off" when broadcast is disabled)
messagestringStatus description
multi_languagebooleantrue if multiple language payloads are provided
languagesarray[string]List of languages in the request

Error Responses

HTTP 400 — Bad Request

Invalid request payload or validation errors.

Request payload không hợp lệ hoặc lỗi validation.

{
"status": "error",
"code": "OA-400",
"timestamp": 1737043200000,
"request_id": "7f5bb3d2-fa5c-40ce-95bc-15c260b77512",
"message": "Invalid request payload",
"details": [
"message_type must be 'template'",
"template_id is required",
"payloads array is required and must not be empty",
"payloads[0].language is required",
"payloads[0].noti_tag is required"
]
}

Common Validation Errors

ErrorDescription
message_type must be 'template'The message_type field must be exactly "template"
template_id is requiredMissing required template_id field
payload is requiredMissing payload (V1 API)
payloads array is required and must not be emptyMissing or empty payloads array (V2 API)
payloads[n].language is requiredMissing language in payload item
payloads[n].noti_tag is requiredMissing noti_tag in payload item
payloads[n].content is requiredMissing content in payload item
user_uuids limit 1000Exceeded maximum 1000 users per request

HTTP 401 — Unauthorized

Authentication failed or OA not authorized.

Xác thực thất bại hoặc OA không được phép.

{
"status": "error",
"code": "OA-401",
"timestamp": 1737043200000,
"request_id": "7f5bb3d2-fa5c-40ce-95bc-15c260b77512",
"message": "Unauthorized: OA ID missing"
}

HTTP 429 — Rate Limit Exceeded

All target users have reached their daily message limit for the specified noti_tag.

Tất cả users đã đạt giới hạn tin nhắn hàng ngày cho noti_tag được chỉ định.

{
"status": "error",
"code": "OA-429",
"timestamp": 1737043200000,
"request_id": "7f5bb3d2-fa5c-40ce-95bc-15c260b77512",
"message": "All users have reached daily limit for Promotion",
"data": {
"noti_tag": 4,
"noti_tag_name": "Promotion",
"limit": 5,
"total_users": 10,
"skipped_users": 10
}
}

HTTP 500 — Internal Server Error

Unexpected server error occurred.

Lỗi server không mong đợi.

{
"status": "error",
"code": "OA-500",
"timestamp": 1737043200000,
"request_id": "7f5bb3d2-fa5c-40ce-95bc-15c260b77512",
"message": "Internal server error"
}

Rate Limiting

Rate limits are applied based on noti_tag type per OA-User pair.

Giới hạn gửi tin được áp dụng dựa trên loại noti_tag cho mỗi cặp OA-User.

noti_tagTypeDaily Limit
1TransactionUnlimited
2ServiceUnlimited
3ViolationUnlimited
4Promotion5 messages(Promotion, News, General Info)/user/day
5News5 messages(Promotion, News, General Info)/user/day
6General Info5 messages(Promotion, News, General Info)/user/day

Note: Rate limits reset daily at 00:00 UTC+7.

Lưu ý: Giới hạn được reset hàng ngày lúc 00:00 UTC+7.


Best Practices

  1. Use request_id — Always include a unique request_id for tracking and debugging.

  2. Choose appropriate noti_tag — Select the correct notification tag to ensure proper delivery and avoid rate limiting.

  3. Batch users wisely — For large user lists, batch requests with up to 1000 users each.

  4. Use V2 for international users — If your users have different language preferences, use V2 APIs with the payloads array containing both Vietnamese and English content.

  5. Handle async responses — For broadcast APIs (HTTP 202), the request is processed asynchronously. Do not wait for completion.


Support

For technical support or questions, please contact your account manager or submit a support ticket.