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.
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).
GetBookings
This method returns all matching bookings sorted by start (asc), object (asc), end (asc).
CreateBooking
This method creates a booking.
CutBooking
This method cuts a booking "now".
DeleteBooking
This method deletes a booking.
GetBalance
This method return the balance of the current user.
GetTransactions
This method returns balance and transactions sorted by date(desc), ID(desc).
Each transaction object contains the following details.
GetFlightLog
This method returns logged flights sorted by date(asc), ID(asc)
Each returned FlightLog object contains the following data.
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.
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"}]}