Helpscout Skill
Description
This skill interacts with Helpscout to fetch conversations from specific inboxes and send replies. It is designed to streamline customer support operations directly from OpenClaw.
Features
- - Fetch conversations from multiple Helpscout inboxes
- Send replies to conversations (customer-visible or internal notes)
- Filter by status, folder, assignee, customer, tags, and more
- Sort conversations by various fields
- Embed thread data directly in the response
- Securely authenticate using an API key and App Secret
- Handle potential errors like invalid credentials or network issues gracefully
Setup Instructions
To use this skill, you need to configure Helpscout credentials and specify the IDs of the inboxes you want to fetch conversations from.
1. Retrieve Helpscout API Key & App Secret
- 1. Go to your Helpscout account.
- Navigate to Manage > Apps.
- Create or open your app to retrieve the following details:
-
API Key
-
App Secret
2. Collect Inbox IDs
- 1. Retrieve the IDs of the inboxes you want to fetch conversations from using Helpscout's API documentation.
3. Save Credentials in OpenClaw
Use the following command to save your Helpscout credentials:
CODEBLOCK0
4. Verify Configuration
To ensure the credentials are properly set, check your configuration:
CODEBLOCK1
Make sure the helpscout object looks correct (avoid sharing the API_KEY or APP_SECRET).
Usage
Basic Usage
Fetch all active conversations from configured inboxes:
CODEBLOCK2
Advanced Filtering
CODEBLOCK3
Sending Replies
CODEBLOCK4
sendReply Options
| Parameter | Type | Description |
|---|
| INLINECODE3 | string | Required. The reply text (HTML supported) |
| INLINECODE4 |
number | Inbox ID - required if
customerId not provided (auto-fetches customer) |
|
customerId | number | Customer ID - if not provided, will be auto-fetched using
inboxId |
|
imported | boolean | Mark as imported (won't email customer). Default:
false |
|
status | string | Conversation status after reply:
active,
pending,
closed. Optional. |
|
userId | number | User ID sending the reply. Optional (defaults to authenticated user). |
createNote
| Parameter | Type | Description |
|---|
| INLINECODE15 | string | Required. The note text (HTML supported) |
Available Options (fetchConversations)
| Parameter | Type | Description |
|---|
| INLINECODE16 | string | Filter by status: active, pending, closed, spam, or all (default: active) |
| INLINECODE23 |
number | Filter by folder ID |
|
assignedTo | number | Filter by user ID |
|
customerId | number | Filter by customer ID |
|
number | number | Filter by conversation number |
|
modifiedSince | string | ISO8601 date to filter conversations modified after this date |
|
sortField | string | Sort field:
createdAt,
mailboxId,
modifiedAt,
number,
score,
status,
subject (default:
createdAt) |
|
sortOrder | string | Sort order:
asc or
desc (default:
desc) |
|
tag | string | Filter by tag name |
|
query | string | Advanced search query in
fieldId:value format |
|
embed | string | Comma-separated list of resources to embed:
threads |
|
page | number | Page number for pagination (default: 1) |
Security Best Practices
- - Never hardcode credentials into your codebase.
- Use OpenClaw's
config.apply system for securely managing sensitive details. - Avoid sharing sensitive parts of your configuration output (
API_KEY and APP_SECRET) with others.
Contribution Guidelines
- - Ensure compliance with Helpscout's API usage policies.
- Add documentation for any new features added.
Helpscout 技能
描述
该技能与 Helpscout 交互,用于从特定收件箱获取对话并发送回复。它旨在直接从 OpenClaw 简化客户支持操作。
功能特性
- - 从多个 Helpscout 收件箱获取对话
- 发送对话回复(客户可见或内部备注)
- 按状态、文件夹、分配对象、客户、标签等条件筛选
- 按多种字段对对话进行排序
- 直接在响应中嵌入线程数据
- 使用 API 密钥和应用密钥进行安全认证
- 优雅处理无效凭证或网络问题等潜在错误
设置说明
要使用此技能,您需要配置 Helpscout 凭证并指定要获取对话的收件箱 ID。
1. 获取 Helpscout API 密钥和应用密钥
- 1. 登录您的 Helpscout 账户。
- 导航至 管理 > 应用。
- 创建或打开您的应用以获取以下信息:
-
API 密钥
-
应用密钥
2. 收集收件箱 ID
- 1. 使用 Helpscout 的 API 文档 获取您要从中获取对话的收件箱 ID。
3. 在 OpenClaw 中保存凭证
使用以下命令保存您的 Helpscout 凭证:
bash
cat ~/.openclaw/openclaw.json | jq .skills.entries.helpscout = {
enabled: true,
env: {
API_KEY: your-api-key,
APP_SECRET: your-app-secret,
INBOX_IDS: [inbox-id-1, inbox-id-2]
}
} | openclaw gateway config.apply
4. 验证配置
为确保凭证设置正确,请检查您的配置:
bash
openclaw gateway config.get
确保 helpscout 对象看起来正确(避免分享 APIKEY 或 APPSECRET)。
使用方法
基本用法
从已配置的收件箱获取所有活跃对话:
javascript
const { fetchAllInboxes } = require(./index.js);
// 获取所有活跃对话(默认)
const results = await fetchAllInboxes();
高级筛选
javascript
const { fetchConversations } = require(./index.js);
// 从特定收件箱获取已关闭对话
const conversations = await fetchConversations(321755, {
status: closed,
sortField: modifiedAt,
sortOrder: desc,
page: 1
});
// 获取分配给特定用户的对话
const assigned = await fetchConversations(321755, {
assignedTo: 782728,
status: active
});
// 获取带有特定标签的对话
const tagged = await fetchConversations(321755, {
tag: urgent,
status: active
});
// 获取嵌入线程的对话
const withThreads = await fetchConversations(321755, {
embed: threads,
status: active
});
// 高级搜索查询
const searched = await fetchConversations(321755, {
query: (customerEmail:user@example.com),
status: all
});
发送回复
javascript
const { sendReply } = require(./index.js);
// 发送客户可见的回复(将发送邮件)
await sendReply(3227506031, {
text: 您好,\n\n感谢您的来信!\n\n此致敬礼,,
inboxId: 321755 // 必需,用于自动获取客户 ID
});
// 发送回复但不发送邮件给客户(标记为导入)
await sendReply(3227506031, {
text: 草稿回复 - 尚未发送给客户,
customerId: 856475517, // 或提供 inboxId 以自动获取
imported: true
});
// 发送回复并关闭对话
await sendReply(3227506031, {
text: 全部完成!如需其他帮助,请随时告知。,
inboxId: 321755,
status: closed
});
// 创建内部备注
const { createNote } = require(./index.js);
await createNote(3227506031, 内部备注:客户来电,问题已解决。);
sendReply 选项
| 参数 | 类型 | 描述 |
|---|
| text | 字符串 | 必需。 回复文本(支持 HTML) |
| inboxId |
数字 | 收件箱 ID - 如果未提供 customerId 则必需(自动获取客户) |
| customerId | 数字 | 客户 ID - 如果未提供,将使用 inboxId 自动获取 |
| imported | 布尔值 | 标记为导入(不会发送邮件给客户)。默认值:false |
| status | 字符串 | 回复后的对话状态:active、pending、closed。可选。 |
| userId | 数字 | 发送回复的用户 ID。可选(默认为认证用户)。 |
createNote
| 参数 | 类型 | 描述 |
|---|
| text | 字符串 | 必需。 备注文本(支持 HTML) |
可用选项(fetchConversations)
| 参数 | 类型 | 描述 |
|---|
| status | 字符串 | 按状态筛选:active、pending、closed、spam 或 all(默认:active) |
| folderId |
数字 | 按文件夹 ID 筛选 |
| assignedTo | 数字 | 按用户 ID 筛选 |
| customerId | 数字 | 按客户 ID 筛选 |
| number | 数字 | 按对话编号筛选 |
| modifiedSince | 字符串 | ISO8601 日期,筛选在此日期之后修改的对话 |
| sortField | 字符串 | 排序字段:createdAt、mailboxId、modifiedAt、number、score、status、subject(默认:createdAt) |
| sortOrder | 字符串 | 排序顺序:asc 或 desc(默认:desc) |
| tag | 字符串 | 按标签名称筛选 |
| query | 字符串 | 高级搜索查询,格式为 fieldId:value |
| embed | 字符串 | 要嵌入的资源列表,以逗号分隔:threads |
| page | 数字 | 分页页码(默认:1) |
安全最佳实践
- - 切勿将凭证硬编码到代码库中。
- 使用 OpenClaw 的 config.apply 系统安全地管理敏感信息。
- 避免与他人分享配置输出中的敏感部分(APIKEY 和 APPSECRET)。
贡献指南
- - 确保符合 Helpscout 的 API 使用政策。
- 为添加的任何新功能提供文档。