SMS - Listing and Searching SMS

Groundhogg enables SMS communication to customers by adding Groundhogg's SMS plugin. Groundhogg's SMS plugin comes with its own API. you can access your SMS using /SMS/ endpoint. Using SMS endpoint you can search string within your SMS, fetch specific SMS using sms_id or you can get a list of all the SMS.

To list all the SMS you need to make GET HTTP request to SMS endpoint. You can use the following URL to make a request. Before making a request just make sure you added all the essential headers in the request.

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

List of SMS for select

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

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

List of emails for select2

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

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

Searching SMS 

You can search for a specific keyword by adding “search” or “q” arguments while making a request. It returns a list of SMS which contains keyword from the query string.

http://yoursite.com/wp-json/gh/v3/sms?q=hello<br>
{
    "sms": [
        {
            "ID": "2",
            "title": "hello",
            "message": "Hello Welcome to Groundhogg!",
            "author": "1"
        }
    ],
    "status": "success"
}<br>
Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us