aodb/Readme/MobileInterfaceEndpoints.md
Martin Donnelly afe73b5baa upload
2016-12-22 00:00:06 +00:00

522 lines
9.2 KiB
Markdown

# Mobile Interface Endpoints
|Verb|Name|Url|
|---|---|---|
|POST|[Authentication](#authentication)|/api/auth|
|POST|[CancelTransaction](#canceltransaction)|/api/cancelTransaction|
|POST|[ConfirmTransaction](#confirmtransaction)|/api/confirmTransaction|
|POST|[CreateTransaction](#createtransaction)|/api/createTransaction|
|GET|[Detail](#detail)|/api/detail/|
|GET|[Flights](#flights)|/api/flights|
|GET|[GetOperatorImage](#getoperatorimage)|/api/GetOperatorImage|
|GET|[GetTransactionCodes](#gettransactioncodes)|/api/getTransactionCodes|
|GET|[GetTransactionConfig](#gettransactionconfig)|/api/getTransactionConfig|
|GET|[GetUserAccessRightsForTransaction](#getuseraccessrightsfortransaction)|/api/getUserAccessRightsForTransaction|
|GET|[GetWindows](#getwindows)|/api/getWindows|
|POST|[SetSite](#setsite)|/api/setSite|
|GET|[Transactions](#transactions)|/api/transactions|
|POST|[UpdateTransaction](#updatetransaction)|/api/updateTransaction|
|POST|[UpdateFlight](#Updatflight)|/api/updateFlight|
---
## Authentication
**/api/auth**
**Example post**
```json
{
"Username": "username",
"Password": "password",
"ActiveDirectoryUsername": ""
}
```
**Example response**
```json
{
"ContentEncoding": null,
"ContentType": null,
"Data": {
"LoginSuccess": true,
"SiteSelectionRequired": true,
"Sites": {
"SelectedSiteId": 0,
"Sites": [
{
"SiteId": 23,
"SiteName": "Oslo Airport",
"IATACode": "OSL"
},
{
"SiteId": 68,
"SiteName": "Alesund Airport, Vigra",
"IATACode": "AES"
}
],
"Warning": false
}
},
"JsonRequestBehavior": 1,
"MaxJsonLength": null,
"RecursionLimit": null
}
```
---
## CancelTransaction
**Example request**
```
http://localhost:89/api/cancelTransaction
```
**Example post**
```json
{
"Id": "296994",
"PhysflightId": "7126204",
"PublflightId": "7126204",
"Code": "TOW",
"Name": "ACFT TOW",
"Quantity": 1,
"Duration": "0",
"PONumber": "1",
"StartTime": "08/12/2016 12:18",
"EndTime": "08/12/2016 12:18",
"Confirmed": true,
"Cancelled": true,
"CodeType": 1,
"Timestamp": 1689685320
}
```
---
## ConfirmTransaction
**Example request**
```
http://localhost:89/api/confirmTransaction
```
**Example post**
```json
{
"Id": "296994",
"PhysflightId": "7126204",
"PublflightId": "7126204",
"Code": "TOW",
"Name": "ACFT TOW",
"Quantity": 1,
"Duration": "0",
"PONumber": "1",
"StartTime": "08/12/2016 12:18",
"EndTime": "08/12/2016 12:18",
"Confirmed": false,
"Cancelled": true,
"CodeType": 1,
"Timestamp": 1689685320
}
```
**Example response**
```json
{
"Success":true
}
```
---
## CreateTransaction
**Example request**
```
http://localhost:89/api/createTransaction
```
**Example post**
```json
{
"Id": "296994",
"PhysflightId": "7126204",
"PublflightId": "7126204",
"Code": "TOW",
"Name": "ACFT TOW",
"Quantity": 1,
"Duration": "0",
"PONumber": "1",
"StartTime": "08/12/2016 12:18",
"EndTime": "08/12/2016 12:18",
"Confirmed": false,
"Cancelled": false,
"CodeType": 1,
"Timestamp": 1689685320
}
```
**Example response**
```json
{
"Success":true
}
```
---
## Detail
**/api/detail/**
**Example request**
```
http://localhost:89//api/detail/?flightId=7121274&requestId=c9bced9b-1e6e-44b3-a236-0dd3005ee967
```
**Example response**
```json
{
"Editors": [
{
"Name": "readonly",
"Type": "readonly",
"Url": ""
},
{
"Name": "datetime",
"Type": "datetime",
"Url": "updateflightdate"
},
{
"Name": "freetext",
"Type": "freetext",
"Url": "updateflight"
}
],
"Groups": [
{
"Name": "Detail",
"Display": "Details",
"Icon": "ion-plane"
}
],
"Fields": [
{
"Value": "WF",
"Name": "Operator",
"Editor": "readonly",
"Group": "detail",
"Mapping": "SCOPER",
"Restrict": ""
}
],
"Flight": {
"Id": "7121274",
"PhysFlightId": "7121274",
"Type": "D",
"Number": "128",
"Operator": "WF",
"FlightConcat": "WF128",
"AircraftType": "DH1",
"Registration": "",
"Location": "FRO",
"Scheduled": "\/Date(1478635200000)\/",
"Estimated": "\/Date(-62135596800000)\/",
"Actual": "\/Date(-62135596800000)\/",
"Terminal": "T1",
"Stand": ""
},
"IsOutsideOfWindow": false
}
```
---
## Flights
**/api/flights**
>Gets list of flights
**Example request**
```
http://localhost:89/api/flights?window=Default
```
**Example json data**
```json
{
"Flights": [
{
"Id": "6760005",
"PhysFlightId": "6760005",
"Type": "D",
"Number": "4055",
"Operator": "SK",
"FlightConcat": "SK4055",
"AircraftType": "73G",
"Registration": "",
"Location": "SVG",
"Scheduled": "\/Date(1478895600000)\/",
"Estimated": "\/Date(-62135596800000)\/",
"Actual": "\/Date(-62135596800000)\/",
"Terminal": "T1",
"Stand": ""
}
],
"RequestId": "6be3dc32-847c-4d6f-b504-a5dac8444791",
"Filter": "Default"
}
```
---
## GetOperatorImage
**api/GetOperatorImage**
**Example get request**
```
/api/GetOperatorImage?code=BA
```
>Content-Type:image/jpeg
---
## GetTransactionCodes
**/api/getTransactionCodes**
**Example request**
```
http://localhost:89//api/getTransactionCodes
```
**Example response**
```json
[
{
"Code": "TOW",
"CodeType": 1,
"Name": "ACFT TOW"
},
{
"Code": "ASU",
"CodeType": 1,
"Name": "AIR START UNIT"
}
]
```
---
## GetTransactionConfig
**/api/getTransactionConfig**
**Example request**
```
http://localhost:89//api/getTransactionConfig?flightId=7250332&physFlight=7250332
```
**Example response**
```json
[
{
"Id": 0,
"ColumnName": "FLGTTRAN_TRANCATG_CODE",
"Visible": true,
"Editable": true,
"Width": 6,
"Index": 0,
"HeaderText": "Code",
"DateFormat": null,
"Highlight": false,
"Description": "Code",
"Frozen": false,
"Configuration": null,
"ListItems": null,
"Justify": "RIGHT",
"Length": 4,
"Precision": 0,
"ColumnDataType": 0,
"CodeSetType": null,
"LookupType": 0,
"Formatter": null,
"Fixed": false,
"LookupTypeName": null,
"InGrid": false
}
]
```
---
## GetUserAccessRightsForTransaction
**/api/getUserAccessRightsForTransaction**
**Example request**
```
http://localhost:89//api/getUserAccessRightsForTransaction
```
**Example response**
```json
{
"ProfileCode": "FSWH SYSTEM CONTROLLER",
"FunctionDefinition": "FSW_TRANSACTIONS",
"Enabled": true,
"Update": true,
"Add": true,
"Delete": true,
"View": true,
"FuncEnabled": false,
"FuncPackage": false,
"FuncProcedure": false,
"FuncParamaters": 0
}
```
---
## GetWindows
**/api/getWindows**
**Example response**
```json
[
{
"Id": 0,
"Name": "ABB",
"Description": "ABB",
"Type": "STANDARD"
}
]
```
---
//TODO
## SetSite
**/api/setSite**
**Example request**
```
http://localhost:89/api/setSite
```
**Example response**
```json
{
"ContentEncoding": null,
"ContentType": null,
"Data": {
"Error": false
},
"JsonRequestBehavior": 1,
"MaxJsonLength": null,
"RecursionLimit": null
}
```
---
## Transactions
**/api/transactions**
**Example request**
```
http://localhost:89//api/transactions?flightId=7250332&physFlight=7250332
```
**Example response**
```json
[
{
"Id": "296645",
"PhysflightId": "7250332",
"PublflightId": "7250332",
"Code": "TOW",
"Name": "ACFT TOW",
"Quantity": 1,
"Duration": "0",
"PONumber": "",
"StartTime": "10/11/2016 19:14",
"EndTime": "10/11/2016 19:14",
"Confirmed": false,
"Cancelled": false,
"CodeType": 1,
"Timestamp": 1683178617
}
]
```
---
## UpdateTransaction
**Example post**
```json
{
"Id": "296994",
"PhysflightId": "7126204",
"PublflightId": "7126204",
"Code": "TOW",
"Name": "ACFT TOW",
"Quantity": 1,
"Duration": "0",
"PONumber": "1",
"StartTime": "08/12/2016 12:18",
"EndTime": "08/12/2016 12:18",
"Confirmed": false,
"Cancelled": false,
"CodeType": 1,
"Timestamp": 1689685320
}
```
---
## UpdateFlight
**Example post**
```json
{
"ErrorCode": null,
"Error": null,
"Success": true,
"RequiresConfirmation": false,
"ErrorDescription": null,
"ErrorCaption": null,
"PublishedFlightId": "7126204",
"ColumnName": "S1_PHYSFLGT_CREW_NUMBER",
"Value": "100",
"UpdatedValue": "100",
"Operator": null,
"AircraftType": null
}
```
---