Edit a Message Campaign
Edit a message campaign.
Request URL
POST {base_url}/{api_path}/message_campaign/update?access_token={access_token}
Request parameters
| Parameter | Required | Type | Description |
|---|---|---|---|
| id | Yes | Integer | The ID of the message campaign. Note: You can query the ID using Search Specific Message Campaigns. |
| name | No | String | The name of the message campaign. |
| channel_type | No | String | The type of the message channel used by the campaign. Valid value:
|
| omnichannel_id | No | Integer | The ID of the message channel used by the campaign. Note: You can query the ID using Search Specific Message Channels. |
| sender | No | Integer | The ID of the number associated with the specified message channel. Note: You can query the ID using Search Specific Message Channels. |
| recipient_type | No | String | The method used to add recipients to the campaign. Valid value:
|
| number_list | No | Array <Number_List> | The phone numbers for the campaign. Note:
|
| recipient_id | No | Integer | The ID of the phonebook where the recipients' phone numbers are stored. Note:
|
| recipient_num_type | No | String | The type of phone number field from which to retrieve the recipient's number in the specified phonebook. Note: This parameter is REQUIRED when recipient_type is set to phonebook. Valid value:
|
| content_type | No | String | The type of the message content. Valid value:
|
| content | No | String | Message content for SMS campaign. Note: This parameter is REQUIRED when content_type is set to text or document.
|
| msg_param | No | String | Message parameters to be filled into the template, provided in JSON-formatted string. Note: This parameter is REQUIRED when content_type is set to template. To send a message template, you need to first get the desired WhatsApp message template, then construct the message object with the template information and the desired contents. For the specific structure, see MSG_Param below. |
| send_type | No | String | When the campaign message should be sent. Valid value:
|
| send_time | No | Integer | The timestamp (in seconds) of the scheduled time when the campaign messages should be sent. Note: This parameter is REQUIRED when send_type is set to schedule. |
| send_mode | No | String | The sending mode of the campaign. Valid value:
|
| assign_to_type | No | String | The type of the destination to which new campaign sessions will be assigned. Note: This parameter is REQUIRED when send_mode is set to new_session. Valid value:
|
| assign_to_id | No | Integer | The ID of the destination to which new campaign sessions will be assigned.Note:
|
Number_List
| Parameter | Required | Type | Description |
|---|---|---|---|
| id | Yes | Integer | The ID of the phone number in the number list. |
| number | Yes | String | Recipient's phone number in E.164 format. For example, +254703424344. |
MSG_ParamNote:You can fill in the values in the table below with the information you get when querying a specific template.
| Parameter | Required | Type | Description |
|---|---|---|---|
| id | Yes | Integer | The ID of the message template in the PBX system. |
| template_id | Yes | String | The original template ID from the WhatsApp platform. |
| name | Yes | String | Template name. |
| language | Yes | Object<Template_Lang> | Template language. |
| parameter_format | Yes | String | Whether placeholders are referenced by position or by variable name. Valid value:
|
| components | No | Array<Components> | The list of message components for WhatsApp message template in JSON-formatted string. Note: If the template contains only static text (no variables or buttons), this parameter can be left empty. You can use this parameter to provide values for template placeholders (variables) and required button parameters. For more information, see WhatsApp Message Template Component Description. |
Template_Lang
| Parameter | Required | Type | Description |
|---|---|---|---|
| code | Yes | String | The language code used for the template. |
Response parameters
| Parameter | Type | Description |
|---|---|---|
| errcode | Integer | Returned error code.
|
| errmsg | String | Returned message.
|
Examples
Request example
Update the send mode for a message campaign.
POST /openapi/v1.0/message_campaign/update?access_token=YAuOvAdHfaqJ8Ni46FDdM9zgK7jYa6mE HTTP/1.1
Host: 192.168.5.150:8088
Content-Type: application/json
{
"id":246,
"send_type": "schedule",
"send_time": 1753951516
}Response example
HTTP/1.1 200 OK
{
"errcode": 0,
"errmsg": "SUCCESS"
}