Maintenance

Maintenance management.

The Maintenance Model

A maintenance is represented by the following schema:

Scheme

  • Name
    id
    Type
    integer
    Description
  • Name
    name
    Type
    string
    Description
  • Name
    type
    Type
    string
    Description
  • Name
    start
    Type
    number
    Description
  • Name
    period
    Type
    number
    Description
  • Name
    attributes
    Type
    object
    Description

GET/maintenance

Retrieve a list of maintenance

Without any params, returns a list of maintenances 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 Maintenance 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
  • Name
    limit
    Type
    integer
    Description
    Limit the number of returned results
  • Name
    offset
    Type
    integer
    Description
    Offset for pagination
  • Name
    keyword
    Type
    string
    Description
    Search keyword filter

Responses

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

Request

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

Response

[
{
  "id": 0,
  "name": "string",
  "type": "string",
  "start": 0,
  "period": 0,
  "attributes": {}
},
{
  ...
}
]

POST/maintenance

Create a maintenance

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
    type
    Type
    string
    Description
  • Name
    start
    Type
    number
    Description
  • Name
    period
    Type
    number
    Description
  • Name
    attributes
    Type
    object
    Description

Responses

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

Request

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

Response

{
"id": 0,
"name": "string",
"type": "string",
"start": 0,
"period": 0,
"attributes": {}
}

PUT/maintenance/{id}

Update a maintenance

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
    type
    Type
    string
    Description
  • Name
    start
    Type
    number
    Description
  • Name
    period
    Type
    number
    Description
  • Name
    attributes
    Type
    object
    Description

Responses

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

Request

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

Response

{
"id": 0,
"name": "string",
"type": "string",
"start": 0,
"period": 0,
"attributes": {}
}

DELETE/maintenance/{id}

Delete a maintenance

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
/maintenance/{id}
curl --location --request DELETE 'https://gw.onemap8.com/api/maintenance/<integer>' \
--header 'Authorization: Basic {your_access_token}'

Response

No content
GET/maintenance/{id}

Fetch a Maintenance task

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

Response schema

  • Name
    application/json
    Type
    schema
    Description

Responses

  • Name
    200
    Type
    success
    Description
    Maintenance
  • Name
    401
    Type
    error
    Description
    Unauthorized
  • Name
    404
    Type
    error
    Description
    Not found

Request

GET
/maintenance/{id}
curl --location 'https://gw.onemap8.com/api/maintenance/<integer>' \
--header 'Accept: application/json' \
--header 'Authorization: Basic {your_access_token}'

Response

{
"id": 0,
"name": "<string>",
"type": "<string>",
"start": 0,
"period": 0,
"attributes": {}
}