Contacts & Lists

Add Contact to List

Adds a new contact to a list If a contact is added that already exists it will be ignored, not updated.

post/add-to-list.json

Request

  • Base URL
    https://api.transmitsms.com
  • Auth
    HTTP basic

Request body application/x-www-form-urlencoded

list_idinteger required

Numeric ID of the list to be added to. List IDs can be retrieved with the get-lists request.

msisdnstring required

Mobile number being added to the list. Invalid numbers will be ignored. Number must be defined in E.164 international format. You can use the countrycode parameter to format numbers that are in local format.

countrycodestring

2 letter ISO 3166 format country code or country name. Automatically formats numbers to international format required for reliable SMS delivery. eg. In Australia 0422222222 will become 6142222222 when set to AU or Australia. If not set to numbers must be defined in E.164 international format.

COUNTRYCOUNTRY CODELOCALINTERNATIONAL
Australiaau049157015661491570156
New Zealandnz021267012964212670129
United Kingdomgb075001769644750017696
United Statesus251355114512513551145
first_namestring

First name of the contact being added.

last_namestring

Last name of the contact being added.

field_nstring

Custom field name. Firstname and lastname are created by default. There can be up to 10 extra custom fields. n is an integer between 1 and 10.

response_stylestring

Determines the response style. 'array' returns custom field lists as an array.

Example request

{
  "list_id": 12345,
  "countrycode": "AU",
  "first_name": "John",
  "last_name": "Doe",
  "field_n": "Email",
  "response_style": "array"
}

Response

OK

list_idinteger

Numeric ID of the list that contact was added to.

msisdnstring

Mobile number of contact that was added.

firstnamestring

First name of contact added.

lastnamestring

Last name of contact added.

created_atstring

Date and time contact was added. Returned in ISO8601 format YYYY-MM-DD HH:MM:SS in UTC Timezone.

statusstring

Status of contact. This is always set to active with this request.

fieldsobject

Values assigned to custom fields.

Changes

No recorded changes to this operation across all 2 revisions of this API.