News: SaferMe Contact Tracing wins OH&S New Product of the Year

Shapes API

With Shapes api V4 you can:

Create a Shape

The created shape will be associated with the Branded App specified with header X-AppID.

POST /api/v4/shapes

{
  "shape": {
    "geom":"LINESTRING(0 0, 1 21)",
    "metadata": {
      "display": [
        'line 1',
        ...
      ],
      "raw": {
        "info": 'here',
        ...
      },
      ...
    }
  }
}
{
  {
    "id": 3,
    "geom":"LINESTRING(0 0, 1 21)",
    "metadata": {
      "display": [
        'line 1',
        ...
      ],
      "raw": {
        "info": 'here',
        ...
      }
    }
  }
}

Fetch a shape

Get a shape. See the optional available fields.

GET /api/v4/shapes/14
{
  "id": 14,
  "geom":"LINESTRING(0 0, 1 21)"
}

List shapes

Fetch a paginated list of shapes. If provided a shapesearchid param the shapes will be filtered, and ordered accordingly with the related shape search (See Shape searches for details about searching for shapes). The list of shapes will be filtered by current branded app if no shapesearchid if provided. The current branded app is set using the required header X-AppID.

GET /api/v4/shapes?fields=branded_app,cache_key,highlight_color,metadata,normal_color
[  
  {  
    "id": 1,
    "branded_app_id": 1,
    "geom":"LINESTRING(0 0, 1 2)",
    "metadata": {
      "color": "#ffff00"
    }
  },
  ...
]

Delete a shape

The branded app for the identified shape is required to match Branded App specified with header X-AppID.

DELETE /api/v4/shapes/14
204 No Content

Available shape fields

You can use the fields parameter in any of the Shapes API methods. The requested method will respond with the required fields accordingly. Some fields are included by default but you can opt-out from them on request.

  • id
  • cache_key
  • geom
  • highlight_color
  • metadata
  • normal_color
SaferMe uses cookies to give you the best experience on our website. For more details see our Privacy Policies.