MobiTexter API

Overview

Are you looking for platform-native Sdks to integrate into your app. All you need to do is include the MobiTexter SDK as a library in your project and a couple of lines of code. We will take care of rest things from server hosting, database, maintenance to analytics.

We are providing AppLozic platform native SDK to integrate native app message communication to your product.

Visit for more details: AppLozic

Are you looking for a way to connect your software with MobiTexter application? Connect your software with the MobiTexter app to send text messages directly from the software without any manual work.

We are providing API for the businesses to integrate with the software.

Documentation

Getting Started: Create an Account

To create an account with mobitexter you need to install mobitexter app on your phone. After the app is successfully installed on your device please contact our support for the API key. Once you got the API key, you are ready for the API calls.

Authentication

Please contact support@mobitexter.net to obtain your password. 

Authentication is done using BASIC authentication.

All request should contain the following header.

Authorization: Basic Base64Encode of emailId:apiKey

If the emailId is abc@gmail.com and apiKey is helloWorld, then the request header will be:

Authorization: Basic YWJjQGdtYWlsLmNvbTpoZWxsb1dvcmxk

Response

Response Description
success Request is successfully processed
error In case of any exception contact support@mobitexter.net
UnAuthorized Access This will come if the emailId and apiKey doesn't match.

API

Currently, we provide APIs to send, delete and retrieve list of text messages associated to your account. Following are the details:

Send Text Message

SEND SMS URL: http://mobitexter.appspot.com/rest/ws/app/v1/sms/add
Method Type: POST
Content-Type: application/x-www-form-urlencoded

Parameters:

Parameter Required Default Description
to Yes Comma separated list of phone numbers to which you want to send message
message Yes Text Message
Response:
Response Description
success Request is successfully processed
error In case of any exception contact support@mobitexter.net
UnAuthorized Access This will come if the emailId and apiKey doesn't match or your API Pack got expired.
DAILY_QUOTA_LIMIT_EXCEEDED This will come if the 600 API calls per day is crossed
NUMBERS_PER_SMS_LIMIT_CROSSED This will come if more than 50 numbers are added in a single API call
Limitations:

In order to provide consistent service to all the users, there is a limitation of 600 API calls per day. Per API call, upto 50 comma separated phone numbers are allowed. In case you want to send sms to lets say 100 phone numbers then send 2 separate requests with 50 phone numbers in each request.

HTTP POST
Example in Java
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import org.apache.commons.codec.binary.Base64;
import org.apache.http.HttpResponse;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.NameValuePair;
import org.apache.http.message.BasicNameValuePair;
import org.apache.http.client.entity.UrlEncodedFormEntity;
import java.util.*;
public class HTTPClientAddPost {
// Send Text Message URL.
public static final String REST_SEND_MESSAGE_URL = "http://mobitexter.appspot.com/rest/ws/app/v1/sms/add";
public static void main(String[] args) throws ClientProtocolException,IOException {
// Base64 encoding of emailId:apikey.
byte[] authEncBytes = Base64.encodeBase64("abc@gmail.com:hello".getBytes());
String authStringEnc = new String(authEncBytes);
DefaultHttpClient httpClient = new DefaultHttpClient();
HttpPost postHTTPRequest = new HttpPost(REST_SEND_MESSAGE_URL);
postHTTPRequest.addHeader("Authorization", "Basic " + authStringEnc);
postHTTPRequest.addHeader("Content-Type", "application/x-www-form-urlencoded");
ArrayList postParameters = new ArrayList();
postParameters.add(new BasicNameValuePair("to", "+91740611"));
postParameters.add(new BasicNameValuePair("message", "Hi, how r you..??"));
postHTTPRequest.setEntity(new UrlEncodedFormEntity(postParameters));
HttpResponse httpResponse = httpClient.execute(postHTTPRequest);
System.out.println("\nSending 'POST' request to URL : " + REST_SEND_MESSAGE_URL);
System.out.println("Response Code : " + httpResponse.getStatusLine().getStatusCode());
BufferedReader rd = new BufferedReader(new InputStreamReader(httpResponse.getEntity().getContent()));
StringBuilder result = new StringBuilder();
String line = "";
while ((line = rd.readLine()) != null) {
result.append(line);
}
System.out.println("Response Status : " + result.toString());
}
}

Text Message List

SMS LIST URL: http://mobitexter.appspot.com/rest/ws/app/v1/sms/list
Method Type: GET

Parameters:

Parameter Required Default Description
contactNumber No Contact Number for which you want to fetch the message
startTime No Start Time from when you want to fetch message list. It is number of milliseconds since January 1, 1970, 00:00:00 GMT.
endTime No End Time upto when you want to fetch message list. It is number of milliseconds since January 1, 1970, 00:00:00 GMT.
startIndex Yes 0 Starting Index to fetch messages from list.
pageSize Yes 200 Number of messages per page you want to fetch.
smsType No One of the following : INBOX, OUTBOX, DRAFT, OUTBOX_SENT_FROM_DEVICE, MT_INBOX, MT_OUTBOX.

Note: For fetching the next page of your message list startIndex value should be equal to the sum of pageSize value of all the previous calls.

Response:
{"sms":[{"contactIds":"+917406118...","createdAtTime":"1382023531066","deviceKeyString":"agtzfm9zdS1hbHBoYXIaCxVVc2VyGKOvTgwLEgZEZXZpY2UYAQw","keyString":"agtzfm9zdS1hbHBoCxIDU21zGI63Tgw","message":"hi","sendToDevice":"true","sent":"false","suUserKeyString":"agtzfm9zdS1hbHBoxIGU3VVc2VyGKOvTgw","to":"7406118...","type":"5"},{"contactIds":"+917406118...","createdAtTime":"1382023510530","deviceKeyString":"agtzfm9zdS1hbHBoYXIaCxIGU3VVc2VyGKOvTgwLEXZpY2UYAQw","keyString":"agtzfm9zdS1hbHBoY21zGPW-Tgw","message":"hi","sendToDevice":"true","sent":"false","suUserKeyString":"agtzfm9zdS1hbHBoYXIVVc2VyGKOvTgw","to":"7406118...","type":"5"}]}
Response Description
error In case of any exception contact support@mobitexter.net
null This will come if message list is empty
UnAuthorized Access This will come if the emailId and apiKey doesn't match or your API Pack got expired.
HTTP GET
Example in Java
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import org.apache.commons.codec.binary.Base64;
import org.apache.http.HttpResponse;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.client.methods.HttpGet;
public class HTTPClientListGet {
// Get Text Message List URL.
public static final String REST_GET_MESSAGE_LIST_URL = "http://mobitexter.appspot.com/rest/ws/app/v1/sms/list?
contactNumber=+91740611&startTime=1391193000000&endTime=1394562599000&
startIndex=0&pageSize=30&smsType=OUTBOX";
public static void main(String[] args) throws ClientProtocolException,IOException {
// Base64 encoding of emailId:apikey.
byte[] authEncBytes = Base64.encodeBase64("abc@gmail.com:hello".getBytes());
String authStringEnc = new String(authEncBytes);
DefaultHttpClient httpClient = new DefaultHttpClient();
HttpGet getHTTPRequest = new HttpGet(REST_GET_MESSAGE_LIST_URL);
getHTTPRequest.addHeader("Authorization", "Basic " + authStringEnc);
HttpResponse httpResponse = httpClient.execute(getHTTPRequest);
System.out.println("\nSending 'GET' request to URL : " + REST_GET_MESSAGE_LIST_URL);
System.out.println("Response Code : " + httpResponse.getStatusLine().getStatusCode());
BufferedReader rd = new BufferedReader(new InputStreamReader(httpResponse.getEntity().getContent()));
StringBuilder result = new StringBuilder();
String line = "";
while ((line = rd.readLine()) != null) {
result.append(line);
}
System.out.println("Response : " + result.toString());
}
}

Delete Text Message

 SMS DELETE URL: http://mobitexter.appspot.com/rest/ws/app/v1/sms/delete
Method Type: GET

Parameters:

Parameter Required Default Description
contactNumber No Contact Number for which you want to delete message
startTime No Start Time from when you want to delete message. It is number of milliseconds since January 1, 1970, 00:00:00 GMT.
endTime No End Time upto when you want to delete message. It is number of milliseconds since January 1, 1970, 00:00:00 GMT.

*Required: Atleast one of the above three Parameters

Response:
Response Description
success Request is successfully processed
error In case of any exception contact support@mobitexter.net
UnAuthorized Access This will come if the emailId and apiKey doesn't match or your API Pack got expired.
Please provide atleast one parameter contactNumber, fromTime and toTime This will come if all the three parameters are null.
HTTP GET
Example in Java
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import org.apache.commons.codec.binary.Base64;
import org.apache.http.HttpResponse;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.client.methods.HttpGet;
public class HTTPClientDeleteGet {
// Delete Text Message URL.
public static final String REST_DELETE_MESSAGE_URL = "http://mobitexter.appspot.com/rest/ws/app/v1/sms/delete?
contactNumber=+91740611&startTime=1394476200000&endTime=139456259900";
public static void main(String[] args) throws ClientProtocolException,IOException {
// Base64 encoding of emailId:apikey.
byte[] authEncBytes = Base64.encodeBase64("abc@gmail.com:hello".getBytes());
String authStringEnc = new String(authEncBytes);
DefaultHttpClient httpClient = new DefaultHttpClient();
HttpGet getHTTPRequest = new HttpGet(REST_DELETE_MESSAGE_URL);
getHTTPRequest.addHeader("Authorization", "Basic " + authStringEnc);
HttpResponse httpResponse = httpClient.execute(getHTTPRequest);
System.out.println("\nSending 'GET' request to URL : " + REST_DELETE_MESSAGE_URL);
System.out.println("Response Code : " + httpResponse.getStatusLine().getStatusCode());
BufferedReader rd = new BufferedReader(new InputStreamReader(httpResponse.getEntity().getContent()));
StringBuilder result = new StringBuilder();
String line = "";
while ((line = rd.readLine()) != null) {
result.append(line);
}
System.out.println("Response Status : " + result.toString());
}
}

Contact Us