### Start Recording Source: https://github.com/dji-sdk/cloud-api-doc/blob/master/docs/en/60.api-reference/20.dock-to-cloud/00.mqtt/20.dock/00.dock1/110.drc.md Command to start recording video. ```APIDOC ## camera_recording_start ### Description Command to start recording video. ### Topic thing/product/*{gateway_sn}*/services ### Direction down ### Method camera_recording_start ### Data #### payload_index (text) - Required - Camera enumeration values. Non-standard device_mode_key, formatted as {type-subtype-gimbalindex}. Please refer to [Product Supported](https://developer.dji.com/doc/cloud-api-tutorial/en/overview/product-support.html) ### Request Example ```json { "bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx", "data": { "payload_index": "39-0-7" }, "tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx", "timestamp": 1654070968655 } ``` ## camera_recording_start Reply ### Description Reply for the camera_recording_start command. ### Topic thing/product/*{gateway_sn}*/services_reply ### Direction up ### Method camera_recording_start ### Data #### result (int) - Required - 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 } ``` ``` -------------------------------- ### Install Project Dependencies Source: https://github.com/dji-sdk/cloud-api-doc/blob/master/docs/en/20.quick-start/20.source-code-deployment-steps.md Run this command in the project's root directory to install all necessary Node.js packages. ```shell npm install ``` -------------------------------- ### Start Charging Source: https://github.com/dji-sdk/cloud-api-doc/blob/master/docs/en/60.api-reference/20.dock-to-cloud/00.mqtt/20.dock/00.dock1/70.cmd.md Sends a command to start the charging process for the dock. This is a down-link message to the device. ```APIDOC ## Start Charging ### Description Sends a command to start the charging process for the dock. ### Method Publish (down-link) ### Topic thing/product/*{gateway_sn}*/services ### Data null ### Response Topic thing/product/*{gateway_sn}*/services_reply ### Response Data |Column|Name|Type|constraint|Description| |---|---|---|---|---| |result|Return code|int| |Non-zero represents an error| |output|Output|struct| || |»status|Task state|enum_string| {"canceled":"Cancelled or terminated","failed":"Failed","in_progress":"Executing","ok":"Executed successfully","paused":"Paused","rejected":"Rejected","sent":"Issued","timeout":"Timeout"} || ``` -------------------------------- ### Start the Front-end Service Source: https://github.com/dji-sdk/cloud-api-doc/blob/master/docs/en/20.quick-start/20.source-code-deployment-steps.md Execute this command to launch the development server and make the front-end application accessible. ```shell npm run serve ``` -------------------------------- ### Start Live Streaming Source: https://github.com/dji-sdk/cloud-api-doc/blob/master/docs/en/60.api-reference/10.pilot-to-cloud/30.jsbridge.md Manually initiates live streaming from the App side. ```APIDOC ## liveshareStartLive ### Description Manually enables live streaming in the App. ### Method `window.djiBridge.liveshareStartLive()`` ``` -------------------------------- ### Start Docker Containers Source: https://github.com/dji-sdk/cloud-api-doc/blob/master/docs/en/20.quick-start/30.docker-deployment-steps.md Use docker-compose to start all the necessary images in detached mode. Navigate to the directory containing your docker-compose.yml file before running this command. ```shell sudo docker-compose up -d ``` -------------------------------- ### Start Live Streaming Source: https://github.com/dji-sdk/cloud-api-doc/blob/master/docs/en/60.api-reference/10.pilot-to-cloud/00.mqtt/20.rc-pro/20.live.md This operation starts a live video stream. It requires the gateway serial number, the video stream ID, the URL type, the streaming URL, and optionally the video quality. ```APIDOC ## Start live streaming **Topic:** thing/product/*{gateway_sn}*/services **Direction:** down **Method:** live_start_push **Data:** |Column|Name|Type|constraint|Description| |---|---|---|---|---| |url_type|Live streaming protocol type|enum_int| {"0":"Agora","1":"RTMP","3":"GB28181"} | | |url|Live streaming parameters|text| |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. Otherwise, the Pilot side may encounter parsing errors. | |video_id|ID of the live streaming video stream|text| |Identifier for pushing video streams on a certain route, formatted as *{sn}/{camera_index}/{video_index}*. *{sn}* is the serial number of the video source device. *{camera_index}* is the camera index, using the format *{type-subtype-gimbalindex}*. *{video_index}* is the index of the video stream that can be selected at the camera level.| |video_quality|Live streaming quality|enum_int| {"0":"Adaptive","1":"Smooth","2":"Standard definition","3":"High definition","4":"Ultra-high definition"} |The resolutions and bitrates for different video qualities are as follows: Fluent: 960 * 540, 512Kbps; Standard Definition (SD): 1280 * 720, 1Mbps; High Definition (HD): 1280 * 720, 1.5Mbps; Ultra High Definition (UHD): 1920 * 1080, 3Mbps.| **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 } ``` **Topic:** thing/product/*{gateway_sn}*/services_reply **Direction:** up **Method:** live_start_push **Data:** |Column|Name|Type|constraint|Description| |---|---|---|---|---| |result|Return code|int| |Non-zero represents an error| **Example:** ```json { "bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx", "data": { "result": 0 }, "tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx", "timestamp": 1654070968655 } ``` ``` -------------------------------- ### Start Live Streaming Source: https://github.com/dji-sdk/cloud-api-doc/blob/master/docs/en/60.api-reference/20.dock-to-cloud/00.mqtt/20.dock/10.dock2/30.live.md Initiates a live streaming session from the dock. This is a down-link service initiated by the cloud. ```APIDOC ## Start Live Streaming ### Description Starts a live streaming session from the dock. ### Method live_start_push ### Topic thing/product/*{gateway_sn}*/services ### Data #### Request Body - **url_type** (enum_int) - Required - Live streaming protocol type. 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. 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 (0) - **result** (int) - Return code. 0 represents success. #### Response Example ```json { "bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx", "data": { "result": 0 }, "tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx", "timestamp": 1654070968655 } ``` ``` -------------------------------- ### Start Capturing Response Source: https://github.com/dji-sdk/cloud-api-doc/blob/master/docs/en/60.api-reference/20.dock-to-cloud/00.mqtt/20.dock/10.dock2/110.drc.md This is the response received after requesting to start photo capture. A result of 0 indicates the command was accepted. Further status updates may follow for ongoing operations. ```json { "bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx", "data": { "result": 0 }, "tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx", "timestamp": 1654070968655, "method": "camera_photo_take" } ``` -------------------------------- ### Start Recording Source: https://github.com/dji-sdk/cloud-api-doc/blob/master/docs/en/60.api-reference/10.pilot-to-cloud/00.mqtt/20.rc-pro/30.drc.md Initiates video recording on the RC Pro's camera. ```APIDOC ## Start Recording ### Description Initiates video recording on the RC Pro's camera. ### Method Publish to `thing/product/*{gateway_sn}*/services` ### Data | Column | Name | Type | Constraint | Description | |---|---|---|---|---| | payload_index | Camera enumeration | text | | Camera enumeration values. Non-standard device_mode_key, formatted as {type-subtype-gimbalindex}. Please refer to [Product Supported](https://developer.dji.com/doc/cloud-api-tutorial/en/overview/product-support.html) | ### 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 (from `thing/product/*{gateway_sn}*/services_reply`) | Column | Name | Type | Description | |---|---|---|---| | result | Return code | int | 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 } ``` ``` -------------------------------- ### Remote Log Source: https://github.com/dji-sdk/cloud-api-doc/blob/master/docs/en/01.tutorial-map.md APIs for remote logging, including getting file lists, starting uploads, updating status, and informing of progress. ```APIDOC ## Server API (MQTT) ### Description APIs for remote logging. ### Functions - **Get file list of uploadable device** - **Start the log file uploading** - **Update the uploding status** - **Inform of file uploding progress** ``` -------------------------------- ### Get Waypoint List Source: https://github.com/dji-sdk/cloud-api-doc/blob/master/docs/en/60.api-reference/10.pilot-to-cloud/10.https/20.waypoint-management/10.obtain-waypointfile-list.md This example shows the structure of a successful response when retrieving a list of waylines. It includes details about each wayline 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 } } } ``` -------------------------------- ### Example Response for Get Duplicated Waypoint Names Source: https://github.com/dji-sdk/cloud-api-doc/blob/master/docs/en/60.api-reference/10.pilot-to-cloud/10.https/20.waypoint-management/40.get-duplicated-waypointfile-name.md This JSON object shows a successful response when querying for duplicated waypoint names. It includes a status code, a message, and a list of duplicate names. ```json { "code": 0, "message": "string", "data": ["name1", "name2"] } ``` -------------------------------- ### Server-Side Protocol to Start Live Stream Source: https://github.com/dji-sdk/cloud-api-doc/blob/master/docs/en/30.feature-set/10.pilot-feature-set/30.pilot-livestream.md This sequence diagram outlines the server-side protocol for initiating a live stream. It includes querying device live capabilities, sending the 'live_start_push' service command via MQTT, and handling the subsequent reply and OSD topic publications. ```mermaid sequenceDiagram participant pilot as DJI Pilot 2 participant preview as Pilot Preview participant mqtt as MQTT Gateway participant server as Cloud Server participant web as Third-party Web Page web ->> server: Send a request to query the device live capability note over server: Query the local database for
device live capability server ->> web: Return live capability data server ->> web: Click to start live streaming server ->> mqtt: Sending services topics of method="live_start_push" mqtt ->> pilot: Publish services topic note over pilot: Parse and verify services topic note left of preview: The checks include whether the camera is decoding,
whether in flight control interface and so on pilot -->> mqtt: Publish "service_reply" topic mqtt -->> server: Publish service_reply topic pilot ->> mqtt: Publish osd topic that contains the live_status field mqtt ->> server: Publish osd topic ``` -------------------------------- ### Get STS Token Example Response Source: https://github.com/dji-sdk/cloud-api-doc/blob/master/docs/en/60.api-reference/10.pilot-to-cloud/10.https/20.waypoint-management/20.obtain-temporary-credential.md This JSON response shows the structure of temporary credentials obtained for cloud storage access. It includes bucket information, access keys, expiration time, and security token. ```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+BhjQ0GkZDP9ie332Xnhn5nOugICpYlv5++p2Ap6WZIKTVEkFetdVKjkxal2zhXoCN9Aq4YeLn5bfQiTHrA3pjjhuE7sMSFsMVdxVvftI= }, "endpoint":"https://oss-cn-hangzhou.aliyuncs.com", "object_key_prefix":"5a6f9d4b-2a38-4b4b-86f9-3a678da0bf4a", "provider":"ali" }, "message":"success" } ``` -------------------------------- ### Example Response for Get Map Elements Source: https://github.com/dji-sdk/cloud-api-doc/blob/master/docs/en/60.api-reference/10.pilot-to-cloud/10.https/10.map-elements/30.obtain.md This JSON structure represents a successful response when querying for map elements. It includes a list of map elements, each with its own ID, type, name, and a collection of 'elements'. Each element details its resource type, user name, and content, which can be a GeoJSON Feature with geometry and properties. ```json { "code":0, "message":"success", "data":[ { "id":"d275c4e1-d864-4736-8b5d-5f5882ee9bdd", "type":1, "name":"string", "is_lock":false, "create_time":1637158501230, "elements":[ { "id":"6d5da7b4-ac39-42bf-9580-4c8a94c11989", "name":"string", "create_time":1637158501230, "update_time":1637158501230, "resource":{ "type":0, "user_name":"name", "content":{ "type":"Feature", "properties":{ "color":"#0091FF", "clampToGround":false }, "geometry":{ "type":"Point", "coordinates":[ -112.49344909640939, 48.18734850103778, 40.2 ] } } } }, { "id":"6d5da7b4-ac39-42bf-9580-4c8a94c11988", "name":"string", "create_time":1637158501230, "update_time":1637158501230, "resource":{ "type":0, "user_name":"string", "content":{ "type":"Feature", "properties":{ "color":"#0091FF", "clampToGround":false }, "geometry":{ "type":"LineString", "coordinates":[ [ -112.49344909640939, 48.18734850103778 ], [ -104.47267952618783, 46.60029335386577 ], [ -109.20285386177949, 42.63945392538244 ], [ -113.51847222524307, 43.059268439796575 ] ] } } } }, { "id":"6d5da7b4-ac39-42bf-9580-4c8a94c11987", "name":"string", "create_time":1637158501230, "update_time":1637158501230, "resource":{ "type":0, "user_name":"string", "content":{ "type":"Feature", "properties":{ "color":"#0091FF", "clampToGround":false }, "geometry":{ "type":"Polygon", "coordinates":[ [ [ -112.49344909640939, 48.18734850103778 ], [ -104.47267952618783, 46.60029335386577 ], [ -109.20285386177949, 42.63945392538244 ], [ -113.51847222524307, 43.059268439796575 ] ] ] } } } } ] } ] } ``` -------------------------------- ### Initiate Log File Upload (Downstream) Source: https://github.com/dji-sdk/cloud-api-doc/blob/master/docs/en/60.api-reference/20.dock-to-cloud/00.mqtt/20.dock/00.dock1/90.log.md Send this JSON payload to the 'fileupload_start' service on the 'thing/product/*{gateway_sn}*/services' topic to initiate a log file upload. Ensure all required fields, including bucket details, credentials, and file information, are correctly populated. ```json { "bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx", "data": { "bucket": "stg-dji-service-hz-ksd7", "credentials": { "access_key_id": "STS.access_key_id", "access_key_secret": "access_key_secret", "expire": 1659432522000, "security_token": "security_token" }, "endpoint": "https://oss-cn-hangzhou.aliyuncs.com", "params": { "files": [ { "list": [ { "boot_index": 321 }, { "boot_index": 322 } ], "module": "3", "object_key": "object_key" } ] }, "provider": "ali", "region": "hz" }, "tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx", "timestamp": 1659429523120 } ``` -------------------------------- ### Start Cloud Module Connection Source: https://github.com/dji-sdk/cloud-api-doc/blob/master/docs/en/60.api-reference/10.pilot-to-cloud/30.jsbridge.md Initiates a connection for the Cloud Module using provided username and password. A callback function can be specified. ```javascript window.djiBridge.thingConnect(String userName, String passwd, String callback) ``` -------------------------------- ### Start Live Streaming (Manual) Source: https://github.com/dji-sdk/cloud-api-doc/blob/master/docs/en/60.api-reference/10.pilot-to-cloud/30.jsbridge.md Initiate live streaming manually from the application side. This command is typically used when the streaming type is set to manual control. ```javascript window.djiBridge.liveshareStartLive() ``` -------------------------------- ### Check if App is Installed Source: https://github.com/dji-sdk/cloud-api-doc/blob/master/docs/en/60.api-reference/10.pilot-to-cloud/30.jsbridge.md Checks if a specific application is installed on the device based on its package name. ```APIDOC ## platformIsAppInstalled ### Description Checks if a specific application is installed on the device based on its package name. ### Method `window.djiBridge.platformIsAppInstalled(String pkgName)` ### Parameters #### Path Parameters - **pkgName** (String) - Required - The package name of the application to check. ### Response #### Success Response - **Boolean** - `true` if the app is installed, `false` otherwise. ``` -------------------------------- ### Start Live Stream Source: https://github.com/dji-sdk/cloud-api-doc/blob/master/docs/cn/60.api-reference/10.pilot-to-cloud/00.mqtt/30.others/20.rc/20.live.md Initiates a live video stream with specified parameters including protocol type, URL, video ID, and quality. ```APIDOC ## Start Live Stream ### Description Starts a live video stream with configurable options for protocol, URL, video source, and quality. ### Method `live_start_push` ### Topic `thing/product/*{gateway_sn}*/services` (downstream) ### Data #### Request Body - **url_type** (enum_int) - Required - The type of live streaming protocol. Supported values: `0` (Agora), `1` (RTMP), `3` (GB28181). - **url** (text) - Required - The streaming URL or 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`. Note: Special characters in Agora tokens like '+' must be URL-encoded. - **video_id** (text) - Required - Identifier for the video stream. Format: `*{sn}/{camera_index}/{video_index}*`. - **video_quality** (enum_int) - Optional - The desired quality of the stream. Values: `0` (Adaptive), `1` (Fluent), `2` (SD), `3` (HD), `4` (Ultra HD). ### 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) - **result** (int) - Return code. Non-zero indicates an error. #### Response Example ```json { "bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx", "data": { "result": 0 }, "tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx", "timestamp": 1654070968655, "method": "live_start_push" } ``` ``` -------------------------------- ### DRC Down Message Struct Example Source: https://github.com/dji-sdk/cloud-api-doc/blob/master/docs/en/60.api-reference/10.pilot-to-cloud/00.mqtt/00.topic-definition.md Example of the JSON structure for a Drone Control (DRC) down message sent from the cloud to the pilot. ```json { "method": "drone_control", "data": { "seq": 1, "x": 2.34, "y": -2.45, "h": 2.76, "w": 2.86 } } ``` -------------------------------- ### Start Recording Reply Source: https://github.com/dji-sdk/cloud-api-doc/blob/master/docs/en/60.api-reference/20.dock-to-cloud/00.mqtt/20.dock/10.dock2/110.drc.md This is the reply payload received after sending a start recording command. A result of 0 indicates the command was successful. ```json { "bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx", "data": { "result": 0 }, "tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx", "timestamp": 1654070968655, "method": "camera_recording_start" } ``` -------------------------------- ### Start Live Streaming Source: https://github.com/dji-sdk/cloud-api-doc/blob/master/docs/en/60.api-reference/20.dock-to-cloud/00.mqtt/20.dock/00.dock1/30.live.md Initiates a live streaming session from a device. This method allows specifying the streaming protocol, parameters, video source, and desired quality. ```APIDOC ## POST /services/live_start_push ### Description Starts a live streaming session. This endpoint is used to configure and begin pushing video streams from a device to a specified destination. ### Method POST ### Endpoint `thing/product/*{gateway_sn}*/services` ### Parameters #### Path Parameters - **gateway_sn** (string) - Required - The serial number of the gateway device. #### Request Body - **bid** (string) - Required - Unique identifier for the message. - **data** (object) - Required - Contains the live streaming configuration. - **url_type** (enum_int) - Required - Live streaming protocol type. Supported values: 0 (Agora), 1 (RTMP), 3 (GB28181), 4 (WebRTC). - **url** (text) - Required - Live streaming parameters specific to the chosen protocol (e.g., RTMP URL, GB28181 server details, Agora channel/token/UID, WebRTC WHIP URL). - **video_id** (text) - Required - Identifier for the live streaming video stream, formatted as *{sn}/{camera_index}/{video_index}*. - **video_quality** (enum_int) - Optional - Live streaming quality. Supported values: 0 (Adaptive), 1 (Smooth), 2 (Standard definition), 3 (High definition), 4 (Ultra-high definition). - **tid** (string) - Required - Transaction identifier. - **timestamp** (integer) - Required - Unix timestamp of the request. ### 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 message. - **data** (object) - Contains the result of the operation. - **result** (int) - Return code. Non-zero indicates an error. - **tid** (string) - Transaction identifier. - **timestamp** (integer) - Unix timestamp of the response. #### Response Example ```json { "bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx", "data": { "result": 0 }, "tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx", "timestamp": 1654070968655 } ``` ``` -------------------------------- ### drc down Struct Example Source: https://github.com/dji-sdk/cloud-api-doc/blob/master/docs/en/60.api-reference/20.dock-to-cloud/00.mqtt/00.topic-definition.md Example of a down message structure for drone control via MQTT. This topic is used to send commands to the drone. ```APIDOC ## drc down Struct Example ### Description This section provides an example of the data structure for a 'drc down' message, which is used to send drone control commands over MQTT. The topic structure includes a placeholder for the gateway serial number. ### Topic `thing/product/*{gateway_sn}*/drc/down` ### Method `drone_control` ### Request Example ```json { "method": "drone_control", "data": { "seq": 1, "x": 2.34, "y": -2.45, "h": 2.76, "w": 2.86 } } ``` ### Parameters #### Request Body - **method** (string) - Required - The method name, which is `drone_control` for this message type. - **data** (object) - Required - The payload containing drone control parameters. - **seq** (integer) - Required - Sequence number for the command. - **x** (float) - Required - X-axis coordinate or value. - **y** (float) - Required - Y-axis coordinate or value. - **h** (float) - Required - Height or H-axis value. - **w** (float) - Required - Width or W-axis value. ``` -------------------------------- ### startRecord Source: https://github.com/dji-sdk/cloud-api-doc/blob/master/docs/en/60.api-reference/00.dji-wpml/40.common-element.md Initiates video recording on a specified payload. Allows configuration of payload position, file naming suffix, and storage type for different lenses. ```APIDOC ## startRecord ### Description Initiates video recording on a specified payload. Allows configuration of payload position, file naming suffix, and storage type for different lenses. ### Parameters #### Request Body - **wpml:payloadPositionIndex** (int) - Required - The position where the payload is mounted. `0`: Mount position 1 (front left for M300/M350, main gimbal for others). `1`: Mount position 2 (front right for M300/M350). `2`: Mount position 3 (top for M300/M350). - **wpml:fileSuffix** (string) - Required - This suffix is appended to the name of the generated media file. - **wpml:payloadLensIndex** (List of video format) - Required - Storage type of video. Possible values: `zoom`, `wide`, `ir`, `narrow_band`. Can be a comma-separated list for multi-lens storage (e.g., "wide,ir,narrow_band"). - **wpml:useGlobalPayloadLensIndex** (bool) - Required - Whether to use the global storage type setting. `0`: Do not use global set. `1`: Use global set. ``` -------------------------------- ### Build Front-end Image Source: https://github.com/dji-sdk/cloud-api-doc/blob/master/docs/en/20.quick-start/30.docker-deployment-steps.md Execute this script to build the Docker image for the front-end application. ```shell ./update_front.sh ``` -------------------------------- ### Start Capturing Photo Source: https://github.com/dji-sdk/cloud-api-doc/blob/master/docs/en/60.api-reference/20.dock-to-cloud/00.mqtt/20.dock/00.dock1/110.drc.md Initiates the process of taking a photo with a specified camera. This is used for single shots or the start of continuous capture sequences like panoramas. ```APIDOC ## Start Capturing Photo ### Description Initiates photo capturing for a specified camera. ### Method `camera_photo_take` ### Topic `thing/product/*{gateway_sn}*/services` (Downstream) ### Data #### Request Body - **payload_index** (text) - Required - Camera enumeration values. Formatted as {type-subtype-gimbalindex}. ### 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) - **result** (int) - Return code. Non-zero indicates an error. - **output** (struct) - Output details. - **status** (enum_string) - Task state. For example, 'in_progress' indicates ongoing capturing. Further progress events may be uploaded via `camera_photo_take_progress`. #### Response Example ```json { "bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx", "data": { "result": 0, "output": { "status": "in_progress" } }, "tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx", "timestamp": 1654070968655 } ``` ``` -------------------------------- ### Install vConsole Webpack Plugin Source: https://github.com/dji-sdk/cloud-api-doc/blob/master/docs/en/50.debug/10.dji-pilot2-webview-debug.md Install the vConsole webpack plugin using npm. This plugin helps to automatically add vConsole debugging functionality to your project. ```shell $ npm install vconsole-webpack-plugin --save-dev ``` -------------------------------- ### Import SQL Initialization File Source: https://github.com/dji-sdk/cloud-api-doc/blob/master/docs/en/20.quick-start/20.source-code-deployment-steps.md Execute this command within the MySQL client to import the database schema and initial data from the specified SQL file. ```shell source "path to cloud_sample.sql file" ``` -------------------------------- ### Start Charging Progress Source: https://github.com/dji-sdk/cloud-api-doc/blob/master/docs/en/60.api-reference/20.dock-to-cloud/00.mqtt/20.dock/00.dock1/70.cmd.md Initiates the charging process for a dock and provides real-time updates on its status and progress. This is an event-driven endpoint that receives updates from the dock. ```APIDOC ## Start Charging Progress ### Description Receives charging progress updates for a dock. This endpoint is used by the dock to report its charging status and progress. ### Method This is an event-driven topic, not a direct HTTP method call. ### Topic `thing/product/*{gateway_sn}*/events` ### Data |Column|Name|Type|constraint|Description| |---|---|---|---|---| |result|Return code|int| |Non-zero represents an error| |output|Output|struct| || |»status|Task state|enum_string| {"canceled":"Cancelled or terminated","failed":"Failed","in_progress":"Executing","ok":"Executed successfully","paused":"Paused","rejected":"Rejected","sent":"Issued","timeout":"Timeout"} || |»progress|Progress|struct| || |»»percent|Progress percentage|int| {"max":"100","min":"0","step":"1","unit_name":"Percentage / %"} || |»»step_key|Current step|enum_string| {"download_firmware":"Download firmware","upgrade_firmware":"Firmware update"} || ### Example ```json { "bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx", "data": { "output": { "progress": { "percent": 45, "step_key": "close_putter" }, "status": "in_progress" }, "result": 0 }, "tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx", "timestamp": 1654070968655 } ``` ``` -------------------------------- ### Create Map Element Response Example Source: https://github.com/dji-sdk/cloud-api-doc/blob/master/docs/cn/60.api-reference/10.pilot-to-cloud/10.https/10.map-elements/10.create.md Example of a successful response when creating a map element, returning a success code, a message, and the ID of the created element. ```json { "code":0, "data":{ "id":"94c51c50-f111-45e8-ac8c-4f96c93ced44" }, "message": "success" } ``` -------------------------------- ### Login to MySQL Source: https://github.com/dji-sdk/cloud-api-doc/blob/master/docs/en/20.quick-start/20.source-code-deployment-steps.md Use this command to log in to your MySQL instance. Ensure you have the correct username. ```shell mysql -u username -p ``` -------------------------------- ### Delete Map Element Request Example Source: https://github.com/dji-sdk/cloud-api-doc/blob/master/docs/en/60.api-reference/10.pilot-to-cloud/10.https/10.map-elements/40.delete.md This example shows a successful JSON response when deleting a map element. It includes the element's ID in the response data. ```json { "code":0 "data":{ "id":"94c51c50-f111-45e8-ac8c-4f96c93ced44" }, "message": "success" } ``` -------------------------------- ### Get Configuration Request Source: https://github.com/dji-sdk/cloud-api-doc/blob/master/docs/en/60.api-reference/20.dock-to-cloud/00.mqtt/20.dock/10.dock2/100.config.md This section describes the MQTT request to get the dock's configuration. It specifies the topic, direction, method, and data fields required for the request. ```APIDOC ## Get Configuration Request ### Description Sends a request to the dock to retrieve its configuration. ### Method config ### Topic thing/product/*{gateway_sn}*/requests ### Direction up ### Data |Column|Name|Type|constraint|Description| |---|---|---|---|---| |config_type|Configuration type|enum_string| {"json":"JSON format"} || |config_scope|Configuration scope|enum_string| {"product":"Product dimension"} || ### Request Example ```json { "bid": "42a19f36-5117-4520-bd13-fd61d818d52e", "data": { "config_scope": "product", "config_type": "json" }, "gateway": "sn", "tid": "6a7bfe89-c386-4043-b600-b518e10096cc", "timestamp": 1667803298000, "method": "config" } ``` ``` -------------------------------- ### Speaker Replay Command Source: https://github.com/dji-sdk/cloud-api-doc/blob/master/docs/en/60.api-reference/20.dock-to-cloud/00.mqtt/20.dock/00.dock1/140.psdk.md Send this JSON payload to the 'thing/product/*{gateway_sn}*/services' topic to initiate speaker replay. Ensure the 'psdk_index' is correctly set. ```json { "bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "data": { "psdk_index": 2 }, "method": "speaker_replay", "tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "timestamp": 1689748764875 } ``` -------------------------------- ### Start Live Stream Reply MQTT Payload Source: https://github.com/dji-sdk/cloud-api-doc/blob/master/docs/cn/60.api-reference/10.pilot-to-cloud/00.mqtt/30.others/20.rc/20.live.md This is the expected reply payload after sending a start live stream command. A `result` of 0 indicates the stream was successfully initiated. ```json { "bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx", "data": { "result": 0 }, "tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx", "timestamp": 1654070968655, "method": "live_start_push" } ```