Query Remote Access Channels

Query the available remote access channels of a specific device.

Request URL

GET {base_url}/device/openapi/v1/devices/{deviceId}/remote-access-channels

Request Parameters

Table 1. Header Parameters
Parameter Required Type Description
Authorization Yes String The valid access token for making API calls.

The format should be Bearer {access_token}.

Table 2. Path Parameters
Parameter Required Type Description
deviceId Yes Long The unique ID of this device, which is returned when you add the device.
Note: If you did NOT save the deviceID, you can query the device's ID using Search Specific Devices.

Response Parameters

Parameter Type Description
data Array<Object<Channel_Info>> The list of available remote access channels.
status String The result of the API request.
  • Success
  • Failed
requestId String The unique ID of the request, which can be used to quickly locate the request.
Channel_Info
Parameter Type Description
channelToken String The token of the remote access channel.
Note: It is required when deleting the channel.
webUrl String The URL for web-based remote access to the device.
sshCommand String The SSH command for remote access to the device.
remainingDuration Long The remaining validity duration of the channel. Unit: second.
passwordless Boolean Whether the channel is passwordless.

Examples

Request example
Query the available remote access channels of the device with ID "1737007595605147649".
GET /device/openapi/v1/devices/1737007595605147649/remote-access-channels HTTP/1.1
Host: demo.milesight.com
Authorization: Bearer {access_token}
Response example
HTTP/1.1 200 OK

{
    "data": [
        {
            "channelToken": "f8a2c9e14d7b4036a1e5c2d8f90b3a7c",
            "webUrl": "https://ra.milesight.com/channels/f8a2c9e14d7b4036a1e5c2d8f90b3a7c",
            "sshCommand": "ssh -p 22022 root@ra.milesight.com",
            "remainingDuration": 2350,
            "passwordless": false
        },
        {
            "channelToken": "b3d7a9c2e15f4860a8c1d4e9f7b2a630",
            "webUrl": "https://ra.milesight.com/channels/b3d7a9c2e15f4860a8c1d4e9f7b2a630",
            "sshCommand": "ssh -p 22023 root@ra.milesight.com",
            "remainingDuration": 88200,
            "passwordless": true
        }
    ],
    "status": "Success",
    "requestId": "5a8a5cf9e0d34b62b0d64a1f3e77c910"
}