RADAR API Documentation

Overview

Direct access to your RADAR data is now possible without having to use the RADAR system itself. Simply use the RADAR API.

As the API is in BETA at the moment we would really welcome any feedback you can give us. It would be particularly useful if you can let us know how you would like to use it. Our friendly, customer-focused team are dying to help you. Just email api@marketingradar.com.

Getting Started

First of you need an API key. There are three simple steps to follow to get yourself one:

  • 1. Log into RADAR
  • 2. Go to Admin > API
  • 3. Click ...or add a new one

Authentication

There is a choice of two authentication methods to best suit different programming languages:

1. Authenticate with Query Parameters

Send the API key with your query as a parameter

GET An example call to get a feed list

http GET https://demo.radar.ms/api/feeds apiKey=={yourAPIkey}
POST An example call to submit a fancy thing
http POST https://demo.radar.ms/api/fancy/thing thatThing='so fancy' apiKey={yourAPIkey}

2. Authenticate with HTTP Headers

Send the API key with your query as a HTTP header

An example call to get a feed list by HTTP header

http GET https://demo.radar.ms/api/feeds apiKey:{yourAPIkey}

Filters

Certain API endpoints support filters, the filter syntax is dependent on the data type of the field being filtered.

Dates

Dates are expected in ISO 8601 format and use a min..max notation which works as follows...

Example Description
2015-10-01..2015-10-10 Between October 1st, 2015 and October 10th, 2015
2015-10-01.. After October 1st, 2015
..2015-10-10 Before October 10th, 2015
2015-10-05 October 5th, 2015

One final thing worth mentioning is that all date ranges are inclusive.

Examples

To get all Tweets on Christmas Day, 2014 we would use...

http GET https://demo.radar.ms/api/feeds/Tweets apiKey=={yourAPIkey} TweetedOn==2014-12-25
To get all Bookings in October we would use...
http GET https://demo.radar.ms/api/feeds/Bookings apiKey=={yourAPIkey} DateBooked==2015-10-01..2015-10-31
To get all Enquiries prior to the 5th of June, 2005 we would use...
http GET https://demo.radar.ms/api/feeds/Enquiries apiKey={yourAPIkey} EnquiryDate==..2005-06-05 

Numbers

Numbers use the same min..max notation as dates...

Example Description
15..30 Between 15 and 30
15.. Greater than or equal to 15
..30 Less than or equal to 30
23 23

Lookups

Lookup fields contain one of a limited number of possible values. For example, PreferredContactMethod might contain Phone, Post or Email

We can filter on these fields in two ways...

Example Description
Post Matches fields containing Post
Phone,Email Matches fields containing either Phone or Email

Custom Parameters

Certain API endpoints support custom parameters. In the case of the /client/ endpoints these parameters will be defined by your account manager.

Other endpoints, /emailer/trigger/ for example, allow you to pass whatever parameters you would like in so-as they're available as merge tags or other functionality.

FAQ

The examples use a HTTP command, what is this? And why are there double-equals signs and where is the question mark?

All examples use HTTPie, a simple cURL-like, command line HTTP client. HTTPie allows for a param==value syntax when constructing the querystring to avoid having to escape the ampersand. Please see the HTTPie documentation for further details.

POST /emailer/trigger/{campaignname}

Trigger an email

http POST https://demo.radar.ms/api/emailer/trigger/{campaignname} email=={recipientemail} apiKey=={yourAPIkey}
{
    "success": true,
    "title": "emailer.trigger",
}
Parameter Description
email
string
Recipient email address
apikey
string
RADAR API key
Optional Parameters
This endpoint supports custom parameters
{key}
key/value pair
Any custom parameters passed into trigger can be used as merge-tags within the triggered email
Example: Surname=Smith

GET /feeds

Get a list of Feeds

Returns a complete list of available feeds

http GET https://demo.radar.ms/api/feeds apiKey=={yourAPIkey}
{
    "success": true,
    "title": "feeds",
    "feeds": [
    {
        "id": 1,
        "feed": "Bookings",
        "description": "Bookings",
        "endpoint": "/api/feeds/Bookings/"
    },
    {
        "id": 2,
        "feed": "Brochures",
        "description": "Brochures",
        "endpoint": "/api/feeds/Brochures/"
    }
    ]
}
Parameter Description
apikey
string
RADAR API key
Optional Parameters
limit
number
The maximum number of results to return.
Default is 1000
Example: 500

GET /feeds/{feed}

Get a specific Feed

Returns 1,000 records from the specified feed

http GET https://demo.radar.ms/api/feeds/{feed} apiKey=={yourAPIkey}
{
    "success": true,
    "title": "feeds",
    "context": "Bookings",
    "filters": {
        "Pax": "5..",
        "TourCountries": "Peru,Egypt"
    },
    "limit": 2,
    "results": [
        {
            "IdentityValue": 91209,
            "IndividualID": 6000129,
            "BookNo": "1093485",
            "BookingDate": "1965-05-13T00:00:00",
            "BookingStatus": "Confirmed",
            "DepartureDate": "2004-04-04T00:00:00",
            "DurationOfTrip": 13,
            "MainCountry": "Egypt",
            "Pax": 7,
            "ProductType": "Tailormade",
            "TourCountries": "Egypt"
        },
        {
            "IdentityValue": 118205,
            "IndividualID": 6001262,
            "BookNo": "1291622",
            "BookingDate": "1988-01-04T00:00:00",
            "BookingStatus": "Confirmed",
            "DepartureDate": "2006-09-02T00:00:00",
            "DurationOfTrip": 22,
            "MainCountry": "Peru",
            "Pax": 6,
            "ProductType": "Walking and Trekking",
            "TourCountries": "Peru"
        }
    ]
}
Parameter Description
apikey
string
RADAR API key
feed
string
The name of the feed
Example: Bookings
Optional Parameters
limit
number
The maximum number of results to return.
Default is 200 with no filters, 1000 with filters
Example: 500
expandIndividual
enum
Append additional information to the feed: none, sparse, email, household, all.
Default is none
Example: household
This endpoint supports filters
{field}
filter
Any field within the results collection can be filtered on
Example: Pax=5..

POST /telephony/inbound/callanswered

Notify us of an answered call

http POST https://demo.radar.ms/api/telephony/inbound/callanswered source=={inboundnumber} destination={answeredextension} dialed={numberdialed} apiKey=={yourAPIkey}
{
    "success": true,
    "title": "telephony.inbound.callanswered",
}
Parameter Description
source
string
The inbound number in E.164 format
destination
string
The extension that answered the call
dialed
string
The number dialed to make the call in E.164 format
apikey
string
RADAR API key

POST /client/{endpoint}

Do... something?

http POST https://demo.radar.ms/api/client/{endpoint} apiKey=={yourAPIkey}
{
    "success": true,
    "title": "client.endpoint",
    "requestid": 123
}
Parameter Description
apikey
string
RADAR API key
Optional Parameters
This endpoint supports custom parameters
{key}
key/value pair
Any custom parameters required by the endpoint are defined here
Example: Surname=Smith

GET /client/{endpoint}/{requestid}

Get an update for a specific request

Using the request id received

http GET https://demo.radar.ms/api/client/{endpoint}/{requestid} apiKey=={yourAPIkey}
{
    "success": true,
    "title": "client.endpoint",
    "response": "Processing..."
}
Parameter Description
apikey
string
RADAR API key

POST /import/{destination}

The dynamic data endpoint

Allows the import of custom payloads into dynamically created destination tables. Each key/value pair in the payload becomes a column and the value of that column respectively.

http POST https://demo.radar.ms/api/import/{destination} apiKey=={yourAPIkey}
{
    "success": true,
    "title": "import.destination"
}
Parameter Description
apikey
string
RADAR API key
Optional Parameters
This endpoint supports custom parameters
{key}
key/value pair
Any custom parameters required by the endpoint are defined here.
Keys may only contain alphanumeric characters or the underscore
Example: Surname=Smith

POST /ping

Ping? Pong!

Is this thing on?

http POST https://demo.radar.ms/api/ping 
{
    "success": true,
    "title": "ping",
    "message": "PONG!"
}