Mobile API v3.0.0
General
The mobile API functions are intended to be used by developers of mobile device applications.
Individual developer approval is required prior to accessing the API methods. Contact support@myweblog.se to apply for an approval.
API Call Address
The API is accessed via https://api.myweblog.se/api_mobile.php. The version number is no longer required in the endpoint address.
Active version(s)
Current version is 3.0.0.
API Methods
All methods are called via POST data. Method selection is made by posting any of the method names below as qtype.
Username and password are submitted as mwl_u and mwl_p respectively.
The API replies can be formatted as a JSON string (UTF-8), XML as an ARRAY dump. Post JSON, XML or ARRAY as returnType.
Default charset is UTF-8, but may be changed by posting any other encoding as charset.
All methods also require the call to include the unique app_token. This token will be received from myWebLog Support after approval.
Where applicaple, the replied messages will be according to the selected language. Default is English.
To summarize, all calls must include (in addition to method specific inputs) the mandatory inputs below.
| Input |
Format |
Mandatory |
Comment |
| qtype |
string |
Y |
|
| mwl_u |
string |
Y |
|
| mwl_p |
string |
Y |
|
| returnType |
string |
|
JSON|XML|ARRAY |
| charset |
string |
|
|
| app_token |
string |
Y |
|
| language |
string |
|
se|en|no |
All calls will return Result as "OK" after a successful process.
GetObjects
This method returns all objects that the user is authorized to view sorted by regnr (asc).
| Input |
Format |
Mandatory |
Comment |
| includeObjectThumbnail |
bool |
|
0|1 |
| Output |
Format |
Comment |
| ID |
int |
|
| regnr |
string |
|
| club_id |
int |
|
| clubname |
string |
|
| model |
string |
|
| objectThumbnail |
jpg |
150x100 px |
GetBookings
This method returns all matching bookings sorted by start (asc), object (asc), end (asc).
| Input |
Format |
Mandatory |
Comment |
| ac_id |
int |
|
|
| mybookings |
bool |
|
0|1 |
| from_date |
yyyy-mm-dd |
|
Default: [Today] |
| to_date |
yyyy-mm-dd |
|
|
| includeSun |
bool |
|
0|1. Will include sunrise/sunset data for the user's reference airport and the selected dates. If no to_date is specified, one month will be used. |
| Output |
Format |
Comment |
| ID |
int |
|
| ac_id |
int |
|
| regnr |
string |
|
| bobject_cat |
int |
|
| club_id |
int |
|
| user_id |
int |
|
| bStart |
timestamp |
|
| bEnd |
timestamp |
|
| typ |
string |
|
| primary_booking |
bool |
|
| fritext |
string |
|
| elevuserid |
int |
|
| platserkvar |
int |
|
| fullname |
string |
|
| email |
string |
|
| completeMobile |
string |
|
| sunData Output |
Format |
Comment |
| refAirport |
Misc |
Reference airport data such as name, designators and coordinates. |
| dates |
Misc |
Data for each included date, including morning twillight, sunrise, sunset and evening twillight. |
CreateBooking
This method creates a booking.
| Input |
Format |
Mandatory |
Comment |
| ac_id |
int |
Y |
|
| bStart |
yyyy-mm-ddThh:mm+hh:mm |
Y |
Last hh:mm is difference from UTC. E.g.: "2018-04-22T10:30+02:00" |
| bEnd |
yyyy-mm-ddThh:mm+hh:mm |
Y |
Last hh:mm is difference from UTC. E.g.: "2018-04-22T10:30+02:00" |
| fritext |
string |
|
|
| expectedAirborne |
decimal |
|
|
| platserkvar |
int |
|
|
| Output |
Format |
Comment |
| infoMessageTitle |
string |
Message title (if any) after approved booking. |
| infoMessage |
string |
Message text (if any) after approved booking. |
| errorMessage |
string |
Booking not approved. |
CutBooking
This method cuts a booking "now".
| Input |
Format |
Mandatory |
Comment |
| bookingID |
int |
Y |
|
| Output |
Format |
Comment |
| infoMessageTitle |
string |
Message title (if any) after approved cut. |
| infoMessage |
string |
Message text (if any) after approved cut. |
| errorMessage |
string |
Cut not approved. |
DeleteBooking
This method deletes a booking.
| Input |
Format |
Mandatory |
Comment |
| bookingID |
int |
Y |
|
| reason |
string |
N |
|
| Output |
Format |
Comment |
| infoMessageTitle |
string |
Message title (if any) after approved deletion. |
| infoMessage |
string |
Message text (if any) after approved deletion. |
| errorMessage |
string |
Deletion not approved. |
GetBalance
This method return the balance of the current user.
| Output |
Format |
Comment |
| Fornamn |
string |
|
| Partikel |
string |
|
| Efternamn |
string |
|
| fullname |
string |
|
| Balance |
decimal |
|
| currency_symbol |
string |
E.g. "kr" |
| int_curr_symbol |
string |
E.g. "SEK" |
GetTransactions
This method returns balance and transactions sorted by date(desc), ID(desc).
| Input |
Format |
Mandatory |
Comment |
| limit |
int |
|
Number of transactions. Default: 20 |
| from_date |
yyyy-mm-dd |
|
|
| to_date |
yyyy-mm-dd |
|
|
| Output |
Format |
Comment |
| Balance |
decimal |
|
| BalanceAtToDate |
decimal |
|
| UsedCountLimit |
int |
|
| currency_symbol |
string |
E.g. "kr" |
| int_curr_symbol |
string |
E.g. "SEK" |
| Transaction |
|
Array of transaction objects. See below. |
Each transaction object contains the following details.
| Output |
Format |
Comment |
| datum |
yyyy-mm-dd |
|
| created |
yyyy-mm-dd hh:mm:ss |
|
| belopp |
decimal |
|
| comment |
string |
|
| bookedby_fullname |
string |
|
GetFlightLog
This method returns logged flights sorted by date(asc), ID(asc)
| Input |
Format |
Mandatory |
Comment |
| limit |
int |
|
Number of rows. Default: 20 |
| from_date |
yyyy-mm-dd |
|
|
| to_date |
yyyy-mm-dd |
|
|
| myflights |
bool |
|
Only own flights if set to 1. |
| ac_id |
int |
|
|
Each returned FlightLog object contains the following data.
| Output |
Format |
Comment |
| flight_datum |
yyyy-mm-dd |
|
| ac_id |
int |
|
| regnr |
string |
|
| fullname |
string |
|
| departure |
string |
ICAO code |
| via |
string |
ICAO code(s) |
| arrival |
string |
ICAO code |
| block_start |
hh:mm |
|
| block_end |
hh:mm |
|
| block_total |
decimal |
|
| airborne_start |
hh:mm |
|
| airborne_end |
hh:mm |
|
| airborne_total |
decimal |
|
| tach_start |
hh:mm |
|
| tach_end |
hh:mm |
|
| tach_total |
decimal |
|
| flights |
int |
|
| distance |
decimal |
|
| nature_beskr |
string |
Type of flight |
| comment |
string |
|
| rowID |
int |
|
GetFlightLogReversed
Identical to "GetFlightLog" but with reversed sorting.
Error codes
All error messages will be returned according to the following format (JSON exemple). The reply may contain several error messages:
{"APIVersion":"3.0.0","Error":[{"Code":"200","Message":"INVALID USERNAME OR PASSWORD"},":[{"Code":"299","Message":" TEST ERROR MESSAGE 2"}]}
"Code" is always a value according to the table below and Message is always a text string.
| Code |
Message |
| 0 |
SSL CONNECTION NOT DETECTED |
| 100 |
INVALID CLUB OR APP TOKEN |
| 101 |
BOOKING DISABLED IN SETTINGS |
| 200 |
INVALID USERNAME OR PASSWORD |
| 900 |
INVALID QTYPE |
JSON Example
This is an example of a JSON coded reply from a GetFlightLog request:
{"qtype":"GetFlightLog","FlightLog":[{"flight_datum":"2011-10-04","ac_id":
"1118","regnr":"LN-ABC","departure":"ESTA","via":null,"arrival":"ESTL","block_start":null,"block_end":null,"block_total":"0.0000","airborne_start":"12:00","airborne_end":"13:00","airborne_total":"1.0000","nature_beskr":"PRIVAT"comment":"Kommentarsexempel"}]}