Information For Developers
INSTRUCTIONS
FOR USE
All data
can be retrieved by calling a single URL, the parameters passed on the
querystring will determine the type of data and filtering required.
URL & QUERYSTRING
The URL to
access is: https://apis.rentalcarmanager.com/export/ReservationsExport.ashx
General
format for the querystring is: {URL as
above}?key={keyvalue}&method={methodname}&{param1name}={param1value}&{param2name}={param2value}...etc
KEY
Your key (an encrypted string of about 20 characters) will be provided when API access is granted. Please note that we will require a static IP address to set up the key - access will only be allowed from this IP address.
All calls
to the URL requires the key. This will
identify the caller and match the request to your database.
SHARED SECRET
For those API clients that do not have a static IP address, there are further steps necessary to secure the request. If you have been issued with a Shared Secret, please see further information below here.
METHOD
The method
name for the data that requires export.
Valid method names are "repbookingexport", “bookingextrafees”,
"vehicle", "customer", "location",
"extraitem", "rentalsource", "salesrep", “agency”
and “respayment”
Over time, we may add more methods for exports. If you see a method here that is unavailable in your system, please contact us at support@rentalcarmanager.com to request access.
DATA
RETURNED
All data
will be returned in as a JSON file. The
data will be in the form
[{first
record},{next record}, {record 3}, {…}, {last record}]
where
record = “fieldname1”:”fieldvalue1”,”fieldname2”:”fieldvalue2”, …
,”fieldnameX”:”fieldvalueX”
No records
found will return “[]”
REQUEST RATE LIMITS
From November 2019 each export method has constraints around how many requests may be made per day. In some cases there is also a defined maximum date range. See each method definition below for further information. If you require a higher level of access to this API please contact us for pricing details.
---------------------------------------------
RESERVATIONS
key = key
value as above
method =
"repbookingexport"
lid =
Integer location id to restrict report by.
A value of 0 returns all locations.
sd = Start
date - bookings altered on or after this date will be returned. String format is yyyyMMdd-HHmm.
ed = End
date - bookings altered on or before this date will be returned. String format
is yyyyMMdd-HHmm
Example
call - {URL}?key={key}&method=repbookingexport&lid=2&sd=20160501-0000&ed=20160502-0000
Restrictions: Date range is maximum 1 day. May be called up to 6 times per day, where hours are specified.
-------------------------------------------------
VEHICLES
key = key
value as above
method =
"vehicle"
vid =
Integer vehicle id to restrict report by.
A value of 0 returns all vehicles.
sd = Start
date - vehicles altered on or after this date will be returned. String format is yyyyMMdd-HHmm.
ed = End
date - vehicles altered on or before this date will be returned. String format
is yyyyMMdd-HHmm
Example
call - {URL}?key={key}&method=vehicle&vid=0&sd=20160501&ed=20160502
Restrictions: Date range is maximum 1 day. May be called up to 6 times per day, where hours are specified.
-------------------------------------------------
CUSTOMERS
key = key value
as above
method =
"customer"
cid =
Integer customer id to restrict report by.
A value of 0 returns all customers.
sd = Start
date - customer records or last hire dates altered on or after this date will be returned. String format is yyyyMMdd-HHmm.
ed = End
date - customer records or last hire dates altered on or before this date will be returned. String format
is yyyyMMdd-HHmm
Example
call - {URL}?key={key}&method=customer&cid=0&sd=20170101-0900&ed=20170102-0900
Restrictions: Date range is maximum 1 day. May be called up to 6 times per day, where hours are specified. May be called more times if a specific customer id is passed in
------------------------------------------------------
LOCATIONS
key = key
value as above
method =
"location"
lid =
Integer location id to restrict report by.
A value of 0 returns all locations.
Example
call - {URL}?key={key}&method=location&lid=2
Restrictions: May be called once per day
-------------------------------------------------------
EXTRA ITEMS
key = key
value as above
method =
"extraitem"
eid =
Integer extraItem id to restrict report by.
A value of 0 returns all items.
Example
call - {URL}?key={key}&method=extraitem&eid=2
Restrictions: May be called once per day. May be called more times if a specific item id is passed in
---------------------------------------------------------
RENTAL SOURCES
key = key
value as above
method =
"rentalsource"
rid =
Integer rental source id to restrict report by.
A value of 0 returns all rental sources.
Example
call - {URL}?key={key}&method=rentalsource&rid=2
Restrictions: May be called once per day. May be called more times if a specific rental source id is passed in
----------------------------------------------------------
OPERATORS (SALES REPRESENTATIVES)
key = key
value as above
method =
"salesrep"
uid =
Integer user id to restrict report by. A
value of 0 returns all users.
Example
call - {URL}?key={key}&method=salesrep&uid=2
Restrictions: May be called once per day. May be called more times if a specific user id is passed in
-------------------------------------------------------------
EXTRA FEES
key = key
value as above
method =
"bookingextrafees"
lid =
Integer location id to restrict report by.
A value of 0 returns all locations.
res =
Integer reservation number to restrict report by. A value of 0 returns all
reservations. Note a value in this field will be matched against allocated
reservationNo and unallocated reservationNos. Returned data will indicate which
field was matched.
sd = Start
date - bookings altered on or after this date will be returned. String format is yyyyMMdd-HHmm.
ed = End
date - bookings altered on or before this date will be returned. String format
is yyyyMMdd-HHmm
Example
call - {URL}?key={key}&method=bookingextrafees&lid=2&sd=20150501-0000&ed=20150502-0000&res=10232
Restrictions: Date range is maximum 1 day. May be called up to 6 times per day, where hours are specified. May be called more times if a specific reservation no is passed in
-------------------------------------------------
AGENCIES
key = key
value as above
method =
"agency"
There are
no additional parameters for this call
Example
call - {URL}?key={key}&method=agency
Restrictions: May be called once per day.
-------------------------------------------------------------
RESERVATION PAYMENTS
key = key
value as above
method =
"respayment"
sd = Start
date - bookings altered on or after this date will be returned. String format is yyyyMMdd-HHmm.
ed = End
date - bookings altered on or before this date will be returned. String format
is yyyyMMdd-HHmm
Example
call - {URL}?key={key}&method=respayment&sd=20150501-0900&ed=20150502-0900
Restrictions: Date range is maximum 1 day. May be called up to 6 times per day, where hours are specified. May be called more times if a specific reservation no is passed in.
-------------------------------------------------------------
RESERVATION NOTES
key = key value as above
method = "resnotes"
res = Integer reservation number to restrict report by. A value of 0 returns all reservations. Note a value in this field will be matched against allocated reservationNo and unallocated reservationNos. Returned data will indicate which field was matched.
sd = Start date - notes altered on or after this date will be returned. String format is yyyyMMdd-HHmm.
ed = End date - notes altered on or before this date will be returned. String format is yyyyMMdd-HHmm
Example call - {URL}?key={key}&method=resnotes&res=0&sd=20180501-0900&ed=20180502-0900
Restrictions: Date range is maximum 1 day. May be called up to 6 times per day, where hours are specified. May be called more times if a specific reservation no is passed in
------------------------------------------------------------------
SEASON
key = key
value as above
method =
"season"
There are
no additional parameters for this call
Example
call - {URL}?key={key}&method=season
Restrictions: May be called once per day.
-------------------------------------------------------------
RESERVATION RATES
key = key
value as above
method =
"paymentdetails"
sd = Start
date - bookings rates altered on or after this date will be returned. String format is yyyyMMdd-HHmm.
ed = End
date – bookings rates altered on or before this date will be returned. String
format is yyyyMMdd-HHmm
res =
Integer reservation number to restrict report by. A value of 0 returns all
reservations. Note a value in this field will be matched against allocated
reservationNo and unallocated reservationNos. Returned data will indicate which
field was matched.
lid =
Integer location id to restrict report by (as pickup location). A value of 0 returns all locations.
Example
call - {URL}?key={key}&method=paymentdetails&sd=20150501-0900&ed=20150502-0900&lid=1&res=10231
Restrictions: Date range is maximum 1 day. May be called up to 6 times per day, where hours are specified. May be called more times if a specific reservation no is passed in
------------------------------------------------------------
VEHICLE SERVICE RECORDS
key = key value as above
method = "service"
sd = Start date - service records entered or closed on or after this date will be returned. String format is yyyyMMdd.
ed = End date – service records entered or closed on or before this date will be returned. String format is yyyyMMdd.
lid = Integer location id to restrict report by (as Branch). A value of 0 returns all locations.
Example call - {URL}?key={key}&method=service&sd=20150501&ed=20150502&lid=1
Restrictions: Date range is maximum 1 day. May be called once per day, per location.
-------------------------------------------------------------
ON ROAD REPAIRS
key = key value as above
method = "onroad"
sd = Start date - repair records entered on or after this date will be returned. String format is yyyyMMdd.
ed = End date – repair records entered on or before this date will be returned. String format is yyyyMMdd.
Example call - {URL}?key={key}&method=service&sd=20150501&ed=20150502&lid=1
Restrictions: Date range is maximum 1 day. May be called once per day, per location.
-------------------------------------------------------------
MAINTENANCE BOOKINGS
key = key value as above
method = "maintenance"
sd = Start date - repair records entered on or after this date will be returned. String format is yyyyMMdd-HHmm.
ed = End date – repair records entered on or before this date will be returned. String format is yyyyMMdd-HHmm.
lid = Integer location id to restrict report by (as pickup location). A value of 0 returns all locations.
Example call - {URL}?key={key}&method=maintenance&lid=1&sd=20150501-0900&ed=20150502-0900
Restrictions: Date range is maximum 1 day. May be called once per day, per location.
---------------------------------------------------------------
AGENT PAYMENTS
key = key value as above
method = "agentpayment"
sd = Start date - payments entered on or after this date will be returned. String format is yyyyMMdd.
ed = End date – payments entered on or before this date will be returned. String format is yyyyMMdd.
Example call - {URL}?key={key}&method=agentpayment&sd=20150501&ed=20150502
Restrictions: Date range is maximum 1 day. May be called once per day.
--------------------------------------------------------------
AGENT RATES
key = key value as above
method = "agentrates"
sd = Start date - rates for seasons starting on or after this date will be returned. String format is yyyyMMdd.
ed = End date – rates for seasons ending on or before this date will be returned. String format is yyyyMMdd.
Example call - {URL}?key={key}&method=agentrates&sd=20180101&ed=20180201
Restrictions: Date range is maximum 62 days, or 2 months. May be called up to 12 times per day.
--------------------------------------------------------------
SHARED SECRET ACCESS
For those API clients who do not have a fixed IP address, we will issue a "Shared Secret" along with your secure key.
If you have been issued with this secret key then you will need to sign each request using the HMACSHA256 protocol.
To create the signature:
1. Get the part of the request URL following the domain information (including the entire query string).
2. Use the hash secret to sign the part of the URL using HMACSHA256.
3. Add the hex encoded result to the header of the request as the signature.
Sample VB Code for requesting agencies:
Public Sub ReturnsMultipleRecords_Demo()
Dim domain As String = "https://apis.rentalcarmanager.com"
Dim urlpath As String = "/export/ReservationsExport.ashx"
Dim secureKey As String = "[secure key here]"
Dim url As String = urlpath & "?key=" & secureKey & "&method=agency" 'add other parameters here as required
Dim sharedSecret As String = "[shared secret here]"
Dim encoding = New System.Text.UTF8Encoding
Dim myHMAC As New HMACSHA256(encoding.GetBytes(sharedSecret))
'Hash the url
Dim hashedBytes As Byte() = myHMAC.ComputeHash(encoding.GetBytes(url))
'Convert the hash to hex
Dim strSignature As New StringBuilder(hashedBytes.Length * 2)
Dim hex As String
For Each b As Byte In hashedBytes
hex = Conversion.Hex(b)
If hex.Length = 1 Then hex = "0" & hex
strSignature.Append(hex)
Next
Using client As New WebClient()
client.Headers.Add("signature", strSignature.ToString())
Dim response As String = client.DownloadString(domain & url)
Console.WriteLine(domain & url)
'Check response
Console.WriteLine(response)
Dim list As List(Of AgencyRecord) = JsonConvert.DeserializeObject(Of List(Of AgencyRecord))(response)
Console.WriteLine("Found Records: " & list.Count)
End Using
End Sub
During development, please try testing using the following credentials, which will connect to one of our demonstration systems. If you are able to get a list of sample agencies, then you may proceed to test with the key/shared secret that you have been issued:
SECURE_KEY: "U2FuZGJveFJDTURCNDA2fFJDTVN1cHBvcnR8bUN5NDF6T0s="
SHARED_SECRET: "mGfLE4DLFDrzG3HAMMjE4u1Hy3tOpG22"
--------------------------------------------------------------