NAV

Contact(Last Updated : 01/11/2017)

The following section provides the parameters and template for making requests to manage subscriptions, or contacts. Example response from the system is also provided.

Methods

Add Contact /http/v2/addcontact
Get Contact Data /http/v2/getcontactdata
Get Contact ID /http/v2/getcontactid
Update Contact Data /http/v2/updatecontactdata
Add Contact to List /http/v2/addcontacttolist
Remove Contact /http/v2/removecontact
Delete Contact /http/v2/deletecontact

Add Contact

Add a new contact to your database and to a distribution list. At the beginning of your request, you must specify the URL of the resource: http://api.trumpia.com/http/v2/addcontact. Once the request has been completed, a request ID will be returned. There can be only one instance of a tool, such as a unique mobile number, per list; however, the same contact or some of the same contact information may exist on multiple lists.

Resource Information

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

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
list_name * List to which the contact is to be added. List name is case-insensitive but must contain only alphanumeric characters. The maximum length for a list name is 32 characters.

Example value: GeneralList
first_name * First name of the contact. Max 30 characters. Must contain only alphanumeric characters.

Example value: John
last_name Last name of the contact. Max 30 characters. Must contain only alphanumeric characters.

Example value: Doe
email Email address of the contact.

Example value: email@domain.com
country_code Mobile phone number's country code. If left blank then it will be assumed to be a U.S. number.

Default value: 1
mobile_number For U.S., the 10-digit number without the leading 0 or 1. For some international numbers, the leading 0 or 1 also must be omitted. No symbols or spaces.

Example value: 7774443210
send_verification TRUE or FALSE. If set to TRUE, this sends a verification message to each tool before contacts are added to your distribution list. If the tool is not verified, it will be marked as not verified and cannot be used. If set to FALSE, the verification step is bypassed and contacts will be added directly into your distribution list. A verification is omitted for an international phone number (not U.S.).

Default value: FALSE
custom_verification_msg Character limit of 60 characters.

Default value: Reply OK to start. Msg&Data rates may apply. Upto 30msg/mo.

Request Example

GET Method

http://api.trumpia.com/http/v2/addcontact?apikey=123456789abc1011&list_name=listname&first_name=firstname&last_name=lastname&email=abc@abc.com&country_code=1&mobile_number=2345678901&send_verification=TRUE&custom_verification_msg=custom%20verify%20message

POST Method

<form method="post" action="http://api.trumpia.com/http/v2/addcontact"> <input type="text" name="apikey" value="123456789abc1011"> <input type="text" name="list_name" value="listname"> <input type="text" name="first_name" value="firstname"> <input type="text" name="last_name" value="lastname"> <input type="text" name="email" value="abc@abc.com"> <input type="text" name="country_code" value="1"> <input type="text" name="mobile_number" value="2345678901"> <input type="text" name="send_verification" value="TRUE"> <input type="text" name="custom_verification_msg" value="custom verify message"> </form>

Response Example

{ "requestID" : "1234561234567asdf123" }

Get Contact Data

This function returns the contact's information and registered tools along with the tool's verification status. At the beginning of your request, you must specify the URL of the resource: http://api.trumpia.com/http/v2/getcontactdata.

Resource Information

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

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
contact_id * Unique ID of contact.

Example value: 321231

Request Example

GET Method

http://api.trumpia.com/http/v2/getcontactdata?apikey=123456789abc1011&contact_id=123456

POST Method

<form method="post" action="http://api.trumpia.com/http/v2/getcontactdata"> <input type="text" name="apikey" value="123456789abc1011"> <input type="text" name="contact_id" value="123456"> </form>

Response Example

{ "message" : "Query Success", "contactcode" : "aaa111bbb222", "contactdata" : { "tools" : { "mobilephone" : { "verify" : "1", "value" : "1234567890", "country_code" : "1" }, "email" : { "verify" : "1", "value" : "email@email.com" } }, "lastname" : "doe", "firstname" : "jane" }, "statuscode" : "1" }

Get Contact ID

This function can be used to find a contact record within a distribution list, searching by email address, or phone number. At the beginning of your request, you must specify the URL of the resource: http://api.trumpia.com/http/v2/getcontactid. Only one contact ID will be returned since a tool is unique within a list.

Resource Information

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

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
list_name * List in which to search.

Example value: GeneralList
tool_type * Contact information type.
Value Description
1 Email
2 Mobile
tool_data * Email address, or mobile number depending on the tool type selected.

Example value: abc@abc.com

Request Example

GET Method

http://api.trumpia.com/http/v2/getcontactid?apikey=123456789abc1011&list_name=listname&tool_type=1&tool_data=abc@abc.com

POST Method

<form method="post" action="http://api.trumpia.com/http/v2/getcontactid"> <input type="text" name="apikey" value="123456789abc1011"> <input type="text" name="list_name" value="listname"> <input type="text" name="tool_type" value="1"> <input type="text" name="tool_data" value="abc@abc.com"> </form>

Response Example

{ "statuscode" : "1", "message" : "Query Success", "contactid" : "1234567" }

Update Contact Data

This function allows you to update an existing contact record. At the beginning of your request, you must specify the URL of the resource: http://api.trumpia.com/http/v2/updatecontactdata. The contact ID must be provided to update the contact. Keep in mind that the same contact can exist on multiple lists.

Resource Information

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

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
contact_id * Unique ID of contact.

Example value: 321231
first_name First name of the contact.

Example value: John
last_name Last name of the contact.

Example value: Doe
email Email address of the contact.

Example value: email@domain.com
country_code Mobile phone number's country code. If left blank then it will be assumed to be a U.S. number.

Default value: 1
mobile_number For U.S., the 10-digit number without the leading 0 or 1. For some international numbers, the leading 0 or 1 also must be omitted. No symbols or spaces.

Example value: 7774443210
send_verification TRUE or FALSE. If set to TRUE, this sends a verification message to each tool before contacts are added to your distribution list. If the tool is not verified, it will be marked as not verified and cannot be used. If set to FALSE, the verification step is bypassed and contacts will be added directly into your distribution list. A verification is omitted for an international phone number (not U.S.).

Default value: FALSE
custom_verification_msg Character limit of 60 characters.

Default value: Reply OK to start. Msg&Data rates may apply. Upto 30msg/mo.

Request Example

GET Method

http://api.trumpia.com/http/v2/updatecontactdata?apikey=123456789abc1011&contact_id=123456&first_name=firstname&last_name=lastname&email=abc@abc.com&country_code=1&mobile_number=2345678901&send_verification=TRUE&custom_verification_msg=custom%20verify%20message

POST Method

<form method="post" action="http://api.trumpia.com/http/v2/updatecontactdata"> <input type="text" name="apikey" value="123456789abc1011"> <input type="text" name="contact_id" value="123456"> <input type="text" name="first_name" value="firstname"> <input type="text" name="last_name" value="lastname"> <input type="text" name="email" value="abc@abc.com"> <input type="text" name="country_code" value="1"> <input type="text" name="mobile_number" value="2345678901"> <input type="text" name="send_verification" value="TRUE"> <input type="text" name="custom_verification_msg" value="custom verify message"> </form>

Response Example

{ "requestID" : "1234561234567asdf123" }

Add Contact to List

This function adds an existing contact to a list using contact ID. At the beginning of your request, you must specify the URL of the resource: http://api.trumpia.com/http/v2/addcontacttolist. You can copy the contact or use a pointer. Contacts with duplicate tool data, such as mobile phone number, cannot be added to the same list.

Resource Information

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

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
contact_id * Unique ID of contact.

Example value: 321231
list_name * The list to which the contact is to be added.

Example value: Testlist

Request Example

GET Method

http://api.trumpia.com/http/v2/addcontacttolist?apikey=123456789abc1011&contact_id=123456&list_name=TestList

POST Method

<form method="post" action="http://api.trumpia.com/http/v2/addcontacttolist"> <input type="text" name="apikey" value="123456789abc1011"> <input type="text" name="contact_id" value="123456"> <input type="text" name="list_name" value="TestList"> </form>

Response Example

{ "requestID" : "1234561234567asdf123" }

Remove Contact

This function removes a contact from one or all associated distribution lists by the contact's actual information instead of the contact ID. At the beginning of your request, you must specify the URL of the resource: http://api.trumpia.com/http/v2/removecontact.

Resource Information

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

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
tool * Email address or mobile number depending on the tool_type selected.

Example values: email@domain.com, 7775553210
tool_type * The list to Contact information type.
Value Description
1 Email
2 Mobile
remove_all TRUE or FALSE. By setting this flag to TRUE, all other tools related to the specified tools will be deleted. In other words the whole subscription will be deleted.

Default value: FALSE
list_name Distribution list name. If remove_all is TRUE, then the contact will be removed from the particular distribution list. If no distribution list is specified, then the contact will be removed from all lists.

Request Example

GET Method

http://api.trumpia.com/http/v2/removecontact?apikey=123456789abc1011&tool=abc@abc.com&tool_type=1&remove_all=TRUE&list_name=TestList

POST Method

<form method="post" action="http://api.trumpia.com/http/v2/removecontact"> <input type="text" name="apikey" value="123456789abc1011"> <input type="text" name="tool" value="abc@abc.com"> <input type="text" name="tool_type" value="1"> <input type="text" name="remove_all" value="TRUE"> <input type="text" name="list_name" value="TestList"> </form>

Response Example

{ "requestID" : "1234561234567asdf123" }

Delete Contact

Permanently delete a contact from your database and any distribution lists it was on. At the beginning of your request, you must specify the URL of the resource: http://api.trumpia.com/http/v2/deletecontact.

Resource Information

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

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
contact_id * Unique ID of contact.

Example value: 321231

Request Example

GET Method

http://api.trumpia.com/http/v2/deletecontact?apikey=123456789abc1011&contact_id=123456

POST Method

<form method="post" action="http://api.trumpia.com/http/v2/deletecontact"> <input type="text" name="apikey" value="123456789abc1011"> <input type="text" name="contact_id" value="123456"> </form>

Response Example

{ "requestID" : "1234561234567asdf123" }