View All SMS

Endpoint

[GET] https://usenotifier.com/api/sms

Example Request

$response = Http::withToken('YOUR_API_KEY')
               ->get('https://usenotifier.com/api/sms');

Read the Authentication docs to get your API KEY

Example Response

{
    "data":
    [
        {
            "uuid": "40d78e06-55f4-4103-9234-09a9f0228028",
            "to": "+447700900389",
            "body": "Hello World!",
            "status": "delivered",
            "failure_reason": null,
            "created_at": "2022-09-07T20:32:57.000000Z",
            "sent_at": "2022-09-07T20:32:57.000000Z",
            "delivered_at": "2022-09-07T20:32:57.000000Z",
            "contact":
            {
                "uuid": "0338181e-358c-41f4-b914-8533df524aae",
                "firstname": "John",
                "lastname": "Smith",
                "created_at": "2022-09-01T15:45:32.000000Z",
                "contact_methods":
                [
                    {
                        "uuid": "6e7b6c86-4d24-41e4-9328-ec55ac088e9a",
                        "type": "phone",
                        "address": "+447949839469",
                        "created_at": "2022-09-06T15:45:32.000000Z",
                        "updated_at": "2022-09-06T15:45:32.000000Z"
                    }
                ]
            }
        },
        {
            "uuid": "8fd949db-f089-4d74-9b0e-3e0dd0d3deee",
            "to": "+447700900077",
            "body": "Message Two",
            "status": "delivered",
            "failure_reason": null,
            "created_at": "2022-09-07T21:34:26.000000Z",
            "sent_at": "2022-09-07T21:34:26.000000Z",
            "delivered_at": "2022-09-07T21:34:26.000000Z",
            "contact":
            {
                "uuid": "0338181e-358c-41f4-b914-8533df524aae",
                "firstname": "Jane",
                "lastname": "Doe",
                "created_at": "2022-09-01T15:45:32.000000Z",
                "contact_methods":
                [
                    {
                        "uuid": "6e7b6c86-4d24-41e4-9328-ec55ac088e9a",
                        "type": "phone",
                        "address": "+447949839469",
                        "created_at": "2022-09-06T15:45:32.000000Z",
                        "updated_at": "2022-09-06T15:45:32.000000Z"
                    }
                ]
            }
        },
        {
            ...more messages
        }
    ],
    "links":
    {
        "first": "https://usenotifier.com/api/sms?page=1",
        "last": "https://usenotifier.com/api/sms?page=4",
        "prev": null,
        "next": "https://usenotifier.com/api/sms?page=2"
    },
    "meta":
    {
        "current_page": 1,
        "from": 1,
        "last_page": 4,
        "links":
        [
            {
                "url": null,
                "label": "« Previous",
                "active": false
            },
            {
                "url": "https://usenotifier.com/api/sms?page=1",
                "label": "1",
                "active": true
            },
            {
                "url": "https://usenotifier.com/api/sms?page=2",
                "label": "2",
                "active": false
            },
            {
                "url": "https://usenotifier.com/api/sms?page=3",
                "label": "3",
                "active": false
            },
            {
                "url": "https://usenotifier.com/api/sms?page=4",
                "label": "4",
                "active": false
            },
            {
                "url": "https://usenotifier.com/api/sms?page=2",
                "label": "Next »",
                "active": false
            }
        ],
        "path": "https://usenotifier.com/api/sms",
        "per_page": 25,
        "to": 25,
        "total": 79
    }
}

Pagination

The meta object at the end of the response contains pagination links and variables. You can use these within your code to keep a track of how many more requests you need to make to retrieve all messages. To get the next page of results, simple add a page parameter. For example:

https://usenotifier.com/api/sms?page=2 //page 2
https://usenotifier.com/api/sms?page=3 //page 3

Available Statuses

  • pending

  • sent

  • delivered

  • failed

  • rejected

  • expired

  • undelivered

Last updated

Was this helpful?