Developer documentation for AudioCompass's API. All endpoints are appended to http://api.audiocompass.in
###Step 1: Exchanging your username and password for an access token
####Endpoint
POST /auth/token
Content-Type: application/x-www-form-urlencoded
####Parameters username required: The username given to you.
password required: Your account password.
####Example response
{
access_token: "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJhY2ciLCJpYXQiOiIxNDEyMDc5MjYwIiwicm9sZSI6ImFkbWluIiwic3ViIjoNTQxZWQ1ODFh0TY4MmExNzBiNmU1NThiIiwiYWxpYXMiOiJhZG1pbiIsImFnZW50X25hbWUiOiJhZG1pbiJ9.xKLGsEucHwNB20euE4H2nOApdPEjz-Wm8Cyufw1Cetw"
}
Tip:This access_token is valid for 30 days and can be cached by your application.
###Step 2: Creating a trip
####Endpoint
POST /trips/create
Content-Type: application/x-www-form-urlencoded
####Parameters pnr Required: The PNR/Booking-Id of the trip. This pnr should be a unique string generated by your systems
fname Required: The First name of the main passenger.
lname Required: The Last name of the main passenger.
email Required: The email of the main passenger.
mobile Required: The 10 digit mobile number of the main passenger
trip_start Required: The start date of the trip in YYYY-MM-dd format.
trip_end Required: The end date of the trip in YYYY-MM-dd format.
num_of_activations Required(integer): The no of passengers in the trip(PAX).
access_token Required: The access token that you recieved in the previous step.
debug Optional(default: false): Set this option to true if you want to create test trip. Else don't include this field
####Example response
{
trip_start: "2014-11-18T00:00:00.000Z"
trip_end: "2014-12-30T00:00:00.000Z"
pax: 2
lock_date: "2015-01-01T00:00:00.000Z"
unlock_date: "2014-11-27T11:24:55.878Z"
agent_id: "54212dc60197e8380c948cc7"
agent_alias: "test"
agent_name: "Test agent"
activated: false
created: "2014-11-27T11:24:55.878Z"
modified: "2014-11-27T11:24:55.878Z"
activation_time: null
activation_ip: null
debug: false
mobile: "9876543210"
fname: "Test First Name"
lname: "Test Last name"
email: "[email protected]"
pnr: "testrip1235"
code: "testrip1235"
sms_activation_url: "http://bnc.lt/l/1g90elU-_V"
email_activation_url: "http://bnc.lt/l/1g90elU-_U"
id: "54770a079ce2511577ae9306"
}
#####Link distribution email_activation_url: Use this url to share with your passengers.
####Common errors
- In case the access_token is invalid you get the following error
{
statusCode: 400
error: "Bad Request"
message: "invalid access token"
}
- If the PNR/Booking-Id already exists
{
statusCode: 400
error: "Bad Request"
message: "Booking Id already exists."
}