Query Information of Multiple Message Campaigns

Query the detailed information of multiple message campaigns.

Request URL

GET {base_url}/{api_path}/message_campaign/query?access_token={access_token}

Request parameters

Parameter Required Type Description
ids Yes String The unique ID(s) of the message campaigns.
Note:
  • Use a comma to separate multiple IDs.

Response parameters

Parameter Type Description
errcode Integer Returned error code.
  • 0: Succeed.
  • Non-zero value: Failed.
Note: You can check the error code and error message in Error Code and Error Message.
errmsg String Returned message.
  • SUCCESS: Succeed.
  • FAILURE: Failed.
list Array <MSGCampaign_DetailInfo> The list of detailed information for queried message campaigns.
MSGCampaign_DetailInfo
Parameter Type Description
id Integer The ID of the message campaign.
name String The name of the message campaign.
channel_type String The type of message channel used by the campaign.
  • sms: SMS channel.
  • whatsapp: WhatsApp channel.
omnichannel_id Integer The ID of the message channel used by the campaign.
sender String The number used to send messages.
recipient_type String The method used to add recipients to the campaign.
  • input: Add recipients by manual input or file import.
  • phonebook: Add recipients from a specified phonebook.
recipient_id Integer The ID of the phonebook where the recipients' phone number are stored.
recipient_num_type String The type of phone number field from which to retrieve the recipient's number in the specified phonebook.
send_type String When the campaign message should be sent.
  • immediately: Messages are sent as soon as the campaign is saved.
  • schedule: Messages are sent at a scheduled time.
  • draft: The campaign is saved as a draft and no messages are sent.
send_time Integer The timestamp of the scheduled time when the campaign messages should be sent.
send_mode String The sending mode of the campaign.
  • new_session: New sessions will be created and assigned to a specified destination when sending campaign messages.
  • direct: Messages will be sent directly without creating new sessions.
assign_to_type String The type of the destination to which new campaign sessions will be assigned.
  • extension: Extension.
  • queue: Message queue.
assign_to_id Integer The ID of the destination to which new campaign sessions will be assigned.
content_type String The type of the message content.
  • text: Text.
  • document: File.
  • template: WhatsApp message template.
content String Message content.
number_list Array <Number_List> The list of numbers added by manual input or file import.
msg_param String Message parameters, which contains the parameters to be filled into the WhatsApp message template, in JSON-formatted string.
Note: This parameter is returned only when a WhatsApp message template is used in the campaign.
Number_List
Parameter Type Description
id Integer The ID of the phone number.
number String Phone number.

Example

Request example

GET /openapi/v1.0/message_campaign/query?access_token=MmkEiOx3iOn4qbIOUh9QI0Bzj69pXza3&ids=245,255 HTTP/1.1

Host: yeastardocs.example.yeastarcloud.com

Response example

HTTP/1.1 200 OK
{
    "errcode": 0,
    "errmsg": "SUCCESS",
    "list": [
        {
            "id": 245,
            "name": "VIP Summer Sale Notification",
            "channel_type": "sms",
            "omnichannel_id": 7,
            "sender": 7,
            "recipient_type": "input",
            "send_type": "immediately",
            "send_mode": "new_session",
            "assign_to_type": "queue",
            "assign_to_id": 1,
            "content_type": "text",
            "content": "Hi! We’re excited to announce our new product line. Check it out on our website and enjoy a special launch offer!",
            "number_list": [
                {
                    "id": 7858,
                    "number": "+8615394416953"
                },
                {
                    "id": 7858,
                    "number": "+8615394416954"
                }
            ]
        },
        {
            "id": 255,
            "name": "New Product Launch",
            "channel_type": "whatsapp",
            "omnichannel_id": 1,
            "sender": 1,
            "recipient_type": "input",
            "send_type": "schedule",
            "send_time": 1753898766,
            "send_mode": "new_session",
            "assign_to_type": "extension",
            "assign_to_id": 2,
            "content_type": "template",
            "content": "{\"id\":1773,\"template_id\":\"1293546285747227\",\"name\":\"docstest\",\"parameter_format\":\"NAMED\",\"components\":[{\"type\":\"HEADER\",\"format\":\"IMAGE\"},{\"type\":\"BODY\",\"text\":\"Hello! 👋\\n\\nAs a valued  {{customer_tier}} member, we’re excited to share a special {{offer_type}} with you! 🎁\\nEnjoy {{offer_details}}—available until {{expiry_date}}.\\n\\nIf you have any questions or want to redeem your offer, simply reply to this message or contact our team.\\n\\nThank you for choosing {{company_name}}! 💙\"},{\"type\":\"BUTTONS\",\"buttons\":[{\"type\":\"FLOW\",\"text\":\"Redeem Offer\",\"flow_id\":657693363952373,\"flow_action\":\"NAVIGATE\",\"navigate_screen\":\"SIGN_UP\"},{\"type\":\"URL\",\"text\":\"Visit website\",\"url\":\"https://test.com/\"},{\"type\":\"VOICE_CALL\",\"text\":\"Contact us\"}]}],\"language\":\"en\",\"category\":\"MARKETING\",\"sub_category\":\"CUSTOM\",\"omnichannel_id\":1}",
            "msg_param": "{\"id\":1773,\"template_id\":\"1293546285747227\",\"name\":\"docstest\",\"language\":{\"code\":\"en\"},\"components\":[{\"type\":\"HEADER\",\"parameters\":[{\"type\":\"IMAGE\",\"file_list\":[{\"id\":\"d8b23d56d9974cdb90d6c2d6927861b9\",\"name\":\"pexels-photo-5632382.jpeg\",\"uri\":\"20250725/d8b23d56d9974cdb90d6c2d6927861b9\",\"type\":\"image/jpeg\",\"size\":88555}]}]},{\"type\":\"BODY\",\"parameters\":[{\"type\":\"TEXT\",\"text\":\"\",\"parameter_name\":\"customer_tier\"},{\"type\":\"TEXT\",\"text\":\"\",\"parameter_name\":\"offer_type\"},{\"type\":\"TEXT\",\"text\":\"\",\"parameter_name\":\"offer_details\"},{\"type\":\"TEXT\",\"text\":\"\",\"parameter_name\":\"expiry_date\"},{\"type\":\"TEXT\",\"text\":\"SmartMal\",\"parameter_name\":\"company_name\"}]},{\"type\":\"BUTTONS\",\"parameters\":[{\"type\":\"FLOW\",\"text\":\"\"},{\"type\":\"URL\",\"text\":\"\"},{\"type\":\"VOICE_CALL\",\"text\":\"\"}]}],\"parameter_format\":\"NAMED\"}"
        }
    ]
}