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:
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.
Command documentation
To view the documentation for a command i.e. its parameters, filters, output format and return codes, simply click on its name:
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:
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.
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à:
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!
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 [email protected].