composio-drive
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseGoogle Drive via Composio
通过Composio操作Google Drive
Environment
环境变量
bash
COMPOSIO_API_KEY # API key
COMPOSIO_USER_ID # Entity ID (required for all requests)
COMPOSIO_CONNECTIONS # JSON with .googledrive connection IDbash
COMPOSIO_API_KEY # API密钥
COMPOSIO_USER_ID # 实体ID(所有请求均必填)
COMPOSIO_CONNECTIONS # 包含.googledrive连接ID的JSON数据Core Pattern
核心调用模式
bash
CONNECTION_ID=$(echo $COMPOSIO_CONNECTIONS | jq -r '.googledrive')
curl -s "https://backend.composio.dev/api/v3/tools/execute/ACTION_NAME" \
-H "x-api-key: $COMPOSIO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"connected_account_id": "'$CONNECTION_ID'",
"entity_id": "'$COMPOSIO_USER_ID'",
"arguments": {}
}' | jq '.data'bash
CONNECTION_ID=$(echo $COMPOSIO_CONNECTIONS | jq -r '.googledrive')
curl -s "https://backend.composio.dev/api/v3/tools/execute/ACTION_NAME" \
-H "x-api-key: $COMPOSIO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"connected_account_id": "'$CONNECTION_ID'",
"entity_id": "'$COMPOSIO_USER_ID'",
"arguments": {}
}' | jq '.data'Quick Start
快速开始
bash
undefinedbash
undefinedList files
列出文件
curl -s "https://backend.composio.dev/api/v3/tools/execute/GOOGLEDRIVE_LIST_FILES"
-H "x-api-key: $COMPOSIO_API_KEY" -H "Content-Type: application/json"
-d '{ "connected_account_id": "'$CONNECTION_ID'", "entity_id": "'$COMPOSIO_USER_ID'", "arguments": {} }' | jq
-H "x-api-key: $COMPOSIO_API_KEY" -H "Content-Type: application/json"
-d '{ "connected_account_id": "'$CONNECTION_ID'", "entity_id": "'$COMPOSIO_USER_ID'", "arguments": {} }' | jq
curl -s "https://backend.composio.dev/api/v3/tools/execute/GOOGLEDRIVE_LIST_FILES"
-H "x-api-key: $COMPOSIO_API_KEY" -H "Content-Type: application/json"
-d '{ "connected_account_id": "'$CONNECTION_ID'", "entity_id": "'$COMPOSIO_USER_ID'", "arguments": {} }' | jq
-H "x-api-key: $COMPOSIO_API_KEY" -H "Content-Type: application/json"
-d '{ "connected_account_id": "'$CONNECTION_ID'", "entity_id": "'$COMPOSIO_USER_ID'", "arguments": {} }' | jq
Search files
搜索文件
curl -s "https://backend.composio.dev/api/v3/tools/execute/GOOGLEDRIVE_SEARCH_FILES"
-H "x-api-key: $COMPOSIO_API_KEY" -H "Content-Type: application/json"
-d '{ "connected_account_id": "'$CONNECTION_ID'", "entity_id": "'$COMPOSIO_USER_ID'", "arguments": {"query": "name contains 'report'"} }' | jq
-H "x-api-key: $COMPOSIO_API_KEY" -H "Content-Type: application/json"
-d '{ "connected_account_id": "'$CONNECTION_ID'", "entity_id": "'$COMPOSIO_USER_ID'", "arguments": {"query": "name contains 'report'"} }' | jq
undefinedcurl -s "https://backend.composio.dev/api/v3/tools/execute/GOOGLEDRIVE_SEARCH_FILES"
-H "x-api-key: $COMPOSIO_API_KEY" -H "Content-Type: application/json"
-d '{ "connected_account_id": "'$CONNECTION_ID'", "entity_id": "'$COMPOSIO_USER_ID'", "arguments": {"query": "name contains 'report'"} }' | jq
-H "x-api-key: $COMPOSIO_API_KEY" -H "Content-Type: application/json"
-d '{ "connected_account_id": "'$CONNECTION_ID'", "entity_id": "'$COMPOSIO_USER_ID'", "arguments": {"query": "name contains 'report'"} }' | jq
undefinedAll Actions
所有可用操作
See references/actions.md for complete API reference including:
- Files: list, search, get metadata, download, upload, delete
- Folders: create, list contents
- Sharing: share with users
查看references/actions.md获取完整API参考,包括:
- 文件:列出、搜索、获取元数据、下载、上传、删除
- 文件夹:创建、列出内容
- 共享:与用户共享文件
Discover Actions
发现可用操作
bash
curl -s "https://backend.composio.dev/api/v2/actions?apps=googledrive" \
-H "x-api-key: $COMPOSIO_API_KEY" | jq '.items[] | {name, description}'bash
curl -s "https://backend.composio.dev/api/v2/actions?apps=googledrive" \
-H "x-api-key: $COMPOSIO_API_KEY" | jq '.items[] | {name, description}'