Mertrack API docs

#Map layer

Contains map layer object structure and API calls to interact with it.

#Map layer object structure:

{
  "id": 123456,
  "label": "test"
}
  • id - int. Map layer entity ID.
  • label - string. Map layer name.

#API actions

API path: /map_layer.

#read

Reads the body of the specified layer.

#Parameters

name description type format
id ID of the map layer. int 123456

#Examples

curl -X POST 'https://api.mergroup.be/map_layer/read' \
    -H 'Content-Type: application/json' \
    -d '{"hash": "22eac1c27af4be7b9d04da2ce1af111b", "id": 123456}'
https://api.mergroup.be/map_layer/read?hash=a6aa75587e5c59c32d347da438505fc3&id=123456

#Response

Layer body with content-type: application/vnd.google-earth.kml+xml; charset=utf-8.

#Errors

  • 201 - Not found in the database – if there is no map layer with such ID belonging to current user.

#list

Returns metadata for all map layers for the user.

#Parameters

Only API key hash.

#Examples

curl -X POST 'https://api.mergroup.be/map_layer/list' \
    -H 'Content-Type: application/json' \
    -d '{"hash": "22eac1c27af4be7b9d04da2ce1af111b"}'
https://api.mergroup.be/map_layer/list?hash=a6aa75587e5c59c32d347da438505fc3

#Response

{
  "success": true,
  "list": [
    {
      "id": 123456,
      "label": "test"
    }
  ]
}

#Errors

No specific errors.

#upload

Uploads new map layer.

MUST be a POST multipart request (multipart/form-data), with one of the parts being a KML file upload
(with the name "file").

#Parameters

name description type
label Label for a new map layer. string
file A KML file upload containing map_layer data. File upload
redirect_target Optional. URL to redirect. If redirect_target passed return redirect to <redirect_target>?response=<urlencoded_response_json> string

#Response

{
  "success": true,
  "id": 163
}
  • id - int. ID of the created layer.

#Errors

  • 233 - No data file – if file part is missing.
  • 234 - Invalid data format – if file has wrong mime type.
  • 242 - Validation error – if uploaded file is not valid KML.
  • 268 - Over quota – if the user's quota for map layers exceeded.

#update

Updates metadata for the specified map layer.

#Parameters

name description type
layer Map layer object described here JSON object

#Response

{
  "success": true
}

#Errors

  • 201 - Not found in the database – if there is no map layer with such ID belonging to current user.

#delete

Deletes specified layer.

#Parameters

name description type format
id ID of the map layer. int 123456

#Examples

curl -X POST 'https://api.mergroup.be/map_layer/delete' \
    -H 'Content-Type: application/json' \
    -d '{"hash": "22eac1c27af4be7b9d04da2ce1af111b", "id": 123456}'
https://api.mergroup.be/map_layer/delete?hash=a6aa75587e5c59c32d347da438505fc3&id=123456

#Response

{
  "success": true
}

#Errors

  • 201 - Not found in the database – if there is no map layer with such ID belonging to current user.