The landing resource is a special case within the API and represents a grab-bag of functions which don’t belong elsewhere.
Returns a hash of information about the currently logged in user.
Operation: GET /
Intent: get the user's landing information.
Status: 200 OK
Response body:
{
"user": {
"id": 1,
"name": "Matilda Swinton",
"location": "/user/1",
"email": "tilly@somewhere.else",
"assets: {
"avatar": "http://en.wikipedia.org/wiki/Tilda_Swinton#mediaviewer/File:Tilda_Swinton_at_the_Deauville_Film_Festival.jpg"
},
"branches": [ { BRANCH HASH }, { BRANCH HASH }, ... ]
},
"company": {
"id": 1,
"slug": "divine-engine",
"name": "The Divine Engine",
"location": "/company/1",
"description": ""
},
"companies": [ { COMPANY HASH }, { COMPANY HASH }, ... ],
"cost-centre": {
"id": 1,
"name": "TDE1",
"code": "TDE1",
"location": "/cost-centre/1"
},
"perms": [
"admin"
],
"counts": {
"company_bookings_total": 2,
"company_branches": 17,
"company_users": 341,
"company_vehicles": 3
}
}
Updates the logged in user’s session state based on a supplied action via the query string.
Operation: PUT /?company_id=2
Intent: change user's active company to /company/2
Status: 200 OK
Adds a user to the current company. The user is identified by their email address.
Note
Only users with admin or keaz permissions may access this endpoint.
Operation: POST /?email=gijoe@secret.mil
Intent: add gijoe to the current company
Status: 200 OK