DingTalk Skill
Overview
This skill provides DingTalk instant messaging functions, supporting contact management, message sending and receiving operations.
Scripts
get_contacts.sh
Get all contacts with optional search filter.
limit (integer, optional, default: 50): Return limit
search (string, optional): Search keyword
add_contact.sh
Add new contact with optional nickname.
user_id (string, required): User ID
nickname (string, optional): Nickname
delete_contact.sh
Delete specified contact.
contact_id (string, required): Contact ID
get_messages.sh
Get chat history with specified contact.
contact_id (string, required): Contact ID
limit (integer, optional, default: 20): Return limit
send_message.sh
Send message to contact.
contact_id (string, required): Contact ID
content (string, required): Message content
delete_message.sh
Delete specified message.
message_id (string, required): Message ID
search_messages.sh
Keyword search message history.
keyword (string, required): Search keyword
limit (integer, optional, default: 20): Return limit
Usage
# Get contacts
./scripts/get_contacts.sh 20
# Add contact
./scripts/add_contact.sh "user123" "Nickname"
# Delete contact
./scripts/delete_contact.sh "contact_xxx"
# Get messages
./scripts/get_messages.sh "contact_xxx" 20
# Send message
./scripts/send_message.sh "contact_xxx" "Hello!"
# Delete message
./scripts/delete_message.sh "msg_xxx"
# Search messages
./scripts/search_messages.sh "hello" 10
Return Format
Success Response
{
"success": true,
"data": { ... },
"message": "Operation successful"
}
Error Response
{
"success": false,
"error": "Error message",
"message": "Operation failed"
}
Script-specific Response Data
get_contacts.sh
- Success:
data contains an array of contact objects:[
{
"id": "contact_abc123",
"user_id": "user123",
"nickname": "John",
"remark": "",
"added_at": "2025-04-01T12:00:00"
}
]
add_contact.sh
- Success:
data contains the added contact object:{
"id": "contact_abc123",
"user_id": "user123",
"nickname": "John",
"remark": "",
"added_at": "2025-04-01T12:00:00"
}
delete_contact.sh
get_messages.sh
- Success:
data contains an array of message objects:[
{
"id": "msg_abc123",
"contact_id": "contact_abc123",
"content": "Hello!",
"type": "text",
"direction": "sent",
"timestamp": "2025-04-01T12:00:00",
"read": true
}
]
send_message.sh
- Success:
data contains the sent message object:{
"id": "msg_abc123",
"contact_id": "contact_abc123",
"content": "Hello!",
"type": "text",
"direction": "sent",
"timestamp": "2025-04-01T12:00:00",
"read": true
}
delete_message.sh
search_messages.sh
- Success:
data contains an array of matching message objects:[
{
"id": "msg_abc123",
"contact_id": "contact_abc123",
"content": "Hello world!",
"type": "text",
"direction": "sent",
"timestamp": "2025-04-01T12:00:00",
"read": true
}
]
1---2name: dingtalk3description: DingTalk skill - Provides contact management, message sending and receiving functions for DingTalk4license: Apache-2.05---67# DingTalk Skill89## Overview1011This skill provides DingTalk instant messaging functions, supporting contact management, message sending and receiving operations.1213## Scripts1415### get_contacts.sh16Get all contacts with optional search filter.17- `limit` (integer, optional, default: 50): Return limit18- `search` (string, optional): Search keyword1920### add_contact.sh21Add new contact with optional nickname.22- `user_id` (string, required): User ID23- `nickname` (string, optional): Nickname2425### delete_contact.sh26Delete specified contact.27- `contact_id` (string, required): Contact ID2829### get_messages.sh30Get chat history with specified contact.31- `contact_id` (string, required): Contact ID32- `limit` (integer, optional, default: 20): Return limit3334### send_message.sh35Send message to contact.36- `contact_id` (string, required): Contact ID37- `content` (string, required): Message content3839### delete_message.sh40Delete specified message.41- `message_id` (string, required): Message ID4243### search_messages.sh44Keyword search message history.45- `keyword` (string, required): Search keyword46- `limit` (integer, optional, default: 20): Return limit4748## Usage4950```bash51# Get contacts52./scripts/get_contacts.sh 205354# Add contact55./scripts/add_contact.sh "user123" "Nickname"5657# Delete contact58./scripts/delete_contact.sh "contact_xxx"5960# Get messages61./scripts/get_messages.sh "contact_xxx" 206263# Send message64./scripts/send_message.sh "contact_xxx" "Hello!"6566# Delete message67./scripts/delete_message.sh "msg_xxx"6869# Search messages70./scripts/search_messages.sh "hello" 1071```7273## Return Format7475### Success Response7677```json78{79 "success": true,80 "data": { ... },81 "message": "Operation successful"82}83```8485### Error Response8687```json88{89 "success": false,90 "error": "Error message",91 "message": "Operation failed"92}93```9495### Script-specific Response Data9697#### get_contacts.sh98- **Success**: `data` contains an array of contact objects:99 ```json100 [101 {102 "id": "contact_abc123",103 "user_id": "user123",104 "nickname": "John",105 "remark": "",106 "added_at": "2025-04-01T12:00:00"107 }108 ]109 ```110111#### add_contact.sh112- **Success**: `data` contains the added contact object:113 ```json114 {115 "id": "contact_abc123",116 "user_id": "user123",117 "nickname": "John",118 "remark": "",119 "added_at": "2025-04-01T12:00:00"120 }121 ```122123#### delete_contact.sh124- **Success**: `data` is empty, check `message` for confirmation:125 ```json126 {127 "success": true,128 "message": "Contact deleted successfully"129 }130 ```131132#### get_messages.sh133- **Success**: `data` contains an array of message objects:134 ```json135 [136 {137 "id": "msg_abc123",138 "contact_id": "contact_abc123",139 "content": "Hello!",140 "type": "text",141 "direction": "sent",142 "timestamp": "2025-04-01T12:00:00",143 "read": true144 }145 ]146 ```147148#### send_message.sh149- **Success**: `data` contains the sent message object:150 ```json151 {152 "id": "msg_abc123",153 "contact_id": "contact_abc123",154 "content": "Hello!",155 "type": "text",156 "direction": "sent",157 "timestamp": "2025-04-01T12:00:00",158 "read": true159 }160 ```161162#### delete_message.sh163- **Success**: `data` is empty, check `message` for confirmation:164 ```json165 {166 "success": true,167 "message": "Message deleted successfully"168 }169 ```170171#### search_messages.sh172- **Success**: `data` contains an array of matching message objects:173 ```json174 [175 {176 "id": "msg_abc123",177 "contact_id": "contact_abc123",178 "content": "Hello world!",179 "type": "text",180 "direction": "sent",181 "timestamp": "2025-04-01T12:00:00",182 "read": true183 }184 ]185 ```