Amadis
Administration APIs - SMDevices
ADD a new device
This API allows registering a device:
Verb | POST |
Resource | /api/datamanagement/v1/SMDevices |
Content type | application/json |
Body | { “data”: { “smrdTerminalId”: “<terminal id>”, “smrdModel”: <device model>, “smrdIMEI”: <device IMEI> } } |
Where:
Field | Description |
smrdTerminalId | Device unique terminal Id, assigned by the administrator (max 255 chars). |
smrdModel | Device model Id. The device model must exist (see 10.2.1). |
smrdIMEI | Device IMEI number (max 15 chars, ‘0000 …’ if none). |
The response data is a JSON object with the following structure:
{
"statusCode":200,
"data":{
"smrdId":11
}
}
GET all existing devices
This API allows getting information about all existing devices:
Verb | GET |
Resource | /api/datamanagement/v1/SMDevices |
The response data is a JSON object with the following structure:
{
"statusCode":200,
"SMDevices":[
{
"smrdId":0,
"smrdTerminalId":"",
"smrdIMEI":"000000000000000",
"smrdModel":0,
"smrdState":1,
"smrdCreatedAt":"2020-11-20 15:54:56",
"smrdUpdatedAt":"2020-11-20 15:54:56",
"smrdDeletedAt":null,
"SMDeviceModels":{
"smdmId":0,
"smdmModel":"Unspecified",
"smdmMetricProfile":0,
"smdmCreatedAt":"2020-11-20 15:55:35",
"smdmUpdatedAt":"2020-11-20 15:55:35",
"smdmDeletedAt":null
}
},
...
]
}
GET an existing device
This API allows getting information about an existing device:
Verb | GET |
Resource | /api/datamanagement/v1/SMDevices/{id} |
The response data is a JSON object with the following structure:
{
"statusCode":200,
"SMDevices":[
{
"smrdId":11,
"smrdTerminalId":"1",
"smrdIMEI":"IMEG",
"smrdModel":1,
"smrdState":1,
"smrdCreatedAt":"2022-06-24 14:05:25",
"smrdUpdatedAt":"2022-06-24 14:05:25",
"smrdDeletedAt":null,
"SMDeviceModels":[
]
}
]
}
UPDATE an existing device
This API allows updating an existing device:
In the “data” section of the body, only the fields that need to be update must be present
Verb | PATCH |
Resource | /api/datamanagement/v1/SMDevices/{id} |
Content type | application/json |
Body | { “data”: { “smrdTerminalId”: “<terminal id>”, “smrdModel”: <device model>, “smrdIMEI”: <device IMEI>, “smriSecurityState”: <state> } } |
Where:
Field | Description |
smrdTerminalId | Device unique terminal Id, assigned by the administrator (max 255 chars). |
smrdModel | Device model Id. The device model must exist (see 10.2.1). |
smrdIMEI | Device IMEI number (max 15 chars, ‘0000 …’ if none). |
smriSecurityState | Security state ('SECURE’ or ‘UNSECURE’) |
The response data is a JSON object with the following structure:
DELETE an existing device
This API allows updating an existing device:
Verb | DELETE |
Resource | /api/datamanagement/v1/SMDevices/{id} |
The response data is a JSON object with the following structure:
Known issues
Reuse an existing or old IMEI will fail when attempting to update or add a device
smrdId keeps increasing even when the add command fails