Mount Management API (1.0.0)

API for managing mounts and associated entities

Download OpenAPI description
Languages
Servers
Mock server
https://docs.obh-mobility.com/_mock/api-definitions/obh-mobility/
http://localhost:3000/dev/api/v1/
https://api.dev.obh-mobility.com:3000/dev/api/v1/
https://api.staging.obh-mobility.com:3000/dev/api/v1/

Accounts

Operations

Mounts

Operations

Get owned mounts

Request

This operation will return a list of all mounts owned by the account. The list can be filtered by serial number, macAddress and mount UID. The filters are case insensitive, and are linked by an AND operator.

Query
currentPageinteger

Page number of the mounts listing. Starts at 1.

Default 1
pageSizeinteger

Number of mounts per page

Default 10
serialNumberstring

Filter mounts by serial number

macAddressstring

Filter mounts by mac address

mountUidstring

Filter mounts by UID

curl -i -X GET \
  'https://docs.obh-mobility.com/_mock/api-definitions/obh-mobility/mounts?currentPage=1&macAddress=string&mountUid=string&pageSize=10&serialNumber=string' \
  -H 'Access-Key: YOUR_API_KEY_HERE'

Responses

List of all mounts with pagination

Bodyapplication/json
mountsArray of objects(Mount)
Example: [[{"uid":"b2413500-8106-4530-b7dc-91ebe3b6236","name":"My favorite mount","serialNumber":"1234567890","macAddress":"00:00:00:00:00:00","firmwareRevision":"NCS2.4.0","softwareRevision":"0.99.2","modelNumber":"52832-OP","associationState":"ASSOCIATED","mountLocked":false,"helmetMounted":true,"batteryLevel":82,"cpuTemperature":45.5,"associatedAt":"2023-12-12T17:24:43.000Z"}]]
paginationobject
Response
application/json
{ "mounts": [ [] ], "pagination": { "currentPage": 0, "pageSize": 0, "totalItems": 0, "totalPages": 0 } }

Request mount association

Request

This operation will request the association of a mount to the account. If the mount is not in a INACTIVE state, it has to be owned by the account, otherwise the request will be rejected. After this request is successful, the mount will be in a IDLE state, unless it's already associated. Once in IDLE, the association has to be confirmed within 10 minutes. Doing this request while being already the owner allows you to refresh the public key in the mount. If the mount doesn't exist, it will be created, otherwise it will be updated based on the uid.

Bodyapplication/jsonrequired
uidstringrequired
serialNumberstringrequired
macAddressstringrequired
firmwareRevisionstringrequired
softwareRevisionstringrequired
modelNumberstringrequired
namestring
curl -i -X POST \
  https://docs.obh-mobility.com/_mock/api-definitions/obh-mobility/mounts \
  -H 'Access-Key: YOUR_API_KEY_HERE' \
  -H 'Content-Type: application/json' \
  -d '{
    "uid": "string",
    "serialNumber": "string",
    "macAddress": "string",
    "firmwareRevision": "string",
    "softwareRevision": "string",
    "modelNumber": "string",
    "name": "string"
  }'

Responses

Mount association ready. You need to confirm the association after the mount has accepted it.

Bodyapplication/json
codestring
Enum"ASSOCIATE_OWNER""DISSOCIATE_OWNER""RELEASE_HELMET""READ_TAG""SET_RFID_MODE""REMOVE_TAG""SET_ALARM_SENSITIVITY""SET_ALARM_VOLUME""SET_ALARM_MODE"
dataobject

Human readable data to send to the mount

generatedAtstring(date-time)
payloadstring(date-time)

Payload to send to the mount

signedTokenstring(32 bytes)

Signature of the query

Response
application/json
[ { "code": "ASSOCIATE_OWNER", "data": {}, "generatedAt": "2023-12-12T17:24:43.000Z", "payload": "2023-12-12T17:24:43.000Zb2413500-8106-4530-b7dc-91ebe3b6236605A2F4C21C7D560D3C5DCDB1581B2B8", "signedToken": null }, { "code": "RELEASE_HELMET", "data": {}, "generatedAt": "2023-12-12T17:24:43.000Z", "payload": "12023-12-12T17:24:43.000Z28C6A9258EC9579187175AD6FE4FD55B929F0BFC9F008FEBE082D64474B5DE9E2FC2B51EA207", "signedToken": "28C6A9258EC9579187175AD6FE4FD55B929F0BFC9F008FEBE082D64474B5DE9E2FC2B51EA207" } ]

Confirm the mount has accepted the association

Request

This operation will confirm the mount has accepted the association. The mount has to be in a IDLE state to be confirmed. The account needs to be the owner of the mount to confirm the association.

Path
uidstringrequired
curl -i -X POST \
  'https://docs.obh-mobility.com/_mock/api-definitions/obh-mobility/mounts/{uid}/confirm-association' \
  -H 'Access-Key: YOUR_API_KEY_HERE'

Responses

Mount associated successfully

Get mount data by uid

Request

This operation will return the details of the mount with the given UID. The account needs to be the owner of the mount to retrieve its details.

Path
uidstringrequired
curl -i -X GET \
  'https://docs.obh-mobility.com/_mock/api-definitions/obh-mobility/mounts/{uid}' \
  -H 'Access-Key: YOUR_API_KEY_HERE'

Responses

Mount details retrieved successfully

Bodyapplication/json
uidstring

Unique identifier of the mount

serialNumberstring

Serial number of the mount

macAddressstring

Mac Address of the BLE device

firmwareRevisionstring

Firmware version of the mount

softwareRevisionstring

Software version of the mount

modelNumberstring

Model number of the mount

namestring

Human readable name of the mount

associationStatestring

Current association state of the mount

Enum"ASSOCIATED""IDLE""INACTIVE"
associatedAtstring(date-time)

Date and time of the association

mountLockedboolean

Whether the mount is locked or not, null if not available. Value computed from the states.

helmetMountedboolean

Whether the helmet is mounted or not, null if not available. Value computed from the states.

batteryLevelinteger

Battery level in percentage (0-100) no decimals, null if not available. Value computed from the states.

cpuTemperaturenumber

CPU temperature in Celsius, 1 decimal, null if not available. Value computed from the states.

nfcTagsCountnumber

Number of NFC tags associated with the mount

Response
application/json
[ { "uid": "b2413500-8106-4530-b7dc-91ebe3b6236", "name": "My favorite mount", "serialNumber": "1234567890", "macAddress": "00:00:00:00:00:00", "firmwareRevision": "NCS2.4.0", "softwareRevision": "0.99.2", "modelNumber": "52832-OP", "associationState": "ASSOCIATED", "mountLocked": false, "helmetMounted": true, "batteryLevel": 82, "cpuTemperature": 45.5, "associatedAt": "2023-12-12T17:24:43.000Z" } ]

Update mount data by uid

Request

This operation will update the details of the mount with the given UID. The account needs to be the owner of the mount to update its details.

Path
uidstringrequired
Bodyapplication/jsonrequired
namestring

Human readable name of the mount

softwareRevisionstring
curl -i -X PATCH \
  'https://docs.obh-mobility.com/_mock/api-definitions/obh-mobility/mounts/{uid}' \
  -H 'Access-Key: YOUR_API_KEY_HERE' \
  -H 'Content-Type: application/json' \
  -d '{
    "name": "string",
    "softwareRevision": "string"
  }'

Responses

Mount details updated successfully

Bodyapplication/json
uidstring

Unique identifier of the mount

serialNumberstring

Serial number of the mount

macAddressstring

Mac Address of the BLE device

firmwareRevisionstring

Firmware version of the mount

softwareRevisionstring

Software version of the mount

modelNumberstring

Model number of the mount

namestring

Human readable name of the mount

associationStatestring

Current association state of the mount

Enum"ASSOCIATED""IDLE""INACTIVE"
associatedAtstring(date-time)

Date and time of the association

mountLockedboolean

Whether the mount is locked or not, null if not available. Value computed from the states.

helmetMountedboolean

Whether the helmet is mounted or not, null if not available. Value computed from the states.

batteryLevelinteger

Battery level in percentage (0-100) no decimals, null if not available. Value computed from the states.

cpuTemperaturenumber

CPU temperature in Celsius, 1 decimal, null if not available. Value computed from the states.

nfcTagsCountnumber

Number of NFC tags associated with the mount

Response
application/json
[ { "uid": "b2413500-8106-4530-b7dc-91ebe3b6236", "name": "My favorite mount", "serialNumber": "1234567890", "macAddress": "00:00:00:00:00:00", "firmwareRevision": "NCS2.4.0", "softwareRevision": "0.99.2", "modelNumber": "52832-OP", "associationState": "ASSOCIATED", "mountLocked": false, "helmetMounted": true, "batteryLevel": 82, "cpuTemperature": 45.5, "associatedAt": "2023-12-12T17:24:43.000Z" } ]

Dissociate mount from the account

Request

This operation will dissociate the mount from the account. The mount will be available for association with another account. The mount needs to be in an ASSOCIATED state to be dissociated and the account needs to be the owner of the mount.

Path
uidstringrequired
curl -i -X DELETE \
  'https://docs.obh-mobility.com/_mock/api-definitions/obh-mobility/mounts/{uid}' \
  -H 'Access-Key: YOUR_API_KEY_HERE'

Responses

Mount dissociated successfully

Record a new state for the mount

Request

This operation will record a new state for the mount.\n The state will be recorded with the date and time of the occurrence. You may passe one or more states at once.

Path
uidstringrequired
Bodyapplication/jsonrequired
statesArray of objects(CreateMountState)
Example: [[{"code":"BATTERY_LEVEL","value":"82","occurredAt":"2023-12-12T17:24:43.000Z"},{"code":"CPU_TEMPERATURE","value":"45.5","occurredAt":"2023-12-12T17:24:43.000Z"},{"code":"MOUNT_LOCKED","value":"1","occurredAt":"2023-12-12T17:24:43.000Z"}]]
curl -i -X POST \
  'https://docs.obh-mobility.com/_mock/api-definitions/obh-mobility/mounts/{uid}/states' \
  -H 'Access-Key: YOUR_API_KEY_HERE' \
  -H 'Content-Type: application/json' \
  -d '{
    "states": [
      [
        {
          "code": "BATTERY_LEVEL",
          "value": "82",
          "occurredAt": "2023-12-12T17:24:43.000Z"
        },
        {
          "code": "CPU_TEMPERATURE",
          "value": "45.5",
          "occurredAt": "2023-12-12T17:24:43.000Z"
        },
        {
          "code": "MOUNT_LOCKED",
          "value": "1",
          "occurredAt": "2023-12-12T17:24:43.000Z"
        }
      ]
    ]
  }'

Responses

Mount states saved successfully

Request a signed query to send to the mount

Request

This operation will request a signed query to send to the mount. The query will be signed with the account's private key and will be used to send commands to the mount. Note: You cannot generate a query to ASSOCIATE_OWNER with this endpoint, use the POST /mounts endpoint instead.

Path
uidstringrequired
Query
codestringrequired
tagUidstring

Required when using REMOVE_TAG

rfidModestring

Required when using SET_RFID_MODE

Enum"NORMAL""LEARNING"
alarmSensitivitystring

Required when using SET_ALARM_SENSITIVITY

Enum"HIGH""AVERAGE""LOW"
alarmVolumestring

Required when using SET_ALARM_VOLUME

Enum"HIGH""NORMAL""LOW"
alarmModestring

Required when using SET_ALARM_MODE

Enum"OFF""AUTO"
curl -i -X GET \
  'https://docs.obh-mobility.com/_mock/api-definitions/obh-mobility/mounts/{uid}/query?alarmMode=OFF&alarmSensitivity=HIGH&alarmVolume=HIGH&code=string&rfidMode=NORMAL&tagUid=string' \
  -H 'Access-Key: YOUR_API_KEY_HERE'

Responses

Query executed successfully

Bodyapplication/json
codestring
Enum"ASSOCIATE_OWNER""DISSOCIATE_OWNER""RELEASE_HELMET""READ_TAG""SET_RFID_MODE""REMOVE_TAG""SET_ALARM_SENSITIVITY""SET_ALARM_VOLUME""SET_ALARM_MODE"
dataobject

Human readable data to send to the mount

generatedAtstring(date-time)
payloadstring(date-time)

Payload to send to the mount

signedTokenstring(32 bytes)

Signature of the query

Response
application/json
[ { "code": "ASSOCIATE_OWNER", "data": {}, "generatedAt": "2023-12-12T17:24:43.000Z", "payload": "2023-12-12T17:24:43.000Zb2413500-8106-4530-b7dc-91ebe3b6236605A2F4C21C7D560D3C5DCDB1581B2B8", "signedToken": null }, { "code": "RELEASE_HELMET", "data": {}, "generatedAt": "2023-12-12T17:24:43.000Z", "payload": "12023-12-12T17:24:43.000Z28C6A9258EC9579187175AD6FE4FD55B929F0BFC9F008FEBE082D64474B5DE9E2FC2B51EA207", "signedToken": "28C6A9258EC9579187175AD6FE4FD55B929F0BFC9F008FEBE082D64474B5DE9E2FC2B51EA207" } ]

Abandon a mount

Request

This operation will abandon the mount, making it available for association with another account. The account needs to be the owner of the mount to abandon it.

Path
uidstringrequired
curl -i -X DELETE \
  'https://docs.obh-mobility.com/_mock/api-definitions/obh-mobility/mounts/{uid}/abandon' \
  -H 'Access-Key: YOUR_API_KEY_HERE'

Responses

Mount abandoned successfully

Firmware

Operations

NfcTags

Operations