Activate Device API
POST /activateDevice
Description
This API endpoint allows an admin to activate a device for a specific user by providing the user's ID and the device details such as UUID, serial number, and device name. This operation links the device to the user's account within the platform.
Request Body
The request utilizes GraphQL to perform the activateDevice
mutation.
Mutation:
mutation activateDevice ($userId: Int!, $deviceIdInput: DeviceIdInput) {
activateDevice (userId: $userId, deviceIdInput: $deviceIdInput)
}
Variables:
{
"userId": 0,
"deviceIdInput": {
"uuid": "<Device_UUID>",
"serial": "<Device_Serial_Number>",
"name": "<Device_Name>"
}
}
- userId (Int): The unique identifier of the user for whom the device is being activated.
- deviceIdInput (DeviceIdInput Object): An object containing the device's identification details.
- uuid (String): The universally unique identifier (UUID) of the device.
- serial (String): The serial number of the device.
- name (String): The name of the device.
Response:
-
Success (200 OK):
- If the device activation is successful, the response will confirm that the device has been activated for the user.
{
"data": {
"activateDevice": true
}
} -
Error (4XX/5XX):
- If there is an issue with activating the device, the response will include an appropriate error message and status code.
Note:
Ensure that the userId
corresponds to an existing user within the platform and that the deviceIdInput
object contains valid and correctly formatted data. This API should be used by admins with the necessary permissions to manage and activate devices for users.