Groups

A group is a named collection of users, geofences and devices.

The Groups Model

A group is represented by the following schema:

Scheme

  • Name
    id
    Type
    integer
    Description
  • Name
    name
    Type
    string
    Description
  • Name
    groupId
    Type
    integer
    Description
    The id of parent group. Use 0 or blank if the group is not a child group.
  • Name
    attributes
    Type
    object
    Description

GET/groups

Retrieve groups information

Without any params, returns a list of the groups the user belongs 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 Device objects.

  • Name
    userId
    Type
    integer
    Description

    Standard users can use this only with their own userId

Response schema

  • Name
    application/json
    Type
    schema
    Description

Responses

  • Name
    200
    Type
    success
    Description

    Array of Group

  • Name
    400
    Type
    error
    Description

    Not permission

Request

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

Response

[
    {
        "id": 0,
        "name": "string",
        "groupId": 0,
        "attributes": { }
    },
    {
        ...
    }
]

POST/groups

Create a group

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
    groupId
    Type
    integer
    Description
    The id of parent group. Use 0 or blank if the group is not a child group.
  • Name
    attributes
    Type
    object
    Description

Response schema

  • Name
    application/json
    Type
    schema
    Description

Responses

  • Name
    200
    Type
    success
    Description

    Group

Request

POST
/groups
curl --location 'https://gw.onemap8.com/api/groups' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Authorization: Basic {your_access_token}' \
--data '{
"id": "<integer>",
"name": "<string>",
"groupId": "<integer>",
"attributes": {}
}'

Response

{
  "id": 0,
  "name": "string",
  "groupId": 0,
  "attributes": { }
}

PUT/groups/{id}

Update a group

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
    Description

    required

Request body schema

  • Name
    application/json
    Type
    schema
    Description

Body schema

  • Name
    id
    Type
    integer
    Description
  • Name
    name
    Type
    string
    Description
  • Name
    groupId
    Type
    integer
    Description
    The id of parent group. Use 0 or blank if the group is not a child group.
  • Name
    attributes
    Type
    object
    Description

Response schema

  • Name
    application/json
    Type
    schema
    Description

Responses

  • Name
    200
    Type
    success
    Description

    Group

Request

PUT
/groups/{id}
  curl --location --request PUT 'https://gw.onemap8.com/api/groups/<integer>' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Authorization: Basic {your_access_token}' \
--data '{
"id": "<integer>",
"name": "<string>",
"groupId": "<integer>",
"attributes": {}
}'

Response

{
    "id": 0,
    "name": "string",
    "groupId": 0,
    "attributes": { }
    }
}

DELETE/groups/{id}

Delete a group

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
    Description

    required

Responses

  • Name
    204
    Type
    success
    Description

    No content

Request

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

Response

No content