Fetch SMS

GET method used to get a list of SMS from Groundhogg. Users can retrieve all available SMS by making a GET request to the following URL. make sure you added require header parameters before making a request.

http://yoursite.com/wp-json/gh/v3/sms
{
    "sms": [
        {
            "ID": "2",
            "title": "hello",
            "message": "Hello Welcome to Groundhogg!",
            "author": "1"
        },
        {
            "ID": "1",
            "title": "Payment",
            "message": "Your payment approved.",
            "author": "1"
        }
    ],
    "status": "success"
}

Searching SMS

You can search for a specific keyword by adding “search” or “q” arguments while making a request. it returns an output which contains that query string.

http://yoursite.com/wp-json/gh/v3/sms?q=hello
{
    "sms": [
        {
            "ID": "2",
            "title": "hello",
            "message": "Hello Welcome to Groundhogg!",
            "author": "1"
        }
    ],
    "status": "success"
}

List of SMS for select

Users can easily bound all the available SMS list in dropdown by setting select parameter true. It will return a list of SMS id and SMS title.

http://yoursite.com/wp-json/gh/v3/sms?select=true
{
    "sms": {
        "1": "payment",
        "2": "hello"
    },
    "status": "success"
}

List of emails for select2

Users can also bound sms list inside a select-2 drop down by setting select2=true while making GET request. It will return the select2 formate of SMS list.

http://yoursite.com/wp-json/gh/v3/sms?select2=true
{
    "results": [
        {
            "id": "2",
            "text": "hello"
        },
        {
            "id": "1",
            "text": "Payment"
        }
    ],
    "more": false
}



Was this article helpful to you? Yes No

How can we help?