AccessLink Documentation
Url
You can login and access the DeliSky ordering system with the following URL:
https://hub.delisky.com/a/OrderCatering?{query}
Query Parameters
All parameters have to be url encoded.
Authentication/Identification
In order to authenticate we need the following parameters:
- apiKey
-
string
required
Your API key - reference
-
string
required
An identifier for the order (yet to be made), unique in your system - authToken
-
string
required
Authentication token, see instructions on how to generate it below
Airport filtering
The airport for which the caterers will be displayed is defined by either ICAO or IATA code:
- icao
-
string
icao or iata is required
ICAO code - iata
-
string
iata or icao is required
IATA code
Order properties
The following parameters are all optional. Use them to set order details upfront.
- contactName
-
string
optional
Name of responsible contact - contactPhone
-
string
optional
Phone of responsible contact - contactEmail
-
string
optional
Email of responsible contact - handling
-
string
optional
The handler's name - deliveryDateTime
-
string
optional
format: yyyy-MM-ddTHH:mm
Delivery Date/Time (UTC) - flightTime
-
string
optional
format: hh:mm
Expected duration of flight - typeOfFlight
-
string
optional
"international" or "domestic"
Type of Flight - faOnBoard
-
bool
optional
Specifies if a flight attendant is on board - numOfPax
-
int
optional
Estimated number of passengers - acRegistration
-
string
optional
Aircraft registration - flightNumber
-
string
optional
Flight number - oven
-
string
optional
"Oven", "Microwave" or "Oven, Microwave"
Heating equipment
Groups
- group
-
string
optional
Group name
It is possible to assign an order to a specific group. Groups can be used to customize webhook URLs. Manage your groups in the @Html.ActionLink("Developer Dashboard", "Index", new { controller = "Home", area = "Dev" } ).
Example:
| Group name | Webhook URL |
|---|---|
| default | https://webhooks.delisky.com |
| test | https://test.webhooks.delisky.com |
Authentication token
The auth token contains a timestamp and expires after 10 minutes.
How to generate the auth token
-
We need the following elements to generate the auth token:
- user name identify the user on our system
- user key used as key for the hashing
- timestamp (unix timestamp; seconds since 1970-01-01 00:00:00 UTC) make the token temporary
- the browsers user agent string tie token to a specific user (together with ip address)
- Concat user name, user agent, user IP and timestamp using the colon as separator. [username]:[useragent]:[userip]:[timestamp]
- Generate a SHA256 hash (HMAC variant) of the above, using the user key as key
- Convert the hash to a base64 string and concat user name and timestamp separated by colons. ([hash]:[username]:[timestamp])
- Convert the whole thing to a base64 string.
JavaScript Example
// Sample Data:
// var userName = "SampleUser";
// var userKey = "c4d6cafe6cf341dffe8af44e9eae5c5af01b920397422a05304597ce1dd6aa32";
// var userAgent = "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36";
// var timeStamp = 1483667814;
function generateToken(userName, userKey, userAgent,timeStamp) {
var message = [userName, userAgent, timeStamp].join(":");
// message = "SampleUser:Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36:1483667814"
var hash = CryptoJS.HmacSHA256(message, userKey);
var hashLeft = CryptoJS.enc.Base64.stringify(hash);
// hashLeft = "BmF6MLmctLLqV9NiqLNmg9wI44p41bz8WY6jCqsEZ9Y="
var hashRight = userName + ":" + timeStamp;
// hashRight = "SampleUser:1483667814"
var hashAll = hashLeft + ":" + hashRight;
var token = CryptoJS.enc.Base64.stringify(CryptoJS.enc.Utf8.parse(hashLeft + ":" + hashRight));
// token = "Qm1GNk1MbWN0TExxVjlOaXFMTm1nOXdJNDRwNDFiejhXWTZqQ3FzRVo5WT06U2FtcGxlVXNlcjoxNDgzNjY3ODE0"
return token;
}
C# Example
// Sample Data:
// var userName = "SampleUser";
// var userKey = "c4d6cafe6cf341dffe8af44e9eae5c5af01b920397422a05304597ce1dd6aa32";
// var userAgent = "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36";
// var timeStamp = 1483667814;
public string GenerateToken(string userName, string userKey, string userAgent, long timeStamp)
{
var message = string.Join(":", userName, userAgent, timeStamp);
// message = "SampleUser:Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36:1483667814"
var hashLeft = "";
var hashRight = "";
using (HMAC hmac = new HMACSHA256(Encoding.UTF8.GetBytes(userKey)))
{
hmac.ComputeHash(Encoding.UTF8.GetBytes(message));
hashLeft = Convert.ToBase64String(hmac.Hash);
// hashLeft = "BmF6MLmctLLqV9NiqLNmg9wI44p41bz8WY6jCqsEZ9Y="
hashRight = string.Join(":", new string[] { userName, timeStamp.ToString() });
// hashRight = "SampleUser:1483667814"
}
var token = Convert.ToBase64String(Encoding.UTF8.GetBytes(string.Join(":", hashLeft, hashRight)));
// token = "Qm1GNk1MbWN0TExxVjlOaXFMTm1nOXdJNDRwNDFiejhXWTZqQ3FzRVo5WT06U2FtcGxlVXNlcjoxNDgzNjY3ODE0"
return token;
}