forked from nxtele/http-api-document
-
Notifications
You must be signed in to change notification settings - Fork 1
WhatsApp API getMedia
CodingMakeWordBetter edited this page Jun 14, 2023
·
11 revisions
Get information about files uploaded to WhatsApp through the API.
- URL:
https://api2.nxcloud.com/api/wa/getMedia - Method:
POST - Content-Type:
application/json - Requires authentication: Yes
Please refer to the authentication rules at API Interface Calling Convention.
| Parameter Name | Type | Required | Example | Description |
|---|---|---|---|---|
| accessKey | String | Yes | fme2na3kdi3ki | User identity identifier |
| ts | String | Yes | 1655710885431 | The timestamp (in milliseconds) of the current request. The server allows a maximum time difference of 60 seconds between the client and the server. |
| bizType | String | Yes | 2 | WhatsApp business type, fixed value "2" |
| action | String | Yes | getMedia | WhatsApp business operation, fixed value "getMedia" |
| sign | String | Yes | 6e9506557d1f289501d333ee2c365826 | API input parameter signature, signature algorithm |
| Parameter Name | Type | Required | Example | Description |
|---|---|---|---|---|
| business_phone | String | Yes | 86158xxxx1795 | Merchant phone number with country code. e.g., 86158xxxx1795 |
| messaging_product | String | Yes | Channel used for sending messages. When sending WhatsApp messages, the value must be "whatsapp". | |
| Media-ID | String | Yes | fd81acff-eea8-4d9d-acc9-6c62904d6615 | Media file ID |
Body (application/json) parameters:
{
"business_phone": "86158xxxx1795",
"Media-ID": "fd81acff-eea8-4d9d-acc9-6c62904d6615",
"messaging_product": "whatsapp"
}| Parameter Name | Type | Description |
|---|---|---|
| code | Integer | Result code |
| data | JsonObject | Request result |
| message | String | Description of the request result |
- data object parameters:
| Parameter Name | Type | Description |
|---|---|---|
| mime_type | String | File type |
| file_name | String | File name |
| url | String | File download URL |
{
"code": 0,
"data": {
"mime_type": "image/webp",
"file_name": "c5e744fab2a3b69941ed3c64",
"url": "https://goss.oss-cn-hongkong.aliyuncs.com/1b0a4c77-c5e7-44fa-b2a3-b69941ed3c64?Expires=1663747602&OSSAccessKeyId=LTAI5tBrjWM5EyDe6MA5uc7z&Signature=EW1KaByzd3rybo2swNSEKkpF5Lk%3D"
},
"message": "Request successful"
}{
"code": -1,
"message": "Request failed",
"data": null
}| code | message | Solution |
|---|---|---|
| 0 | Request successful | |
| -1 | Request failed | Please contact technical personnel to troubleshoot the issue |
| 1000~100X | Authentication issues | Refer to the API authentication section for details |
| 9000 | Parameter exception | Missing parameters, please check the required parameters |
| 9001 | System business error | Please contact technical personnel to troubleshoot the issue |
| 9002 | Merchant phone number error | Confirm if the merchant number belongs to a WhatsApp number |
| 9006 | The WhatsApp number is not bound to any application | Contact the business personnel to handle the application and phone number binding. |
Introduction
- Send Message
- Mark Incoming Message as Read
- Upload Media File
- Get Media File
- Delete Media File
- Webhook
- Query Number Information
- Query Message Template
- Create Message Template
- Edit Message Template
- Delete Message Template
- Upload Template Example File
- Embedded Page Login
- Create Client Application
- List of Phone Numbers for Client Application
- Get Verification Code
- Verify Verification Code
- Create Local Client
Short message
Voice
Call Center(NXLink)
- Web Iframe
- Manual Dial Record
- Manual Dial Record Query By orderId
- List Agent Information
- List Agent Status
- List Queue
- List Agents In Queue
- List Agent Efficiency
- Update Queue Agents
- Create AutoDial Task
- Webhook - Manual Dial
Call Center(Callbot)
- Callbot API Summary
- Callbot API Authorization
- Callbot API Ping
- Create Auto Dial Task
- Add Contact List To Task
- Create Task And Add Contact
- Start Or Pause Task
- Update Task Parameters
- Get List Task
- List Call
- List Task Orders
- Stop Order
- Get Call Detail By Order
- Webhook - By Call
- Webhook - By Order
- Webhook - Task Status
Flash Call
Short links
邮件验证码
DID号码
通用
号码检测