Skip to content

WhatsApp API deleteMedia

CodingMakeWordBetter edited this page Jun 14, 2023 · 8 revisions

Delete Media File

Delete information about files uploaded to WhatsApp through the API.

  • URL: https://api2.nxcloud.com/api/wa/deleteMedia
  • Method: POST
  • Content-Type: application/json
  • Requires authentication: Yes

Authentication Mechanism

Please refer to the authentication rules at API Interface Calling Convention.

Request Parameters

Header parameters:

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 deleteMedia WhatsApp business operation, fixed value "deleteMedia"
sign String Yes 6e9506557d1f289501d333ee2c365826 API input parameter signature, signature algorithm

Body parameters:

Parameter Name Type Required Example Description
business_phone String Yes 86158xxxx1795 Merchant phone number with country code. e.g., 86158xxxx1795
messaging_product String Yes whatsapp 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

Request Example

Body (application/json) parameters:

{
    "business_phone": "86158xxxx1795",
    "Media-ID": "fd81acff-eea8-4d9d-acc9-6c62904d6615",
    "messaging_product": "whatsapp"
}

Response Parameters

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
success boolean Success flag

Response Example

Successful Example

{
    "code": 0,
    "data": {
        "success": true
    },
    "message": "Request successful"
}

Failed Example

{
    "code": -1,
    "message": "Request failed",
    "data": null
}

Response Code Description

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

WhatsApp

Short message

Voice

Call Center(NXLink)

Call Center(Callbot)

Flash Call

Short links

邮件验证码

DID号码

通用

号码检测

Clone this wiki locally