SMS Rest API

Introduction

The SMS Rest API can be used to send SMS requests through the ZapApp platform. There are currently three SMS operations that can be done through the Rest API.

Operations

NameMethodDescription
/v1/{subscriptionId}/smsPOST

Sends an SMS Message to the given destination

/v1/{subscriptionId}/sms/queue/{id}/{messageId}DELETE

Deletes a specific SMS from the queue. Warning this operation has been deprecated.

/v1/{subscriptionId}/sms/logGET

Returns the SMS Log for the given Subscription Id

Usage

Using the SMS Platform Rest API is straightforward, these are just a couple of ways to interact with it.

Swagger

Swagger can be found on the API website for Zapappi.

To use the SMS Platform, go to the SMS section of Swagger and expand it.

In this example, we'll use the SendSMS method.

Fill in the SubscriptionID, Source, Destination, Message and the optional Webhook link.

 

Once those details have been entered, press the 'Try it out!' button.

Several boxes will appear, containing the Response Body, Response Code and the Response Headers.

All of the other methods on Swagger work in the same way, making it easy to test.

Curl

You can also use Curl to access the API methods.

To easily install Curl you can download Chocolatey and follow this instructions here

Make sure to copy the Request URL which can be generated manually or taken from the Swagger response.

Bring up the command prompt and enter the following filling in between the asterisks with your own values.

curl -k -X POST -H "Cache-Control: no-cache" -H "Content-Length: 0" -u *YourAPIKeyHere*:*YourAPISecretHere* "*YourRequestURLHere*"

(-X POST and  -H "Content-Length: 0" are only needed for POST requests)

If the curl command is successful, you should receive a JSON response.