NAV

Message(Last Updated : 01/11/2017)

The following section provides the parameters and template for making requests to send messages via mobile text (SMS), and/or email. Example response from the system is also provided.

Methods

Send to List /http/v2/sendtolist
Send to Contact /http/v2/sendtocontact

Send to List

This function sends a message to all the contacts in the specified list. At the beginning of your request, you must specify the URL of the resource: http://api.trumpia.com/http/v2/sendtolist. SMS, email, or any combination of the three can be sent with one function call using the relevant mode parameters. Multiple lists can be selected by passing multiple list names separated by commas. Messages can also be scheduled to be sent automatically at a later date and time enabling the later_time parameter.

Resource Information

Response Formats JSON
Allowed Methods GET/POST
URL http://api.trumpia.com/http/v2/sendtolist

Body Parameters

* required parameters
Parameter Description
apikey * The API key is located in API Settings within the system. An API certification must be approved before a key is generated.

Example value: 123456789abc1011
email_mode * Value must be TRUE or FALSE. Used for sending your message via email.

Example value: TRUE
sms_mode * Value must be TRUE or FALSE. Used for sending your message via mobile text (SMS).

Example value: TRUE
description * Description of message for your reference.

Example value: Christmas Week 1 Message
email_subject Required if email_mode is TRUE. Subject line for email. Plain text only.
email_message Required if email_mode is TRUE. Email message body with support for basic HTML.
change_org_name This parameter is for SMS. By setting this parameter, you can temporarily change your organization name for this message blast. But you can use only registered organization names. You can register organization names via the website (Sign in > Account > Organization Profile).

The default structure of a SMS message is as follows:
Organization Name: your message content Txt STOP to OptOut
sms_message Required if sms_mode is TRUE. SMS message body must be in plain text. Supported Character Set.

Character limits vary per country. The maximum length for a message is 160 characters as default. For instance, SMS messages for Canadian accounts are limited to 140 characters. Although a 160 character message can be sent in full to US mobile numbers, Canadian mobile devices will only receive the first 140 characters.

Also, please note that the SMS header and footer are counted as part of the message and should be taken into consideration when composing a message.
list_names * Enter the list_names to send the message to. You can specify up to 100 list_names. You will have to separate multiple lists with commas (ex: name1, name2, name3...).
mail_merge_first_name Mail merge replacement for null values if email content contains mail merge variables.

Example value: John
mail_merge_last_name See mail merge feature online in compose email.

Example value: Doe
later_time Specify a date for the message to be sent out, sends out immediately if left blank. The format is : YYYY-MM-DD HH:MM:SS

Example value: 2011-10-01 08:32:00

Request Example

GET Method

http://api.trumpia.com/http/v2/sendtolist?apikey=123456789abc1011&email_mode=TRUE&sms_mode=TRUE&description=test%20message&email_subject=test%20subject&email_message=test%20message&sms_message=test%20message&list_names=TestList&later_time=2009-04-22%20014%3A10%3A32

POST Method

<form method="post" action="http://api.trumpia.com/http/v2/sendtolist"> <input type="text" name="apikey" value="123456789abc1011"> <input type="text" name="email_mode" value="TRUE"> <input type="text" name="sms_mode" value="TRUE"> <input type="text" name="description" value="test message"> <input type="text" name="email_subject" value="test subject"> <input type="text" name="email_message" value="test message"> <input type="text" name="sms_message" value="test message"> <input type="text" name="change_org_name" value=""> <input type="text" name="list_names" value="TestList"> <input type="text" name="mail_merge_first_name" value=""> <input type="text" name="mail_merge_last_name" value=""> <input type="text" name="later_time" value="2009-04-22 14:10:32"> </form>

Response Example

{ "requestID" : "1234561234567asdf123" }

Send to Contact

This function is used to send a message to a single contact or multiple selected contacts using their contact ID numbers. At the beginning of your request, you must specify the URL of the resource: http://api.trumpia.com/http/v2/sendtocontact.

Resource Information

Response Formats JSON
Allowed Methods GET/POST
URL http://api.trumpia.com/http/v2/sendtocontact

Body Parameters

* required parameters
Parameter Description
apikey * The API key is located in API Settings within the system. An API certification must be approved before a key is generated.

Example value: 123456789abc1011
email_mode * Value must be TRUE or FALSE. Used for sending your message via email.

Example value: TRUE
sms_mode * Value must be TRUE or FALSE. Used for sending your message via mobile text (SMS).

Example value: TRUE
description * Description of message for your reference.

Example value: Christmas Week 1 Message
email_subject Required if email_mode is TRUE. Subject line for email. Plain text only.
email_message Required if email_mode is TRUE. Email message body with support for basic HTML.
change_org_name This parameter is for SMS. By setting this parameter, you can temporarily change your organization name for this message blast. But you can use only registered organization names. You can register organization names via the website (Sign in > Account > Organization Profile).

The default structure of a SMS message is as follows:
Organization Name: your message content Txt STOP to OptOut
sms_message Required if sms_mode is TRUE. SMS message body must be in plain text. Supported Character Set.

Character limits vary per country. The maximum length for a message is 160 characters as default. For instance, SMS messages for Canadian accounts are limited to 140 characters. Although a 160 character message can be sent in full to US mobile numbers, Canadian mobile devices will only receive the first 140 characters.

Also, please note that the SMS header and footer are counted as part of the message and should be taken into consideration when composing a message.
contact_ids * Enter the contact_ids to send the message to. You can specify up to 500 contact_ids. You will have to separate multiple contact_ids with commas (ex: contact_id1, contact_id2, contact_id3...).
mail_merge_first_name Mail merge replacement for null values if email content contains mail merge variables.

Example value: John
mail_merge_last_name See mail merge feature online in compose email.

Example value: Doe

Request Example

GET Method

http://api.trumpia.com/http/v2/sendtocontact?apikey=123456789abc1011&email_mode=TRUE&sms_mode=TRUE&description=test%20message&email_subject=test%20subject&email_message=test%20message&sms_message=test%20message&contact_ids= 111111,111112

POST Method

<form method="post" action="http://api.trumpia.com/http/v2/sendtolist"> <input type="text" name="apikey" value="123456789abc1011"> <input type="text" name="email_mode" value="TRUE"> <input type="text" name="sms_mode" value="TRUE"> <input type="text" name="description" value="test message"> <input type="text" name="email_subject" value="test subject"> <input type="text" name="email_message" value="test message"> <input type="text" name="sms_message" value="test message"> <input type="text" name="change_org_name" value=""> <input type="text" name="contact_ids" value="111111,111112"> <input type="text" name="mail_merge_first_name" value=""> <input type="text" name="mail_merge_last_name" value=""> </form>

Response Example

{ "requestID" : "1234561234567asdf123" }