Testing TextMagic in Sandbox

Sandbox is a tool to test TextMagic REST API requests without the need to install any applications or write any code. Here, we explain the following details about Sandbox:

Go to TextMagic Sandbox

The credentials area

To make requests using your TextMagic account, you need to enter your account username and your API key into the corresponding fields. You may also Save them in your browser or press Clear to erase them.

TextMagic API Sandbox 1

Command documentation

To view the documentation for a command i.e. its parameters, filters, output format and return codes, simply click on its name:

TextMagic SMS Gateway API Sandbox 2

How it works

Sandbox allows you to test the TextMagic REST API directly from your browser. No programming skills are required. To use Sandbox, simply click on the entry for the command you want to test:

TextMagic SMS Gateway API Sandbox 3

Enter the required parameters and then click Try! to make a request. The URL corresponds to the command you wish to use, e.g. /api/v2/templates corresponds to the templates command.

You will receive an HTTP response code along with a JSON response body showing whether the request was successful or not. You will find additional information provided in the HTTP response headers Response Body and the Response Header.

TextMagic SMS Gateway API Sandbox 4

In the example above, note that the request failed because the user did not specify values for the name and content fields which are both required. Thus, the TextMagic API thus returned an HTTP error status code, with a brief error message showing which fields contained errors.

Now, let’s modify the request so that it includes both of the required parameters. Voilà:

TextMagic SMS Gateway API Sandbox 5

We have now successfully created a new message template, and saved it to the TextMagic database. It was created with an ID value of 51386. Now we can send a message using this template via API or TextMagic Online.

Let’s retrieve the template now to verify that its content was saved correctly. To do this, use the GET /api/v2/templates/{id} command. Open it, enter the user id you obtained in the previous step and click Try!

TextMagic SMS Gateway API Sandbox 6

The next step

Congratulations! Now you know how to use TextMagic Sandbox to make requests without writing code and are now ready to send text messages using the TextMagic REST API. Why not start at the Messages: Send section?

If you need help with Sandbox testing or if you have any other enquiries regarding the test program in Sandbox, you can email us at support@textmagic.com.