Geofences

Geofence management.

The Geofences Model

A geofence is represented by the following schema:

Scheme

  • Name
    id
    Type
    integer
    Description
  • Name
    name
    Type
    string
    Description
  • Name
    description
    Type
    string
    Description
  • Name
    area
    Type
    string
    Description
  • Name
    calendarId
    Type
    integer
    Description
  • Name
    attributes
    Type
    object
    Description

GET/geofences

Retrieve a list of geofences

Without any params, returns a list of geofences the user has access to

Authorizations

BasicAuth or ApiKey

  • Name
    BasicAuth
    Type
    scheme
    Description

    HTTP Authorization Scheme: basic

  • Name
    ApiKey
    Type
    scheme
    Description

    HTTP Authorization Scheme: bearer

Query Parameters

  • Name
    all
    Type
    boolean
    Description

    Can only be used by administrators or managers to retrieve all Geofence objects.

  • Name
    userId
    Type
    integer
    Description

    Standard users can use this only with their own userId

  • Name
    deviceId
    Type
    integer
    Description

    Standard users can use this only with their own deviceIds they have access to

  • Name
    groupId
    Type
    integer
    Description

    Standard users can use this only with their own groupIds they have access to

  • Name
    refresh
    Type
    boolean
    Description

Responses

  • Name
    200
    Type
    success
    Description
  • Name
    application/json
    Type
    response schema
    Description
  • Array of Geofence

Request

GET
/geofences
curl --location 'https://gw.onemap8.com/api/geofences?all=<boolean>' \
--header 'Accept: application/json' \
--header 'Authorization: Basic {your_access_token}'

Response

[
    {
        "id": 0,
        "name": "string",
        "description": "string",
        "area": "string",
        "calendarId": 0,
        "attributes": {}
    },
    {
        ...
    }
]

POST/geofences

Create a geofence

Authorizations

BasicAuth or ApiKey

  • Name
    BasicAuth
    Type
    scheme
    Description

    HTTP Authorization Scheme: basic

  • Name
    ApiKey
    Type
    scheme
    Description

    HTTP Authorization Scheme: bearer

Request body schema

  • Name
    application/json
    Type
    schema
    Description

Body schema

  • Name
    id
    Type
    integer
    Description
  • Name
    name
    Type
    string
    Description
  • Name
    description
    Type
    string
    Description
  • Name
    area
    Type
    string
    Description
  • Name
    calendarId
    Type
    integer
    Description
  • Name
    attributes
    Type
    object
    Description

Responses

  • Name
    200
    Type
    success
    Description
  • Name
    application/json
    Type
    response schema
    Description
  • Geofence

Request

POST
/geofences
curl --location 'https://gw.onemap8.com/api/geofences' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Authorization: Basic {your_access_token}' \
--data '{
"id": "<integer>",
"name": "<string>",
"uniqueId": "<string>",
"status": "<string>",
"disabled": "<boolean>",
"lastUpdate": "<dateTime>",
"positionId": "<integer>",
"groupId": "<integer>",
"phone": "<string>",
"model": "<string>",
"contact": "<string>",
"category": "<string>",
"attributes": {}
}'

Response

{
    "id": 0,
    "name": "string",
    "description": "string",
    "area": "string",
    "calendarId": 0,
    "attributes": {}
}

PUT/geofences/{id}

Update a geofence

Authorizations

BasicAuth or ApiKey

  • Name
    BasicAuth
    Type
    scheme
    Description

    HTTP Authorization Scheme: basic

  • Name
    ApiKey
    Type
    scheme
    Description

    HTTP Authorization Scheme: bearer

Path parameters

  • Name
    id
    Type
    integer required
    Description

Request body schema

  • Name
    application/json
    Type
    schema
    Description

Body schema

  • Name
    id
    Type
    integer
    Description
  • Name
    name
    Type
    string
    Description
  • Name
    description
    Type
    string
    Description
  • Name
    area
    Type
    string
    Description
  • Name
    calendarId
    Type
    integer
    Description
  • Name
    attributes
    Type
    object
    Description

Responses

  • Name
    200
    Type
    success
    Description
  • Name
    application/json
    Type
    response schema
    Description
  • Geofence

Request

PUT
/geofences/{id}
  curl --location --request PUT 'https://gw.onemap8.com/api/geofences/<integer>' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Authorization: Basic {your_access_token}' \
--data '{
"id": "<integer>",
"name": "<string>",
"uniqueId": "<string>",
"status": "<string>",
"disabled": "<boolean>",
"lastUpdate": "<dateTime>",
"positionId": "<integer>",
"groupId": "<integer>",
"phone": "<string>",
"model": "<string>",
"contact": "<string>",
"category": "<string>",
"attributes": {}
}'

Response

{
    "id": 0,
    "name": "string",
    "description": "string",
    "area": "string",
    "calendarId": 0,
    "attributes": {}
}

DELETE/geofences/{id}

Delete a geofence

Authorizations

BasicAuth or ApiKey

  • Name
    BasicAuth
    Type
    scheme
    Description

    HTTP Authorization Scheme: basic

  • Name
    ApiKey
    Type
    scheme
    Description

    HTTP Authorization Scheme: bearer

Path parameters

  • Name
    id
    Type
    integer required
    Description

Responses

  • Name
    204
    Type
    success
    Description

    No content

Request

DELETE
/geofences/{id}
  curl --location --request DELETE 'https://gw.onemap8.com/api/geofences/<integer>' \
  --header 'Authorization: Basic {your_access_token}'

Response

No content