Bắt đầu từ đây
Your first request in four steps
Connect and enable WhatsApp for a supported mobile.
Confirm the recipient with the number-check endpoint.
Send with waonly=yes.
To retrieve received messages: activate collection, call /getwa/synchronisation/, wait for recovery, then call /getwa.
MANDATORY BEFORE RETRIEVING RECEIVED MESSAGES
Request WhatsApp synchronization first.
Before calling /getwa to view received WhatsApp messages, you must request a synchronization window through https://api.smsmobileapi.com/getwa/synchronisation/. This explicit step is required to securely authorize the exchange between WhatsApp and SMSMobileAPI. Wait for recovery, then call /getwa.
WEBHOOK V2 CHO API NÀY
Chỉ đăng ký những sự kiện di động mà quy trình làm việc của bạn cần.
Một điểm đến có thể nhận mọi thứ, hoặc bạn có thể tách biệt hệ thống sản xuất, phân tích và cảnh báo vận hành. Mỗi sự kiện có một tên rõ ràng để ứng dụng của bạn xử lý một cách có thể dự đoán.
whatsapp.submittedWhatsApp đã được gửi
Một tác vụ gửi WhatsApp đã được tạo.
whatsapp.sentWhatsApp đã được gửi
Môi trường WhatsApp được kết nối xác nhận tin nhắn đã được gửi.
whatsapp.failedWhatsApp thất bại
Hoạt động gửi WhatsApp đã thất bại.
whatsapp.receivedWhatsApp đã được nhận
Một tin nhắn WhatsApp đã được truy xuất sau khi tài khoản yêu cầu đồng bộ.
whatsapp.voice.transcribedTin nhắn thoại đã được phiên âm
Một tin nhắn thoại WhatsApp hợp lệ được truy xuất đã được chuyển thành văn bản có thể sử dụng.
Authentication
Keep credentials on your server
Use apikey for direct integrations. OAuth2 client credentials are available for server-side applications; request a token and send it as Authorization: Bearer ACCESS_TOKEN.
Quản lý lịch sử
Xoá lịch sử một cách an toàn: xem thử, xoá, theo tiến trình
Những điểm kết thúc này xóa lịch sử máy phục vụ đã chọn cho bạn API không phải tin nhắn trên điện thoại hay dịch vụ bên ngoài. Họ không cung cấp bảo đảm tài khoản. Hoạt động mới có thể xuất hiện sau khi bị xóa.
Đọc hướng dẫn thử lại và request_id
Theo mặc định, vẫn còn thấy các hồ sơ liên kết hay xử lý. Chỉ dùng include_linked=1 Nếu bạn chấp nhận sự tích hợp đó hoặc xử lý đang diễn ra, có thể sẽ không còn hiệu quả nữa.
request_id hoạt động như thế nào
- Xem thử các đếm có action=previewKhông. request_id là cần thiết và không có hồ sơ nào bị xóa.
- Tạo ra một độc nhất request_id Cho một xóa mới, ví dụ như UUIDHãy để dành nó trước khi gửi action=delete.
- Để tái lưu trữ, hay thời hạn HTTP 202, tái sử dụng API Chìa khóa, điểm kết thúc lịch sử, request_id và include_linked giá trị. Không bao giờ tạo ra một ID mới tự động sau khi gặp lỗi.
- Khi completed=true, chiến dịch đã kết thúc. Sử dụng lại thẻ căn cước của nó đã trả lại cùng kết quả thay vì xóa các hồ sơ mới đến. Dùng ID mới chỉ cho việc dọn dẹp mới có chủ đích.
request_id Xác định thao tác xoá của bạn, không phải cá nhân SMS. Cho phép định dạng: 16–128 ASCII chữ, chữ số, dấu gạch nối hay dấu gạch nối. A UUID tạo ra với mã hóa.randoUUID là thích hợp.
Việc xóa được thực hiện theo từng lô. Nếu nhận HTTP 202 với continue_required=true, hãy gửi lại action=delete sau 3 giây. Không có cron chạy nền. action=status chỉ đọc tiến độ, không tiếp tục xóa, ngay cả khi trả về HTTP 200.
Ví dụ xóa và kiểm tra trạng thái
Thay thế mẫu request_id với giá trị độc đáo của riêng mình trước khi bắt đầu. Những yêu cầu xoá theo đây thay đổi lịch sử tài khoản thật; không phải là xem thử.
curl -X POST "https://api.smsmobileapi.com/delete-history-whatsapp-sent/" \
--data-urlencode "apikey=YOUR_API_KEY" \
-d "action=delete" -d "include_linked=0" \
-d "request_id=6d54ac58-41f1-4fbc-9a39-6e6c86089451"curl -X POST "https://api.smsmobileapi.com/delete-history-whatsapp-sent/" \
-H "Authorization: Bearer YOUR_OAUTH_ACCESS_TOKEN" \
-d "action=delete" -d "include_linked=0" \
-d "request_id=6d54ac58-41f1-4fbc-9a39-6e6c86089451"curl -G "https://api.smsmobileapi.com/delete-history-whatsapp-sent/" \
--data-urlencode "apikey=YOUR_API_KEY" \
-d "action=status" \
-d "request_id=6d54ac58-41f1-4fbc-9a39-6e6c86089451"GET cũng chấp nhận action=preview hay action=delete. POST khuyến khích: tham số URL có thể rò rỉ vào lịch sử trình duyệt và bản ghi máy phục vụ. Không bao giờ đặt địa chỉ URL xoá trong liên kết công cộng, ảnh hoặc tiềnfetch.
Vì POSTGửi tất cả các tham số vào cơ thể mẫu hoặc a JSON đối tượng, không bao giờ trong chuỗi truy vấn. Tham số không rõ bị từ chối; không hỗ trợ ngày tháng hay bộ lọc di động.
Xác thực cho điểm kết thúc lịch sử
Dùng apikey hay một Authorization: Bearer Comment SMSMobileAPI OAuth2Đừng gửi tín hiệu mới hay một thẻ API Chìa khóa là... Bearer - Tôi không biết. Vật trang trí bị bỏ hoang bị từ chối.
Khi phạm vi được đặt, history:read Cho phép xem thử/tatus và history:delete cũng cho phép xóa. Giới hạn cả vật tượng trưng lẫn vật kỷ niệm OAuth Khách áp dụng. Vật lưu giữ di sản mà không có phạm vi, giữ lại quyền truy cập tài khoản đã có của họ.
OAuth2 chọn điều cần thiết API Chìa khóa. Nếu có nhiều phím chính, cũng cung cấp apikey để chọn một phần của tài khoản. Chìa khóa thứ hai không bao giờ cho phép truy cập vào lịch sử chính.
Đọc câu trả lời trước khi tiếp tục
count_delete là số gia tăng được gỡ bỏ bởi chiến dịch này. selected_at_start là sự lựa chọn ban đầu; protected_at_start tính trừ các hồ sơ. Dùng preview.linked_or_processing để đếm hồ sơ liên kết ngay cả khi include_linked=1.
{
"result": {
"error": 0,
"history": "whatsapp-sent",
"action": "delete",
"request_id": "6d54ac58-41f1-4fbc-9a39-6e6c86089451",
"status": "processing",
"completed": false,
"count_delete": 100,
"total_before": 250,
"selected_at_start": 200,
"protected_at_start": 50,
"include_linked": 0,
"continue_required": true,
"message": "Repeat GET or POST with the same request_id and include_linked to continue. Status requests do not run deletion."
}
}- 200 có completed=true: xong. Chỉ xem trước 200 hoặc chỉ trả lời trạng thái thôi thì không chứng tỏ là hoàn tất.
- 400 INVALID_REQUEST_ID: kiểm tra định dạng . 404 REQUEST_NOT_FOUNDKhông có thao tác nào cho ID này, API Chìa khóa và lịch sử.
- 401: không hợp lệ hoặc hết hạn. 403: không đủ OAuth Phạm vi hoặc tài khoản trái phép.
- 409 HISTORY_BUSY: một việc dọn dẹp khác đang chạy; tiếp tục nó từ trình khách gốc. 409 INCLUDE_LINKED_CONFLICT: khôi phục lại bản gốc include_linked giá trị.
- 409 OAUTH_ACCOUNT_AMBIGUOUSCung cấp một API Chìa khóa của lời tường thuật này.
- 503 hoặc ngắt quãng mạng: một số mẻ có thể đã hoàn tất. Kiểm tra cấu hình, rồi thử lại với bản gốc request_idKhông tạo một thao tác thay thế tự động.
POST · GET
Send a WhatsApp message
https://api.smsmobileapi.com/sendsmsSends a WhatsApp text or supported media through the connected environment.
Use it for individual recipients or a dashboard contact group.
Parameters
| Tên | Type | Requirement | Description |
|---|---|---|---|
apikey |
string | Required | Your API key; omit when using a Bearer token. |
recipients |
phone | Required | Country code plus number, without + or 00. |
message |
string | Required | Text body; multiple lines are supported. |
waonly |
yes | Required | Must be yes to request WhatsApp-only delivery. |
url_media |
HTTPS URL | Tùy chọn | Public PDF, document, archive or JPG/PNG URL. |
url_media_shorted |
yes | Tùy chọn | Use a shortened download URL with PDF preview mode. |
pdf_with_image |
yes | Tùy chọn | Add an image preview for a PDF. |
encrypt_message |
yes | Tùy chọn | Require recipient-side decryption. |
contactGroup |
GUID | Tùy chọn | Send to every contact in a dashboard group. |
Request example
curl -X POST "https://api.smsmobileapi.com/sendsms?waonly=yes" \
-d "apikey=YOUR_API_KEY" \
-d "recipients=191728660" \
--data-urlencode "message=Your order is ready."
Example response
{
"result": {
"error": 0,
"sent": "1",
"id": "MESSAGE_GUID",
"send_with_whatsapp": "1"
}
}
Want to run this request? Connect your API key at the top of the page to unlock the interactive tester.
Connect key ↑- Supported media URLs must be public HTTPS resources.
- WhatsApp formatting: *bold*, _italic_, ~strikethrough~ and triple-backtick monospace.
POST · GET
Resend an unsent WhatsApp message
https://api.smsmobileapi.com/resendwa/Retries a WhatsApp message that currently has an error status.
Use it after diagnosing a failed WhatsApp log entry.
Parameters
| Tên | Type | Requirement | Description |
|---|---|---|---|
apikey |
string | Required | Your API key. |
guid |
string | Required | GUID of the failed message. |
Request example
curl "https://api.smsmobileapi.com/resendwa/?apikey=YOUR_API_KEY&guid=MESSAGE_GUID"
Want to run this request? Connect your API key at the top of the page to unlock the interactive tester.
Connect key ↑- Only failed messages are eligible for resend.
GET
Activate inbound retrieval
https://api.smsmobileapi.com/getwa/active/Activates, deactivates or toggles WhatsApp message retrieval.
Activate collection first. Then, before retrieving received messages, you must request synchronization through /getwa/synchronisation/.
Parameters
| Tên | Type | Requirement | Description |
|---|---|---|---|
apikey |
string | Required | Your API key. |
statut |
0 | 1 | x | Tùy chọn | 1 activates, 0 deactivates, x or omission toggles the current state. |
Request example
curl "https://api.smsmobileapi.com/getwa/active/?apikey=YOUR_API_KEY&statut=1"
Example response
{
"success": true,
"read_message_active": 1,
"status_note": "Activated"
}
Want to run this request? Connect your API key at the top of the page to unlock the interactive tester.
Connect key ↑- Inbound retrieval is disabled by default for privacy.
- Activation alone does not retrieve messages: a synchronization request remains mandatory before using /getwa for newly received activity.
GET
Required: request WhatsApp synchronization
https://api.smsmobileapi.com/getwa/synchronisation/Mandatory security step before retrieving received WhatsApp messages. It opens a time-limited synchronization window.
You must call this endpoint before /getwa whenever you need SMSMobileAPI to check WhatsApp for newly received messages. Wait for recovery, then call /getwa.
Parameters
| Tên | Type | Requirement | Description |
|---|---|---|---|
apikey |
string | Required | Your API key. |
Request example
curl "https://api.smsmobileapi.com/getwa/synchronisation/?apikey=YOUR_API_KEY"
Example response
{
"error": "0",
"messages": "synchronized",
"expire_at": "2026-03-11 12:27:00",
"expire_at_unix": "1773232020"
}
Want to run this request? Connect your API key at the top of the page to unlock the interactive tester.
Connect key ↑- Synchronization is for receiving messages only. Do not call it before sending.
- The response returns expire_at and expire_at_unix. Request another synchronization window when you need to collect newer received messages.
- A synchronization request is mandatory to protect the exchange between WhatsApp and SMSMobileAPI.
GET
Retrieve WhatsApp messages
https://api.smsmobileapi.com/getwaReturns received WhatsApp messages that were recovered during a requested synchronization window.
Mandatory prerequisite: activate inbound retrieval, call https://api.smsmobileapi.com/getwa/synchronisation/ first, wait for recovery, then call this endpoint. /getwa does not itself start synchronization.
Parameters
| Tên | Type | Requirement | Description |
|---|---|---|---|
apikey |
string | Required | Your API key. |
before |
Unix timestamp | Tùy chọn | Return records before this timestamp. |
date |
YYYY-MM-DD | Tùy chọn | Return records for one date. |
message_type |
text | audio | Tùy chọn | Filter text messages or audio messages converted to text; omit for both. |
Request example
curl "https://api.smsmobileapi.com/getwa/?apikey=YOUR_API_KEY&message_type=text"
Example response
{
"date": "2026-03-11",
"hour": "12:27:00",
"timestamp": "1773232020",
"number": "19176728660",
"contact": "SMSMobileAPI",
"message": "When will I receive my order?",
"guid": "652fcfc0-12a8-46f5-b5ba-9391135b8b4c"
}
Want to run this request? Connect your API key at the top of the page to unlock the interactive tester.
Connect key ↑
GET
Check a WhatsApp number
https://api.smsmobileapi.com/whatsapp/checknumber/Checks whether a phone number is available on WhatsApp.
Use it before sending to reduce avoidable failures.
Parameters
| Tên | Type | Requirement | Description |
|---|---|---|---|
apikey |
string | Required | Your API key. |
recipients |
phone | Required | Country code plus number, without + or 00. |
Request example
curl "https://api.smsmobileapi.com/whatsapp/checknumber/?apikey=YOUR_API_KEY&recipients=19176728660"
Example response
{
"contact_found_on_whatsapp": "yes",
"recipients": "19176728660"
}
Want to run this request? Connect your API key at the top of the page to unlock the interactive tester.
Connect key ↑
POST
Create an OAuth2 access token
https://api.smsmobileapi.com/oauth2/tokenExchanges client credentials for a Bearer token.
Use it for server-to-server integrations where short-lived credentials are preferred.
Parameters
| Tên | Type | Requirement | Description |
|---|---|---|---|
grant_type |
string | Required | Must be client_credentials. |
client_id |
string | Required | Client ID from the dashboard. |
client_secret |
string | Required | Client secret from the dashboard. |
Request example
curl -X POST "https://api.smsmobileapi.com/oauth2/token" \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "grant_type=client_credentials" \
-d "client_id=YOUR_CLIENT_ID" \
-d "client_secret=YOUR_CLIENT_SECRET"
Want to run this request? Connect your API key at the top of the page to unlock the interactive tester.
Connect key ↑- Keep the client secret on your server. Never include it in mobile or browser code.
POST · GET
Xóa lịch sử tin nhắn WhatsApp đã gửi
https://api.smsmobileapi.com/delete-history-whatsapp-sent/Xóa các ghi chép của máy phục vụ gửi WhatsApp Tin nhắn. Nó không xoá các thông điệp khỏi WhatsApp Nói chuyện.
Dùng ô xem thử trước, kiểm tra lại các số, rồi yêu cầu xóa bỏ rõ ràng. Điều này xóa toàn bộ lịch sử đã chọn cho API Chìa khóa, không hẹn hò, không điện thoại hay bộ lọc tin nhắn.
Parameters
| Tên | Type | Requirement | Description |
|---|---|---|---|
apikey |
string | Tùy chọn | Yêu cầu không OAuth2Với OAuth2, tùy chọn chọn API Chìa khóa của cùng một tài khoản. |
action |
preview | delete | status | Tùy chọn | preview đếm mà không xóa; delete bắt đầu hoặc tiếp tục xóa; status chỉ xem tiến độ. API mặc định dùng delete; công cụ thử này mặc định dùng preview. |
include_linked |
0 | 1 | Tùy chọn | Mặc định 0: giữ hồ sơ liên kết hay xử lý. Đặt 1 để bao gồm cả chúng, với nguy cơ phá vỡ sự liên kết. Giữ giá trị này không thay đổi khi tiếp tục xoá. |
request_id |
string | Tùy chọn | Bắt buộc với delete và status, không bắt buộc với preview. Dùng 16–128 chữ cái ASCII, chữ số, dấu gạch ngang (-) hoặc gạch dưới (_). Tạo một ID duy nhất cho mỗi lần xóa mới và giữ nguyên ID đó khi thử lại. Đây không phải ID tin nhắn hay khóa API. |
Request example
curl -X POST "https://api.smsmobileapi.com/delete-history-whatsapp-sent/" \
--data-urlencode "apikey=YOUR_API_KEY" \
-d "action=preview" -d "include_linked=0"
Ví dụ xóa và kiểm tra trạng thái
Thay thế mẫu request_id với giá trị độc đáo của riêng mình trước khi bắt đầu. Những yêu cầu xoá theo đây thay đổi lịch sử tài khoản thật; không phải là xem thử.
curl -X POST "https://api.smsmobileapi.com/delete-history-whatsapp-sent/" \
--data-urlencode "apikey=YOUR_API_KEY" \
-d "action=delete" -d "include_linked=0" \
-d "request_id=6d54ac58-41f1-4fbc-9a39-6e6c86089451"curl -X POST "https://api.smsmobileapi.com/delete-history-whatsapp-sent/" \
-H "Authorization: Bearer YOUR_OAUTH_ACCESS_TOKEN" \
-d "action=delete" -d "include_linked=0" \
-d "request_id=6d54ac58-41f1-4fbc-9a39-6e6c86089451"curl -G "https://api.smsmobileapi.com/delete-history-whatsapp-sent/" \
--data-urlencode "apikey=YOUR_API_KEY" \
-d "action=status" \
-d "request_id=6d54ac58-41f1-4fbc-9a39-6e6c86089451"Example response
{
"result": {
"error": 0,
"history": "whatsapp-sent",
"action": "preview",
"total": 120,
"simple": 100,
"linked_or_processing": 20,
"selected": 100,
"include_linked": 0,
"operation_in_progress": false,
"active_include_linked": null
}
}
Want to run this request? Connect your API key at the top of the page to unlock the interactive tester.
Connect key ↑- Ví dụ trên là xem trước, không phải xoá. Số lượng được mô tả; lựa chọn dứt khoát được cố định khi việc xoá bắt đầu.
- include_linked=1 có thể phá vỡ GHL. ZapierXác định liên kết hoặc theo dõi giao hàng. Nó không bao giờ vượt qua quyền sở hữu tài khoản hay kiểm tra tính toàn vẹn của tài khoản.
POST · GET
Xóa lịch sử tin nhắn WhatsApp đã nhận
https://api.smsmobileapi.com/delete-history-whatsapp-received/Xóa các ghi chép máy phục vụ đã nhận WhatsApp Tin nhắn. Nó không ngắt kết nối WhatsApp hoặc xóa các cuộc trò chuyện.
Dùng ô xem thử trước, kiểm tra lại các số, rồi yêu cầu xóa bỏ rõ ràng. Điều này xóa toàn bộ lịch sử đã chọn cho API Chìa khóa, không hẹn hò, không điện thoại hay bộ lọc tin nhắn.
Parameters
| Tên | Type | Requirement | Description |
|---|---|---|---|
apikey |
string | Tùy chọn | Yêu cầu không OAuth2Với OAuth2, tùy chọn chọn API Chìa khóa của cùng một tài khoản. |
action |
preview | delete | status | Tùy chọn | preview đếm mà không xóa; delete bắt đầu hoặc tiếp tục xóa; status chỉ xem tiến độ. API mặc định dùng delete; công cụ thử này mặc định dùng preview. |
include_linked |
0 | 1 | Tùy chọn | Mặc định 0: giữ hồ sơ liên kết hay xử lý. Đặt 1 để bao gồm cả chúng, với nguy cơ phá vỡ sự liên kết. Giữ giá trị này không thay đổi khi tiếp tục xoá. |
request_id |
string | Tùy chọn | Bắt buộc với delete và status, không bắt buộc với preview. Dùng 16–128 chữ cái ASCII, chữ số, dấu gạch ngang (-) hoặc gạch dưới (_). Tạo một ID duy nhất cho mỗi lần xóa mới và giữ nguyên ID đó khi thử lại. Đây không phải ID tin nhắn hay khóa API. |
Request example
curl -X POST "https://api.smsmobileapi.com/delete-history-whatsapp-received/" \
--data-urlencode "apikey=YOUR_API_KEY" \
-d "action=preview" -d "include_linked=0"
Ví dụ xóa và kiểm tra trạng thái
Thay thế mẫu request_id với giá trị độc đáo của riêng mình trước khi bắt đầu. Những yêu cầu xoá theo đây thay đổi lịch sử tài khoản thật; không phải là xem thử.
curl -X POST "https://api.smsmobileapi.com/delete-history-whatsapp-received/" \
--data-urlencode "apikey=YOUR_API_KEY" \
-d "action=delete" -d "include_linked=0" \
-d "request_id=6d54ac58-41f1-4fbc-9a39-6e6c86089451"curl -X POST "https://api.smsmobileapi.com/delete-history-whatsapp-received/" \
-H "Authorization: Bearer YOUR_OAUTH_ACCESS_TOKEN" \
-d "action=delete" -d "include_linked=0" \
-d "request_id=6d54ac58-41f1-4fbc-9a39-6e6c86089451"curl -G "https://api.smsmobileapi.com/delete-history-whatsapp-received/" \
--data-urlencode "apikey=YOUR_API_KEY" \
-d "action=status" \
-d "request_id=6d54ac58-41f1-4fbc-9a39-6e6c86089451"Example response
{
"result": {
"error": 0,
"history": "whatsapp-received",
"action": "preview",
"total": 120,
"simple": 100,
"linked_or_processing": 20,
"selected": 100,
"include_linked": 0,
"operation_in_progress": false,
"active_include_linked": null
}
}
Want to run this request? Connect your API key at the top of the page to unlock the interactive tester.
Connect key ↑- Ví dụ trên là xem trước, không phải xoá. Số lượng được mô tả; lựa chọn dứt khoát được cố định khi việc xoá bắt đầu.
- include_linked=1 có thể phá vỡ GHL. ZapierXác định liên kết hoặc theo dõi giao hàng. Nó không bao giờ vượt qua quyền sở hữu tài khoản hay kiểm tra tính toàn vẹn của tài khoản.
Troubleshooting
Errors and safe retries
Read the HTTP status and the JSON error field before retrying. Do not retry validation or authentication failures without correcting the request first.
| HTTP | Code | What to do |
|---|---|---|
| 400 | missing_parameter | A required parameter is empty or absent. Check the parameter table for the endpoint. |
| 403 | invalid_apikey | The API key is unknown, expired or not authorized for the requested feature. |
| 429 | too_many_requests | Requests are arriving too quickly. Wait, then retry with exponential backoff. |
| 500 | server_error | The service could not complete the request. Keep the response and contact support if it persists. |
Need help?
Bring the request context—not your secrets.
Share the endpoint, timestamp, HTTP status and sanitized response. Never include API keys, tokens or private message content.
Official mobile application
The secure bridge between your phone, dashboard and API.
SMS and call operations pass through the official SMSMobileAPI app installed on your connected phone. The app securely pairs the device with your account, synchronizes authorized events and links the mobile network to the dashboard and REST API.
- Signed releases distributed through the official Google Play and Apple App Store listings
- Google and Apple platform review, signing and distribution controls
- Secure device pairing, HTTPS transport and authenticated API access
- Only the permissions required for the mobile features you enable


