^Login

Location API Retrieve, Create and Update Locations

This guide documents the two Location endpoints:



Retrieving Locations (get_locations)

The get_locations call returns all locations (active and inactive) that belong to the authenticated business.

VariableValues & example
mk_actionget_locations
mk_data
{ "status":"all" }


Response

FieldDescription
locationsArray of location objects (see below)


FieldDescriptionExample
LIDMicrokeeper Location ID1234
third_IDExternal reference IDEXT-LOC-A
titleName / labelBrisbane Depot
lonLongitude (string)153.025131
latLatitude (string)-27.469770
JIDDefault Job ID0
manager_eusernameArray of manager usernames["alice","bob"]
GIDGroup ID (visibility in roster UI)269
CIDClient ID4
hours_goalBudgeted hours"100.00"
cost_goalBudgeted labour cost"10000.00"
colorHEX colour used in roster UI#FF80EA
active"1" (active) or "0" (inactive)1
address1Street line 1
address2Street line 2
cityCity / suburb
stateState / region
postcodePostcode4000
countryCountry code / nameAU
{
"success":"1",
"authenticated":"1",
"message":"Location data",
"data":{"locations":[{ rows as above }]}
}



Creating & Updating Locations (upsert_locations)

upsert_locations inserts new locations or updates existing ones.

Any location sent is up-inserted; locations that are not sent remain unchanged.

VariableValues & example
mk_actionupsert_locations
mk_data
{
"config": { "write_list": "all" },
"locations": [
{
"LID" : "0",
"third_ID" : "EXT-LOC-A",
"title" : "Brisbane Depot",
"lon" : "153.025131",
"lat" : "-27.469770",
"manager_eusername": ["alice_long","frank_fulltime","john_smith"],
"GID" : "269",
"CID" : "4",
"hours_goal" : "100.00",
"cost_goal" : "10000.00",
"color" : "#FF80EA",
"active" : "1"
},
{
"LID" : "1234",
"title" : "Melbourne HQ",
"active" : "0"
}
]
}


mk_data variables

NameTypeNotes
configObjectContains write_list
locationsArrayLocations to upsert


config object

FieldDescriptionRequiredAccepted
write_listReserved for future use cases; must be "all"TRUEall


locations[] field reference

FieldDescriptionRequiredExample / format
LID0 to insert; existing LID to update.Conditional0 / 1234
third_IDExternal ID used for lookup.ConditionalEXT-LOC-A
titleName / label.TRUEBrisbane Depot
active"1" enable "0" disable.TRUE"1"
lonLongitude.FALSE"153.025131"
latLatitude.FALSE"-27.469770"
JIDDefault Job ID.FALSE0
manager_eusernameArray of manager usernames.FALSE["alice","bob"]
GIDGroup ID (visibility).FALSE269
CIDClient ID.FALSE4
hours_goalBudgeted hours.FALSE"100.00"
cost_goalBudgeted labour cost.FALSE"10000.00"
colorRoster colour (HEX).FALSE#FF80EA
Optional address block
address1Street line 1FALSE1 High St
address2Street line 2FALSE
cityCity / suburbFALSEBrisbane
stateState / regionFALSEQLD
postcodePostcodeFALSE4000
countryCountry code / nameFALSEAU


Successful Response

FieldDescription
LIDArray of LIDs inserted or updated.
{
"success":"1",
"authenticated":"1",
"message":"Locations updated",
"data":{"LID":[1234,1235]}
}