TrueDialog API – Overview

TrueDialog Logo

TrueDialog API

API Documentation

The TrueDialog API allows you to send messages from within your website or app and provides callbacks, contact management/filtering, and more. The following is an overview of the API, explaining its main features and variables. For more in-depth information about each endpoint, see the API Endpoints documentation.

All the URLs referenced in the instructions are based on the same Base URL https://api.truedialog.com/api/v2.1

Resources

The core features of any RESTful API are the resources themselves. This table outlines the resources necessary to use the API effectively. For more information on implementation, refer to the Endpoints section.

NameDescription
AccountThe top-level resource from which all API requests are made.
SubscriptionThis is what your customers opt in and out of. Most accounts only have one or a small number of subscriptions. A subscription is required before sending any messages.
CampaignContains information on messages to send. Several campaign types exist.
Content & Content TemplatesMulti-channel and multi-language message templates. A Template campaign can have one Content Template for each supported channel and language.
ContactThe subscriber receiving the message, including contact information (phone number and/or email) and subscriber channel preferences.
Contact AttributesEach account can create custom contact attributes to mimic (or build) their customer database. Attributes may be used in message templates and in ContactLists to create targeted contact filters.
Contact ListA sophisticated static/dynamic list used to group Contacts. A container for a set of filters that are evaluated at the time a campaign is sent.
ChannelA communication/transport channel. TrueDialog currently supports SMS, MMS, and Email channels.
KeywordFor SMS, participants use Keywords to text into a campaign. Primarily used on shared short codes, they can also be used on dedicated codes to distinguish which promotion a participant is responding to.

Accounts

TypeDescription
SubaccountsSubaccounts isolate campaign and contact information for all contacts within the subaccount. Subaccounts can be created with the Portal or API.
UATUser Acceptance Testing accounts can be used for API integration testing before going live or for after-sales use.
DemoDemo accounts may be used for pre-sales client-specific capability demonstrations.

Subscriptions

A Subscription ID is required for the API to track the contact’s opt-in/opt-out status for campaigns.

One-time subscriptions are useful for sending one-time messages. Examples: “Your package has been delivered”, “Your appointment is at 12 pm”.

Recurring subscriptions are for sending ongoing communications (e.g., “Thanks for joining our program, here’s this week’s coupon”, “This week’s special is the tomato soup”, “We are having a big sale next month”). This type of subscription is commonly used for mobile marketing campaigns.

NOTE: When a new account is created, a recurrent subscription is also created.

Synchronization

Contact

You should regularly synchronize any information you have for a contact/customer (i.e., FirstName, LastName, ZipCode, etc.) with the TrueDialog system. All contact information is stored as “Contact Attributes” in our system/API. While the API allows you to merge all contact information, it is recommended that you merge only recently changed data.

NOTE: This can be done at the PROD account level, so that all linked accounts are synchronized regularly via a single API call or similar process.

Account

“Account Attributes” are primarily used by customers with multiple subaccounts to represent their various business locations or divisions. These attributes can be synchronized through the API, and the synchronization frequency depends on the specific use case. Generally, 24 hours is sufficient time for synchronization to occur.

Segmentation

  • We allow segmentation based on any contact attribute or account attribute.
  • All lists are dynamic. When a message is sent, a filtering criterion is executed to determine the current list of contacts.

Campaigns

  • Messages can be sent via a Gateway Campaign, where the message body is delivered to us via the API. One API request delivers the message to a single phone number or a list of contacts.
  • Messages can be sent via a Basic Campaign, where the message body is stored in a template. One API request delivers the message to a list of contacts.
  • Basic messages can contain dynamic content via a Razor template that pulls in both Account Attribute data (specific to the subaccount, such as LocationCity) and Contact Attribute data (specific to the individual contact, such as FirstName).

Gateway Campaigns

Gateway Campaigns are the most basic type of campaign. They have no predefined content and require you to supply the message when you push the campaign. To create this type of campaign, all that is needed is the Campaign Name (Name) and the Campaign Type ID (campaignTypeId), which is 0. Once the campaign is created, the Campaign ID (id) is used whenever you push a new message with the campaign.

Campaign Types

TrueDialog supports a variety of campaign types.

If you need further assistance, Contact Us to discuss your requirements so we can help you determine the best approach.

Below is a list of supported Campaign Types with their API values.

IDNameDescription
0GatewayAPI-only campaign type used to send single-channel, single-language SMS messages, with the message text passed through every request. Not recommended when pushing to over 500 contacts.
1BasicThe most common campaign. Message content is stored in the campaign and sent to a list of contacts passed through the request, or to a predefined ContactList for large pushes.
2DialogDialog asks the subscriber one or more questions and listens for their response. Responses are stored as contact attributes. Dialogs can be yes/no, multiple choice, or validated open responses.
3CouponSimilar to a Basic campaign but will include a static or system-generated unique coupon code in the message, an external list coupon code, or a shortened URL to a barcode coupon.

Channel Types

The TrueDialog Platform supports messaging over multiple channels. If you require a channel that is not listed, Contact Us to discuss your unique requirements.

Below is a list of supported Channel Types with their API values.

IDNameDescription
0SMSSMS messages go out over a short code (e.g., 33898) or a Long Code (e.g., +19103755141). SMS messages in the United States must be 160 characters or less.
1MMSMMS messages are sent via a short code (e.g., 70626).
2EmailEmail channels can be set up for any SMTP server. By default, we will send emails using Amazon SES.

Encoding Types

Content templates can be encoded as plain text or in a C# Razor template compiled at runtime.

Below is a list of supported Message Encoding Types with their API values.

IDNameDescription
0TextPlain text: no encoding or dynamic text.
1RazorRequired for emails. Can use dynamic text (contact attributes or account attributes) in messages.

Schedule Types

Any campaign can be sent immediately or scheduled for a future time. The API also supports recurring scheduling.

To send a message immediately, set the execute variable to true in the Creates a new push action request body.

Below is a list of supported Schedule Types with their API values.

IDNameDescription
2One TimeTrigger the action at a specified time in the future.
6DailyTrigger the action at a specified time every day.
7WeeklyTrigger the action at a specified time on specified days of the week.
8MonthlyTrigger the action at a specified time on specified days of the month.

Language Types

Below is a list of supported Languages with their API values.

IDLanguage
0English
1Spanish
2Simplified Chinese
3French
4Arabic
5Nepali
6Burmese
7Somali

Data Types

Below is a list of supported Data Types with their API values.

IDNameDescription
1IntegerWhole number {0,1,2,3… or -1, -2, -3}.
2StringText information.
3Real NumberNumber with decimal {1.732, etc.}.
4DateDate or Datetime value.
5BooleanTrue or False
6BinaryBinary data, such as an image or other file
7GUIDGlobally unique identifier {e.g., 8D796643-F9AE-4BE6-846C-B44EB9124DE9}
8BigIntLarge whole number {0,1,2,3… or -1, -2, -3}

Date and Time Formats

While the TrueDialog API can read many different Date/Time formats, we recommend using ISO 8601 format for best support. Below are some examples of valid date/time strings.

A string with a date and time component:

"2013-04-01T12:31:00.0000Z"
"2013-04-01T12:31:00.0000-05:00"

A string that includes the GMT designator and conforms to RFC 1123:

"Mon, 01 Apr 2013 12:31:00 GMT"

A string that includes the date and time in addition to the time zone offset:

"04/01/2013 12:31:00 -5:00"

A string with a date but no time. The time component will default to 12:00 midnight.

A time with no date. The default date will be the current date.

Process Statuses

Process statuses indicate the current state of a campaign push or action. Below is a list of the Process Statuses with their API values.

IDName
0Pending
1Processing
2Completed
3Aborted
4Failed
5Waiting Approval
6Declined

HTTP Response Codes

TrueDialog uses the following HTTP response/error codes. Error codes are returned with Content-Type=text/plain.

IDResponseDescription
200OKThe request was received successfully.
201CreatedThe resource was created successfully via POST.
204No ContentThe request was processed successfully, but there was no content to return.
400Bad RequestThe request was malformed or missing required information.
401Not AuthorizedThe authenticated user is not authorized to access the resource.
404Not FoundThe requested resource is not found or not accessible to the user.
405Method Not AllowedThe requested resource does not support the HTTP method attempted. See Endpoints for a full list of which methods are supported on all resources.
415Unsupported Media TypeThe TrueDialog Web API supports XML (application/xml) and JSON (application/json) content types. A user may see this error if a different media type is requested in the Accept or Content Type headers.
500Server ErrorSee message body for further details. Sometimes this occurs when the request body cannot be parsed. If noticed repeatedly, please contact TrueDialog so we can investigate the issue.
503Service UnavailableSee message body for further details. Sometimes, this occurs when the server is temporarily unable to handle the request. This may be due to the server being overloaded or down for maintenance. Please contact TrueDialog so we can investigate the issue.

Updated on July 5, 2026
Was this article helpful?
Need Support?
Can’t find the answer you’re looking for? Don’t worry we’re here to help!
CONTACT SUPPORT

Leave a Comment