POST |
/logincheck/ | Validates user credentials. |
myWebLog API v4
Main API v4 is operational until 2027-09-30. Main API v5 is the primary version: v4 will not be developed or changed, and new functions are only added to v5. Moving from v4 to v5 lists every difference, with what to change.
Every v4 reply has the headers Deprecation: @1791244800 (2026-10-06, the release of v5), Sunset: Thu, 30 Sep 2027 22:00:00 GMT (2027-10-01 00:00 Swedish time) and Link: <https://api.myweblog.se/main/v5/migration.html>; rel="deprecation"; type="text/html". From 2027-10-01 every v4 call is answered with error 10060 (410 Gone).
General
Endpoint: https://api.myweblog.se/main/v4/{request}/
All inputs and filters, except headers as defined below, shall be submitted as follows:
- GET: Filtering, sorting, and pagination via URI query parameters
- POST/PUT/PATCH: Data submitted via JSON request body
- DELETE: Target resource identification via URI path
All filters are optional. Wildcards * and _ may be used in string filters.
Request Headers
| Header | Data | Mandatory | Description |
|---|---|---|---|
| Authorization | Bearer [your token] | Yes | Required for authorization |
| Request-Id | [your key] | No | A key submitted here will be returned in all replies as a header. Use this to verify that a reply originates from your request. |
| Deprecated. Use Request-Id. |
Global Filters
| Filter | Description |
|---|---|
| limit (int) | Will limit the number of returned items. Valid range 1-500. Default 500. |
| offset (int) | Will offset the returned items. Default 0. |
Endpoints
Click on each endpoint method to expand.
bookings
GET |
/bookings/?{filter1}&{filter2}... | Retrieves object bookings. |
GET |
/bookings/instructors/ | To be implemented |
GET |
/bookings/students/ | To be implemented |
POST |
/bookings/ | To be implemented |
PATCH |
/bookings/ | To be implemented |
DELETE |
/bookings/ | To be implemented |
flightlogs
GET |
/flightlogs/?{filter1}&{filter2}... | Retrieves the object logbook entries. |
POST |
/flightlogs/ | To be implemented |
GET |
/flightlogs/flighttypes/ | Retrieves the organization's flight types. |
GET |
/flightlogs/flighttypes/approved/?{filter} | Retrieves the approved flight types for a specific user. |
logincheck
objects
GET |
/objects/?{filter1}&{filter2}... | Retrieves a list of objects. |
GET |
/objects/status/ | Retrieves a list of the objects' technical status. |
organizations
GET |
/organizations/location/ | Retrieves basic location data for the organization. |
remarks
GET |
/remarks/ | To be implemented |
POST |
/remarks/ | To be implemented |
test
GET |
/test/ | Returns a simulated erroneous request with two errors. |
POST |
/test/ | Returns a simulated succesful request. |
token
GET |
/token/rights/ | Retrieves auth token read/write rights. |
transactions
GET |
/transactions/?{filter1}&{filter2}... | Retrieves transactions. |
GET |
/transactions/swish/ | To be implemented |
POST |
/transactions/ | Creates a transaction |
PATCH |
/transactions/ | To be implemented |
users
GET |
/users/?{filter1}&{filter2}... | Retireves user information |
POST |
/users/ | Creates a user |
PATCH |
/users/ | Updates a user |
DELETE |
/users/ | Deletes a user |
GET |
/users/memberships/?{filter1}&{filter2}... | Retrieves a list of membership types |
GET |
/users/groups/?{filter1}&{filter2}... | Retrieves a list of user groups |
Examples
These examples are abbreviated and will not include the header(s).
GET objects request
GET objects reply
"auth_token": {
"description": "Postman",
"owner": "Magnus Winsth, Svanshalls FK"
},
"meta_information": {
"objects": 1
},
"objects": [
{
"id": 24,
"registration": "SE-ABC",
"category": {
"id": 0,
"name": "Aircraft"
},
"type_designator": "C172",
"type_name": "CESSNA 172",
"comment": "Ã…rsmodell 2002",
"organization_id": 3,
"organization_name": "Svanshalls FK",
"active": 1
}
]
}
POST transactions request body
"user_id": 987654321
"date": "2026-01-27"
"amount": -123
"comment": "Test transaction"
"accounting": {
"amount": 123,
"debit": 1940,
"credit": 1510,
"cost_center": "CCTR1",
"project": "PRJ1",
}
}
Reply with error
"auth_token": {
"description": "Postman",
"owner": "Magnus Winsth, Svanshalls FK"
},
"errors": [
{
"id": 10130
"message": "Duplicate transaction detected"
}
]
}
PHP cURL POST Request
$endpoint = 'https://api.myweblog.se/main/v4/test/';
// Set authorization token
$headers = [
'Content-Type: application/json',
'Authorization: Bearer {my_auth_token}',
'Request-Id: {my_request_id}'
];
// Set post body
$post = json_encode([
'my_test_input' => 'My input data'
]);
// Prepare and perform the request
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $endpoint);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
curl_setopt($curl, CURLOPT_POSTFIELDS, $post);
$response = curl_exec($curl);
$response_code = curl_getinfo($curl, CURLINFO_HTTP_CODE);
// Process the response as desired in your application
var_dump($response_code);
var_dump($response);
Linux/Mac cURL Requests
curl -X GET "https://api.myweblog.se/main/v4/users/?active=2&verbose=true" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer {my_auth_token}" \
-H "Request-Id: {my_request_id}"
## Fetch all transactions for January 2026 and include accounting rows.
curl -X GET "https://api.myweblog.se/main/v4/transactions/?include_account_rows=true&date_from=2026-01-01&date_to=2026-01-31" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer {my_auth_token}" \
-H "Request-Id: {my_request_id}"
## Generate a negative transaction to the user account with accounting information.
curl -X POST "https://api.myweblog.se/main/v4/transactions/" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer {my_auth_token}" \
-H "Request-Id: {my_request_id}" \
-d '{
"user_id": 987654321,
"amount": -500.00,
"comment": "Test Transaction via CURL",
"date": "2026-01-29",
"accounting": {
"amount": 500.00,
"debit": 3011,
"credit": 1910
}
}'
Error Codes
| Code | Name | Comment | Response |
|---|---|---|---|
| 10000 | SSL Connection Required | Self explanatory | 406 Not Acceptable |
| 10001 | Unauthorized | Check your token to be correct and valid. | 401 Unauthorized |
| 10002 | Unauthorized Module Access | Check the module access settings for the auth token. | 403 Forbidden |
| 10003 | Invalid parameter data | Check that your parameters are UTF-8 and, if GET parameters, do not include any %. | 400 Bad Request |
| 10005 | Invalid parameter format | Check the format of the indicated parameter. | 400 Bad Request |
| 10006 | Invalid input format | Check the format of the input parameters or json body, including required parameters. | 400 Bad Request |
| 10010 | Internal SQL Error | An internal SQL error has occurred and has been logged. | 500 Internal Server Error |
| 10020 | Unknown exception on row {row} | An internal error has occurred. Contact support if it persists. | 500 Internal Server Error |
| 10030 | Duplicate detected | Your request to insert or modify an item has detected a duplicate. | 500 Internal Server Error |
| 10040 | User limit reached | A trial organization can have at most 5 active users. Contact support to activate the organization. | 403 Forbidden |
| 10050 | Method Not Allowed | Check correct usage of GET/POST/PATCH/PUT/DELETE. | 405 Method Not Allowed |
| 10060 | Main API v4 is no longer available since 2027-10-01 | Every call from 2027-10-01. Move to Main API v5. | 410 Gone |
| 10100 | Not found | The requested resource id could not be found. | 400 Bad Request |
| 10105 | Not modified ({reason}) | The requested action could not be taken. | 400 Bad Request |
| 10110 | Invalid Date Format | Date must be submitted in ISO8601 format (yyyy-mm-dd or yyyymmdd). | 400 Bad Request |
| 10120 | Invalid Amount Format | Amount must be (int) or (decimal). | 400 Bad Request |
| 10121 | Invalid Amount | Amount must be between -100000 and 100000, and can not be 0. | 400 Bad Request |
| 10130 | Duplicate transaction detected | Self explanatory | 400 Bad Request |
| 10140 | Comment can not be empty. | Self explanatory | 400 Bad Request |
| 10150 | Organization transaction lockdate violation. | A transaction can not be created prior to the set transaction lockdate. | 400 Bad Request |
| 10151 | Future transaction date is not permitted | Self explanatory | 400 Bad Request |
| 10160 | Invalid acct_debit format | Ensure that the account is submitted as (int). | 400 Bad Request |
| 10161 | Invalid acct_credit format | Ensure that the account is submitted as (int). | 400 Bad Request |
| 10162 | Debit account not found | The submitted value could not be found in the organisation's settings. | 400 Bad Request |
| 10163 | Credit account not found | The submitted value could not be found in the organisation's settings. | 400 Bad Request |
| 10164 | Cost centre not found | The submitted value could not be found in the organisation's settings. | 400 Bad Request |
| 10165 | Project not found | The submitted value could not be found in the organisation's settings. | 400 Bad Request |
| 10190 | Unable to save transaction | Contact support. | 500 Internal Server Error |