DingTalk

1. Overview

Dingtalk is an intelligent mobile office platform designed by Alibaba Group specifically for Chinese enterprises, integrating instant messaging, online documents, smart human resources, OA approval, and other functions, aimed at improving enterprise communication and collaboration efficiency.

Through GoInsight's Dingtalk node, you can seamlessly integrate Dingtalk's powerful capabilities into your automated workflows, achieving comprehensive automated control of organizational structure, communication and collaboration, and knowledge management. Including:

  • Organizational Structure Management: Automate the creation, query, and search of users and departments within the enterprise.
  • Communication and Collaboration: Automatically create group chats, send work notifications, and manage message status.
  • Knowledge Base and Documents: Create and manage spaces, documents, worksheets, etc. in the Dingtalk knowledge base.
  • Online Spreadsheet Operations: Perform granular operations on Dingtalk smart spreadsheets, such as reading and writing cell data, adding and deleting rows and columns, and setting visibility.

2. Prerequisites

Before using this node, you need to meet the following conditions:

  • Have a valid Dingtalk account and be a member of an enterprise organization.
  • You need to have administrator rights to the enterprise organization, or be authorized by an administrator, in order to create applications and obtain API credentials on the Dingtalk Open Platform.

3. Credentials

For detailed guidance on how to obtain and configure credentials, please refer to our official documentation: Credentials Configuration Guide.

4. Supported Operations

Summary

This Dingtalk node primarily operates around core resources such as group chats, users, departments, knowledge bases, online spreadsheets, and messages within the enterprise. The table below summarizes all supported operations:

Resource Operation Description
Group Chat Create Chat Create a new Dingtalk group chat with detailed settings.
Group Chat Get Chat Info Get detailed information about a group chat by its ID.
User Create User Create a new user directly in the Dingtalk organizational directory.
User Get User Get detailed information about a user by user ID or mobile number.
User Get User Count Get the total number of users in the Dingtalk organization.
User Get UserID By UnionID Get a user's UserID through their UnionID.
User Get Dept Users Get a list of all users under a specified department.
User Search Users Search for users within the enterprise by keywords (such as name, phone number).
Department Get Dept Detail Get detailed information about a department by department ID.
Department Get Dept List Get a list of sub-departments under a specified parent department.
Department Search Departments Search for departments within the enterprise by keywords (such as department name).
Knowledge Base Node Create Doc Create a new document in the Dingtalk knowledge base.
Knowledge Base Node Batch Get Nodes Batch retrieve detailed information about multiple nodes through a list of node IDs.
Knowledge Base Node Get Node By Link Get node information through a document link.
Knowledge Base Node Get Node List Get a list of nodes within a knowledge base space.
Knowledge Base Node Get Workspace Node Get detailed information about a specific node in the knowledge base.
Knowledge Base Space Create Workspace Create a new Dingtalk knowledge base (space).
Knowledge Base Space Batch Get Workspaces Batch retrieve detailed information about multiple knowledge bases through a list of knowledge base IDs.
Knowledge Base Space Get Workspace Get detailed information about a knowledge base space by ID.
Knowledge Base Space Get Workspaces Get a list of knowledge bases within the enterprise.
Worksheet Create Worksheet Create a new worksheet in a specified Dingtalk smart spreadsheet (Workbook).
Worksheet Delete Worksheet Delete a worksheet from a specified Dingtalk smart spreadsheet.
Worksheet Get Worksheet Get detailed information about a specified worksheet.
Worksheet Get Worksheets Get a list of all worksheets in a specified smart spreadsheet.
Column Delete Columns Delete specified columns from a Dingtalk smart spreadsheet.
Column Set Columns Visibility Set the visibility (show/hide) of specified columns in a Dingtalk smart spreadsheet.
Column Insert Columns Before Insert new columns before a specified column.
Row Delete Rows Delete specified rows from a Dingtalk smart spreadsheet.
Row Set Rows Visibility Set the visibility (show/hide) of specified rows in a Dingtalk smart spreadsheet.
Row Insert Rows Before Insert new rows before a specified row.
Row Append Rows Append one or more rows after the last row of existing data in a column range; row count is resolved automatically. Not idempotent.
Row Insert Rows Before with Data Insert rows before a row and write cell data in one step; requires Confirm=true. Not idempotent.
Cell Range Data Get Range Data Retrieve data from a specified cell range in a Dingtalk smart spreadsheet.
Cell Range Data Update Range Data Update data in a specified cell range in a Dingtalk smart spreadsheet.
Cell Range Data Clear Range Content Clear all content (data and formatting) in a specified range of a Dingtalk smart spreadsheet.
Cell Range Data Clear Range Data Clear data in a specified range of a Dingtalk smart spreadsheet, but preserve formatting.
Message Send Work Notice Send a Dingtalk work notification to specified users.
Message Get Message Status Query the sending status of a Dingtalk work notification message.
Message Recall Message Recall a sent Dingtalk work notification.

Operation Details

Create Chat

Create a new Dingtalk group chat with comprehensive settings, including group name (1-20 characters), group owner, members (up to 40 people), chat history viewing permissions, group management permissions, and various feature switches.

Input Parameters:

  • Name: Name of the group chat (1-20 characters).
  • Owner: UserID of the group owner.
  • UserIds: Array of UserIDs for group members (maximum 40 members), also accepts comma-separated string format.

Options:

  • ShowHistoryType: Whether new members can view chat history: 0-no, 1-yes.
  • Searchable: Whether the group can be searched.
  • ValidationType: Join group verification type: 0-no verification required, 1-verification required.
  • MentionAllAuthority: @all permission: 0-only group owner and administrators, 1-everyone.
  • ManagementType: Group management type: 0-everyone can manage, 1-only group owner and administrators can manage.
  • ChatBannedType: Group mute setting: 0-not muted, 1-all muted.

Output:

  • ChatData (object): Group chat creation result data.
  • StatusCode (number): HTTP status code.
  • ErrorMessage (string): Error message if an error occurs.

Create Doc

Create a new document in the Dingtalk knowledge base.

Input Parameters:

  • WorkspaceId: ID of the knowledge base.
  • Name: Name of the document to create.
  • DocType: Document type: DOC (text), WORKBOOK (spreadsheet), MIND (mind map), FOLDER (folder).
  • OperatorId: UnionID of the user performing the operation.

Options:

  • ParentNodeId: Parent node ID. If not provided, the document will be created in the root directory.
  • TemplateId: Document template ID.
  • TemplateType: Document template type: public_template, team_template, user_template.

Output:

  • DocData (object): Information about the created document.
  • StatusCode (number): HTTP status code.
  • ErrorMessage (string): Error message if an error occurs.

Create User

Create a new user directly in the Dingtalk organizational directory.

Input Parameters:

  • Name: Employee name, must be 1-64 characters long.
  • Mobile: Employee mobile number, must be unique within the organization.
  • DeptIdList: Comma-separated list of department IDs the user belongs to.

Options:

  • JobNumber: Employee job number.
  • Email: Employee email address.
  • Title: Position/title.
  • WorkPlace: Work location.
  • Remark: Additional remarks.
  • Extension: Additional extension information.

Output:

  • UserData (object): User creation result data.
  • StatusCode (number): HTTP status code.
  • ErrorMessage (string): Error message if an error occurs.

Create Worksheet

Create a new worksheet in a Dingtalk smart spreadsheet.

Input Parameters:

  • WorkbookId: ID of the target smart spreadsheet in which the worksheet will be created.
  • SheetName: Name of the new worksheet to create.
  • OperatorId: UserID of the operator performing this operation.

Output:

  • SheetId (string): ID of the created worksheet.
  • SheetName (string): Name of the created worksheet.
  • Created (bool): Whether the worksheet was successfully created.
  • StatusCode (number): HTTP status code.
  • ErrorMessage (string): Error message if an error occurs.

Create Workspace

Create a new knowledge base (space) in Dingtalk.

Input Parameters:

  • Name: Name of the knowledge base to create.
  • OperatorId: UserID of the operator.

Options:

  • Description: Description of the knowledge base.

Output:

  • WorkspaceData (object): Information about the created knowledge base space.
  • StatusCode (number): HTTP status code.
  • ErrorMessage (string): Error message if an error occurs.

Delete Columns

Delete specified columns from a Dingtalk smart spreadsheet.

Input Parameters:

  • WorkbookId: Unique identifier of the smart spreadsheet.
  • SheetId: Unique identifier of the worksheet within the smart spreadsheet.
  • Column: Starting column index to delete (1-based).
  • ColumnCount: Number of columns to delete (default is 1).
  • OperatorId: ID of the operator performing the operation.

Output:

  • Success (bool): Indicates whether the column deletion operation was successful.
  • DeletedColumnCount (number): Actual number of columns deleted.
  • StatusCode (number): Operation status code: 200 (success), 500 (server error), -1 (parameter error).
  • ErrorMessage (string): Error message if the operation fails, otherwise empty.

Delete Rows

Delete specified rows from a Dingtalk smart spreadsheet.

Input Parameters:

  • WorkbookId: Unique identifier of the smart spreadsheet.
  • SheetId: Unique identifier of the worksheet within the smart spreadsheet.
  • Row: Starting row index to delete (1-based).
  • RowCount: Number of rows to delete (default is 1).
  • OperatorId: ID of the operator performing the operation.

Output:

  • Success (bool): Indicates whether the row deletion operation was successful.
  • DeletedRowCount (number): Actual number of rows deleted.
  • StatusCode (number): Operation status code: 200 (success), 500 (server error), -1 (parameter error).
  • ErrorMessage (string): Error message if the operation fails, otherwise empty.

Delete Worksheet

Delete a worksheet from a Dingtalk smart spreadsheet.

Input Parameters:

  • WorkbookId: ID of the smart spreadsheet containing the worksheet to delete.
  • SheetId: ID of the worksheet to delete.
  • OperatorId: UserID of the operator performing this operation.

Output:

  • Deleted (bool): Whether the worksheet was successfully deleted.
  • StatusCode (number): HTTP status code.
  • ErrorMessage (string): Error message if an error occurs.

Batch Get Nodes

Batch retrieve detailed information about multiple nodes by providing a list of node IDs.

Input Parameters:

  • NodeIds: Comma-separated list of node IDs.
  • OperatorId: ID of the operating user.

Output:

  • NodeList (object-array): List of nodes.
  • StatusCode (number): HTTP status code.
  • ErrorMessage (string): Error message if an error occurs.

Batch Get Workspaces

Batch retrieve detailed information about multiple Dingtalk knowledge bases.

Input Parameters:

  • WorkspaceIds: Comma-separated list of knowledge base space IDs.
  • OperatorId: ID of the operating user.

Output:

  • WorkspaceList (object-array): List of successfully retrieved knowledge bases.
  • StatusCode (number): HTTP status code.
  • ErrorMessage (string): Error message if an error occurs.

Get Chat Info

Get Dingtalk group chat information through openConversationId.

Options:

  • ChatId: The openConversationId of the group chat to retrieve information about.

Output:

  • ChatInfo (object): Group chat information details.
  • StatusCode (number): HTTP status code.
  • ErrorMessage (string): Error message if an error occurs.

Get Dept Detail

Get detailed information about a specific department in the Dingtalk organizational structure through department ID.

Input Parameters:

  • DeptId: Department ID to query details for.

Options:

  • Language: Language setting, default is zh_CN, options: zh_CN, en_US.

Output:

  • DeptDetail (object): Department detailed information.
  • StatusCode (number): HTTP status code.
  • ErrorMessage (string): Error message if an error occurs.

Get Dept List

Get a list of sub-departments under a specified parent department in the Dingtalk organizational structure.

Options:

  • DeptId: Parent department ID, default is 1 (root department).
  • Language: Language setting, default is zh_CN, options: zh_CN, en_US.

Output:

  • Departments (object-array): List of department information.
  • TotalCount (number): Number of departments returned.
  • StatusCode (number): HTTP status code.
  • ErrorMessage (string): Error message if an error occurs.

Get Dept Users

Get a list of all users within a Dingtalk enterprise, supporting paginated queries and specific department queries.

Options:

  • Cursor: Pagination cursor, default is 0.
  • Size: Page size, default is 50, maximum is 100.
  • DeptId: Department ID to get users from. If not specified, defaults to the root department (1).

Output:

  • Users (object-array): List of user information.
  • HasMore (bool): Whether there is more data.
  • StatusCode (number): HTTP status code.
  • ErrorMessage (string): Error message if an error occurs.

Get Message Status

Query the sending status of a Dingtalk work notification message.

Input Parameters:

  • AgentId: Agent ID of the application.
  • TaskId: Task ID returned when sending the message.

Output:

  • MessageStatus (object): Message status details.
  • StatusCode (number): HTTP status code.
  • ErrorMessage (string): Error message if an error occurs.

Get Node By Link

Retrieve Dingtalk node information through a URL link.

Input Parameters:

  • NodeUrl: URL link of the node to retrieve.
  • OperatorId: ID of the operating user.

Output:

  • NodeData (object): Node information retrieved through the URL.
  • StatusCode (number): HTTP status code.
  • ErrorMessage (string): Error message if an error occurs.

Get Node List

Get a list of nodes in a Dingtalk knowledge base space.

Input Parameters:

  • WorkspaceId: Knowledge base space ID.
  • OperatorId: ID of the operating user.
  • ParentNodeId: Parent node ID, empty for root level.

Options:

  • MaxResults: Maximum results per page (1-100).
  • NextToken: Next page token for pagination.

Output:

  • NodeList (object-array): List of nodes.
  • NextToken (string): Next page token.
  • StatusCode (number): HTTP status code.
  • ErrorMessage (string): Error message if an error occurs.

Get Range Data

Retrieve data from a specified cell range in a Dingtalk smart spreadsheet.

Input Parameters:

  • WorkbookId: ID of the target smart spreadsheet.
  • SheetId: ID of the target worksheet.
  • RangeAddress: Cell range address to retrieve data from (e.g., 'A1:C3').
  • OperatorId: ID of the operator performing the operation.

Output:

  • RangeData (object): Range data containing values and metadata.
  • StatusCode (number): HTTP status code.
  • ErrorMessage (string): Error message if an error occurs.

Get User

Get Dingtalk user details through userId or mobile number.

Options:

  • UserId: User userId (mutually exclusive with Mobile).
  • Mobile: User mobile number (mutually exclusive with UserId).

Output:

  • UserData (object): User details.
  • StatusCode (number): HTTP status code.
  • ErrorMessage (string): Error message if an error occurs.

Get User Count

Get the total number of users in the Dingtalk organization.

Options:

  • OnlyActive: Whether to count only active users. Default is yes.

Output:

  • UserCount (number): Total number of users in the organization.
  • StatusCode (number): HTTP status code.
  • ErrorMessage (string): Error message if an error occurs.

Get UserID By UnionID

Get Dingtalk user ID through union ID.

Input Parameters:

  • UnionId: Union ID of the user to convert.

Output:

  • UserId (string): User ID corresponding to the union ID.
  • ContactType (number): User type: 0-internal employee, 1-external contact.
  • StatusCode (number): HTTP status code.
  • ErrorMessage (string): Error message if an error occurs.

Get Worksheet

Get Dingtalk worksheet details through smart spreadsheet ID and worksheet ID.

Input Parameters:

  • WorkbookId: ID of the smart spreadsheet containing the worksheet.
  • SheetId: ID of the worksheet to retrieve.
  • OperatorId: UserID of the operator performing this operation.

Output:

  • SheetData (object): Worksheet detailed information.
  • StatusCode (number): HTTP status code.
  • ErrorMessage (string): Error message if an error occurs.

Get Worksheets

Get all worksheets in a Dingtalk smart spreadsheet.

Input Parameters:

  • WorkbookId: ID of the smart spreadsheet to get all worksheets from.
  • OperatorId: UserID of the operator performing this operation.

Output:

  • SheetList (object-array): List of all worksheets.
  • SheetCount (number): Total number of worksheets.
  • StatusCode (number): HTTP status code.
  • ErrorMessage (string): Error message if an error occurs.

Get Workspace

Get Dingtalk knowledge base space information through knowledge base space ID.

Input Parameters:

  • WorkspaceId: Knowledge base space ID to retrieve information about.
  • OperatorId: UserID of the operator.

Output:

  • WorkspaceData (object): Knowledge base space detailed information.
  • StatusCode (number): HTTP status code.
  • ErrorMessage (string): Error message if an error occurs.

Get Workspace Node

Get detailed information about a specific node in a Dingtalk knowledge base space.

Input Parameters:

  • NodeId: Node ID to retrieve information about.
  • OperatorId: UserID of the operator.

Output:

  • NodeData (object): Node detailed information.
  • StatusCode (number): HTTP status code.
  • ErrorMessage (string): Error message if an error occurs.

Get Workspaces

Get a list of Dingtalk knowledge bases.

Input Parameters:

  • OperatorId: ID of the operating user.

Options:

  • MaxResults: Maximum results per page (1-100).
  • NextToken: Next page token for pagination.

Output:

  • WorkspaceList (object-array): List of knowledge bases.
  • NextToken (string): Next page token.
  • StatusCode (number): HTTP status code.
  • ErrorMessage (string): Error message if an error occurs.

Search Departments

Search for departments within a Dingtalk enterprise by keywords such as department name, supporting fuzzy search and pagination.

Input Parameters:

  • QueryWord: Search keyword (supports department name).

Options:

  • Offset: Pagination offset, default is 0.
  • Size: Page size, default is 10, maximum is 20.

Output:

  • SearchResult (object): Search results from the API. Contains department list and pagination information.
  • StatusCode (number): HTTP status code.
  • ErrorMessage (string): Error message if an error occurs.

Search Users

Search for users within a Dingtalk enterprise by keywords such as name and mobile number, supporting fuzzy search and pagination.

Input Parameters:

  • QueryWord: Search keyword (supports name, mobile number, email).

Options:

  • Offset: Pagination offset, default is 0.
  • Size: Page size, default is 10, maximum is 20.

Output:

  • SearchResult (object): Search results from the API. Contains user list and pagination information.
  • StatusCode (number): HTTP status code.
  • ErrorMessage (string): Error message if an error occurs.

Send Work Notice

Send a text or Markdown format Dingtalk work notification (enterprise conversation message) to specified users.

Input Parameters:

  • AgentId: AgentId of the Dingtalk application.
  • UserIds: Comma-separated list of userIds of recipients.
  • MsgType: Message type: text/markdown.
  • Content: Message content.

Options:

  • Title: Markdown title (required for markdown type).

Output:

  • MessageData (object): Message sending result data.
  • StatusCode (number): HTTP status code.
  • ErrorMessage (string): Error message if an error occurs.

Set Columns Visibility

Set the visibility (show/hide) of specified columns in a Dingtalk smart spreadsheet.

Input Parameters:

  • WorkbookId: Unique identifier of the smart spreadsheet.
  • SheetId: Unique identifier of the worksheet within the smart spreadsheet.
  • Column: Starting column index to set visibility for (1-based).
  • ColumnCount: Number of columns to set visibility for (default is 1).
  • Visibility: Visibility status: 'visible' for show, 'hidden' for hide.
  • OperatorId: ID of the operator performing the operation.

Output:

  • Success (bool): Indicates whether the column visibility operation was successful.
  • AffectedColumnCount (number): Actual number of columns affected.
  • Visibility (string): Set visibility status ('visible' or 'hidden').
  • StatusCode (number): Operation status code: 200 (success), 500 (server error), -1 (parameter error).
  • ErrorMessage (string): Error message if the operation fails, otherwise empty.

Set Rows Visibility

Set the visibility (show/hide) of specified rows in a Dingtalk smart spreadsheet.

Input Parameters:

  • WorkbookId: Unique identifier of the smart spreadsheet.
  • SheetId: Unique identifier of the worksheet within the smart spreadsheet.
  • Row: Starting row index to set visibility for (1-based).
  • RowCount: Number of rows to set visibility for (default is 1).
  • Visibility: Visibility status: 'visible' for show, 'hidden' for hide.
  • OperatorId: ID of the operator performing the operation.

Output:

  • Success (bool): Indicates whether the row visibility operation was successful.
  • AffectedRowCount (number): Actual number of rows affected.
  • Visibility (string): Set visibility status ('visible' or 'hidden').
  • StatusCode (number): Operation status code: 200 (success), 500 (server error), -1 (parameter error).
  • ErrorMessage (string): Error message if the operation fails, otherwise empty.

Clear Range Content

Clear all content, including data and formatting, in a specified range of a Dingtalk smart spreadsheet.

Input Parameters:

  • WorkbookId: ID of the target smart spreadsheet.
  • SheetId: ID of the target worksheet.
  • RangeAddress: Cell range address to clear all content from (e.g., 'A1:C3').
  • OperatorId: ID of the operator performing the operation.

Output:

  • ClearResult (object): Clear operation result.
  • StatusCode (number): HTTP status code.
  • ErrorMessage (string): Error message if an error occurs.

Clear Range Data

Clear data in a specified range of a Dingtalk smart spreadsheet, but preserve formatting.

Input Parameters:

  • WorkbookId: ID of the target smart spreadsheet.
  • SheetId: ID of the target worksheet.
  • RangeAddress: Cell range address to clear data from (e.g., 'A1:C3').
  • OperatorId: ID of the operator performing the operation.

Output:

  • ClearResult (object): Clear operation result.
  • StatusCode (number): HTTP status code.
  • ErrorMessage (string): Error message if an error occurs.

Insert Columns Before

Insert columns before a specified column index in a Dingtalk smart spreadsheet.

Input Parameters:

  • WorkbookId: Unique identifier of the smart spreadsheet.
  • SheetId: Unique identifier of the worksheet within the smart spreadsheet.
  • Column: Column index before which new columns will be inserted (1-based).
  • ColumnCount: Number of columns to insert (default is 1).
  • OperatorId: ID of the operator performing the operation.

Output:

  • Success (bool): Indicates whether the column insertion operation was successful.
  • StatusCode (number): Operation status code: 200 (success), 500 (server error), -1 (parameter error).
  • ErrorMessage (string): Error message if the operation fails, otherwise empty.

Insert Rows Before

Insert rows before a specified row index in a Dingtalk smart spreadsheet.

Input Parameters:

  • WorkbookId: Unique identifier of the smart spreadsheet.
  • SheetId: Unique identifier of the worksheet within the smart spreadsheet.
  • Row: Row index before which new rows will be inserted (1-based).
  • RowCount: Number of rows to insert (default is 1).
  • OperatorId: ID of the operator performing the operation.

Output:

  • Success (bool): Indicates whether the row insertion operation was successful.
  • StatusCode (number): Operation status code: 200 (success), 500 (server error), -1 (parameter error).
  • ErrorMessage (string): Error message if the operation fails, otherwise empty.

Append Rows

Append one or more rows of data after the last row of existing data in a specified column range of a Dingtalk smart worksheet. The action queries the current row count and writes at the end, so you do not need to compute the next row manually. Not idempotent — retries append duplicate rows.

Input Parameters:

  • WorkbookId: Unique ID of the target smart workbook (from Get Node List, Get Workspace Node, or the workbook URL).
  • SheetId: Unique ID of the worksheet tab (not the visible tab name); use Get Worksheets.
  • RangeAddress: Column range in A1-style notation (e.g. A:C or A1:C10); column span must match each row in Values.
  • Values: JSON string of a 2D array; each inner array is one row of string cell values.
  • OperatorId: Operator’s unionId for permission checks; from Get User or Search Users.

Output:

  • AppendResult (object): Contains a1Notation, appendedRange (e.g. A6:C7), appendedRows, and upstream fields when successful.
  • Summary (string): One-sentence outcome for the agent on success; empty when failed.
  • Hint (string): Suggested next step when failed; empty on success.
  • Retryable (bool): Whether retrying the same request may succeed.
  • OriginalStatusCode (number): Last upstream HTTP status; 0 if the request did not reach upstream.
  • StatusCode (number): 200 success, -1 parameter error, 500 system/network error.
  • ErrorMessage (string): Error message if any; empty on success.

Insert Rows Before with Data

Insert rows before a specified 1-based row index and fill them with data in a single call. The number of rows inserted equals the number of rows in Values. Existing rows at and below Row shift down. Not idempotent — retries insert duplicate rows. You must set Confirm to true to run the write.

Input Parameters:

  • WorkbookId: Unique ID of the target smart workbook.
  • SheetId: Unique ID of the worksheet tab; use Get Worksheets.
  • Row: 1-based row index before which new rows are inserted (e.g. 3 inserts above row 3).
  • Values: JSON string of a 2D array; row count determines how many rows are inserted.
  • StartColumn: Starting column letter for writing data; default A (supports AA, etc.).
  • OperatorId: Operator’s unionId for permission checks.
  • Confirm: Must be true to perform the insert and write (safety guard for non-idempotent writes).

Output:

  • InsertedRows (number): Number of rows inserted (matches Values row count); 0 if insertion failed.
  • UpdateResult (object): Write result including a1Notation for the range written; empty object if the write step failed after insert.
  • Summary (string): One-sentence outcome for the agent on success; empty when failed.
  • Hint (string): Suggested next step when failed; empty on success.
  • Retryable (bool): Whether retrying the same request may succeed.
  • OriginalStatusCode (number): Last upstream HTTP status; 0 if the request did not reach upstream.
  • StatusCode (number): 200 success, -1 parameter error, 500 system/network error.
  • ErrorMessage (string): Error message if any; empty on success.

Recall Message

Recall a Dingtalk work notification message.

Input Parameters:

  • AgentId: Agent ID of the application.
  • MsgTaskId: Message task ID returned when sending the message.

Output:

  • RecallResult (bool): Whether the message was successfully recalled.
  • StatusCode (number): HTTP status code.
  • ErrorMessage (string): Error message if an error occurs.

Update Range Data

Update range data in a Dingtalk smart spreadsheet.

Input Parameters:

  • WorkbookId: ID of the target smart spreadsheet.
  • SheetId: ID of the target worksheet.
  • RangeAddress: Cell range address to update (e.g., 'A1:C3').
  • Values: JSON string of two-dimensional array values to update.
  • OperatorId: ID of the operator performing the operation.

Output:

  • UpdateResult (object): Update operation result.
  • StatusCode (number): HTTP status code.
  • ErrorMessage (string): Error message if an error occurs.

5. Example Usage

This section will guide you through creating a simple workflow to send a text message to specified users in Dingtalk.

Workflow Overview

A basic workflow contains three nodes: Start -> Dingtalk: Send Work Notice -> Answer.

Step-by-Step Guide

  1. Add Tool Node:
    • In the workflow canvas, click the "+" button to add a new node.
    • Select the "Tools" tab in the pop-up panel.
    • Find and select Dingtalk in the tools list.
    • In the Dingtalk supported operations list, click to select Send Work Notice, which will add a corresponding node to the canvas.
  2. Configure Node:
    • Click the newly added Send Work Notice node, and the configuration panel for this node will expand on the right side.
    • Credentials Configuration: At the top of the panel, find the credentials field. Click the dropdown menu and select your configured Dingtalk credentials.
    • Parameter Filling: Fill in the following parameters according to your needs:
    • AgentId: Enter the AgentId of the application you created on the Dingtalk Open Platform. For example: 123456789.
    • UserIds: Enter the UserID of the users who will receive the message. Can be one or more, separated by commas. For example: manager001,user002.
    • MsgType: Enter the message type. For plain text messages, enter text.
    • Content: Enter the message content you want to send. For example: This is a test message from the GoInsight automated workflow.
  3. Run and Verify:
    • When all required parameters are filled in correctly, the error message in the upper right corner of the workflow canvas will disappear.
    • Click the "Test Run" button in the upper right corner of the canvas to execute the workflow.
    • After successful execution, you can click the log icon in the upper right corner to view the detailed input and output of the node and verify whether the operation was successful. Meanwhile, the specified users should receive your sent message in Dingtalk.

Final Workflow Display

After completing the above steps, your entire workflow is configured. Click "Test Run", and a work notification will be successfully sent to the Dingtalk client of the specified users.

6. FAQs

Q: Why did my message fail to send?

A: Please check the following:

  • Credentials and AgentId: Ensure that the AgentId you entered in the node matches the selected credentials (AppKey/AppSecret).
  • Is UserID correct: Confirm that the user IDs in the UserIds field are valid and exist in your enterprise organization.
  • Application Permissions: Log in to the Dingtalk Open Platform and check whether your application has the "send work notification" interface permission.
  • IP Whitelist: Ensure that the outbound IP address of the GoInsight server has been added to your Dingtalk application's IP whitelist.
  • Check Error Output: Check the ErrorMessage field in the node output, which usually provides the specific reason for failure.

Q: How do I get a user's UserID?

A: You can obtain it in the following ways:

  • Use GoInsight Node: In your workflow, you can use the Get User or Search Users operation to query user details, which includes the UserID.
  • Dingtalk Management Backend: Log in to your enterprise's Dingtalk management backend, find the corresponding employee in the "Directory", and view their personal profile to find the UserID.

Q: I received a permission error (such as 401/403), what should I do?

A: Permission errors are usually related to credentials or application settings. Please check:

  • Credentials Validity: Confirm that the AppKey and AppSecret configured in GoInsight are correct and not expired.
  • Interface Permission Scope: On the Dingtalk Open Platform, check whether your application has applied for and been approved for the API interface permissions you want to call. For example, to create users, you need permissions related to "directory management".
  • IP Whitelist: This is one of the most common reasons. Please ensure that the IP address of the GoInsight platform server is correctly configured in your Dingtalk application's IP whitelist.

7. Official Documentation

For a deeper understanding of the details and advanced features of the Dingtalk API, please refer to the official documentation:

Dingtalk Official API Documentation

Was This Page Helpful?
Discussion

Leave a Reply.

Your email address will not be published. Required fields are marked*

loading...
No Results