WhatsApp Bulk Upload

Use the WhatsApp Bulk Upload APIs to upload recipient files and start, pause, or resume bulk WhatsApp campaigns.

API flow

File Upload

Upload a CSV or plain text file that contains recipient phone numbers and messages.

Send Bulk Campaign

Start, pause, or resume the uploaded bulk campaign.

File Upload API

The File Upload API sends multiple messages to users in a single upload.

Endpoint details

FieldValue
URLhttps://apis.rmlconnect.net/wba/v2/upload
Authorizationjwt
Request Body schemamultipart/form-data

Query parameters

ParameterTypeExampleDescription
sourcestringsource=UIThe details of the source for uploading the file for a bulk campaign.
debuganydebug=TrueThe parameter that enables or disables the debug mode. Set the default value of debug=True to enable the debug mode. The system generates additional information and logs to help resolving troubleshoot and debug issues with the bulk campaigns.

Debug enum values

  • "True"
  • "False"

Request body parameters

ParameterRequiredTypeDescription
campaign_typeYesstringThe type of campaign being sent, which can be either generalized or personalized.
fileYesstringThe CSV or plain text file path on your local system or network that you want to upload as part of a bulk campaign. The file contains the list of phone numbers and messages.
file_mimetypeYesstringThe MIME type of the file containing the phone numbers of the recipients. The type of the file can be either "text/plain" or "text/csv".
filenameYesstringThe name of the file containing the phone numbers of the recipients, including the file extension.
messageYesstringThe message that you want to send to the users along with the file.

See the sample files for more information on bulk upload files and their details:

  • Bulk Upload File
  • Bulk Upload Campaign File
  • Campaign File

File Upload responses

200 Success

Response

{
  "message": "File uploaded successfully",
  "campaign_id": "670b3fd4-d442-11ed-a821-xxxxxxxxxxxx",
  "file_type": "text/csv",
  "file_size": "19.0B",
  "total_records": 1,
  "valid_records": 1,
  "duplicate records": 0,
  "campaign_type": "generalized",
  "message_preview": {
    "phone": "91868841xxxx",
    "enable_acculync": true,
    "extra": "{'asd':'asd'}",
    "media": {
      "type": "media_template",
      "template_name": "boarding_pass_update",
      "lang_code": "en",
      "header": [
        {
          "image": {
            "link": "https://media.istockphoto.com/vectors/airplane-ticket-boarding-pass-ticket-template-vector-id878xxxxxx"
          }
        }
      ],
      "body": [
        {
          "text": "Here is your boarding pass"
        }
      ]
    }
  },
  "asynchronous": false,
  "country_code": "string"
}

Response Schema: application/json

FieldTypeDescription
messagestringThe outcome of the file upload process.
campaign_idstringThe unique identifier for the campaign associated with the uploaded file.
file_typestringThe type of the uploaded file.
file_sizestringThe size of the uploaded file.
total_recordsintegerThe total number of records present in the uploaded file.
valid_recordsintegerThe count of valid records within the uploaded file.
duplicate recordsintegerThe count of duplicate records found in the uploaded file.
campaign_typestringThe type of campaign being sent, which can be either generalized or personalized.
message_previewobject (inline_response_200_4_message_preview)A preview of the message or content associated with the campaign.
asynchronousbooleanThe parameter indicates whether the file upload process is synchronous or asynchronous.
country_codestringThe country code.
401 Unauthorized

Response

{
  "message": "unable to process campaign request",
  "reason": "jwt token expired",
  "status": "failure"
}

Response Schema: application/json

FieldTypeDescription
messagestringThe response message.
reasonstringThe reason for not processing the product feed update request.
statusstringThe status of the product feed update.
404 Page Not Found

Response

{
  "message": "The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again."
}

Response Schema: application/json

FieldTypeDescription
messagestringThe message response.
422 Unprocessable Entity (WebDAV)

Response

{
  "message": "please check API docs for more info",
  "status": "failed",
  "reason": {
    "campaign_type": [
      "Must be one of: generalized, personalized."
    ]
  }
}

Response Schema: application/json

One of Unknown Campaign Type Error / File Mimetype Error

FieldTypeDescription
messagestringThe response message.
statusstringThe status of the file upload.
reasonobjectThe reason for not processing the file upload request.
500 Internal Server Error

Response

{
  "status": "failure",
  "message": "unable to process request"
}

Response Schema: application/json

FieldTypeDescription
statusstringThe status of the message delivery.
messagestringThe message response.

Send Bulk Campaign API

The Send Bulk Campaign API sends messages in bulk to multiple users, manages large-scale campaigns, and reduces the workload for marketers or business owners.

Endpoint details

FieldValue
URLhttps://apis.rmlconnect.net/wba/v2/manage_campaign
Authorizationjwt
Request Body schemaapplication/json

Query parameters

ParameterTypeExampleDescription
debuganydebug=TrueThe parameter that enables or disables the debug mode. Set the default value of debug=True to enable the debug mode. The system generates additional information and logs to help resolving troubleshoot and debug issues with the bulk campaigns.
sourcestringsource=UIThe details of the source for uploading the file for a bulk campaign.

Debug enum values

  • "True"
  • "False"

Campaign actions

Request body example

{
  "campaign_action": "start",
  "campaign_id": "{campaign id}",
  "campaign_name": "{campaign name}",
  "file_mimetype": "text/plain or text/csv",
  "filename": "{filename with extension}",
  "payload": {
    "type": "{payload type}"
  },
  "scheduled_time": "{date and time in UTC e.g.2021-12-08 13:36:00}"
}

Request Body schema: application/json

ParameterRequiredTypeDescription
campaign_actionYesstringThe action to be taken for the campaign. For sending a bulk campaign, the value should be set to "start".
campaign_idYesstringThe unique identifier for the campaign. This ID is generated by WhatsApp when you execute the File Upload API.
campaign_nameYesstringThe name of the campaign.
file_mimetypeYesstringThe MIME type of the file containing the phone numbers of the recipients. The type of the file can be in different formats, such as "text/plain" or "text/csv".
filenameYesstringThe name of the file containing the phone numbers of the recipients, including the file extension.
payloadYesobject (wbav2manage_campaign_payload)An object representing the template type, such as media template.
scheduled_timeYesstringThe date and time at which the campaign should be scheduled to start, in UTC format. The format of the string should be "YYYY-MM-DD HH:mm:ss".

Send Bulk Campaign responses

202 Accepted

Response

{
  "status": "success",
  "message": "campaign with id 670b3fd4-d442-11ed-a821-xxxxxxxxxxxx is now processing"
}

Response Schema: application/json

FieldTypeDescription
statusstringThe status of the message.
messagestringThe response message.
400 Bad Request

Response

{
  "status": "failed",
  "message": "unable to process request",
  "reason": "file name mismatch between /upload and /campaign endpoints for 670b3fd4-d442-11ed-a821-xxxxxxxxxxxx"
}

Response Schema: application/json

FieldTypeDescription
statusstringThe status of the message.
messagestringThe response message.
reasonstringThe reason for not processing the message.
401 Authentication Failure

Response

{
  "status": "failed",
  "message": "unable to process request",
  "reason": "jwt token expired"
}

Response Schema: application/json

FieldTypeDescription
statusstringThe status of the message.
messagestringThe response message.
reasonstringThe reason for not processing the message.
404 Page Not Found

Response

{
  "message": "The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again."
}

Response Schema: application/json

FieldTypeDescription
messagestringThe message response.
422 Unprocessable Entity (WebDAV)

Response

{
  "message": "please check API docs for more info",
  "status": "failed",
  "reason": {
    "payload": [
      "Unable to check payload type"
    ]
  }
}

Response Schema: application/json

One of Incorrect Response Type Error/Incorrect Campaign ID Error

FieldTypeDescription
messagestringThe response message.
statusstringThe status of the bulk send campaign.
reasonobjectThe reason for not processing the bulk send campaign request.
500 Internal Server Error

Response

{
  "status": "failed",
  "message": "unable to process request",
  "reason": "<internal server error reason>"
}

Response Schema: application/json

FieldTypeDescription
statusstringThe status of the bulk campaign.
messagestringThe response message.
reasonstringThe reason for not processing the request.


Did this page help you?