### Start Recording Source: https://developer.dji.com/doc/cloud-api-tutorial/en/api-reference/dock-to-cloud/mqtt/dock/dock2/drc.html Command to start recording video. ```APIDOC ## POST /services ### Description Command to start recording video. ### Method POST ### Endpoint thing/product/_{gateway_sn}_/services ### Parameters #### Request Body - **bid** (string) - Required - Unique identifier for the request. - **data** (object) - Required - Contains the payload control parameters. - **payload_index** (string) - Required - Camera enumeration values. Non-standard device_mode_key, formatted as {type-subtype-gimbalindex}. - **tid** (string) - Required - Unique identifier for the target device. - **timestamp** (integer) - Required - Timestamp of the request in milliseconds. - **method** (string) - Required - The method to call, which is 'camera_recording_start'. ### Request Example ```json { "bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx", "data": { "payload_index": "39-0-7" }, "tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx", "timestamp": 1654070968655, "method": "camera_recording_start" } ``` ### Response #### Success Response (200) - **bid** (string) - Unique identifier for the response. - **data** (object) - Contains the result of the operation. - **result** (integer) - Return code. Non-zero represents an error. - **tid** (string) - Unique identifier for the target device. - **timestamp** (integer) - Timestamp of the response in milliseconds. - **method** (string) - The method called, which is 'camera_recording_start'. #### Response Example ```json { "bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx", "data": { "result": 0 }, "tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx", "timestamp": 1654070968655, "method": "camera_recording_start" } ``` ``` -------------------------------- ### Start Front-end Development Server Source: https://developer.dji.com/doc/cloud-api-tutorial/en/quick-start/source-code-deployment-steps.html Execute this command to start the local development server for the front-end application. ```bash npm run serve ``` -------------------------------- ### Install Front-end Dependencies Source: https://developer.dji.com/doc/cloud-api-tutorial/en/quick-start/source-code-deployment-steps.html Run this command in the root of the front-end project to install all necessary dependencies. ```bash npm install ``` -------------------------------- ### POST /services - Start Recording Source: https://developer.dji.com/doc/cloud-api-tutorial/en/api-reference/dock-to-cloud/mqtt/dock/dock1/drc.html Starts video recording on the specified camera. ```APIDOC ## POST /services - Start Recording ### Description Starts video recording on the specified camera. ### Method POST ### Endpoint `thing/product/{gateway_sn}/services` ### Parameters #### Request Body - **bid** (string) - Required - Unique identifier for the request. - **data** (object) - Required - Contains the camera control parameters. - **payload_index** (string) - Required - Camera enumeration value, formatted as {type-subtype-gimbalindex}. - **tid** (string) - Required - Unique identifier for the target device. - **timestamp** (integer) - Required - Timestamp of the request in milliseconds. ### Request Example ```json { "bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx", "data": { "payload_index": "39-0-7" }, "tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx", "timestamp": 1654070968655 } ``` ### Response #### Success Response (200) - **bid** (string) - Unique identifier for the response. - **data** (object) - Contains the result of the operation. - **result** (integer) - Return code. Non-zero indicates an error. - **tid** (string) - Unique identifier for the target device. - **timestamp** (integer) - Timestamp of the response in milliseconds. #### Response Example ```json { "bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx", "data": { "result": 0 }, "tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx", "timestamp": 1654070968655 } ``` ``` -------------------------------- ### Start Recording Source: https://developer.dji.com/doc/cloud-api-tutorial/en/api-reference/pilot-to-cloud/mqtt/rc-pro/drc.html This endpoint allows you to start recording with the camera on a DJI device. ```APIDOC ## POST /thing/product/{gateway_sn}/services ### Description Starts recording with the camera. ### Method POST ### Endpoint `/thing/product/{gateway_sn}/services` ### Parameters #### Request Body - **bid** (string) - Required - Unique identifier for the request. - **data** (object) - Required - Contains the payload index. - **payload_index** (text) - Required - Camera enumeration values, formatted as `{type-subtype-gimbalindex}`. - **tid** (string) - Required - Transaction identifier. - **timestamp** (integer) - Required - Timestamp of the request. ### Request Example ```json { "bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx", "data": { "payload_index": "39-0-7" }, "tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx", "timestamp": 1654070968655 } ``` ### Response #### Success Response (200) - **bid** (string) - Unique identifier for the response. - **data** (object) - Contains the result of the operation. - **result** (int) - Return code. Non-zero represents an error. - **tid** (string) - Transaction identifier. - **timestamp** (integer) - Timestamp of the response. #### Response Example ```json { "bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx", "data": { "result": 0 }, "tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx", "timestamp": 1654070968655 } ``` ``` -------------------------------- ### Start Charging Progress Source: https://developer.dji.com/doc/cloud-api-tutorial/en/api-reference/dock-to-cloud/mqtt/dock/dock3/cmd.html This endpoint allows you to start the charging progress for a device. ```APIDOC ## POST /websites/developer_dji_doc_cloud-api-tutorial_en ### Description This endpoint is used to start the charging progress of a device. ### Method POST ### Endpoint thing/product/_{gateway_sn}_ /events ### Request Body - **method** (string) - Required - The method to call, which is 'charge_open'. ### Request Example ```json { "bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx", "data": { "output": { "progress": { "percent": 45, "step_key": "start_charge" }, "status": "in_progress" }, "result": 0 }, "tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx", "timestamp": 1654070968655, "method": "charge_open" } ``` ### Response #### Success Response (200) - **result** (int) - Return code. Non-zero represents an error. - **output** (struct) - Output details. - **status** (enum_string) - Task state. Possible values: "canceled", "failed", "in_progress", "ok", "paused", "rejected", "sent", "timeout". - **progress** (struct) - Progress details. - **percent** (int) - Progress percentage (0-100). - **step_key** (enum_string) - Current step. Possible values: "get_bid", "check_work_mode", "check_task_state", "check_scram_state", "check_cover", "start_charge". #### Response Example ```json { "bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx", "data": { "output": { "progress": { "percent": 45, "step_key": "start_charge" }, "status": "in_progress" }, "tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx", "timestamp": 1654070968655, "method": "charge_open" } ``` ``` -------------------------------- ### Start Charging API Source: https://developer.dji.com/doc/cloud-api-tutorial/en/api-reference/dock-to-cloud/mqtt/dock/dock1/cmd.html This API initiates the charging process for the device. It sends a command to start charging and provides status updates. ```APIDOC ## POST /thing/product/{gateway_sn}/services ### Description Sends a command to start the charging process. ### Method POST ### Endpoint /thing/product/{gateway_sn}/services ### Parameters #### Request Body - **method** (string) - Required - The method to call, which is 'charge_open'. - **payload** (object) - Required - The payload for the method. - **data** (null) - The data field for charge_open is null. ### Request Example ```json { "method": "charge_open", "payload": { "data": null } } ``` ### Response #### Success Response (200) - **result** (int) - Return code. Non-zero represents an error. - **output** (struct) - Output details. - **status** (enum_string) - Task state. Possible values: "canceled", "failed", "in_progress", "ok", "paused", "rejected", "sent", "timeout". #### Response Example ```json { "result": 0, "output": { "status": "ok" } } ``` ``` -------------------------------- ### Live Streaming Start Response Source: https://developer.dji.com/doc/cloud-api-tutorial/en/api-reference/dock-to-cloud/mqtt/dock/dock3/live.html This is the expected response after attempting to start a live stream. A result of 0 indicates success. ```json { "bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx", "data": { "result": 0 }, "tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx", "timestamp:": 1654070968655, "method": "live_start_push" } ``` -------------------------------- ### Example Response for Upload Callback Source: https://developer.dji.com/doc/cloud-api-tutorial/en/api-reference/pilot-to-cloud/https/media-management/mediafile-upload-result-report.html This is an example of a successful response from the upload-callback endpoint, indicating the object key of the uploaded file. ```json { "code":0, "message":"success", "data":{ "object_key":"5asjwu24-2a18-4b4b-86f9-3a678da0bf4d/example.jpg" } } ``` -------------------------------- ### Start Camera Recording Source: https://developer.dji.com/doc/cloud-api-tutorial/en/api-reference/pilot-to-cloud/mqtt/rc-pro/drc.html Initiate camera recording by sending this payload, specifying the target camera with 'payload_index'. The response indicates the success of the recording start command. ```json { "bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx", "data": { "payload_index": "39-0-7" }, "tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx", "timestamp": 1654070968655 } ``` ```json { "bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx", "data": { "result": 0 }, "tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx", "timestamp": 1654070968655 } ``` -------------------------------- ### Start Charging Source: https://developer.dji.com/doc/cloud-api-tutorial/en/api-reference/dock-to-cloud/mqtt/dock/dock2/cmd.html Command to start charging the device. This involves sending a 'charge_open' method to the services endpoint and receiving a reply with the task status. ```APIDOC ## POST /thing/product/{gateway_sn}/services ### Description Sends a command to start charging the device. ### Method POST ### Endpoint thing/product/_{gateway_sn}_/services ### Request Body ```json { "method": "charge_open", "data": null } ``` ### Response #### Success Response (200) - **result** (int) - Return code. Non-zero represents an error. - **output** (struct) - Output structure containing task status. - **status** (enum_string) - Task state. Possible values: "canceled", "failed", "in_progress", "ok", "paused", "rejected", "sent", "timeout". ### Response Example ```json { "result": 0, "output": { "status": "ok" } } ``` ``` -------------------------------- ### Start Docker Containers Source: https://developer.dji.com/doc/cloud-api-tutorial/en/quick-start/docker-deployment-steps.html Execute the docker-compose up -d command in the directory containing the docker-compose.yml file to start all defined services in detached mode. ```bash sudo docker-compose up -d ``` -------------------------------- ### Start Live Streaming Source: https://developer.dji.com/doc/cloud-api-tutorial/en/api-reference/dock-to-cloud/mqtt/dock/dock3/live.html This endpoint is used to start a live video stream. It requires parameters such as the streaming URL, URL type, video ID, and desired video quality. ```APIDOC ## POST /services ### Description Starts a live video stream. ### Method POST ### Endpoint `thing/product/{gateway_sn}/services` ### Parameters #### Request Body - **bid** (text) - Required - Unique identifier for the request. - **data** (object) - Required - Contains the data for the start live stream command. - **url_type** (enum_int) - Required - Live streaming protocol type. Possible values: `1` (RTMP), `3` (GB28181), `4` (WebRTC). - **url** (text) - Required - Livestream parameters. Format varies by `url_type`. - **video_id** (text) - Required - ID of the live video stream. Formatted as _{sn}/{camera_index}/{video_index}_. - **video_quality** (enum_int) - Optional - Livestream quality. Possible values: `0` (Adaptive), `1` (Smooth), `2` (Standard definition), `3` (High definition), `4` (Ultra-high definition). - **tid** (text) - Required - Unique identifier for the tenant. - **timestamp** (integer) - Required - Timestamp of the request. - **method** (text) - Required - The method name, should be `live_start_push`. ### Request Example ```json { "bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx", "data": { "url": "channel=1ZNDH1D0010098_39-0-7&sn=1ZNDH1D0010098&token=006dca67721582a48768ec4d817b7b25a86IADk%2Fcm%2Fdv%2BHY6qT%2FAKM6y7TcUe4lXNvZpycH7vUMAlM6pFALUKF2zyCIgA82pQE8cCoYAQAAQDxwKhgAgDxwKhgAwDxwKhgBADxwKhg&uid=50000", "url_type": 0, "video_id": "1ZNDH1D0010098/39-0-7/normal-0", "video_quality": 0 }, "tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx", "timestamp": 1654070968655, "method": "live_start_push" } ``` ### Response #### Success Response (200) - **bid** (text) - Unique identifier for the response. - **data** (object) - Contains the result of the operation. - **result** (integer) - Return code. Non-zero represents an error. - **tid** (text) - Unique identifier for the tenant. - **timestamp** (integer) - Timestamp of the response. - **method** (text) - The method name, should be `live_start_push`. #### Response Example ```json { "bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx", "data": { "result": 0 }, "tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx", "timestamp": 1654070968655, "method": "live_start_push" } ``` ``` -------------------------------- ### Get Waylines List Example Source: https://developer.dji.com/doc/cloud-api-tutorial/en/api-reference/pilot-to-cloud/https/waypoint-management/obtain-waypointfile-list.html This is an example of a successful response when requesting a list of waylines. It includes details about the waylines and pagination information. ```json { "code":0, "message":"success", "data":{ "list":[ { "id":"uuid", "drone_model_key":"0-67-0", "favorited":false, "name":"New wayline 1", "payload_model_keys":[ "1-53-0" ], "template_types":[ 0 ], "action_type": 0, "update_time":1637158501230, "user_name":"string", "start_wayline_point": { "start_latitude": 22.5799601837589, "start_lontitude": 113.942744030171 } } ], "pagination":{ "page":1, "page_size":9, "total":10 } } } ``` -------------------------------- ### Get STS Token API Response Example Source: https://developer.dji.com/doc/cloud-api-tutorial/en/api-reference/pilot-to-cloud/https/waypoint-management/obtain-temporary-credential.html This is an example response from the POST /storage/api/v1/workspaces/{workspace_id}/sts endpoint, illustrating the structure of temporary credentials and associated data. ```json { "code":0, "data":{ "bucket":"string", "credentials":{ "access_key_id":"STS.NUBdKtVadL1U8aBJ2TH6PWoYo", "access_key_secret":"9NG2P2yJaUrck576CkdRoRbchKssJiZygi5D93CBsduY", "expire":3600, "security_token":"CAIS8AN1q6Ft5B2yfSjIr5b3L/HAu75F+/O+OkfzrjIBRLl8uKryjTz2IHhOenBhB+Actfk+lWhV6v0Tlrt+UMQcHQnKbM99q49L9hmobIeZWV4pagxD2vOfAmG2J0PRH6WwCryLq7q/F96pb1fb7FgRpZLxaTSlWXG8LJSNkuQJR98LXw6+H1UkadBNPVkg0sJ4U0HcLvGwKBXnr3PNBU5zwGpGhHh49L60z7+9iDXXh0aozfQO9cajYMqkfYxiPZNyFsyp2/Z/eaeEzCNL918X/fl43aAY83Kdt4rNRgVbvx/DY7Tao5g0JVEmNqQzQ6RK8PG714+D046+voDzzAk3fIMxei/DRYem7dLZEeeyTLgQfqr6PHK/q7LoMYLu4Sclem48PgFHcMY6UCUSbyYhUTbHMKSq1UnXawO4Mci/3boxzIB+wieWn6aDLEPdRK6Cg2RKeM05flsoMAIRxhaiEM09bxZNdVxDBrWYN+d0dwsMkbnlswzCJFQCqXFeufLsZ/TL/fpHMNi4HLA+iNpCPcQa6zd6Fg+rEunw1n15LjI1Hexkt4D2IoK65bO/x+GeXPXLEPhvuC8BKWqP9nvTGSkLcHygvoB/MguCjt/N1+nM4dZuEQ8jo8tDChuMftsos1F9/+6o6BCe4DNU548fW6tTGoABfvC8lAYwapu2ryxHRLeBodm278eCTa57hXytE/f/l9neR9Zg9tLoIJzFOdjs2gLfVc+BhjQ0GkZDP9ie332XnhH5nOugICpYlv5++p2Ap6WZIKTVEkFetdVKjkxal2zhXoCN9Aq4YeLn5bfQiTHrA3pjjhuE7sMSFsMVdxVvftI=" }, "endpoint":"https://oss-cn-hangzhou.aliyuncs.com", "object_key_prefix":"5a6f9d4b-2a38-4b4b-86f9-3a678da0bf4a", "provider":"ali" }, "message":"success" } ``` -------------------------------- ### Import SQL Initialization File Source: https://developer.dji.com/doc/cloud-api-tutorial/en/quick-start/source-code-deployment-steps.html Command to import the database initialization script. Ensure you provide the correct path to the 'cloud_sample.sql' file. ```bash source "path to cloud_sample.sql file" ``` -------------------------------- ### Get STS Token API Response Example Source: https://developer.dji.com/doc/cloud-api-tutorial/en/api-reference/pilot-to-cloud/https/media-management/obtain-temporary-credential.html This is an example of a successful response when requesting STS tokens. It includes bucket information, credentials, endpoint, and object key prefix. ```json { "code":0, "data":{ "bucket":"string", "credentials":{ "access_key_id":"STS.NUBdKtVadL1U8aBJ2TH6PWoYo", "access_key_secret":"9NG2P2yJaUrck576CkdRoRbchKssJiZygi5D93CBsduY", "expire":3600, "security_token":"CAIS8AN1q6Ft5B2yfSjIr5b3L/HAu75F+/O+OkfzrjIBRLl8uKryjTz2IHhOenBhB+Actfk+lWhV6v0Tlrt+UMQcHQnKbM99q49L9hmobIeZWV4pagxD2vOfAmG2J0PRH6WwCryLq7q/F96pb1fb7FgRpZLxaTSlWXG8LJSNkuQJR98LXw6+H1UkadBNPVkg0sJ4U0HcLvGwKBXnr3PNBU5zwGpGhHh49L60z7+9iDXXh0aozfQO9cajYMqkfYxiPZNyFsyp2/Z/eaeEzCNL918X/fl43aAY83Kdt4rNRgVbvx/DY7Tao5g0JVEmNqQzQ6RK8PG714+D046+voDzzAk3fIMxei/DRYem7dLZEeeyTLgQfqr6PHK/q7LoMYLu4Sclem48PgFHcMY6UCUSbyYhUTbHMKSq1UnXawO4Mci/3boxzIB+wieWn6aDLEPdRK6Cg2RKeM05flsoMAIRxhaiEM09bxZNdVxDBrWYN+d0dwsMkbnlswzCJFQCqXFeufLsZ/TL/fpHMNi4HLA+iNpCPcQa6zd6Fg+rEunw1n15LjI1Hexkt4D2IoK65bO/x+GeXPXLEPhvuC8BKWqP9nvTGSkLcHygvoB/MguCjt/N1+nM4dZuEQ8jo8tDChuMftsos1F9/+6o6BCe4DNU548fW6tTGoABfvC8lAYwapu2ryxHRLeBodm278eCTa57hXytE/f/l9neR9Zg9tLoIJzFOdjs2gLfVc+BhjQ0GkZDP9ie332XnhH5nOugICpYlv5++p2Ap6WZIKTVEkFetdVKjkxal2zhXoCN9Aq4YeLn5bfQiTHrA3pjjhuE7sMSFsMVdxVvftI=" }, "endpoint":"https://oss-cn-hangzhou.aliyuncs.com", "object_key_prefix":"5a6f9d4b-2a38-4b4b-86f9-3a678da0bf4a", "provider":"ali", "region": "cn-hangzhou" }, "message":"success" } ``` -------------------------------- ### Get Duplicated Wayline Names API Response Example Source: https://developer.dji.com/doc/cloud-api-tutorial/en/api-reference/pilot-to-cloud/https/waypoint-management/get-duplicated-waypointfile-name.html This is an example of the JSON response when requesting duplicated wayline names. It includes a status code, a message, and a list of duplicate names. ```json { "code": 0, "message": "string", "data": ["name1", "name2"] } ``` -------------------------------- ### Start Live Streaming Source: https://developer.dji.com/doc/cloud-api-tutorial/en/api-reference/dock-to-cloud/mqtt/dock/dock3/live.html Initiate a live video stream. Configure the URL, URL type, video ID, and desired video quality. The URL format varies based on url_type. ```json { "bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx", "data": { "url": "channel=1ZNDH1D0010098_39-0-7&sn=1ZNDH1D0010098&token=006dca67721582a48768ec4d817b7b25a86IADk%2Fcm%2Fdv%2BHY6qT%2FAKM6y7TcUe4lXNvZpycH7vUMAlM6pFALUKF2zyCIgA82pQE8cCoYAQAAQDxwKhgAgDxwKhgAwDxwKhgBADxwKhg&uid=50000", "url_type": 0, "video_id": "1ZNDH1D0010098/39-0-7/normal-0", "video_quality": 0 }, "tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx", "timestamp:": 1654070968655, "method": "live_start_push" } ``` -------------------------------- ### Start Live Streaming via MQTT Command Source: https://developer.dji.com/doc/cloud-api-tutorial/en/feature-set/pilot-feature-set/pilot-livestream.html Initiate a live stream push from the server to the device using the 'live_start_push' method via MQTT. This interacts with the device's thing model service method. ```mqtt method=live_start_push ``` -------------------------------- ### Example Response for Get File Tiny Fingerprint Source: https://developer.dji.com/doc/cloud-api-tutorial/en/api-reference/pilot-to-cloud/https/media-management/obtain-exited-tiny-fingerprint.html This is an example of a successful response when requesting file tiny fingerprints. It includes a success code, a message, and the data containing the requested tiny fingerprints. ```json { "code":0, "message":"success", "data":{ "tiny_fingerprints":[ "5aec4c6e78052bf38fab901bcd1a2319_2021_12_8_22_13_10" ] } } ``` -------------------------------- ### Flight Setup Abort Service Reply Example Source: https://developer.dji.com/doc/cloud-api-tutorial/en/api-reference/dock-to-cloud/mqtt/dock/dock1/wayline.html This JSON response indicates the result of a flight setup abort request. A result code of 0 signifies success, while other codes indicate specific failure conditions. ```json { "bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx", "data": { "result": 0 }, "tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx", "timestamp": 1234567890123, "method": "flight_setup_abort" } ``` -------------------------------- ### Mission Readiness Notification Example Source: https://developer.dji.com/doc/cloud-api-tutorial/en/api-reference/dock-to-cloud/mqtt/dock/dock1/wayline.html This JSON payload indicates that a mission is ready to start. It includes a collection of flight IDs that meet the mission readiness conditions. ```json { "bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx", "data": { "flight_ids": [ "aaaaaaa", "bbbbbbb" ] }, "tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx", "timestamp": 1654070968655 } ``` -------------------------------- ### POST /services charge_open Source: https://developer.dji.com/doc/cloud-api-tutorial/en/api-reference/dock-to-cloud/mqtt/dock/dock3/cmd.html Starts the charging process for the dongle. ```APIDOC ## POST /services charge_open ### Description Starts the charging process for the dongle. ### Method POST ### Endpoint thing/product/_{gateway_sn}_ /services ### Parameters #### Request Body This endpoint does not require a request body. ### Response #### Success Response (200) - **result** (int) - Return code. Non-zero represents an error. - **output** (struct) - Output details - **status** (enum_string) - Task state. Options: "canceled", "failed", "in_progress", "ok", "paused", "rejected", "sent", "timeout" ### Response Example ```json { "result": 0, "output": { "status": "ok" } } ``` ``` -------------------------------- ### Start Cloud Module Connection Source: https://developer.dji.com/doc/cloud-api-tutorial/en/api-reference/pilot-to-cloud/jsbridge.html Initiate a connection for the Cloud module using provided username, password, and a callback function. ```javascript window.djiBridge.thingConnect(String userName, String passwd, String callback) ``` -------------------------------- ### Get Livestream Ability Update Source: https://developer.dji.com/doc/cloud-api-tutorial/en/api-reference/dock-to-cloud/mqtt/dock/live.html This example shows the structure of a message reporting the livestreaming capabilities of a device. It includes details on available video streams, simultaneous stream limits, and camera-specific information. ```json { "bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx", "tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx", "data": { "live_capacity": { "available_video_number": 3, "coexist_video_number_max": 2, "device_list": [ { "sn": "4BKBJ4R1010TGD", "available_video_number": 1, "coexist_video_number_max": 1, "camera_list": [ { "camera_index": "165-0-7", "available_video_number": 1, "coexist_video_number_max": 1, "video_list": [ { "video_index": "normal-0", "video_type": "normal", "switchable_video_types": [ "normal" ] } ] } ] } { "sn": "1581F4BND22180040075", "available_video_number": 2, "coexist_video_number_max": 2, "camera_list": [ { "camera_index": "39-0-7", "available_video_number": 1, "coexist_number_max": 1, "video_list": [ { "video_index": "normal-0", "video_type": "normal", "switchable_video_types": [ "normal" ] } ] } { "camera_index": "52-0-0", "available_video_number": 1, "coexist_number_max": 1, "video_list": [ { "video_index": "normal-0", "video_type": "wide", "switchable_video_types": [ "wide", "zoom", "ir" ] } ] } ] } ] } }, "timestamp:": 1654070968655, "gateway": "4BKBJ4R1010TGD" } ``` -------------------------------- ### Start Live Streaming Source: https://developer.dji.com/doc/cloud-api-tutorial/en/api-reference/dock-to-cloud/mqtt/dock/dock2/live.html Initiate a live stream by providing the URL, URL type, video ID, and desired quality. Note that Agora tokens may require URL encoding. ```json { "bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx", "data": { "url": "channel=1ZNDH1D0010098_39-0-7&sn=1ZNDH1D0010098&token=006dca67721582a48768ec4d817b7b25a86IADk%2Fcm%2Fdv%2BHY6qT%2FAKM6y7TcUe4lXNvZpycH7vUMAlM6pFALUKF2zyCIgA82pQE8cCoYAQAAQDxwKhgAgDxwKhgAwDxwKhgBADxwKhg&uid=50000", "url_type": 0, "video_id": "1ZNDH1D0010098/39-0-7/normal-0", "video_quality": 0 }, "tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx", "timestamp": 1654070968655 } ``` -------------------------------- ### Receive Camera Recording Start Status Source: https://developer.dji.com/doc/cloud-api-tutorial/en/api-reference/pilot-to-cloud/mqtt/dji-rc-plus-2/remote-control.html Indicates the success or failure of the camera recording start command. A 'result' of 0 means the recording has started. ```json { "data": { "result": 0 }, "method": "drc_camera_recording_start", "seq": 1 } ``` -------------------------------- ### Start Live Streaming Source: https://developer.dji.com/doc/cloud-api-tutorial/en/api-reference/pilot-to-cloud/mqtt/dji-rc-plus-2/live.html Initiates a live streaming session. Note: The provided text does not include specific details for starting a live stream, only for setting lens, quality, and stopping. This entry is a placeholder based on the general 'Live Stream' section. ```APIDOC ## POST /services (Placeholder) ### Description Starts a live streaming session. Specific parameters for starting a stream are not detailed in the provided documentation. ### Method POST ### Endpoint `thing/product/{gateway_sn}/services` ### Parameters #### Request Body [Details for starting a live stream are not provided in the source text.] ### Request Example [Example for starting a live stream is not provided in the source text.] ### Response #### Success Response (200) [Details for success response are not provided in the source text.] #### Response Example [Example for success response is not provided in the source text.] ``` -------------------------------- ### Start Live Streaming Source: https://developer.dji.com/doc/cloud-api-tutorial/en/api-reference/dock-to-cloud/mqtt/dock/dock2/live.html Initiates a live stream. You can configure the streaming protocol, URL, video ID, and quality. ```APIDOC ## Start live streaming ### Description Starts a live streaming session. Configurable with protocol type, URL, video ID, and quality settings. ### Method POST ### Endpoint thing/product/_{gateway_sn}_/services ### Parameters #### Request Body - **url_type** (enum_int) - Required - Live streaming protocol type. Options: {"0":"Agora","1":"RTMP","3":"GB28181","4":"WebRTC"} - **url** (text) - Required - Live streaming parameters. Format varies by `url_type`. - **video_id** (text) - Required - ID of the live streaming video stream. Format: _{sn}/{camera_index}/{video_index}_ - **video_quality** (enum_int) - Optional - Live streaming quality. Options: {"0":"Adaptive","1":"Smooth","2":"Standard definition","3":"High definition","4":"Ultra-high definition"} ### Request Example ```json { "bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx", "data": { "url": "channel=1ZNDH1D0010098_39-0-7&sn=1ZNDH1D0010098&token=006dca67721582a48768ec4d817b7b25a86IADk%2Fcm%2Fdv%2BHY6qT%2FAKM6y7TcUe4lXNvZpycH7vUMAlM6pFALUKF2zyCIgA82pQE8cCoYAQAAQDxwKhgAgDxwKhgAwDxwKhgBADxwKhg&uid=50000", "url_type": 0, "video_id": "1ZNDH1D0010098/39-0-7/normal-0", "video_quality": 0 }, "tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx", "timestamp": 1654070968655 } ``` ### Response #### Success Response (200) - **result** (int) - Return code. Non-zero represents an error. #### Response Example ```json { "bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx", "data": { "result": 0 }, "tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx", "timestamp": 1654070968655 } ``` ``` -------------------------------- ### Start Live Streaming Source: https://developer.dji.com/doc/cloud-api-tutorial/en/api-reference/pilot-to-cloud/mqtt/others/rc/live.html Initiates a live stream from a device. This command requires specifying the streaming protocol, URL, video stream identifier, and desired video quality. ```APIDOC ## POST /api/live/start ### Description Starts a live stream from a device. This endpoint is used to push video streams to a specified destination. ### Method POST ### Endpoint thing/product/_{gateway_sn}_/services ### Parameters #### Request Body - **bid** (string) - Required - Unique identifier for the command. - **data** (object) - Required - Contains the live streaming configuration. - **url_type** (enum_int) - Required - Live streaming protocol type. 0: Agora, 1: RTMP, 3: GB28181. - **url** (text) - Required - Live streaming parameters. Format varies by `url_type`: - RTMP: `rtmp://xxxxxxx` (e.g., `rtmp://192.168.1.1:8080/live`) - GB28181: `serverIP&serverPort&serverID&agentID&agentPassword&localPort&channel` (e.g., `serverIP=192.168.1.1&serverPort=8080&serverID=34000000000000000000&agentID=300000000010000000000&agentPassword=0000000&localPort=7060&channel=340000000000000000000`) - Agora: `channel&sn&token&uid` (e.g., `channel=1ZNDH360010162_39-0-7&sn=1ZNDH360010162&token=006dca67721582a48768ec4d817b7b25a86IAB4cw2JgN6iX8BpTPdc3e4S1Iendz94IFJ56aSXKvzAJei27MqF2zyCIgCLIIoBt41+YAQAAQC3jX5gAgC3jX5gAwC3jX5gBAC3jX5g&uid=50000`). Note: URL-encode special characters in Agora tokens. - **video_id** (text) - Required - ID of the live streaming video stream, formatted as `_{sn}/{camera_index}/{video_index}_`. - **video_quality** (enum_int) - Optional - Live streaming quality. 0: Adaptive, 1: Smooth, 2: Standard definition, 3: High definition, 4: Ultra-high definition. - **tid** (string) - Required - Unique identifier for the target device. - **timestamp** (integer) - Required - Timestamp of the command in milliseconds. ### Request Example ```json { "bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx", "data": { "url": "channel=1ZNDH1D0010098_39-0-7&sn=1ZNDH1D0010098&token=006dca67721582a48768ec4d817b7b25a86IADk%2Fcm%2Fdv%2BHY6qT%2FAKM6y7TcUe4lXNvZpycH7vUMAlM6pFALUKF2zyCIgA82pQE8cCoYAQAAQDxwKhgAgDxwKhgAwDxwKhgBADxwKhg&uid=50000", "url_type": 0, "video_id": "1ZNDH1D0010098/39-0-7/normal-0", "video_quality": 0 }, "tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx", "timestamp": 1654070968655 } ``` ### Response #### Success Response (200) - **bid** (string) - Unique identifier for the command. - **data** (object) - Contains the result of the live streaming start command. - **result** (int) - Return code. 0 indicates success, non-zero indicates an error. - **tid** (string) - Unique identifier for the target device. - **timestamp** (integer) - Timestamp of the response in milliseconds. #### Response Example ```json { "bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx", "data": { "result": 0 }, "tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx", "timestamp": 1654070968655 } ``` ``` -------------------------------- ### Start Live Streaming Source: https://developer.dji.com/doc/cloud-api-tutorial/en/api-reference/dock-to-cloud/mqtt/dock/dock1/live.html Initiates a live stream with specified protocol, parameters, video ID, and quality. ```APIDOC ## POST /services ### Description Starts a live stream with the specified configuration. ### Method POST ### Endpoint thing/product/_{gateway_sn}_/services ### Parameters #### Request Body - **url_type** (enum_int) - Required - Live streaming protocol type. Enum values: 0: Agora, 1: RTMP, 3: GB28181, 4: WebRTC. Note: WebRTC only supports WHIP protocol exchange. - **url** (text) - Required - Live streaming parameters. Format varies by protocol: - RTMP: (rtmp://xxxxxxx, example: rtmp://192.168.1.1:8080/live) - GB28181: (serverIP&serverPort&serverID&agentID&agentPassword&localPort&channel, example: serverIP=192.168.1.1&serverPort=8080&serverID=34000000000000000000&agentID=300000000010000000000&agentPassword=0000000&localPort=7060&channel=340000000000000000000) - Agora: (channel&sn&token&uid, example: channel=1ZNDH360010162_39-0-7&sn=1ZNDH360010162&token=006dca67721582a48768ec4d817b7b25a86IAB4cw2JgN6iX8BpTPdc3e4S1Iendz94IFJ56aSXKvzAJei27MqF2zyCIgCLIIoBt41+YAQAAQC3jX5gAgC3jX5gAwC3jX5gBAC3jX5g&uid=50000). Note: Agora-generated tokens may contain special characters like '+', which need to be URL-encoded once. - WebRTC: (example: http://192.168.1.1:8080/rtc/v1/whip/?app=live&stream=livestream) - **video_id** (text) - Required - ID of the live streaming video stream, formatted as _{sn}/{camera_index}/{video_index}_ - **video_quality** (enum_int) - Optional - Live streaming quality. Enum values: 0: Adaptive, 1: Smooth, 2: Standard definition, 3: High definition, 4: Ultra-high definition. ### Request Example ```json { "bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx", "data": { "url": "channel=1ZNDH1D0010098_39-0-7&sn=1ZNDH1D0010098&token=006dca67721582a48768ec4d817b7b25a86IADk%2Fcm%2Fdv%2BHY6qT%2FAKM6y7TcUe4lXNvZpycH7vUMAlM6pFALUKF2zyCIgA82pQE8cCoYAQAAQDxwKhgAgDxwKhgAwDxwKhgBADxwKhg&uid=50000", "url_type": 0, "video_id": "1ZNDH1D0010098/39-0-7/normal-0", "video_quality": 0 }, "tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx", "timestamp": 1654070968655 } ``` ### Response #### Success Response (200) - **result** (int) - Return code. Non-zero represents an error. #### Response Example ```json { "bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx", "data": { "result": 0 }, "tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx", "timestamp": 1654070968655 } ``` ```