Get Messages For A Contact

Endpoint

https://app.wabais.com/api/messages?order_by=created_at&order_direction=asc&phone_number=223224322432

Method

GET

Authentication

Bearer Token

Body Type

None

Query Parameters

order_by created_at

order_direction asc

phone_number {{phone_number (with country code without the + )}}

Sample Response

{
    "data": [
        {
            "id": "63c14f1f85cedb2f330ba",
            "received_text": null,
            "direction": "Outgoing",
            "current_assignee": null,
            "media_type": "",
            "media_file_path": null,
            "media_caption": null,
            "template": "1567380760431234",
            "body": null,
            "message_template": {
                "id": "63be8120ba8dc171060d",
                "name": "welcome_to_our_bookshop",
                "template_human_name": "Welcome To Our Bookshop (en_US)",
                "components": [
                    {
                        "type": "HEADER",
                        "format": "TEXT",
                        "text": "Welcome"
                    },
                    {
                        "type": "BODY",
                        "text": "Hi {{1}},\n\nPlease welcome to our bookshop. Do you need our help?"
                    },
                    {
                        "type": "FOOTER",
                        "text": "Thanks"
                    }
                ],
                "language": "en_US",
                "status": "APPROVED",
                "category": "MARKETING",
                "template_id": "1567380760431234",
                "created_at": "11 Jan 23 09:28 AM",
                "parameters_array": [
                    1
                ]
            },
            "message_time": "13 Jan 23 12:31 PM",
            "status": "read",
            "failed_reason": null,
            "message_id": "wamid.HBgMMjU0NzI0NDU5NDk3FQIAERgSODlFM0RGN0E5NDU2ODBFRDJGAA==",
            "transer_message": null,
            "conversation_window_period": "Date",
            "iso_message_time": "2023-01-13T12:31:27.000000Z",
            "parameters": "{\"1\":\"John Doe\"}",
            "phone_number": "254123445234",
            "contact": {
                "id": "638b00094eacbaec6b0d5393",
                "phone_number": "254123445234",
                "name": "John Doe",
                "unread_messages_count": 0,
                "assigned_to": null,
                "allow_send": false
            },
            "phone_number_id": "106069605674953",
            "created_at": "13 Jan 23 12:31 PM",
            "customer_id": "6384924f26d5721c24045bd2",
            "media_id": null,
            "previous_assignee": null
        },
        {
            "id": "63c14f2f7cae71be64074493",
            "received_text": "Nope",
            "direction": "Incoming",
            "current_assignee": null,
            "media_type": "",
            "media_file_path": null,
            "media_caption": null,
            "template": null,
            "body": null,
            "message_template": null,
            "message_time": "13 Jan 23 12:31 PM",
            "status": null,
            "failed_reason": null,
            "message_id": "wamid.HBgMMjU0NzI0NDU5NDk3FQIAEhggMTZCNDIzNUQwMzJCMjI3REQ1RjQzQTgxM0U4NTBFQTgA",
            "transer_message": null,
            "conversation_window_period": "Date",
            "iso_message_time": "2023-01-13T12:31:43.000000Z",
            "parameters": "null",
            "phone_number": "254123445234",
            "contact": {
                "id": "638b00094eacbaec6b0d5393",
                "phone_number": "254123445234",
                "name": "John Doe",
                "unread_messages_count": 0,
                "assigned_to": null,
                "allow_send": false
            },
            "phone_number_id": "106069605674953",
            "created_at": "13 Jan 23 12:31 PM",
            "customer_id": "6384924f26d5721c24045bd2",
            "media_id": null,
            "previous_assignee": null
        }
    ]
}