SimpleTexting API Documentation (2.0.0)

Download OpenAPI specification:Download

Introduction

Thousands of businesses rely on SimpleTexting to communicate with their audience via text message. With our API, developers can access many of our platform’s features and integrate them with other websites or applications. This document details the available SimpleTexting API functions and their parameters. For additional security, our API is by approval only. If you’d like access, sign up for a trial account and email [email protected] with details about your use case.

How it works

Our API is organized around REST. It uses standard HTTP response codes and authentication. Before you get started, there a few things to keep in mind:

  • When using the POST request, you must specify that content-type is application/json.
  • The format of responses for all requests is JSON, you can skip the Accept request header or set it to application/json.

Authentication

Each time you make a request to our API, we use a bearer token in your header to authenticate your account. API requests without authentication will fail. Your API token can be found under settings.

Please be sure to keep your bearer token secure. Don’t share it any public areas such as GitHub, client-side code, etc.

api_key

Bearer authentication (also called token authentication) is an authentication scheme that involves security tokens called bearer tokens. The name “Bearer authentication” can be understood as “give access to the bearer of this token.” The bearer token is a cryptic string, usually generated by the server in response to a login request. The client must send this token in the Authorization: Bearer <token> header when making requests to protected resources. To understand more about bearer tokens, please take a look at the following resource.

Security Scheme Type API Key
Header parameter name: Authorization

Campaigns

Send and manage campaigns directly from the SimpleTexting API. The endpoint allows you to Create and Send a campaign, get a specific campaign by its name or ID, or list all of your SimpleTexting campaigns.

Note: If the message contains a link from a common third-party link shortener such as bit.ly, it will appear from our URL shortener instead and occupy 20 characters. Learn more.

Get all Campaigns

Get all immediate campaigns from the SimpleTexting system. Please note that none of your scheduled or recurring campaigns will be returned by this request.

Example: We request all SENT campaigns sent from the 8005551234 number to the list My First List:

https://api-app2.simpletexting.com/v2/api/campaigns?page=100&size=2&accountPhone=8005551234&state=SENT&listNameOrId=My First List&startDateFrom=2021-04-28T23:20:08.489Z&startDateTo=2021-05-28T23:20:08.489Z

Authorizations:
query Parameters
page
integer <int32> >= 0
Default: 0
Example: page=100

An ordinal number of the page to return with the results of a request (with the campaigns sent from the given number). Please note that page numbering starts at zero (0)

size
integer <int32> <= 500
Default: 50
Example: size=2

The number of the returned campaigns to show per page

accountPhone
string
Example: accountPhone=8005551234

The phone number the campaign was sent from

state
string
Enum: "PAUSED" "SENDING" "COMPLETED" "ERROR" "MONITORING"
Example: state=SENDING

The current state of the immediate campaigns you wish to retrieve:

  • ERROR: Returns campaigns that were not sent because of errors

  • PAUSED: Returns Paused campaigns on your account

  • SENDING: Returns sending campaigns

  • COMPLETED: Returns all successfully sent campaigns on your account

  • MONITORING: Returns all campaigns that includes "stop" words or malicious links

listNameOrId
string
Example: listNameOrId=My First List

The list name or list ID

startDateFrom
string <date-time>
Example: startDateFrom=2021-04-28T23:20:08.489Z

List campaigns starting from a certain date. The time is in ISO 8601 format.

startDateTo
string <date-time>
Example: startDateTo=2021-05-28T23:20:08.489Z

List campaigns up to a certain date. The time is in ISO 8601 format.

Responses

Response samples

Content type
application/json
{
  • "content": [
    ],
  • "totalPages": 0,
  • "totalElements": 0
}

Send a Campaign

Create and send a campaign.

Example: Here we created a campaign from our short code 8005551234 and sent it to a segment identified here by its ID, along with a list called My First List. We also specified that the First Name custom field will only take up 20 characters. Finally, we specified that 2 pieces of media will be attached. One is housed on SimpleTexting and identified by its ID, the other is getting pulled from an external link:

{ "title": "My first campaign", "listsOrSegments": [ "507f191e810c19729de860ea", "My First List" ], "accountPhone": "8005551234", "customFieldsMaxLength": { "firstName": 20 }, "messageTemplate": { "title": "My first campaign", "subject": "My first campaign", "text": "Hi %%firstname%%, welcome to our campaign!", "fallbackText": "My first campaign", "mediaItems": [ "https://txt.so/img.jpg", "507f1f77bcf86cd799439011" ] } }

Authorizations:
Request Body schema: application/json
title
required
string [ 1 .. 250 ] characters

Campaign title

Example: My first campaign

listIds
Array of strings

Lists IDs or names

Example: ["507f191e810c19729de860ea","My First List"]

segmentIds
Array of strings

Segments IDs or names

Example: ["507f191e810c19729de860ea","My First List"]

accountPhone
string

Account phone, primary number is default

Example: 8005551234

object

Custom fields length in current campaign, overwrite default settings. See /custom-fields

Example: {"firstname":"20"}

required
object (MessageTemplate)

Campaign Template

Example: { "mode": "MMS_PREFERRED", "subject": "My first campaign", "text": "Hi %%firstname%%, welcome to our campaign!", "fallbackText": "My first campaign", "unsubscribeText": "If you no longer wish to hear from us, reply STOP", "fallbackUnsubscribeText": "If you no longer wish to hear from us, reply STOP", "mediaItems": [ "https://txt.so/img.jpg", "507f1f77bcf86cd799439011" ] }

Responses

Request samples

Content type
application/json
{
  • "title": "My first campaign",
  • "listIds": [
    ],
  • "segmentIds": [
    ],
  • "accountPhone": "8005551234",
  • "customFieldsMaxLength": {
    },
  • "messageTemplate": {
    }
}

Response samples

Content type
application/json
{
  • "id": "507f191e810c19729de860ea"
}

Get a Campaign

Get a campaign via its unique ID.

Example: Below, we return the information associated with the campaign whose ID is 507f1f77bcf86cd799439011. You can use the Get all Campaigns endpoint to retrieve campaign IDs for all of your campaigns:

https://api-app2.simpletexting.com/v2/api/507f1f77bcf86cd799439011

Authorizations:
path Parameters
campaignId
required
string
Example: 507f1f77bcf86cd799439011

Campaign ID in hexadecimal format

Responses

Response samples

Content type
application/json
{
  • "campaignId": "607f0558a7c898629dd47d7a",
  • "title": "My first campaign",
  • "accountPhone": "8005551234",
  • "customFieldsMaxLength": {
    },
  • "state": "COMPLETED",
  • "lists": [
    ],
  • "segments": [
    ],
  • "created": "2021-04-28T23:20:08.489Z",
  • "modified": "2021-04-28T23:20:08.489Z",
  • "started": "2021-04-28T23:20:08.489Z",
  • "finished": "2021-04-28T23:20:08.489Z",
  • "messageTemplate": {
    },
  • "origin": "API_V2",
  • "outcome": {
    },
  • "trackingLinks": {
    }
}

Messages

In SimpleTexting, users can send and receive messages. With our API, this can be done programmatically.

Note: If the message contains a link from a common third-party link shortener such as bit.ly, it will appear from our URL shortener instead and occupy 20 characters. Learn more.

Get all Messages

Retrieves a list of all messages sent to a specific contact from a specific number on your account.

Example: Here we return all messages from an account:

https://api-app2.simpletexting.com/v2/api/messages?page=100&size=500

Authorizations:
query Parameters
page
integer <int32> >= 0
Default: 0
Example: page=25

An ordinal number of the page to return with the results of a request (with the messages of the given number). Please note that page numbering starts at zero (0)

size
integer <int32> <= 500
Default: 50
Example: size=50

The number of the returned messages to show per page

accountPhone
string
Example: accountPhone=8005551234

The phone number on your account the messages were sent to. If blank, the request will return the messages sent to the primary account phone

since
string <date-time>
Example: since=2021-04-28T23:20:08.489Z

First sent/received timestamp. The time is in ISO 8601 format.

contactPhone
string
Example: contactPhone=8001234567

The contact's phone number

Responses

Response samples

Content type
application/json
{
  • "content": [
    ],
  • "totalPages": 0,
  • "totalElements": 0
}

Send a Message

Send either an MMS or SMS message to a contact. Use this programmatically to send to multiple contacts.

If the message contains a link from a common third-party link shortener such as bit.ly, it will appear from our URL shortener instead and occupy 20 characters. Learn more.

There are limitations on Media Files with MMS messages. The size limitations of these items are discussed here.

Example: Below, we have an example of an MMS message being sent. We specified that we wanted to send an MMS message to 1234567 from one of the numbers on our account - 8005551234. We also provided some fallback text, should the receiving cell phone be unable to receive an MMS, and provided a link/ID to the media we wished to attach:

{ "contactPhone": "1234567890", "accountPhone": "8005551234", "mode": "MMS_PREFERRED", "text": "Hello! How are you?", "subject": "Some message from SimpleTexting", "fallbackText": "[url=%%fallback_link%%]", "mediaItems": [ "https://txt.so/img.jpg", "507f1f77bcf86cd799439011" ] }

Authorizations:
Request Body schema: application/json
contactPhone
required
string

Contact's phone

Example: 1234567890

accountPhone
string

The account phone to send from. If this field is left blank, the primary account number will be used as a default

Example: 8005551234

mode
required
string
Enum: "AUTO" "SINGLE_SMS_STRICTLY" "MMS_PREFERRED"

Determines how your message will be presented:

  • AUTO: this means that SimpleTexting will find more relative types for your message content

  • SINGLE_SMS_STRICTLY: this will send only a single SMS or return an error

  • MMS_PREFERRED: this will send an MMS or fallback SMS if MMS is not enabled by your contacts' carriers

Example: MMS_PREFERRED

AUTO is the default value for this field.

subject
string

MMS Subject (available for MMS)

Example: Some message from SimpleTexting

text
required
string

Text Body

Example: Hello! How are you?

fallbackText
string

Custom fallback text if MMS cannot be received. Should contain '[url=%%fallback_link%%]' placeholder that will be replaced with a link to the message

Example: [url=%%fallback_link%%]

mediaItems
Array of strings

List of MMS media URLs for temporal storing or media items IDs

Example: [\"https://txt.so/img.jpg\", \"507f1f77bcf86cd799439011\"]

Responses

Request samples

Content type
application/json
{
  • "contactPhone": "1234567890",
  • "accountPhone": "8005551234",
  • "mode": "MMS_PREFERRED",
  • "subject": "Some message from SimpleTexting",
  • "text": "Hello! How are you?",
  • "fallbackText": "[url=%%fallback_link%%]",
  • "mediaItems": []
}

Response samples

Content type
application/json
{
  • "id": "507f191e810c19729de860ea",
  • "credits": 0
}

Evaluate a Message

Evaluate the body of your message before sending it to a contact or contacts.

Example: We evaluate a message to determine a number of properties. These include the number of credits it will use, whether it is an extended SMS or a regular SMS and any potential errors that may occur:

https://api-app2.simpletexting.com/v2/api/messages/evaluate

Authorizations:
Request Body schema: application/json
mode
required
string
Enum: "AUTO" "SINGLE_SMS_STRICTLY" "MMS_PREFERRED"

Determines how your message will be presented:

  • AUTO: this means that SimpleTexting will find more relative types for your message content

  • SINGLE_SMS_STRICTLY: this will send only a single SMS or return an error

  • MMS_PREFERRED: this will send an MMS or fallback SMS if MMS is not enabled by your contacts' carriers

Example: MMS_PREFERRED

AUTO is the default value for this field.

Example: MMS_PREFERRED

subject
string

MMS Subject (available for MMS)

Example: New In Store

text
required
string

Text Body

Example: Hello! How are you?

fallbackText
string

A custom fallback text if a contact can't receive an MMS message. It should contain a [url=%%fallback_link%%] placeholder that will be replaced with a link to the message.

Example: [url=%%fallback_link%%]

mediaItems
Array of strings

List of MMS media URLs for temporal storing or media items IDs

Example: ["https://txt.so/img.jpg", "507f1f77bcf86cd799439011"]

Responses

Request samples

Content type
application/json
{
  • "mode": "MMS_PREFERRED",
  • "subject": "New In Store",
  • "text": "Hello! How are you?",
  • "fallbackText": "[url=%%fallback_link%%]",
  • "mediaItems": []
}

Response samples

Content type
application/json
{
  • "detectedCategory": "SMS",
  • "length": 134,
  • "remains": 23,
  • "maxLength": 150,
  • "unicode": true,
  • "sumOfCredits": 1,
  • "warnings": "Text is blank",
  • "errors": [
    ]
}

Get a Message

Retrieve a specific message from the system via its message ID.

Example: Below, we return the information associated with the message whose ID is 507f1f77bcf86cd799439011. You can use the Get all Messages endpoint to retrieve message IDs for all of your messages:

https://api-app2.simpletexting.com/v2/api/messages/507f1f77bcf86cd799439011

Authorizations:
path Parameters
messageId
required
string
Example: 507f1f77bcf86cd799439011

Message ID in hexadecimal format

Responses

Response samples

Content type
application/json
{
  • "id": "507f191e810c19729de860ea",
  • "subject": "Some message from SimpleTexting",
  • "text": "Hello! How are you?",
  • "contactPhone": "8001234567",
  • "accountPhone": "8005551234",
  • "directionType": "MO",
  • "timestamp": "2020-04-28T23:20:08.489Z",
  • "referenceType": "API_SEND",
  • "category": "SMS",
  • "mediaItems": [
    ]
}

Media Items

When sending messages via the SimpleTexting platform, you may need to attach various media items. This API allows you to perform various operations needed to manage your media attachments. The size limitations of these items are discussed here.

Upload Media

Upload a media file from a local directory to SimpleTexting.

Example: Here we upload an image from our local directory using an HTTP request. We state that the media should be shared with teammates:

POST /api/mediaitems/upload?shared=true HTTP/1.1 Host: https://api-app2.simpletexting.com/v2/ accept: */* Authorization: Bearer {{YOUR_TOKEN}} Content-Length: 176 Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW ----WebKitFormBound

Authorizations:
query Parameters
shared
boolean
Default: true

Define whether a media file is shared with teammates

Request Body schema: multipart/form-data
file
required
string <binary>

The media file you want to upload

Responses

Response samples

Content type
application/json
{}

Get Media Items

This endpoint allows you to retrieve all Media Items.

Example: Here we return all Media Items from an account:

https://api-app2.simpletexting.com/v2/api/mediaitems?page=100&size=500

Authorizations:
query Parameters
page
integer <int32> >= 0
Default: 0
Example: page=29

Number of pages

size
integer <int32> <= 500
Default: 50
Example: size=50

Page size

Responses

Response samples

Content type
application/json
{}

Get Media Item

Authorizations:
path Parameters
mediaItemId
required
string
Example: 507f1f77bcf86cd799439011

Media item ID in hexadecimal format

Responses

Response samples

Content type
application/json
{}

Delete Media

Remove media that you have previously uploaded to SimpleTexting.

Example: Here we delete a Media Item whose ID is507f1f77bcf86cd799439011. You can use the Get all Media Items endpoint to retrieve Media Items IDs for all of your Media Items:

https://api-app2.simpletexting.com/v2/api/contact-lists/507f1f77bcf86cd799439011

Authorizations:
path Parameters
mediaItemId
required
string
Example: 507f1f77bcf86cd799439011

The mediaItemId in hexadecimal format

Responses

File Information

We can accept a wide variety of file types over MMS. The industry standard maximum file size limit is 600KB for toll-free accounts and is 1MB on shortcode accounts.

We support the following file type: MPEG Audio, MPEG Video, MP4 Video, VCARDs, PDF

For popular image types we can accept media up to 15MB, our system will automatically compress these to the 600KB industry limitation. These media types include: JPEG, PNG, GIF

Contacts

At a minimum, each contact in SimpleTexting must have a phone number. Contacts can also hold additional information including first name, last name, and email address. You can also create custom fields to store data specific to your website or app’s needs.

Get a Contact

Get a contact via their unique ID or phone number. Phone number is the preferred parameter for this call.

Example: Below, we return the information associated with the Contact whose ID is 507f1f77bcf86cd799439011. You can use the Get all Contacts endpoint to retrieve contact IDs for all of your contacts:

https://api-app2.simpletexting.com/v2/api/contacts/507f1f77bcf86cd799439011

Authorizations:
path Parameters
contactIdOrNumber
required
string
Example: 3051234567

Phone number (preferred) or Contact ID in hexadecimal format

Example: 3051234567 / 507f1f77bcf86cd799439011

Responses

Response samples

Content type
application/json
{
  • "contactId": "607f0558a7c898629dd47d7a",
  • "contactPhone": "1234567890",
  • "firstName": "John",
  • "lastName": "Doe",
  • "email": "[email protected]",
  • "birthday": "1985-05-15",
  • "lists": [
    ],
  • "customFields": {
    },
  • "comment": "VIP client",
  • "subscriptionStatus": "OPT_IN",
  • "created": "2021-04-28T23:20:08.489Z",
  • "updated": "2021-05-28T20:20:08.489Z",
  • "updateSource": "IMPORTED_FROM_FILE"
}

Update a Contact

Update a contact’s phone number or any other field.

Example: Below we update our contact, 3051234567. We declared their custom field value for zipcode is 12345 and that they get added to the list with an ID 507f191e810c19729de860ea and another list called My First List. In our URL, we requested that the contact gets added to a new list while remaining on the current one. We also requested not to update the contact's information if they already exist within the system:

URL:

https://api-app2.simpletexting.com/v2/api/contacts/3051234567?listsReplacement=false&false

Request Body:

{ "contactPhone": "1234567890", "firstName": "John", "lastName": "Doe", "email": "[email protected]", "birthday": "1985-05-15", "customFields": { "zipcode": "12345" }, "comment": "VIP client", "listIds": [ "507f191e810c19729de860ea", "My First List" ] }

Authorizations:
path Parameters
contactIdOrNumber
required
string
Example: 3051234567

Contact ID in hexadecimal format or the contact's phone number.

Example: 3051234567 / 507f1f77bcf86cd799439011

query Parameters
upsert
boolean
Default: true

If a contact already exists with the phone number in your request body, the contact will be updated with the information in the request when upsert is set to true.

Example: false

listsReplacement
boolean
Default: true

If listsReplacement is set to true, a contact will be removed from their existing list. If set to false, a contact will be added to a new list and stay in their original list.

Example: false

Request Body schema: application/json
contactPhone
string

Contact's phone number

Example: 1234567890

firstName
string

Contact's first name

Example: John

lastName
string

Contact's last name

Example: Doe

email
string

Contact's email

Example: [email protected]

birthday
string

Contact's birthday in format: yyyy-mm-dd

Example: 1985-05-15

object (Key/value pairs)

Object that contains custom field values, where you should use a Name or a Merge tag in a property name and a field value as a property value.

To find a merge tag, please see the Contacts > Custom Fields section for your account.

For example: if you have a custom field with the name Street address and the merge tag %%street_address%%, you would use the "Street address": "1625 N Central Ave" parameter or the "street_address": "1625 N Central Ave" parameter.

comment
string

Notes about the contact.

Example: VIP client

listIds
Array of strings

All the lists (List IDs or names) to add the contact to or replace.

Example: ["507f191e810c19729de860ea", "My First List"]

Responses

Request samples

Content type
application/json
{
  • "contactPhone": "1234567890",
  • "firstName": "John",
  • "lastName": "Doe",
  • "email": "[email protected]",
  • "birthday": "1985-05-15",
  • "customFields": {
    },
  • "comment": "VIP client",
  • "listIds": [
    ]
}

Response samples

Content type
application/json
{
  • "id": "507f191e810c19729de860ea"
}

Delete a Contact

Delete a contact via their unique ID or phone.

Example: Here we delete a Contact whose ID is507f1f77bcf86cd799439011. You can use the Get all Contacts endpoint to retrieve Contact IDs for all of your Contacts:

https://api-app2.simpletexting.com/v2/api/webhooks/507f1f77bcf86cd799439011

Authorizations:
path Parameters
contactIdOrNumber
required
string
Example: 507f1f77bcf86cd799439011

Contact ID in hexadecimal format or phone number

Example: 3051234567 / 507f1f77bcf86cd799439011

Responses

Get all Contacts

For a given account, return all contacts that have been created in the account. A paginated list of contacts will be returned to you:

Example: Here we return all Contacts from an account since April 28th 2021:

https://api-app2.simpletexting.com/v2/api/contacts?page=100&size=2&since=2021-04-28T23:20:08.489Z&direction=ASC

Authorizations:
query Parameters
page
integer <int32> >= 0
Default: 0
Example: page=250

An ordinal number of the page to return with the results of a request (with the contacts of the given account). Please note that page numbering starts at zero (0)

Example: 250

size
integer <int32> <= 500
Default: 50
Example: size=150

The number of the returned contacts to show per page

Example: 150

since
string <date-time>
Example: since=2021-04-28T23:20:08.489Z

List contacts updated since a specified date. The time is in ISO 8601 format.

Example: 2021-04-28T23:20:08.489Z

direction
string
Default: "desc"
Example: direction=desc

Specify the sort order of your results. By default, results are sorted by the 'updated' field:

  • ASC: Sort values in ascending order

  • DESC: Sort values in descending order

Example: desc

Responses

Response samples

Content type
application/json
{
  • "content": [
    ],
  • "totalPages": 0,
  • "totalElements": 0
}

Create a Contact

Create a new contact and add them to a specific list.

Example: Below we created our contact, John Doe. We declared his custom field value for zipcode is 12345 and that he gets added to the list with an ID 507f191e810c19729de860ea and another list called My First List:

{ "contactPhone": "1234567890", "firstName": "John", "lastName": "Doe", "email": "[email protected]", "birthday": "1985-05-15", "customFields": { "zipcode": "12345" }, "comment": "VIP client", "listIds": [ "507f191e810c19729de860ea", "My First List" ] }

Authorizations:
query Parameters
upsert
boolean
Default: true

If a contact already exists with the phone number in your request body, the contact will be updated with the information in the request when upsert is set to true.

listsReplacement
boolean
Default: true

If listsReplacement is set to true, a contact will be removed from their existing list. If set to false, a contact will be added to a new list and stay in their original list.

Request Body schema: application/json
contactPhone
string

Contact's phone number

Example: 1234567890

firstName
string

Contact's first name

Example: John

lastName
string

Contact's last name

Example: Doe

email
string

Contact's email

Example: [email protected]

birthday
string

Contact's birthday in format: yyyy-mm-dd

Example: 1985-05-15

object (Key/value pairs)

Object that contains custom field values, where you should use a Name or a Merge tag in a property name and a field value as a property value.

To find a merge tag, please see the Contacts > Custom Fields section for your account.

For example: if you have a custom field with the name Street address and the merge tag %%street_address%%, you would use the "Street address": "1625 N Central Ave" parameter or the "street_address": "1625 N Central Ave" parameter.

comment
string

Notes about the contact.

Example: VIP client

listIds
Array of strings

All the lists (List IDs or names) to add the contact to or replace.

Example: ["507f191e810c19729de860ea", "My First List"]

Responses

Request samples

Content type
application/json
{
  • "contactPhone": "1234567890",
  • "firstName": "John",
  • "lastName": "Doe",
  • "email": "[email protected]",
  • "birthday": "1985-05-15",
  • "customFields": {
    },
  • "comment": "VIP client",
  • "listIds": [
    ]
}

Response samples

Content type
application/json
{
  • "id": "507f191e810c19729de860ea"
}

Contacts - Batch Operations

An endpoint to assist in batch operations on your contacts. Using these operations, you can update specific contact information, or delete contacts, all using the contacts phone as an ID.

Update a Group of Contacts

Update multiple fields at once for a batch of contacts. You can update their first name, last name, emails, lists, and more.

Example: Here we are updating two contacts, seen in the array. The list replacement is set to true, so they will be removed from their existing list and added to a new one:

{ "updates": [ { "contactPhone": "1234567890", "firstName": "John", "lastName": "Doe", "email": "[email protected]", "birthday": "1985-05-15", "customFields": { "zipcode": "12345" }, "comment": "VIP client", "listIds": [ "507f191e810c19729de860ea", "My First List" ] },{ "contactPhone": "0987654321", "firstName": "Jane", "lastName": "Doe", "email": "[email protected]", "birthday": "1984-05-25", "customFields": { "zipcode": "54321" }, "comment": "VIP client", "listIds": [ "507f191e810c19729de860ea", "My First List" ] } ], "listsReplacement": true }

Step 1: Start the task for the batch update with the above parameters. As a result, you receive the task ID.

Example:

{ "id": "6176fb3e141c0060668b2c03" }

Step 2: Request the task result by adding task ID from Step 1 to the Get update result request.

Example:

{ "status": "DONE", "results": [{ "done": true, "contactPhone": "1234567890", "contactId": "6176f999141c0060668b258e" }, { "done": true, "contactPhone": "0987654321", "contactId": "1236f555141c0060668b123e"}], "requestedCount": 2, "processedCount": 2 }

Authorizations:
Request Body schema: application/json
listsReplacement
boolean

If listsReplacement is set to true, a contact will be removed from their existing list. If set to false, a contact will be added to a new list and stay in their original list.

Example: true

required
Array of objects (ContactUpdate) [ 0 .. 500 ] items

List of updates for contacts

Responses

Request samples

Content type
application/json
{
  • "listsReplacement": true,
  • "updates": [
    ]
}

Response samples

Content type
application/json
{
  • "id": "507f191e810c19729de860ea"
}

Delete a Group of Contacts

Delete a group of contacts from SimpleTexting using their phone numbers.

Example: Below, we delete a batch of contacts identified here by their phone number in the array:

{ "contactPhones": [ "1234567890", "0987654321", "1122334455" ] }

Authorizations:
Request Body schema: application/json
contactPhones
required
Array of strings (List of contacts' phone numbers for deletion **Example:** `["1234567890","1234567891"]`) [ 0 .. 500 ] items

Responses

Request samples

Content type
application/json
{
  • "contactPhones": [
    ]
}

Response samples

Content type
application/json
{
  • "results": [
    ]
}

Get the Result of a Batch Update Task

Return the result of a batch update by the task id.

Authorizations:
path Parameters
taskId
required
string
Example: 6176fb3e141c0060668b2c03

The ID of the task for the batch update

Example: 6176fb3e141c0060668b2c03

Responses

Response samples

Content type
application/json
{
  • "status": "IN_PROGRESS",
  • "results": [
    ],
  • "requestedCount": 400,
  • "processedCount": 400
}

Contact Lists

Create, update, and delete contact lists.

Update a List Name

Update the name of an existing list.

Example: Here we updated a list name with a new name My Newer List:

{ "name": "My Newer List" }

Authorizations:
path Parameters
listId
required
string
Example: 507f1f77bcf86cd799439011

List ID in hexadecimal format or name.

Example: 507f1f77bcf86cd799439011 / My Newer list

Request Body schema: application/json
name
required
string

A list name containing less than 42 characters

Example: My new list

Responses

Request samples

Content type
application/json
{
  • "name": "My new list"
}

Response samples

Content type
application/json
{
  • "id": "507f191e810c19729de860ea"
}

Get all Lists

Retrieves all lists from your SimpleTexting account.

Example: Here we return all lists from an account:

https://api-app2.simpletexting.com/v2/api/contact-lists?page=100&size=2

Authorizations:
query Parameters
page
integer <int32> >= 0
Default: 0
Example: page=15

An ordinal number of the page to return with the results of a request (with the lists of the given account). Please note that page numbering starts at zero (0)

Example: 15

size
integer <int32> <= 500
Default: 50
Example: size=50

The number of the returned lists to show per page

Example: 50

Responses

Response samples

Content type
application/json
{
  • "content": [
    ],
  • "totalPages": 0,
  • "totalElements": 0
}

Create a List

This endpoint is used to create a new contact list in a given SimpleTexting account.

Example: Here we create a list whose name is My New List:

{ "name": "My New List" }

Authorizations:
Request Body schema: application/json
name
required
string

A list name containing less than 42 characters

Example: My new list

Responses

Request samples

Content type
application/json
{
  • "name": "My new list"
}

Response samples

Content type
application/json
{
  • "id": "507f191e810c19729de860ea"
}

Add Contact To List

Add contact to specified list.

Authorizations:
path Parameters
listIdOrName
required
string
Example: 507f191e810c19729de860ea / My First List

List ID or name to add the contact.

Example: 507f191e810c19729de860ea / My First List

Request Body schema: application/json
contactPhoneOrId
string

Contact ID in hexadecimal format or the contact's phone number.

Example: 3051234567 / 507f1f77bcf86cd799439011

Responses

Request samples

Content type
application/json
{
  • "contactPhoneOrId": "3051234567 / 507f1f77bcf86cd799439011"
}

Get a List

Return a contact list by its unique list ID or name.

Example: Below, we return the information associated with the List whose ID is 507f1f77bcf86cd799439011. You can use the Get all Lists endpoint to retrieve List IDs for all of your Lists:

https://api-app2.simpletexting.com/v2/api/contact-lists/507f1f77bcf86cd799439011

Authorizations:
path Parameters
listIdOrName
required
string
Example: 507f1f77bcf86cd799439011

List ID in hexadecimal format or name.

Example: 507f1f77bcf86cd799439011 / My new list

Responses

Response samples

Content type
application/json
{
  • "listId": "507f191e810c19729de860ea",
  • "name": "My First List",
  • "created": "2021-04-28T23:20:08.489Z",
  • "updated": "2021-04-28T23:20:08.489Z",
  • "description": "List for 'SALE' keyword",
  • "totalContactsCount": 25,
  • "activeContactsCount": 40,
  • "invalidContactsCount": 1,
  • "unsubscribedContactsCount": 2,
  • "keywords": "MYFIRSTKEYWORD"
}

Delete a List

Delete an existing list using the list ID or name.

Example: Here we delete a List whose ID is507f1f77bcf86cd799439011. You can use the [Get all Lists] (#operation/getLists) endpoint to retrieve List IDs for all of your Lists:

https://api-app2.simpletexting.com/v2/api/contact-lists/507f1f77bcf86cd799439011

Authorizations:
path Parameters
listIdOrName
required
string
Example: 507f1f77bcf86cd799439011

List ID in hexadecimal format or name.

Example: 507f1f77bcf86cd799439011 / My new list

Responses

Remove Contact From List

Remove contact from specified list.

Authorizations:
path Parameters
listIdOrName
required
string
Example: 507f191e810c19729de860ea / My First List

List ID or name to remove the contact from.

Example: 507f191e810c19729de860ea / My First List

contactPhoneOrId
required
string
Example: 3051234567

Contact ID in hexadecimal format or the contact's phone number.

Example: 3051234567 / 507f1f77bcf86cd799439011

Responses

Contact Segments

Get all of the segments on a given SimpleTexting account.

Get all Segments

Retrieves all segments from your SimpleTexting account.

Example: Here we return all segments from an account:

https://api-app2.simpletexting.com/v2/api/contact-segments?page=100&size=2

Authorizations:
query Parameters
page
integer <int32> >= 0
Default: 0

An ordinal number of the page to return with the results of a request (with the segments of the given account). Please note that page numbering starts at zero (0)

size
integer <int32> <= 500
Default: 50
Example: size=50

The number of the returned segments to show per page

Responses

Response samples

Content type
application/json
{
  • "content": [
    ],
  • "totalPages": 0,
  • "totalElements": 0
}

Custom Fields

SimpleTexting's Custom Fields feature plays a key role in managing your customer data. Not only does it give you enormous flexibility when it comes to collecting or importing data, it also lets you quickly and easily personalize each message in a mass text campaign.

Get all Custom Fields

This endpoint allows you to retrieve all custom fields.

Example: Here we return all Custom Fields from an account:

https://api-app2.simpletexting.com/v2/api/custom-fields?page=100&size=500

Authorizations:
query Parameters
page
integer <int32> >= 0
Default: 0
Example: page=40

An ordinal number of the page to return with the results of a request (with the custom fields of the given account). Please note that page numbering starts at zero (0)

Example: 40

size
integer <int32> <= 500
Default: 50
Example: size=50

The number of the returned custom fields to show per page

Example: 50

Responses

Response samples

Content type
application/json
{
  • "content": [
    ],
  • "totalPages": 0,
  • "totalElements": 0
}

Webhooks

Use webhooks to communicate between the SimpleTexting platform and your server. Webhooks can be used to forward messages as well as provide info about unsubscribes and message delivery.

SimpleTexting can trigger webhooks for new incoming messages, delivery reports, unsubscribes, and more. Now you can build scripts that interpret and respond to events that occur in your SimpleTexting account! To set the URLs for your webhooks, visit the Webhooks tab on the API section of settings.

Update a Webhook

Update an existing webhook using its unique ID.

Authorizations:
path Parameters
webhookId
required
string
Example: 507f1f77bcf86cd799439011

Webhook ID in hexadecimal format

Request Body schema: application/json
url
required
string

The URL for handling a POST request

Example: https://example.com

triggers
required
Array of strings
Items Enum: "INCOMING_MESSAGE" "OUTGOING_MESSAGE" "DELIVERY_REPORT" "NON_DELIVERED_REPORT" "UNSUBSCRIBE_REPORT"

Trigger a webhook based on a specific platform event:

  • INCOMING_MESSAGE: Trigger a webhook event based on an incoming message

  • OUTGOING_MESSAGE: Trigger a webhook event based on an outgoing message

  • DELIVERY_REPORT: Trigger a webhook when a delivery confirmation is received from a contact

  • NON_DELIVERED_REPORT: Trigger a webhook when a failed delivery is reported from a contact

  • UNSUBSCRIBE_REPORT: Trigger a webhook when a contact unsubscribes

Example: UNSUBSCRIBE_REPORT

requestPerSecLimit
integer <int32> <= 25

The maximum number of requests that can be sent within a second

Example: 15

accountPhone
string

Optional: requests will come exclusively for the specified account phone number

Example: 8881234567

contactPhone
string

Optional: requests will come exclusively for the specified contact's phone number

Example: 3051234567

Responses

Request samples

Content type
application/json
{
  • "triggers": [
    ],
  • "requestPerSecLimit": 15,
  • "accountPhone": "8881234567",
  • "contactPhone": "3051234567"
}

Response samples

Content type
application/json
{
  • "id": "507f191e810c19729de860ea"
}

Delete a Webhook

Delete an existing Webhook by its unique ID.

Example: Here we delete a Webhook whose ID is507f1f77bcf86cd799439011. You can use the Get all Webhooks endpoint to retrieve message IDs for all of your Webhooks:

https://api-app2.simpletexting.com/v2/api/webhooks/507f1f77bcf86cd799439011

Authorizations:
path Parameters
webhookId
required
string
Example: 507f1f77bcf86cd799439011

Webhook ID in hexadecimal format

Responses

Get all Webhooks

Retrieve all the webhooks that you've created.

Example: Here we return all Webhooks from an account:

https://api-app2.simpletexting.com/v2/api/webhooks

Authorizations:
query Parameters
page
integer <int32> >= 0
Default: 0
Example: page=5

An ordinal number of the page to return with the results of a request (with the webhooks of the given account). Please note that page numbering starts at zero (0)

size
integer <int32> <= 500
Default: 50
Example: size=50

The number of the returned webhooks to show per page

Responses

Response samples

Content type
application/json
{
  • "content": [
    ],
  • "totalPages": 0,
  • "totalElements": 0
}

Create a Webhook

Create a new webhook from scratch.

Authorizations:
Request Body schema: application/json
url
required
string

The URL for handling a POST request

Example: https://example.com

triggers
required
Array of strings
Items Enum: "INCOMING_MESSAGE" "OUTGOING_MESSAGE" "DELIVERY_REPORT" "NON_DELIVERED_REPORT" "UNSUBSCRIBE_REPORT"

Trigger a webhook based on a specific platform event:

  • INCOMING_MESSAGE: Trigger a webhook event based on an incoming message

  • OUTGOING_MESSAGE: Trigger a webhook event based on an outgoing message

  • DELIVERY_REPORT: Trigger a webhook when a delivery confirmation is received from a contact

  • NON_DELIVERED_REPORT: Trigger a webhook when a failed delivery is reported from a contact

  • UNSUBSCRIBE_REPORT: Trigger a webhook when a contact unsubscribes

Example: UNSUBSCRIBE_REPORT

requestPerSecLimit
integer <int32> <= 25

The maximum number of requests that can be sent within a second

Example: 15

accountPhone
string

Optional: requests will come exclusively for the specified account phone number

Example: 8881234567

contactPhone
string

Optional: requests will come exclusively for the specified contact's phone number

Example: 3051234567

Responses

Request samples

Content type
application/json
{
  • "triggers": [
    ],
  • "requestPerSecLimit": 15,
  • "accountPhone": "8881234567",
  • "contactPhone": "3051234567"
}

Response samples

Content type
application/json
{
  • "id": "507f191e810c19729de860ea"
}

Webhook Reports

Use webhooks to communicate between the SimpleTexting platform and your server. Webhooks can be used to forward messages as well as provide info about unsubscribes and message delivery. SimpleTexting can trigger webhooks for new incoming messages, delivery reports and unsubscribes.

Unsubscribe Report

Triggers when a client sends STOP to your number.

Example: We create the Unsubscribe report for 8005551234 for the status of the outgoing messages to 8001234567:

{"url": "http://www.yourdomain.com/unsubscribe.php","triggers": ["UNSUBSCRIBE_REPORT"],"requestPerSecLimit": 25,"accountPhone": "8005551234","contactPhone": "8001234567"}

Your custom domain http://www.yourdomain.com/unsubscribe.php has been set as an unsubscribe report URL for this example. The SimpleTexting server will invoke the given call when the subscriber with the number 8001234567 unsubscribes.

Request Body schema: application/json
reportId
string

Unique report ID in hexadecimal format

Example: 507f191e810c19729de860ea

webhookId
string

Webhook ID in hexadecimal format

Example: 507f191e810c19729de860ea

type
string
Enum: "INCOMING_MESSAGE" "OUTGOING_MESSAGE" "DELIVERY_REPORT" "NON_DELIVERED_REPORT" "UNSUBSCRIBE_REPORT"

Webhook report content type:

UNSUBSCRIBE_REPORT: Triggered when a contact unsubscribes

Example: UNSUBSCRIBE_REPORT

object (WebhookUnsubscribeReportDto)

Report content

Responses

Request samples

Content type
application/json
{
  • "reportId": "507f191e810c19729de860ea",
  • "webhookId": "507f191e810c19729de860ea",
  • "type": "UNSUBSCRIBE_REPORT",
  • "values": {
    }
}

Incoming/Outgoing Message Report

Triggers when an outgoing message or incoming message is handled.

Example: We create the incoming webhook for 8005551234 from contact phone 8001234567:

{"url": "http://www.yourdomain.com/receivesms.php","triggers": ["INCOMING_MESSAGE"],"requestPerSecLimit": 25,"accountPhone": "8005551234","contactPhone": "8001234567"}

Request Body schema: application/json
reportId
string

Unique report ID in hexadecimal format

Example: 507f191e810c19729de860ea

webhookId
string

Webhook ID in hexadecimal format

Example: 507f191e810c19729de860ea

type
string
Enum: "INCOMING_MESSAGE" "OUTGOING_MESSAGE" "DELIVERY_REPORT" "NON_DELIVERED_REPORT" "UNSUBSCRIBE_REPORT"

Webhook report content type:

UNSUBSCRIBE_REPORT: Triggered when a contact unsubscribes

Example: UNSUBSCRIBE_REPORT

object (WebhookMessageDto)

Report content

Responses

Request samples

Content type
application/json
{
  • "reportId": "507f191e810c19729de860ea",
  • "webhookId": "507f191e810c19729de860ea",
  • "type": "UNSUBSCRIBE_REPORT",
  • "values": {
    }
}

Delivery/Non Delivered Message Report

Triggers when an outgoing message is reported as delivered or undelivered by the carrier.

Example: We create the Delivery report for 8005551234 for the status of the outgoing messages to 8001234567:

{"url": "http://www.yourdomain.com/delivery.php","triggers": ["DELIVERY_REPORT"],"requestPerSecLimit": 25,"accountPhone": "8005551234","contactPhone": "8001234567"}

Your custom domain http://www.yourdomain.com/delivery.php has been set as a delivery report webhook for this example. The SimpleTexting server will invoke the given call when a message with the messageId 507f191e810c19729de860ea is delivered.

Request Body schema: application/json
reportId
string

Unique report ID in hexadecimal format

Example: 507f191e810c19729de860ea

webhookId
string

Webhook ID in hexadecimal format

Example: 507f191e810c19729de860ea

type
string
Enum: "INCOMING_MESSAGE" "OUTGOING_MESSAGE" "DELIVERY_REPORT" "NON_DELIVERED_REPORT" "UNSUBSCRIBE_REPORT"

Webhook report content type:

UNSUBSCRIBE_REPORT: Triggered when a contact unsubscribes

Example: UNSUBSCRIBE_REPORT

object (WebhookDeliveryReportDto)

Report content

Responses

Request samples

Content type
application/json
{
  • "reportId": "507f191e810c19729de860ea",
  • "webhookId": "507f191e810c19729de860ea",
  • "type": "UNSUBSCRIBE_REPORT",
  • "values": {
    }
}