Skip to content

WhatsApp API uploadTemplateFile

CodingMakeWordBetter edited this page Jun 14, 2023 · 2 revisions

Upload Template Example File

Upload media files for configuring template examples. Media files are uploaded via HTTP multipart/form-data.

  • URL: https://api2.nxcloud.com/api/wa/uploadTemplateFile
  • Method: POST
  • Content-Type: multipart/form-data
  • Requires authentication: Yes

Authentication Mechanism

Refer to the following address for authentication rules: API Interface Call Convention

Request Parameters

Header parameters:

Parameter Name Type Required Example Value Description
accessKey String Yes fmexxx3ki User identity identifier
ts String Yes 1655710885431 Current timestamp of the request in milliseconds. The maximum allowable time difference between the server and the user is 60 seconds.
bizType String Yes 2 WhatsApp business type, fixed value "2"
action String Yes uploadTemplateFile WhatsApp business operation, fixed value "uploadTemplateFile"
sign String Yes 6e95xxx826 API input parameter signature, signature algorithm

Body parameters:

Parameter Name Type Required Example Value Description
business_phone String Yes 86158xxx1795 List of merchant's WhatsApp numbers, including country code, such as 185xxx99
messaging_product String Yes whatsapp Channel for sending messages. When sending WhatsApp messages, the value must be "whatsapp"
file file Yes Local directory where the file is stored. Example: "@/local/path/file.jpg"
type String Yes image/jpeg File type
Supported: application/pdf, video/mp4, image/jpeg, image/png, image/jpg

Request Example

Body (multipart/form-data) parameters:

messaging_product = whatsapp
business_phone = 185xxx99
type = image/jpeg
file = 

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
id String System-generated unique file ID

Response Example

Successful Example

{
    "code": 0,
    "data": {
        "id": "4:Pz8xxxW8"
    },
    "message": "Request successful"
}

Failed Example

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

Response Code Explanation

code message Solution
0 Request successful
-1 Request failed Please contact technical support to troubleshoot the issue.
1000~100X Authentication issue 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 support to troubleshoot the issue.
9002 Merchant phone number error Please confirm whether the merchant number belongs to a WhatsApp number.
9006 The WhatsApp number is not bound to the application Please contact the business personnel to handle the binding operation between the application and the phone number.

Introduction

WhatsApp

Short message

Voice

Call Center(NXLink)

Call Center(Callbot)

Flash Call

Short links

邮件验证码

DID号码

通用

号码检测

Clone this wiki locally