What Is the MITTO SMS API?

Mitto’s SMS API lets you send secure, reliable SMS messages. The service is available to MITTO clients. With this API you can:

  • Make test API calls. (Test the operation of the API without actually sending SMSes.)
  • Send SMS messages. You can send a message to one recipient per API call.
  • Create messages with more than 160 characters.
  • Control the character encoding of the text messages you send. The supported encoding schemas are GSM, Unicode, Binary, and Auto.
  • Receive callback notifications about sent messages.
  • Send SMS messages in bulk.
  • Add metadata to a message which the API returns to you in the callbacks.

Documentation Organization

We organize our documentation as follows:

  • Read details about Mitto’s SMS API including available endpoints, authentication, and a sample request and a response – SMS
  • See a list of use cases showing the capability of the API. – SMS Use Cases
  • Review API details with the reference page, which shows each individual request and response parameter. – SMS API Reference
  • If you want to implement SMPP, this page provides details for getting started. – SMPP Specification

Get Started with the Mitto SMS API

This section describes how to get started with Mitto’s SMS API. After reading this, you will know how to sign up with Mitto, what endpoints are available, and the request and response format for this API.

Sign up for a Mitto Account

To get started with Mitto, do the following:
1. Sign up for a Mitto account at https://www.mitto.ch/contact/ or write to info@mitto.ch.
2. Submit the IPs you want to use for requests. They must be whitelisted on Mitto’s system.
3. For callbacks, provide your dedicated callback URL and method (both GET and POST methods are supported). Alternatively, you can use dynamic callbacks. See Replace Callback URL in an API Call for more details. See Retrieve Delivery Reports for details about reports.
4. Mitto will respond with your API key and confirmation that your IP addresses and callback URL are configured.

Request Requirements

To send a message, make a POST request to this endpoint:
https://rest.mittoapi.com/sms

The rest of the message-related information (like recipient’s MSISDN, text of the message, etc.) and sending options (like the character set encoding) you pass as body parameters.

By default, Mitto returns JSON. If you want to receive the response in XML, then change the URL of the POST request to:
https://rest.mittoapi.com/sms.xml

The JSON representation of the request body schema for the mandatory parameters only looks like:
{
"from": "string",
"to": "string",
"text": "string"
}

The JSON representation of the full request body schema (mandatory + optional parameters) looks like:
{
"from": "string",
"to": "string",
"text": "string",
"type": "string",
"reference": "string",
"udh": "string",
"validity": "int"
"pid": "int",
"test": Boolean,
}

Required Headers

The required headers are:

  • Content-Type: application/json
  • X-Mitto-API-Key: (This is discussed further in the Authentication section.)

For examples of API calls, refer to the SMS Use Cases section.

Response Format and Content

Mitto returns the response in JSON data format by default, but the format can be JSON or XML. The response contains information about the delivery status of the SMS, a timestamp for the delivery, and a message ID. Additionally, if you used optional request parameters in the call, the response includes them. The typical response payload (when the call was made with the mandatory request parameters only) looks like this:
{
"ids": [ "715118ef01aa4480bbd67324a0459b0b" ],
"timestamp": "2019-04-13T12:07:57.8625574Z",
"responseCode": 0,
"responseText": "SMS sent successfully."
}

Authentication

Mitto’s SMS API requires authentication on every request. To authenticate, you pass your API key in the header of the request like this:
X-Mitto-API-Key: string

In addition to authenticating on every request, you must also have the IP from which the requests are made whitelisted on MITTO’s system. Mitto enforces this additional security measure for your protection. To see an implementation of an API call with authentication, refer to the SMS Use Cases section.