Main API v3.1
General
The Main API functions are intended to be used by clubs and organizations to manage their administrative work and information services.
An API authorization key is required prior to accessing the API methods. Club/organization administrators can create their own API keys by selecting ADMIN > System settings > Authorization > API access in the meny after logging in.
The Main API has been built up during a number of years, step by step. Because of this, the structure is not optimal. This has been corrected in version 4.
API Call Address
API v3.1 is accessed via https://api.myweblog.se/api_main.php
Active version(s)
Current version is API v4
API v3.1 is still operational but no longer supported.
API Methods
All methods are called via HEADER and POST (form) data. Method selection is made by using any of the method names below as qtype header.
A valid administrator account is required. Username and API key are submitted as headers username and authtoken respectively.
To summarize, all calls must include (in addition to method specific inputs) the mandatory HEADERS below.
get_user_list
This method returns a simple user list ordered by surname (ASC), first name (ASC).
getExtendedUserList
Like get_user_list but with more extensive information.
get_invalidemail_list
This method returns a list of users with an invalid email address.
insert_user
The method inserts a user as specified.
update_user
Theis method updates user details as specified.
delete_user
Deletes the specified user.
simpleLoginCheck
This method can be used to validate a user login on an external service based on myWebLog user credentials.
getObjectData
This method returns all objects sorted by object category, regnr (asc).
getObjectStatus
This method returns all objects with current status. No IP verification will be performed for this method.
getTransactions
This method returns a list of transactions and their details sorted by transaction date (ASC), time of creation (ASC). Without from_date, only the last 12 months are returned.
updateTransaction
This method updates the bookkeeping data of an existing transaction. To update a value, the corresponding updateKnt**** value must be set to 1.
getBookings
This method returns a list of bookings.
getInstructorAvailability
This method returns a list of available instructors.
getStudentAvailability
This method returns a list of available students.
getFlights
This method returns logged flights sorted by date(asc), ID(asc). Without from_date, only the last 12 months are returned.
Error codes
All error messages will be returned according to the following format (JSON exemple). The reply may contain several error messages:
{"APIVersion":"2.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 (initial part of) a JSON coded reply from a getFlights request:
{"getFlightsResult":{"numberOfFlights":116,"flights":[{"flightID":"65457","isEmptyRow":null,"originalTransactionID":"137997","aircraftID":"24","regnr":"SE-\u00c4BC","flightDate":"2011-04-02","registeredDate":"2011-05-03","typeOfFlightID":"703","typeOfFlightDescription":"PRIVAT","flightUserID":"303","flightUserFullname":"Magnus af Winsth","flightUserMemberNr":"99999","flightInstructorID":null,"flightInstructorFullname":null,"isSoloInstructionFlight":null,"flightScoutID":null,"flightScoutFullname":null,"tachStart":"126.7000","tachEnd":"127.7000","tachTotal":"1.00000","hobbsStart":null,"hobbsEnd":null,"hobbsTotal":null,"airborneStart":"12:00","airborneEnd":"13:13","airborneTotal":"1.00000","blockStart":null,"blockEnd":null,"blockTotal":null,"towTimeTotal":null,"towHeightID":null,"towHeight":null,"dailyCheck":"1","departurePlace":"ESTA","viaRoute":null,"arrivalPlace":"ESTL","numberOfFlights":"1","distance":null,"fuelUplift":null,"oilUplift":null,"flightComments":"jkl","newRemarkRegistered":null,"user_fornamn":"Magnus","user_efternamn":"Winsth","user_efternamn_partikel":"af"} ...