Connect to the API
Setup
- Click File > Configuration > Services.
- Create or obtain a unique identifier to set for the Key field.
» https://www.uuidgenerator.net/ - Add the following API token setup.
12345678<Configuration><API><Token Description="{Description}" Key="{Unique Identifier}" Permission="{Level}" /><!-- Examples --><Token Description="Company App" Key="EB2F8AE0-6B56-4CA5-9A83-BECDCDB0702E" Permission="5" /><Token Description="Flight Status" Key="0B5D6649-CC27-4613-A944-ADBD2399ABE3" Permission="1" /></API></Configuration> - Click OK.
Basic Request
https://api.blueskybooking.com/2019-03/{Request}
JSON
{
Key : "EB2F8AE0-6B56-4CA5-9A83-BECDCDB0702E"
}
XML
<{Request}Request xmlns="http://schemas.datacontract.org/2004/07/BlueSkyBooking.Api.BusinessModel" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<Key>EB2F8AE0-6B56-4CA5-9A83-BECDCDB0702E</Key>
</{Request}Request>
Requests
- 2019-03/booking
- 2019-03/booking/update
- 2019-03/contact/<id>
- 2019-03/contact/create
- 2019-03/contact/find
- 2019-03/contact/password/reset
- 2019-03/class
- 2019-03/crew
- 2019-03/equipment
- 2019-03/fare
- 2019-03/location
- 2019-03/location/pairs
- 2019-03/schedule
- 2019-03/route
- 2019-03/route/<id>
- 2019-03/segment
- 2019-03/status
- 2019-03/tier
- 2019-03/type
Profile (Authenticated)
- 2019-03/profile
- 2019-03/profile/update
- 2019-03/profile/password
Login
https://api.blueskybooking.com/token
Method
POST
Content-Type
application/x-www-form-urlencoded
Data
grant_type=password&email={email}&password={password}&key={apiKey}&method=email
Error
- 0 = Success
- -1 = Login (email) does not exist
- -2 = Password is incorrect
- -3 = Privilege (online access) not available
Example
grant_type=password&email=name@company.com&password=mysecret&key=EB2F8AE0-6B56-4CA5-9A83-BECDCDB0702E&method=email
Response
{
"access_token": "R2LPdq4tzqlF...",
"token_type": "bearer",
"expires_in": 86399,
"refresh_token": "PHCZNmnzG30mu2nz..."
}
Password Recovery
1. Find all ContactId with an email address.
https://api.blueskybooking.com/2019-03/contact/find
Request
{
Key : "EB2F8AE0-6B56-4CA5-9A83-BECDCDB0702E",
Filter : {
Email : "name@company.com"
}
}
Response
{
"contacts": [
2343,
529,
44329,
],
"resultCode": "success"
}
2. Loop through each of the returned ContactId, notify each of the password recovery.
https://api.blueskybooking.com/2019-03/contact/password/reset
Request
{
Key : "0EA8AA5F-6B0D-480E-83D3-06C77AF7385A",
ContactId : 2343
}
Response
{
"resultCode": "success"
}
Profile
Create a new profile. Existing email address is allowed.
https://api.blueskybooking.com/2019-03/contact/create
Request
{
Key : "0EA8AA5F-6B0D-480E-83D3-06C77AF7385A",
"profile": {
"first": "First",
"last": "Last",
"email": "email@company.com",
"gender": "Male",
"weight": 200.0,
"locks": 1,
"password": "my$ecretpw",
"home": {
"address": "1234 Main Street",
"city": "Vancouver",
"state": "BC",
"country": "Canada",
"zip": "X1X 1X2",
"phone": "604-123-1234",
"fax": "",
"mobile": "",
"webSite": null
},
"business": {
"address": "",
"city": "",
"state": "",
"country": "",
"zip": "",
"phone": "",
"fax": "",
"mobile": "",
"webSite": null
}
}
}
Response
{
"profile": {
"contactId": 2533205,
"first": "First",
"last": "Last",
"email": "email@company.com",
"password": "my$ecretpw",
"gender": "Male",
"weight": 200.0,
"locks": 1,
"home": {
"address": "1234 Main Street",
"city": "Vancouver",
"state": "BC",
"country": "Canada",
"zip": "X1X 1X2",
"phone": "604-123-1234",
"fax": "",
"mobile": "",
"webSite": null
},
"business": {
"address": "",
"city": "",
"state": "",
"country": "",
"zip": "",
"phone": "",
"fax": "",
"mobile": "",
"webSite": null
},
"shipping": {
"address": null,
"city": null,
"state": null,
"country": null,
"zip": null,
"phone": null,
"fax": null,
"mobile": null,
"webSite": null
}
},
"resultCode": "success"
}
Error
- 0 = Success
- -1 = Missing name (First, Last or Company)
- -2 = Missing email (or mismatch email list)
- -3 = Missing password
Type: Locks (seats) and Weight
To set the locks and weight in the contact/update, use the /type endpoint and extract all genders that are web active.
https://api.blueskybooking.com/2019-03/type
Request
{
Key : "0EA8AA5F-6B0D-480E-83D3-06C77AF7385A"
}
Filter results by:
{
"typeList": [
{
"web": {
"active": true
}
}
}
Create a booking
Step 1: Search Critera
https://api.blueskybooking.com/2019-03/location
https://api.blueskybooking.com/2019-03/location/pairs
https://api.blueskybooking.com/2019-03/type
URL (Optional)
https://api.blueskybooking.com/2019-03/classes
https://api.blueskybooking.com/2019-03/tiers
https://api.blueskybooking.com/2019-03/segments
Step 2: Search Results
https://api.blueskybooking.com/2019-03/route
Request
{
Key : "0EA8AA5F-6B0D-480E-83D3-06C77AF7385A",
Filter : {
DateStart : "2019-03-20 00:00:00",
DateEnd: "2019-03-20 23:59:59",
TimeStart: 0,
TimeEnd: 1440,
DepartureLocationId: 3,
ArrivalLocationId: 32,
ClassId: [1],
FareId: [0,1,2],
Booking: [0,1,2],
Web: [1,2]
}
}
Required
- DateStart
- DateEnd
- TimeStart
- TimeEnd
- DepartureLocationId
- ArrivalLocsationId
Booking, Web
- 0 = Closed
- 1 = View Only
- 2 = Open
Step 3: Create Booking
[Under construction]