Create a Remote Access Channel

Create an available remote access channel for a specific device.

Request URL

POST {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.
Table 3. Body Parameters
Parameter Required Type Description
duration Yes Long The validity duration of the channel. Unit: second. Only a positive integer ranging from 60 to 2,592,000 is supported.
passwordless No Boolean Whether to enable passwordless access. Only devices that support passwordless access can enable this option, which can be queried through the Search Devices and Query Device Details APIs. Default: false.

Response Parameters

Parameter Type Description
data Object<Channel_Info> The information of the created remote access channel.
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
Create a remote access channel with a validity duration of 3600 seconds for the device with ID "1737007595605147649".
POST /device/openapi/v1/devices/1737007595605147649/remote-access-channels HTTP/1.1
Host: demo.milesight.com
Authorization: Bearer {access_token}
Content-Type: application/json

{
    "duration": 3600,
    "passwordless": false
}
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": 3600,
        "passwordless": false
    },
    "status": "Success",
    "requestId": "22bd34b548bca2981b4bb5f222523caf"
}