### HTTP GET Request Example Source: https://open.dingtalk.com/document/orgapp/api-querydevicecustomtemplatelist Example of an HTTP GET request to query device custom template lists. ```HTTP GET /v1.0/rooms/devices/screens/templateLists HTTP/1.1 Host:api.dingtalk.com x-acs-dingtalk-access-token:xxxxxxxxx Content-Type:application/json ``` -------------------------------- ### Initialize and Start Instance in PHP Source: https://open.dingtalk.com/document/orgapp/initiate-the-approval-process Demonstrates client initialization and starting a process instance in PHP. ```php protocol = "https"; $config->regionId = "central"; return new Dingtalk($config); } /** * @param string[] $args * @return void */ public static function main($args){ $client = self::createClient(); $startInstanceHeaders = new StartInstanceHeaders([]); $startInstanceHeaders->xAcsDingtalkAccessToken = ""; $startInstanceRequest = new StartInstanceRequest([ "appType" => "APP_PBKT0MFBEBTDO8T7SLVP", "systemToken" => "hexxx", "userId" => "1731234567", "language" => "zh_CN", ``` -------------------------------- ### HTTP GET Request Example Source: https://open.dingtalk.com/document/development/api-getprocessdesign Example of an HTTP GET request to retrieve process definitions. Ensure you replace placeholders with actual values. ```HTTP GET /v1.0/yida/processes/{processId}definitions/designs?systemToken=hexxx&userId=02465454670427591261&appType=APP_PBKT0MFBEBTDO8T7SLVP HTTP/1.1 Host:api.dingtalk.com x-acs-dingtalk-access-token:e1224c40ce5c3704a449a4c41d545681 Content-Type:application/json ``` -------------------------------- ### Initialize and Start Instance in Python Source: https://open.dingtalk.com/document/orgapp/initiate-the-approval-process Demonstrates client initialization and starting a process instance using both synchronous and asynchronous methods. ```python # This file is auto-generated, don't edit it. Thanks. import os import sys from typing import List from alibabacloud_dingtalk.yida_1_0.client import Client as dingtalkyida_1_0Client from alibabacloud_tea_openapi import models as open_api_models from alibabacloud_dingtalk.yida_1_0 import models as dingtalkyida__1__0_models from alibabacloud_tea_util import models as util_models from alibabacloud_tea_util.client import Client as UtilClient class Sample: def __init__(self): pass @staticmethod def create_client() -> dingtalkyida_1_0Client: """ 使用 Token 初始化账号Client @return: Client @throws Exception """ config = open_api_models.Config() config.protocol = 'https' config.region_id = 'central' return dingtalkyida_1_0Client(config) @staticmethod def main( args: List[str], ) -> None: client = Sample.create_client() start_instance_headers = dingtalkyida__1__0_models.StartInstanceHeaders() start_instance_headers.x_acs_dingtalk_access_token = '' start_instance_request = dingtalkyida__1__0_models.StartInstanceRequest( app_type='APP_PBKT0MFBEBTDO8T7SLVP', system_token='hexxx', user_id='1731234567', language='zh_CN', form_uuid='FORM-NJYJZELV8YZRDEI2N5IQ7L6VEDMR1VE9GMPCJB', form_data_json='{"textField_jcpm6agt": "单行","employeeField_jcos0sar": ["workno"]}', process_code='TPROC--EF6Y4xxx', department_id='18295', process_data='[{ "key": "__optionalApproval_node_ocltdztr2b1", "value": ["5014533041684350"] }, { "key": "__optionalApproval_node_ocltdztr2b3", "value": ["5014533041684350", "01536610064226180419"] }, { "key": "__optionalApproval_node_oclte07cwn1", "value": ["01432910392321237660"] }]' ) try: client.start_instance_with_options(start_instance_request, start_instance_headers, util_models.RuntimeOptions()) except Exception as err: if not UtilClient.empty(err.code) and not UtilClient.empty(err.message): # err 中含有 code 和 message 属性,可帮助开发定位问题 pass @staticmethod async def main_async( args: List[str], ) -> None: client = Sample.create_client() start_instance_headers = dingtalkyida__1__0_models.StartInstanceHeaders() start_instance_headers.x_acs_dingtalk_access_token = '' start_instance_request = dingtalkyida__1__0_models.StartInstanceRequest( app_type='APP_PBKT0MFBEBTDO8T7SLVP', system_token='hexxx', user_id='1731234567', language='zh_CN', form_uuid='FORM-NJYJZELV8YZRDEI2N5IQ7L6VEDMR1VE9GMPCJB', form_data_json='{"textField_jcpm6agt": "单行","employeeField_jcos0sar": ["workno"]}', process_code='TPROC--EF6Y4xxx', department_id='18295', process_data='[{ "key": "__optionalApproval_node_ocltdztr2b1", "value": ["5014533041684350"] }, { "key": "__optionalApproval_node_ocltdztr2b3", "value": ["5014533041684350", "01536610064226180419"] }, { "key": "__optionalApproval_node_oclte07cwn1", "value": ["01432910392321237660"] }]' ) try: await client.start_instance_with_options_async(start_instance_request, start_instance_headers, util_models.RuntimeOptions()) except Exception as err: if not UtilClient.empty(err.code) and not UtilClient.empty(err.message): # err 中含有 code 和 message 属性,可帮助开发定位问题 pass if __name__ == '__main__': Sample.main(sys.argv[1:]) ``` -------------------------------- ### Initialize Client in Go Source: https://open.dingtalk.com/document/orgapp/query-face-entry-status Shows the initial configuration setup for the Go SDK client. ```go // This file is auto-generated, don't edit it. Thanks. package main import ( "os" util "github.com/alibabacloud-go/tea-utils/service" dingtalkexclusive_1_0 "github.com/alibabacloud-go/dingtalk/exclusive_1_0" openapi "github.com/alibabacloud-go/darabonba-openapi/client" "github.com/alibabacloud-go/tea/tea" ) /** * 使用 Token 初始化账号Client * @return Client * @throws Exception */ func CreateClient () (_result *dingtalkexclusive_1_0.Client, _err error) { config := &openapi.Config{} ``` -------------------------------- ### Install Golang SDK Source: https://open.dingtalk.com/document/resourcedownload/Introduction-to-stream-mode Use the go get command to install the DingTalk Stream SDK for Go. ```shell go get github.com/open-dingtalk/dingtalk-stream-sdk-go ``` -------------------------------- ### Initialize and List Dentries in PHP Source: https://open.dingtalk.com/document/development/obtain-the-file-list-storage Demonstrates client initialization and listing dentries using the PHP SDK. ```php protocol = "https"; $config->regionId = "central"; return new Dingtalk($config); } /** * @param string[] $args * @return void */ public static function main($args){ $client = self::createClient(); $listDentriesHeaders = new ListDentriesHeaders([]); $listDentriesHeaders->xAcsDingtalkAccessToken = ""; $listDentriesRequest = new ListDentriesRequest([ "parentId" => "0", "nextToken" => "next_token", "maxResults" => 30, "orderBy" => "MODIFIED_TIME", "order" => "DESC", "withThumbnail" => false, "unionId" => "cHtUxxxxx" ]); try { $client->listDentriesWithOptions("854xxxxx", $listDentriesRequest, $listDentriesHeaders, new RuntimeOptions([])); } catch (Exception $err) { if (!($err instanceof TeaError)) { $err = new TeaError([], $err->getMessage(), $err->getCode(), $err); } if (!Utils::empty_($err->code) && !Utils::empty_($err->message)) { // err 中含有 code 和 message 属性,可帮助开发定位问题 } } } } $path = __DIR__ . \DIRECTORY_SEPARATOR . '..' . \DIRECTORY_SEPARATOR . 'vendor' . \DIRECTORY_SEPARATOR . 'autoload.php'; if (file_exists($path)) { require_once $path; } Sample::main(array_slice($argv, 1)); ``` -------------------------------- ### Get Assistant Ask Details (HTTP) Source: https://open.dingtalk.com/document/orgapp/api-getaskdetail Example of an HTTP GET request to retrieve assistant ask details. Ensure you have a valid access token. ```HTTP GET /v1.0/assistant/askDetails?assistantId=02125927e37b4a8f86da0e57125038&offset=0&pageSize=3&startTime=0&endTime=1722505491000 HTTP/1.1 Host:api.dingtalk.com x-acs-dingtalk-access-token:f2a6d208b64432df8eea4a9a937c95cb Content-Type:application/json ``` -------------------------------- ### Task Start Date Update JSON Example Source: https://open.dingtalk.com/document/isvapp/teamposition-task-update-event Represents the structure for a task start date update event. Set startDate to an empty string to clear the value. ```json { "data": { "syncAction": "project_task_updated", "eventSubType": "tb.v3.task.startDate.update", "creatorId": "0715153011125xxxx", "startDate": "2022-12-26T09:27:43.733Z", "created": "2022-12-26T09:27:43.733Z", "updated": "2022-12-26T09:27:43.733Z", "taskId": "63c7f91f6ff268bcab40xxxx" } } ``` -------------------------------- ### Initialize and List Dentries in Python Source: https://open.dingtalk.com/document/development/obtain-the-file-list-storage Demonstrates client initialization and listing dentries with both synchronous and asynchronous methods. ```python # This file is auto-generated, don't edit it. Thanks. import sys from typing import List from alibabacloud_dingtalk.storage_1_0.client import Client as dingtalkstorage_1_0Client from alibabacloud_tea_openapi import models as open_api_models from alibabacloud_dingtalk.storage_1_0 import models as dingtalkstorage__1__0_models from alibabacloud_tea_util import models as util_models from alibabacloud_tea_util.client import Client as UtilClient class Sample: def __init__(self): pass @staticmethod def create_client() -> dingtalkstorage_1_0Client: """ 使用 Token 初始化账号Client @return: Client @throws Exception """ config = open_api_models.Config() config.protocol = 'https' config.region_id = 'central' return dingtalkstorage_1_0Client(config) @staticmethod def main( args: List[str], ) -> None: client = Sample.create_client() list_dentries_headers = dingtalkstorage__1__0_models.ListDentriesHeaders() list_dentries_headers.x_acs_dingtalk_access_token = '' list_dentries_request = dingtalkstorage__1__0_models.ListDentriesRequest( parent_id='0', next_token='next_token', max_results=30, order_by='MODIFIED_TIME', order='DESC', with_thumbnail=False, union_id='cHtUxxxxx' ) try: client.list_dentries_with_options('854xxxxx', list_dentries_request, list_dentries_headers, util_models.RuntimeOptions()) except Exception as err: if not UtilClient.empty(err.code) and not UtilClient.empty(err.message): # err 中含有 code 和 message 属性,可帮助开发定位问题 pass @staticmethod async def main_async( args: List[str], ) -> None: client = Sample.create_client() list_dentries_headers = dingtalkstorage__1__0_models.ListDentriesHeaders() list_dentries_headers.x_acs_dingtalk_access_token = '' list_dentries_request = dingtalkstorage__1__0_models.ListDentriesRequest( parent_id='0', next_token='next_token', max_results=30, order_by='MODIFIED_TIME', order='DESC', with_thumbnail=False, union_id='cHtUxxxxx' ) try: await client.list_dentries_with_options_async('854xxxxx', list_dentries_request, list_dentries_headers, util_models.RuntimeOptions()) except Exception as err: if not UtilClient.empty(err.code) and not UtilClient.empty(err.message): # err 中含有 code 和 message 属性,可帮助开发定位问题 pass if __name__ == '__main__': Sample.main(sys.argv[1:]) ``` -------------------------------- ### HTTP GET Request for Automation Logs Source: https://open.dingtalk.com/document/development/api-getautoflowlogdetail Example of an HTTP GET request to retrieve automation logs. Ensure you replace placeholders with your actual access token and other parameters. ```HTTP GET /v1.0/yida/logs/automations?pageSize=100&userId=manager7675&procInstanceId=da7ae0f8-c8e2-4207-9f87-47bd887430ef&pageNumber=1&token=B073NCJSHYD59F8F612DXXXXX&corpId=ding5d17e3add038d44535c2f46xxx485s HTTP/1.1 Host:api.dingtalk.com x-acs-dingtalk-access-token:da7zxcsf8-c8e2-4207-9f87-47bxxxas2830ef Content-Type:application/json ``` -------------------------------- ### Example Usage Source: https://open.dingtalk.com/document/orgapp/dd-getbackgroundaudiomanager Demonstrates how to initialize the background audio manager, set up event listeners, and control playback. ```APIDOC ## Example Code ### Description This example shows how to get the background audio manager, register various event listeners, and start audio playback with title, cover image, and source. ### Code ```javascript Page({ data:{ title:'abc', src:'http://music.xxxx/url?id=317151.mp3', coverImgUrl:'https://img.alicdn.com/tps/TB1sXGYIFXXXXc5XpXXXXXXXXXX.jpg', }, onLoad(){ let manager = dd.getBackgroundAudioManager() let events = ["onCanplay","onPlay","onPause","onStop","onEnded","onTimeUpdate","onError","onWaiting","onSeeking","onSeeked","onPrev","onNext"] events.forEach(item => { manager[item] = function(event){ console.log('EVENT:',item, event) } }) }, start() { let manager = dd.getBackgroundAudioManager() manager.title = this.data.title manager.coverImgUrl = this.data.coverImgUrl manager.src = this.data.src } }) ``` ``` -------------------------------- ### Start Pending Dismission API Request Source: https://open.dingtalk.com/document/orgapp/api-empstartdismission This is an example of an HTTP POST request to start the pending dismission process for an employee. Ensure you have the correct access token and content type. ```HTTP POST /v1.0/hrm/pendingDismission/start HTTP/1.1 Host:api.dingtalk.com x-acs-dingtalk-access-token:e73d7d0e99d234368c4f5b0088edc9c9 Content-Type:application/json { "userId" : "2163515669935611", "lastWorkDate" : 1736489016000, "terminationReasonVoluntary" : [ "1" ], "terminationReasonPassive" : [ "1" ], "remark" : "备注信息", "partner" : false, "toHireBlackList" : false, "toHireDismissionTalent" : false, "toHrmBlackList" : false } ``` -------------------------------- ### Initialize and List Assistant Runs in Go Source: https://open.dingtalk.com/document/orgapp/api-listassistantrun Demonstrates client initialization and the ListAssistantRunWithOptions method call using the Go SDK. ```go // @throws Exception func CreateClient () (_result *dingtalkassistant_1_0.Client, _err error) { config := &openapi.Config{} config.Protocol = tea.String("https") config.RegionId = tea.String("central") _result = &dingtalkassistant_1_0.Client{} _result, _err = dingtalkassistant_1_0.NewClient(config) return _result, _err } func _main (args []*string) (_err error) { client, _err := CreateClient() if _err != nil { return _err } listAssistantRunHeaders := &dingtalkassistant_1_0.ListAssistantRunHeaders{} listAssistantRunHeaders.XAcsDingtalkAccessToken = tea.String("") listAssistantRunRequest := &dingtalkassistant_1_0.ListAssistantRunRequest{ Limit: tea.Int32(20), Order: tea.String("desc"), } tryErr := func()(_e error) { defer func() { if r := tea.Recover(recover()); r != nil { _e = r } }() _, _err = client.ListAssistantRunWithOptions(tea.String("thread_message_95f***abb"), listAssistantRunRequest, listAssistantRunHeaders, &util.RuntimeOptions{}) if _err != nil { return _err } return nil }() if tryErr != nil { var err = &tea.SDKError{} if _t, ok := tryErr.(*tea.SDKError); ok { err = _t } else { err.Message = tea.String(tryErr.Error()) } if !tea.BoolValue(util.Empty(err.Code)) && !tea.BoolValue(util.Empty(err.Message)) { // err 中含有 code 和 message 属性,可帮助开发定位问题 } } return _err } func main() { err := _main(tea.StringSlice(os.Args[1:])) if err != nil { panic(err) } } ``` -------------------------------- ### Get User Follow Status HTTP Request Source: https://open.dingtalk.com/document/orgapp/obtain-the-attention-status-of-the-user-service-window This is an example of an HTTP GET request to retrieve the follow status of a user. Ensure you have the correct access token and user identifiers. ```HTTP GET /v1.0/link/followers/statuses?userId=Rp3Rqcts7BE08y49Jr6iu6xW4iQ&unionId=UgIzXXo+Rp3Rqcts7BE08y49Jr6iu6xW4iQ&accountId=ding1234 HTTP/1.1 Host:api.dingtalk.com x-acs-dingtalk-access-token:a3b89df4dfaaccd5b Content-Type:application/json ``` -------------------------------- ### Initialize Client and Fetch Form List in Go Source: https://open.dingtalk.com/document/development/depending-on-the-application-id-to-get-the-form-list Demonstrates client initialization and calling GetFormListInAppWithOptions with access token authentication. ```go util "github.com/alibabacloud-go/tea-utils/v2/service" dingtalkyida_1_0 "github.com/alibabacloud-go/dingtalk/yida_1_0" openapi "github.com/alibabacloud-go/darabonba-openapi/v2/client" "github.com/alibabacloud-go/tea/tea" ) /** * 使用 Token 初始化账号Client * @return Client * @throws Exception */ func CreateClient () (_result *dingtalkyida_1_0.Client, _err error) { config := &openapi.Config{} config.Protocol = tea.String("https") config.RegionId = tea.String("central") _result = &dingtalkyida_1_0.Client{} _result, _err = dingtalkyida_1_0.NewClient(config) return _result, _err } func _main (args []*string) (_err error) { client, _err := CreateClient() if _err != nil { return _err } getFormListInAppHeaders := &dingtalkyida_1_0.GetFormListInAppHeaders{} getFormListInAppHeaders.XAcsDingtalkAccessToken = tea.String("") getFormListInAppRequest := &dingtalkyida_1_0.GetFormListInAppRequest{ AppType: tea.String("APP_PBKTxxxxx"), SystemToken: tea.String("FO86xxxxx"), FormTypes: tea.String("receipt,process"), PageSize: tea.Int32(100), PageNumber: tea.Int32(1), UserId: tea.String("5014xxxxx"), } tryErr := func()(_e error) { defer func() { if r := tea.Recover(recover()); r != nil { _e = r } }() _, _err = client.GetFormListInAppWithOptions(getFormListInAppRequest, getFormListInAppHeaders, &util.RuntimeOptions{}) if _err != nil { return _err } return nil }() if tryErr != nil { var err = &tea.SDKError{} if _t, ok := tryErr.(*tea.SDKError); ok { err = _t } else { err.Message = tea.String(tryErr.Error()) } if !tea.BoolValue(util.Empty(err.Code)) && !tea.BoolValue(util.Empty(err.Message)) { // err 中含有 code 和 message 属性,可帮助开发定位问题 } } return _err } func main() { err := _main(tea.StringSlice(os.Args[1:])) if err != nil { panic(err) } } ``` -------------------------------- ### HTTP Request Example for Assistant Skills Source: https://open.dingtalk.com/document/orgapp/api-getassistantactioninfo This is a concrete example of an HTTP GET request to fetch assistant skill information, including a sample assistant ID and access token. ```http GET /v1.0/assistant/actionLists?assistantId=e43df51e3884468ca4b4685a81xxxxxx HTTP/1.1 Host:api.dingtalk.com x-acs-dingtalk-access-token:e8e337318919xxxxxx15dc332bd77 Content-Type:application/json ``` -------------------------------- ### Initialize Client in Go Source: https://open.dingtalk.com/document/development/queries-a-space-list Provides the initial setup for the Go client using the Alibaba Cloud SDK. ```go // This file is auto-generated, don't edit it. Thanks. package main import ( "os" util "github.com/alibabacloud-go/tea-utils/service" dingtalkdrive_1_0 "github.com/alibabacloud-go/dingtalk/drive_1_0" openapi "github.com/alibabacloud-go/darabonba-openapi/client" "github.com/alibabacloud-go/tea/tea" ) /** * 使用 Token 初始化账号Client * @return Client * @throws Exception */ ``` -------------------------------- ### HTTP Request Example for User Joined Projects Source: https://open.dingtalk.com/document/orgapp/get-projects-joined-by-users This is a concrete example of an HTTP GET request to fetch projects joined by a specific user. It shows sample values for userId, maxResults, and nextToken. ```http GET /v1.0/project/users/0517xxx/joinProjects?maxResults=10&nextToken=f279e812xxxxxx HTTP/1.1 Host:api.dingtalk.com x-acs-dingtalk-access-token:xxx Content-Type:application/json ``` -------------------------------- ### Initialize and List Inner Apps in Python Source: https://open.dingtalk.com/document/orgapp/get-a-list-of-all-applications-inside-the-enterprise Demonstrates client initialization and listing inner applications using both synchronous and asynchronous methods. ```python # This file is auto-generated, don't edit it. Thanks. import os import sys from typing import List from alibabacloud_dingtalk.micro_app_1_0.client import Client as dingtalkmicroApp_1_0Client from alibabacloud_tea_openapi import models as open_api_models from alibabacloud_dingtalk.micro_app_1_0 import models as dingtalkmicro_app__1__0_models from alibabacloud_tea_util import models as util_models from alibabacloud_tea_util.client import Client as UtilClient class Sample: def __init__(self): pass @staticmethod def create_client() -> dingtalkmicroApp_1_0Client: """ 使用 Token 初始化账号Client @return: Client @throws Exception """ config = open_api_models.Config() config.protocol = 'https' config.region_id = 'central' return dingtalkmicroApp_1_0Client(config) @staticmethod def main( args: List[str], ) -> None: client = Sample.create_client() list_all_inner_apps_headers = dingtalkmicro_app__1__0_models.ListAllInnerAppsHeaders() list_all_inner_apps_headers.x_acs_dingtalk_access_token = '' try: client.list_all_inner_apps_with_options(list_all_inner_apps_headers, util_models.RuntimeOptions()) except Exception as err: if not UtilClient.empty(err.code) and not UtilClient.empty(err.message): # err 中含有 code 和 message 属性,可帮助开发定位问题 pass @staticmethod async def main_async( args: List[str], ) -> None: client = Sample.create_client() list_all_inner_apps_headers = dingtalkmicro_app__1__0_models.ListAllInnerAppsHeaders() list_all_inner_apps_headers.x_acs_dingtalk_access_token = '' try: await client.list_all_inner_apps_with_options_async(list_all_inner_apps_headers, util_models.RuntimeOptions()) except Exception as err: if not UtilClient.empty(err.code) and not UtilClient.empty(err.message): # err 中含有 code 和 message 属性,可帮助开发定位问题 pass if __name__ == '__main__': Sample.main(sys.argv[1:]) ``` -------------------------------- ### HTTP Request Example for Plugin Rule Check Info Source: https://open.dingtalk.com/document/development/you-can-call-this-operation-to-obtain-the-information-about This is an example of an HTTP GET request to retrieve workbench plugin validation rule information, including a sample miniAppId and access token. ```http GET /v1.0/workbench/plugins/validationRules?miniAppId=50000000xxxx HTTP/1.1 Host:api.dingtalk.com x-acs-dingtalk-access-token:ab3dc45xxxx Content-Type:application/json ``` -------------------------------- ### Initialize and Use SyncDataWithOptions in Go Source: https://open.dingtalk.com/document/connection/dingtalk-connector-data-synchronization-interface Demonstrates how to initialize the client and call syncDataWithOptions with error handling in Go. Ensure the necessary packages are imported. ```go // This file is auto-generated, don't edit it. Thanks. package main import ( "os" util "github.com/alibabacloud-go/tea-utils/v2/service" dingtalkconnector_1_0 "github.com/alibabacloud-go/dingtalk/connector_1_0" openapi "github.com/alibabacloud-go/darabonba-openapi/v2/client" "github.com/alibabacloud-go/tea/tea" ) /** * 使用 Token 初始化账号Client * @return Client * @throws Exception */ func CreateClient () (_result *dingtalkconnector_1_0.Client, _err error) { config := &openapi.Config{} config.Protocol = tea.String("https") config.RegionId = tea.String("central") _result = &dingtalkconnector_1_0.Client{} _result, _err = dingtalkconnector_1_0.NewClient(config) return _result, _err } func _main (args []*string) (_err error) { client, _err := CreateClient() if _err != nil { return _err } syncDataHeaders := &dingtalkconnector_1_0.SyncDataHeaders{} syncDataHeaders.XAcsDingtalkAccessToken = tea.String("") triggerDataList0 := &dingtalkconnector_1_0.SyncDataRequestTriggerDataList{ TriggerId: tea.String("TRIGGER-XXXX"), CustomTriggerId: tea.String("ABC"), JsonData: tea.String("{\"a\":\"aa\",\"b\":\"bb\"}"), DataGmtCreate: tea.Int64(1621482274000), DataGmtModified: tea.Int64(1621482274000), Action: tea.String("add"), IntegrationObject: tea.String("11"), TriggerCondition: tea.String("{\"flowIds\":[\"G-FLOW-XXX\"]}"), } syncDataRequest := &dingtalkconnector_1_0.SyncDataRequest{ TriggerDataList: []*dingtalkconnector_1_0.SyncDataRequestTriggerDataList{triggerDataList0}, AppId: tea.String("123"), } tryErr := func()(_e error) { defer func() { if r := tea.Recover(recover()); r != nil { _e = r } }() _, _err = client.SyncDataWithOptions(syncDataRequest, syncDataHeaders, &util.RuntimeOptions{}) if _err != nil { return _err } return nil }() if tryErr != nil { var err = &tea.SDKError{} if _t, ok := tryErr.(*tea.SDKError); ok { err = _t } else { err.Message = tea.String(tryErr.Error()) } if !tea.BoolValue(util.Empty(err.Code)) && !tea.BoolValue(util.Empty(err.Message)) { // err 中含有 code 和 message 属性,可帮助开发定位问题 } } return _err } func main() { err := _main(tea.StringSlice(os.Args[1:])) if err != nil { panic(err) } } ``` -------------------------------- ### Initialize and Search Dentries in Python Source: https://open.dingtalk.com/document/orgapp/search-for-files Demonstrates client initialization and searching for dentries using synchronous and asynchronous methods. ```python # This file is auto-generated, don't edit it. Thanks. import sys from typing import List from alibabacloud_dingtalk.storage_2_0.client import Client as dingtalkstorage_2_0Client from alibabacloud_tea_openapi import models as open_api_models from alibabacloud_dingtalk.storage_2_0 import models as dingtalkstorage__2__0_models from alibabacloud_tea_util import models as util_models from alibabacloud_tea_util.client import Client as UtilClient class Sample: def __init__(self): pass @staticmethod def create_client() -> dingtalkstorage_2_0Client: """ 使用 Token 初始化账号Client @return: Client @throws Exception """ config = open_api_models.Config() config.protocol = 'https' config.region_id = 'central' return dingtalkstorage_2_0Client(config) @staticmethod def main( args: List[str], ) -> None: client = Sample.create_client() search_dentries_headers = dingtalkstorage__2__0_models.SearchDentriesHeaders() search_dentries_headers.x_acs_dingtalk_access_token = '' option_visit_time_range = dingtalkstorage__2__0_models.SearchDentriesRequestOptionVisitTimeRange() option_create_time_range = dingtalkstorage__2__0_models.SearchDentriesRequestOptionCreateTimeRange() option = dingtalkstorage__2__0_models.SearchDentriesRequestOption( next_token='next_token', max_results=20, dentry_categories=[ 'category' ], creator_ids=[ 'creator_id' ], modifier_ids=[ 'modifier_id' ], create_time_range=option_create_time_range, visit_time_range=option_visit_time_range ) search_dentries_request = dingtalkstorage__2__0_models.SearchDentriesRequest( operator_id='tXguN309iPhE4roSKPlLURAiEiE', keyword='keyword', option=option ) try: client.search_dentries_with_options(search_dentries_request, search_dentries_headers, util_models.RuntimeOptions()) except Exception as err: if not UtilClient.empty(err.code) and not UtilClient.empty(err.message): # err 中含有 code 和 message 属性,可帮助开发定位问题 pass @staticmethod async def main_async( args: List[str], ) -> None: client = Sample.create_client() search_dentries_headers = dingtalkstorage__2__0_models.SearchDentriesHeaders() search_dentries_headers.x_acs_dingtalk_access_token = '' option_visit_time_range = dingtalkstorage__2__0_models.SearchDentriesRequestOptionVisitTimeRange() option_create_time_range = dingtalkstorage__2__0_models.SearchDentriesRequestOptionCreateTimeRange() option = dingtalkstorage__2__0_models.SearchDentriesRequestOption( next_token='next_token', max_results=20, dentry_categories=[ 'category' ], creator_ids=[ 'creator_id' ], modifier_ids=[ 'modifier_id' ], create_time_range=option_create_time_range, visit_time_range=option_visit_time_range ) search_dentries_request = dingtalkstorage__2__0_models.SearchDentriesRequest( operator_id='tXguN309iPhE4roSKPlLURAiEiE', keyword='keyword', option=option ) try: await client.search_dentries_with_options_async(search_dentries_request, search_dentries_headers, util_models.RuntimeOptions()) except Exception as err: if not UtilClient.empty(err.code) and not UtilClient.empty(err.message): # err 中含有 code 和 message 属性,可帮助开发定位问题 pass if __name__ == '__main__': Sample.main(sys.argv[1:]) ``` -------------------------------- ### Batch Query Indicator List HTTP Request Example Source: https://open.dingtalk.com/document/development/api-agoalindicatorbatchquery This is an example of an HTTP GET request to batch query indicator details using a specific indicator code. Ensure the Host and x-acs-dingtalk-access-token are correctly set. ```HTTP GET /v1.0/agoal/indicator/batch/query?codeList=["code_xxxxd98w3ifdsj"] HTTP/1.1 Host:api.dingtalk.com x-acs-dingtalk-access-token:ajsdhiq3984hf Content-Type:application/json ``` -------------------------------- ### Initialize and List Assistant Runs in C# Source: https://open.dingtalk.com/document/orgapp/api-listassistantrun Demonstrates client initialization and the ListAssistantRunWithOptions method call using the C# SDK. ```csharp // This file is auto-generated, don't edit it. Thanks. using System; using System.Collections; using System.Collections.Generic; using System.IO; using System.Threading.Tasks; using Tea; using Tea.Utils; namespace AlibabaCloud.SDK.Sample { public class Sample { /// Description: /// /// 使用 Token 初始化账号Client /// /// /// /// Client /// /// /// Exception: /// Exception public static AlibabaCloud.SDK.Dingtalkassistant_1_0.Client CreateClient() { AlibabaCloud.OpenApiClient.Models.Config config = new AlibabaCloud.OpenApiClient.Models.Config(); config.Protocol = "https"; config.RegionId = "central"; return new AlibabaCloud.SDK.Dingtalkassistant_1_0.Client(config); } public static void Main(string[] args) { AlibabaCloud.SDK.Dingtalkassistant_1_0.Client client = CreateClient(); AlibabaCloud.SDK.Dingtalkassistant_1_0.Models.ListAssistantRunHeaders listAssistantRunHeaders = new AlibabaCloud.SDK.Dingtalkassistant_1_0.Models.ListAssistantRunHeaders(); listAssistantRunHeaders.XAcsDingtalkAccessToken = ""; AlibabaCloud.SDK.Dingtalkassistant_1_0.Models.ListAssistantRunRequest listAssistantRunRequest = new AlibabaCloud.SDK.Dingtalkassistant_1_0.Models.ListAssistantRunRequest { Limit = 20, Order = "desc", }; try { client.ListAssistantRunWithOptions("thread_message_95f***abb", listAssistantRunRequest, listAssistantRunHeaders, new AlibabaCloud.TeaUtil.Models.RuntimeOptions()); } catch (TeaException err) { if (!AlibabaCloud.TeaUtil.Common.Empty(err.Code) && !AlibabaCloud.TeaUtil.Common.Empty(err.Message)) { ``` -------------------------------- ### Initialize Client and Get Running Tasks in C# Source: https://open.dingtalk.com/document/development/query-process-running-tasks-vpc Shows the setup of the DingTalk Yida client and the structure for a request in C#. ```csharp // This file is auto-generated, don't edit it. Thanks. using System; using System.Collections; using System.Collections.Generic; using System.IO; using System.Threading.Tasks; using Tea; using Tea.Utils; namespace AlibabaCloud.SDK.Sample { public class Sample { /** * 使用 Token 初始化账号Client * @return Client * @throws Exception */ public static AlibabaCloud.SDK.Dingtalkyida_1_0.Client CreateClient() { AlibabaCloud.OpenApiClient.Models.Config config = new AlibabaCloud.OpenApiClient.Models.Config(); config.Protocol = "https"; config.RegionId = "central"; return new AlibabaCloud.SDK.Dingtalkyida_1_0.Client(config); } public static void Main(string[] args) { AlibabaCloud.SDK.Dingtalkyida_1_0.Client client = CreateClient(); AlibabaCloud.SDK.Dingtalkyida_1_0.Models.GetRunningTasksHeaders getRunningTasksHeaders = new AlibabaCloud.SDK.Dingtalkyida_1_0.Models.GetRunningTasksHeaders(); getRunningTasksHeaders.XAcsDingtalkAccessToken = ""; AlibabaCloud.SDK.Dingtalkyida_1_0.Models.GetRunningTasksRequest getRunningTasksRequest = new AlibabaCloud.SDK.Dingtalkyida_1_0.Models.GetRunningTasksRequest { ProcessInstanceId = "f30233fb-72e1-4xx", AppType = "APP_PBKTxxx", SystemToken = "hexxxx", Language = "zh_CN", UserId = "manager123", }; try { ``` -------------------------------- ### GET /v1.0/assistant/logs/list Source: https://open.dingtalk.com/document/orgapp/api-loglist Retrieves a list of assistant logs. Supports filtering by assistant ID, start time, end time, and pagination. ```APIDOC ## GET /v1.0/assistant/logs/list ### Description Retrieves a list of assistant logs. Supports filtering by assistant ID, start time, end time, and pagination. ### Method GET ### Endpoint /v1.0/assistant/logs/list ### Query Parameters - **assistantId** (string) - Required - The ID of the assistant. - **startTime** (integer) - Required - The start timestamp for filtering logs (in milliseconds). - **endTime** (integer) - Required - The end timestamp for filtering logs (in milliseconds). - **pageSize** (integer) - Optional - The number of logs to return per page. Defaults to 10. - **pageNumber** (integer) - Optional - The page number to retrieve. Defaults to 1. ### Request Example ```http GET /v1.0/assistant/logs/list?assistantId=123&startTime=1732985386000&endTime=1732985386000&pageSize=10&pageNumber=1 HTTP/1.1 Host:api.dingtalk.com x-acs-dingtalk-access-token:28afdd3145423c4bb7d5e1713b72d902 Content-Type:application/json ``` ### Response #### Success Response (200) - **logs** (array) - A list of log entries. - **logId** (string) - The ID of the log entry. - **timestamp** (integer) - The timestamp when the log was created. - **content** (string) - The content of the log message. #### Response Example ```json { "logs": [ { "logId": "log_abc", "timestamp": 1732985386000, "content": "User query processed successfully." } ] } ``` ``` -------------------------------- ### Initialize Go Project Source: https://open.dingtalk.com/document/development/robot-sends-nail-message Provides the initial boilerplate for a Go project using the Alibaba Cloud SDK. ```go // This file is auto-generated, don't edit it. Thanks. package main import ( ``` -------------------------------- ### List Assistant Logs (HTTP) Source: https://open.dingtalk.com/document/orgapp/api-loglist Example of an HTTP GET request to list assistant logs. Ensure you have a valid access token. ```HTTP GET /v1.0/assistant/logs/list?assistantId=123&startTime=1732985386000&endTime=1732985386000&pageSize=10&pageNumber=1 HTTP/1.1 Host:api.dingtalk.com x-acs-dingtalk-access-token:28afdd3145423c4bb7d5e1713b72d902 Content-Type:application/json ``` -------------------------------- ### Initialize Client in Go Source: https://open.dingtalk.com/document/development/enterprise-chatbot-withdraws-internal-group-messages Provides the initial package imports and setup for the Go SDK client. ```go // This file is auto-generated, don't edit it. Thanks. package main import ( "os" util "github.com/alibabacloud-go/tea-utils/service" dingtalkrobot_1_0 "github.com/alibabacloud-go/dingtalk/robot_1_0" openapi "github.com/alibabacloud-go/darabonba-openapi/client" ```