NAV

Overview

REST Methods

Method Description
GET Used to retrieve information
PUT Used to create a resource
POST Used to update a resource
DELETE Used to delete a resource

REST API Headers (Authentication)

Basic authentication is required to access the REST API. Authentication includes the Request URL and API key. The first step is to create a header that includes the Content-Type and X-Apikey. A sample of the required header parameters with their values are listed below.

Example Request URL: http://api.trumpia.com/rest/v1/{username}/subscription

Header Parameter Value
Content-Type application/json
X-Apikey abc123defg456xyz098

Resource Information

Response formats JSON

Resource URL

Method PUT/POST/GET/DELETE
URL http://api.trumpia.com/rest/v1/{user_name}/{api_call}
{user_name} The username used to log in to the platform.

Sending your first message.

Create a list → add subscription to a list(s) → send a message to a list or subscription
  1. Enter your API key. Be sure to save your API key by logging in to api.trumpia.com and going to Account -> API Settings. You will find the API key and additional settings that can be used with your program.
  2. Create a header with two values:
    • a. Content-type: application/json
    • b. X-Apikey: {insert API key}
  3. Create a distribution list using PUT List.
    • Get the list_id from the status of the request.
  4. Add a subscription to the new distribution list you have created using PUT Subscription.
    • Get the subscription_id from the status of the request.
  5. Send a message to the distribution list or subscriptions with PUT Message.

Please note that a request_id is immediately returned after submitting an API request. Check the request_id using GET Report or you can set up PUSH notifications for an automated process.

Additional Features

  • Inbound Message: Our API allows two-way communication for mobile text messages. Our system will notify you when a keyword is texted and a reply has been sent in return.
  • Push notifications: Instead of manually generating a GET Status Report, you can have results automatically sent to you once our system has finished processing your resource call.

Handling Responses

  • Each API request has a response. A successfully processed request will return the response.
  • Checking a request_id: Using GET Report will display if an API request was successful.

System Status Codes

  • Our System status codes page allows you to easily reference our REST API status codes and their definitions.

HTTP Status Codes

Code Description
200 OK
403 Access to resource is forbidden
404 Resource does not exist
405 Method not allowed