Skip to Content
Cloud One
  • Products

    Business Communication Suite & Phone System


      By Edition

      ​Cloud

      Software

      Appliance

    By Deployment

    ​On-premise

    Hosted by Cloud One

    Self-hosted

    By Management

    ​Managed By Cloud One

    Semi-Managed by Cloud One

    Self-Managed


    Simu Connect UC Clients


    Simu Connect Web Client Simu Connect Mobile Client Simu Connect Desktop ClientSimu Connect Chrome ExtensionSimu Connect TAPI Integration

    SIP Trunks


    Business SIPPay As You Go SIP Country Presence SIPVirtual Phone NumbersGolden Phone NumbersToll Free NumbersBring Your Own Carrier (BYOC)Calling RatesTalktime Top-up

    Get a Proof of Concept Now!


    Simu Connect POC Application Managed Business Communication Suite Self Managed Business Communication SuiteSIP Trunk POCOdoo Phone POC
  • Solutions

    Business Needs


    Work from Anywhere Hosted UCaaS Self hosted UCaaSVideo ConferencingAppliance PBXAI-powered Cloud PBXWhite-label Solution

    Industry


    Call Center Healthcare HospitalityFinanceEducationLogisticsRetail BusinessGovernment Agency

    Ecosystem


    IP Phones SIP Trunks IntegrationHeadsetsVirtual Phone Numbers

    By Integration


    Odoo Phone System Zoho Phone System Salesforce Phone SystemMicrosoft Dynamics Phone SystemZendesk Phone SystemFreshdesk Phone SystemBitrix24 Phone SystemHubSpot Phone System
  • Resources

    Downloads

    Download user guides and more documents

    Book a Meeting

    Schedule a meeting at your convenience

    Developer Guide

    Read API Documentation for Cloud One BCS API

    Business Communication Suite

    Experience our user-friendly business communication suite today. Explore robust telephony features that enhance your client connections efficiently.  

    See More Details
  • Devices

    Yealink IP Phones


    Yealink T3 Series IP Phones Yealink T4 Series IP Phones Yealink T5 Series IP PhonesYealink T7 Series IP PhonesYealink T8 Series IP Phones Yealink DECT IP Phones

    Voice Conferencing Solutions


    VC Room Systems BYOD Solutions Video Phone Video Conferencing Accessories

    Microsoft Solutions


    MS Teams Rooms Systems Microsoft Phones Conference Phones HeadsetsYealink MeetingBoardYealink MeetingBoard Pro

    Zoom Rooms


    Zoom Rooms Systems Zoom Phones Zoom Cameras BYOD Solutions
  • Help

    Ticketing System


    Submit a Helpdesk TicketReport an Issue

    Training


    User TrainingOperator TrainingCall Center Agent TrainingSupervisor Training

    Frequently Asked Questions


    General FAQBCS FAQSIP Trunks FAQLocal Phone Numbers FAQ

    Contact Us


    WhatsApp Icon


  • Support Helpdesk Contact
  • +254 20 790 0100
  • support@cloudone.co

  • Accounts Helpdesk Contact
  • +254 20 790 0000
  • finance@cloudone.co
  • Visit our Office


    Cloud One Ltd

    Saachi Plaza - Unit A3, Argwings Kodhek Road, Nairobi, Kenya
    P.O.Box 76484-00508 Yaya Centre

    +254 20 790 0000

    hello@cloudone.co


    Kindly do not email multiple contacts as it creates multiple tickets on our CRM


  • Contact Us
  • Blog
    ​​
  • Sign in
  • 0
  • 0
  • Deploy in hours Certified Experts Zero Setup / License Fees*
  • Follow us
    Click here to setup your social networks
    Click here to setup your social networks
Cloud One
  • 0
  • 0
    • Products
    • Solutions
    • Resources
    • Devices
    • Help
    • Contact Us
    • Blog
  • Deploy in hours Certified Experts Zero Setup / License Fees*
  • Follow us
    Click here to setup your social networks
    Click here to setup your social networks
  • Sign in
  • ​​

Query Messages in Multiple Message Sessions

Query messages in multiple message sessions simultaneously.

Request URL

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

Request parameters

ParameterRequiredTypeDescription
page_sizeYesIntegerDefine how many records per page.
idsYesStringThe unique ID(s) of the message sessions.
Note:
  • You can query the ID using Search Specific Message Sessions.
  • Use commas to separate multiple IDs.

Response parameters

ParameterTypeDescription
errcodeIntegerReturned error code.
  • 0: Succeed.
  • Non-zero value: Failed.
Note:You can check the error code and error message in Error Code and Error Message.
errmsgStringReturned message.
  • SUCCESS: Succeed.
  • FAILURE: Failed.
dataArray<Messages>The information of the queried messages.

Messages

ParameterTypeDescription
session_idIntegerThe unique ID of the message session.
recordsArray<Msg_Record>Message record.

Msg_Record

ParameterTypeDescription
session_idIntegerThe unique ID of the message session.
msg_idIntegerThe unique ID of the message.
delivery_statusIntegerMessage delivery status.
  • 0: Sending.
  • 1: Sent successfully.
  • 2: Failed to send.
senderObject<Sender_Info>The information of the sender.
msg_kindIntegerThe category of the message.
  • 0: Normal message.
  • 1: WhatsApp template message.
msg_typeIntegerThe type of the message content.
  • 0: User message.
  • 1: Transfer message (transferred to extension or third-party message analytics platform).
  • 2: Manually closed message.
  • 3: Automatically closed message.
  • 4: Unsupported message type message.
  • 5: Session pickup message.
  • 6: Transfer message (transferred to message queue).
  • 7: Visitor manually closed session message.
  • 8: Call-related message.
msg_bodyStringMessage content.
msg_filesStringThe information of message files, which is returned as a JSON-formatted string.

The string represents an array of File_Info objects. For more details, see the File_Info table.

send_timeIntegerThe Unix timestamp (in seconds) when the message was sent.
receive_timeIntegerThe Unix timestamp (in seconds) when the message was received.
paramStringAdditional message-related parameters, which is returned as a JSON-formatted string.

The returned value varies depending on the msg_type.

  • If msg_type is 1 or 6, this parameter returns session transfer information.
  • If msg_type is 8, this parameter returns call information.

For more details, see the Param table.

send_errorStringThe type of error that occurred when sending a message.
  • invalid_webhook_request: Invalid request.
  • unsupported_callback_type: Unsupported callback type.
  • resource_not_found: Resource not found.
  • invalid_did_number: Invalid DID number.
  • auth_fail: Authentication failed.
  • auth_not_exit: Authentication information does not exist.
  • request_fail: Request failed.
  • send_fail: Sending failed.
  • exceeds_size_limit: Message exceeded size limit.
  • too_many_request: Too many requests.
  • unsupport_media_type: Unsupported media type.
  • invalid_param: Invalid parameter.
  • invalid_phone_number: Invalid phone number.
  • exceeds_time_limit: Exceeded time limit.
  • service_unavailable: Third-party service unavailable.
  • service_error: Third-party service error.
  • unknown_error: Unknown error.
  • template_not_exist: WhatsApp template does not exist.
  • msg_exceed: WhatsApp message text exceeds the allowed limit.
send_error_msgStringThe error message returned by third-party services when message sending fails.
tagStringThe tag assigned to the Facebook message, indicating its category or purpose.
  • ACCOUNT_UPDATE: Account-related updates.
  • CONFIRMED_EVENT_UPDATE: Confirm event updates.
  • HUMAN_AGENT: Message sent by a human agent.
  • POST_PURCHASE_UPDATE: Updates after a purchase.
whatsapp_msg_paramStringParameters to be inserted into the WhatsApp message template, provided as a JSON-formatted string.

Sender_Info

ParameterTypeDescription
user_idIntegerThe ID of the internal extension user in the session.
user_noStringThe identifier of the user in the session.
  • For internal extension user, this parameter returns the extension number.
  • For Third-party message analytics platform, this parameter returns a fixed value api.
  • For external customer, this parameter returns the ID or phone number of the customer.
user_typeIntegerUser type.
  • 1: Extension user.
  • 2: SMS user.
  • 3: WhatsApp user.
  • 4: Facebook user.
  • 5: Live Chat user.
  • 8: Message campaign recipient.
  • 9: Third-party message analytics platform (transmitted via API)
avatarStringThe ID of the user's avatar.
usernameStringUser name.

File_Info

ParameterTypeDescription
idStringThe ID of the file.
nameStringThe name of the file.
uriStringThe URI for accessing the file.
typeStringFile type.
sizeIntegerFile size (Unit: Byte).

Param

ParameterTypeDescription
Session transfer information
fromStringThe name of the member who transfer the message session.
  • For extension user, this parameter returns the caller ID name of the extension.
  • For third-party message analytics platform, this parameter returns a fixed value Third-Party Message Analytics Platform (Transmitted via API).
from_typeStringThe type of the member who transfer the message session.
  • extension: Extension user.
  • api: Third-party message analytics platform.
toStringThe name of the transfer destination.
  • For internal extension user, this parameter returns the extension number.
  • For message queue, this parameter is not returned.
  • For Third-party message analytics platform, this parameter returns a fixed value api.
to_idIntegerThe ID of the transfer destination.
  • For internal extension user / third-party message analytics platform, this parameter returns the system-assigned sequence ID of the session member.
  • For message queue, this parameter returns the unique ID of the message queue.
to_noStringThe identifier of the transfer destination.
  • For internal extension user, this parameter returns the extension number.
  • For message queue, this parameter is not returned.
  • For Third-party message analytics platform, this parameter returns a fixed value api.
to_typeStringThe type of the transfer destination.
  • extension: Extension user.
  • queue: Message queue.
  • api: Third-party message analytics platform.
Call information (Applicable to Live Chat session only)
fromStringThe name of the member who initiate the call.
  • For internal extension user, this parameter returns the caller ID name of the extension.
  • For external customer, this parameter returns a fixed value Website Visitor.
toStringThe name of the called member.
  • For internal extension user, this parameter returns the caller ID name of the extension.
  • For external customer, this parameter returns a fixed value Website Visitor.
to_typeIntegerThe type of the member who was called.
  • 1: Extension user.
  • 5: Live Chat user (namely the website visitor).
to_member_idIntegerThe system-assigned sequence ID of the session member who was called.
cdr_uidStringThe unique ID of the CDR.
durationStringCall duration.

Examples

Request example

Query the messages in two message sessions (ID: 2874 & 3086).

GET /openapi/v1.0/message/query?page_size=10&access_token=ct7tuz0q8QE6DTNdPUXCQW3N3IYj2SPX&ids=2874,3086 HTTP/1.1
Host: 192.168.5.150:8088

Response example

HTTP/1.1 200 OK
{
"errcode": 0,
"errmsg": "SUCCESS",
"data": [
{
"session_id": 2874,
"records": [
{
"session_id": 2874,
"msg_id": 9263,
"delivery_status": 1,
"sender": {
"user_id": 0,
"user_no": "1cc0546496ae42eabf50a54a97fff976",
"user_type": 5,
"avatar": "",
"username": "Website Visitor"
},
"msg_type": 7,
"msg_body": "The session has been closed by visitor.",
"msg_files": "",
"send_time": 1753238892,
"param": "",
"send_error": "",
"send_error_msg": "",
"tag": "",
"receive_time": 1753238892,
"whatsapp_msg_param": "",
"msg_kind": 0
},
{
"session_id": 2874,
"msg_id": 9211,
"delivery_status": 1,
"sender": {
"user_id": 39,
"user_no": "59996",
"user_type": 1,
"avatar": "HEEsqLBtF2VJ4wV85f2ef07f-15ab-4e62-bffb-1200a54a3209",
"username": "Jane Smith"
},
"msg_type": 6,
"msg_body": "Jane Smith has transferred the session to Tech Support queue.",
"msg_files": "",
"send_time": 1753232835,
"param": "{\"from\":\"Jane Smith\",\"to\":\"Tech Support queue\",\"to_id\":6,\"to_type\":\"queue\"}",
"send_error": "",
"send_error_msg": "",
"tag": "",
"receive_time": 1753232835,
"whatsapp_msg_param": "",
"msg_kind": 0
},
{
"session_id": 2874,
"msg_id": 9209,
"delivery_status": 1,
"sender": {
"user_id": 39,
"user_no": "59996",
"user_type": 1,
"avatar": "HEEsqLBtF2VJ4wV85f2ef07f-15ab-4e62-bffb-1200a54a3209",
"username": "Jane Smith"
},
"msg_type": 8,
"msg_body": "Jane Smith initiates a call to the Website Visitor. Call duration: 00:05:00. CDR ID: 20250723090642A9FDF.",
"msg_files": "",
"send_time": 1753232811,
"param": "{\"from\":\"Jane Smith\",\"to\":\"Website Visitor\",\"to_type\":5,\"to_member_id\":10832,\"cdr_uid\":\"20250723090642A9FDF\",\"duration\":\"00:05:00\"}",
"send_error": "",
"send_error_msg": "",
"tag": "",
"receive_time": 1753232811,
"whatsapp_msg_param": "",
"msg_kind": 0
},
{
"session_id": 2874,
"msg_id": 9208,
"delivery_status": 1,
"sender": {
"user_id": 0,
"user_no": "1cc0546496ae42eabf50a54a97fff976",
"user_type": 5,
"avatar": "",
"username": "Website Visitor"
},
"msg_type": 8,
"msg_body": "Website Visitor initiates a call to the Jane Smith. Call duration: 00:03:02. CDR ID: 20250723090632258BB.",
"msg_files": "",
"send_time": 1753232798,
"param": "{\"from\":\"Website Visitor\",\"to\":\"Jane Smith\",\"to_type\":1,\"to_member_id\":10833,\"cdr_uid\":\"20250723090632258BB\",\"duration\":\"00:03:02\"}",
"send_error": "",
"send_error_msg": "",
"tag": "",
"receive_time": 1753232798,
"whatsapp_msg_param": "",
"msg_kind": 0
},
{
"session_id": 2874,
"msg_id": 9207,
"delivery_status": 1,
"sender": {
"user_id": 39,
"user_no": "59996",
"user_type": 1,
"avatar": "HEEsqLBtF2VJ4wV85f2ef07f-15ab-4e62-bffb-1200a54a3209",
"username": "Jane Smith"
},
"msg_type": 5,
"msg_body": "Jane Smith picked up the session from message queue Customer Query queue",
"msg_files": "",
"send_time": 1753232778,
"param": "{\"from\":\"Customer Query queue\",\"from_id\":4,\"to\":\"Jane Smith\"}",
"send_error": "",
"send_error_msg": "",
"tag": "",
"receive_time": 1753232778,
"whatsapp_msg_param": "",
"msg_kind": 0
},
{
"session_id": 2874,
"msg_id": 9206,
"delivery_status": 1,
"sender": {
"user_id": 0,
"user_no": "1cc0546496ae42eabf50a54a97fff976",
"user_type": 5,
"avatar": "",
"username": "Website Visitor"
},
"msg_type": 0,
"msg_body": "I'm not receiving email notifications from your system. Can you check this for me?",
"msg_files": "",
"send_time": 1753232747,
"param": "",
"send_error": "",
"send_error_msg": "",
"tag": "",
"receive_time": 1753232747,
"whatsapp_msg_param": "",
"msg_kind": 0
}
]
},
{
"session_id": 3086,
"records": [
{
"session_id": 3086,
"msg_id": 10322,
"delivery_status": 1,
"sender": {
"user_id": 39,
"user_no": "59996",
"user_type": 1,
"avatar": "HEEsqLBtF2VJ4wV85f2ef07f-15ab-4e62-bffb-1200a54a3209",
"username": "Jane Smith"
},
"msg_type": 0,
"msg_body": "{\"id\":392,\"template_id\":\"1293546285747227\",\"name\":\"campaign_notification\",\"parameter_format\":\"NAMED\",\"language\":\"en\",\"category\":\"MARKETING\",\"sub_category\":\"CUSTOM\",\"omnichannel_id\":3,\"components\":[{\"type\":\"HEADER\",\"format\":\"IMAGE\"},{\"type\":\"BODY\",\"text\":\"Hello! 👋\\n\\nAs a valued VIP member, we’re excited to share a special DISCOUNT with you! 🎁\\nEnjoy 20% OFF for all products —available until 2025/9/30.\\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 Sale_Mart! 💙\"},{\"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\"}]}]}",
"msg_files": "",
"send_time": 1758591592,
"param": "",
"send_error": "",
"send_error_msg": "",
"tag": "",
"receive_time": 1758591592,
"whatsapp_msg_param": "{\"id\":392,\"template_id\":\"1293546285747227\",\"name\":\"campaign_notification\",\"language\":{\"code\":\"en\"},\"components\":[{\"type\":\"HEADER\",\"parameters\":[{\"type\":\"IMAGE\",\"file_list\":[{\"id\":\"ee6b4017010b401c88a02aeb9cfcd4d2\",\"name\":\"images.jpg\",\"uri\":\"20250923/ee6b4017010b401c88a02aeb9cfcd4d2\",\"type\":\"image/jpeg\",\"size\":7163}]}]},{\"type\":\"BODY\",\"parameters\":[{\"type\":\"TEXT\",\"text\":\"\",\"parameter_name\":\"customertier\"},{\"type\":\"TEXT\",\"text\":\"\",\"parameter_name\":\"offertype\"},{\"type\":\"TEXT\",\"text\":\"\",\"parameter_name\":\"offerdetails\"},{\"type\":\"TEXT\",\"text\":\"\",\"parameter_name\":\"expirydate\"},{\"type\":\"TEXT\",\"text\":\"11\",\"parameter_name\":\"companyname\"}]},{\"type\":\"BUTTONS\",\"parameters\":[{\"type\":\"FLOW\",\"text\":\"\"},{\"type\":\"URL\",\"text\":\"\"},{\"type\":\"VOICE_CALL\",\"text\":\"\"}]}],\"parameter_format\":\"NAMED\"}",
"msg_kind": 1
},
{
"session_id": 3086,
"msg_id": 10321,
"delivery_status": 1,
"sender": {
"user_id": 39,
"user_no": "59996",
"user_type": 1,
"avatar": "HEEsqLBtF2VJ4wV85f2ef07f-15ab-4e62-bffb-1200a54a3209",
"username": "Jane Smith"
},
"msg_type": 0,
"msg_body": "Your order is scheduled to be delivered tomorrow. You’ll receive a notification once it’s out for delivery.",
"msg_files": "",
"send_time": 1758591565,
"param": "",
"send_error": "",
"send_error_msg": "",
"tag": "",
"receive_time": 1758591565,
"whatsapp_msg_param": "",
"msg_kind": 0
},
{
"session_id": 3086,
"msg_id": 10319,
"delivery_status": 1,
"sender": {
"user_id": 0,
"user_no": "+8618159207827",
"user_type": 3,
"avatar": "",
"username": ""
},
"msg_type": 0,
"msg_body": "Thanks! Can you tell me when it will be delivered?",
"msg_files": "",
"send_time": 1758549891,
"param": "",
"send_error": "",
"send_error_msg": "",
"tag": "",
"receive_time": 1758549889,
"whatsapp_msg_param": "",
"msg_kind": 0
},
{
"session_id": 3086,
"msg_id": 10318,
"delivery_status": 1,
"sender": {
"user_id": 39,
"user_no": "59996",
"user_type": 1,
"avatar": "HEEsqLBtF2VJ4wV85f2ef07f-15ab-4e62-bffb-1200a54a3209",
"username": "Jane Smith"
},
"msg_type": 0,
"msg_body": "Thank you. I’m checking the details for order 123456 now.",
"msg_files": "",
"send_time": 1758549851,
"param": "",
"send_error": "",
"send_error_msg": "",
"tag": "",
"receive_time": 1758549848,
"whatsapp_msg_param": "",
"msg_kind": 0
},
{
"session_id": 3086,
"msg_id": 10317,
"delivery_status": 1,
"sender": {
"user_id": 0,
"user_no": "+8618159207827",
"user_type": 3,
"avatar": "",
"username": ""
},
"msg_type": 0,
"msg_body": "Sure, my order number is 123456.",
"msg_files": "",
"send_time": 1758549724,
"param": "",
"send_error": "",
"send_error_msg": "",
"tag": "",
"receive_time": 1758549722,
"whatsapp_msg_param": "",
"msg_kind": 0
},
{
"session_id": 3086,
"msg_id": 10316,
"delivery_status": 1,
"sender": {
"user_id": 39,
"user_no": "59996",
"user_type": 1,
"avatar": "HEEsqLBtF2VJ4wV85f2ef07f-15ab-4e62-bffb-1200a54a3209",
"username": "Jane Smith"
},
"msg_type": 0,
"msg_body": "Hello! I'd be happy to assist you. Could you please provide your order number?",
"msg_files": "",
"send_time": 1758549548,
"param": "",
"send_error": "",
"send_error_msg": "",
"tag": "",
"receive_time": 1758549547,
"whatsapp_msg_param": "",
"msg_kind": 0
},
{
"session_id": 3086,
"msg_id": 10315,
"delivery_status": 1,
"sender": {
"user_id": 0,
"user_no": "+8618159207827",
"user_type": 3,
"avatar": "",
"username": ""
},
"msg_type": 0,
"msg_body": "Hi, I need help with my recent order.",
"msg_files": "",
"send_time": 1758549500,
"param": "",
"send_error": "",
"send_error_msg": "",
"tag": "",
"receive_time": 1758549496,
"whatsapp_msg_param": "",
"msg_kind": 0
}
]
}
]
}
Useful Links
  • Home
  • About us
  • Products
  • Services
  • Shipping
  • Return Policy
  • Warranty
  • Contact us
Legal
  • Terms
  • Privacy
  • Shared Responsibility
    Service Level Agreement
  • Certifications
About us

Cloud One Limited is a leading Kenyan local telephony service provider. Established in 2017, we offer reliable and secure cloud and on premise business communication solutions, including SIP trunks, Yealink IP phones, and VPS hosting in our Tier 3 data center.


Our mission is to revolutionize cloud communications by providing unparalleled reliability, cutting-edge innovation, and substantial cost savings. We deliver a stress-free, always-available service experience that empowers businesses to thrive in the digital age.

DUNS Registration Number: 561230946
Company Registration Number: PVT-5JUEYMA
Licensed & Regulated by the Communications Authority of Kenya


Follow us
Connect with us
  • Contact us
  • hello@cloudone.co
  • +254 20 7900000
  • Saachi Plaza, UNIT A3 - Argwings Kodhek Rd
Download Simu Connect

    Get the app on the playstore

    Download desktop app for Windows​

    Download app from the appstore

    Download MacOS app