hermes 初始配置
This commit is contained in:
@@ -0,0 +1,117 @@
|
||||
---
|
||||
name: formbricks-customer-survey
|
||||
title: Formbricks Customer Information Collection Survey Creation
|
||||
description: Skill for creating customer information collection surveys in Formbricks using Management API with specific field requirements.
|
||||
---
|
||||
|
||||
## Overview
|
||||
Skill for creating customer information collection surveys in Formbricks using Management API with specific field requirements.
|
||||
|
||||
## Required Fields
|
||||
- 姓名(必填)
|
||||
- 公司名称(必填)
|
||||
- 电子邮箱(必填)
|
||||
- 手机号码(必填)
|
||||
- 备注(可选)
|
||||
|
||||
## API Configuration
|
||||
- Base URL: https://form.140103.xyz
|
||||
- API Key: 33513637d4161852807df0eeb734da61
|
||||
- environmentId: cmlw3055s0008xh6f9aod3sko
|
||||
- Authentication: x-api-key header
|
||||
|
||||
## Common Issues & Solutions
|
||||
|
||||
### 1. API Format Errors
|
||||
**Problem**: "Fields are missing or incorrectly formatted" errors, especially with endings format
|
||||
**Solution**: Use the correct endings structure with proper language codes and question IDs
|
||||
|
||||
### 2. Login Issues
|
||||
**Problem**: Browser login failures with pre-configured credentials
|
||||
**Solution**: Use API authentication instead of browser login when possible
|
||||
|
||||
### 3. Questions Array Format
|
||||
**Problem**: Questions array structure not accepted
|
||||
**Solution**: Follow Formbricks API specification for question objects with proper field types
|
||||
|
||||
## API Endpoint
|
||||
POST /api/v1/management/surveys
|
||||
|
||||
## Authentication Header
|
||||
x-api-key: 33513637d4161852807df0eeb734da61
|
||||
|
||||
## Survey Payload Structure
|
||||
```json
|
||||
{
|
||||
"name": "客户信息收集问卷",
|
||||
"description": "用于收集客户基本信息的问卷",
|
||||
"environmentId": "cmlw3055s0008xh6f9aod3sko",
|
||||
"published": true,
|
||||
"endings": {
|
||||
"zh": {
|
||||
"thankYou": "感谢您的填写!",
|
||||
"nextSurveyId": null
|
||||
}
|
||||
},
|
||||
"questions": [
|
||||
{
|
||||
"id": "name",
|
||||
"type": "short_text",
|
||||
"label": {
|
||||
"zh": "姓名"
|
||||
},
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"id": "company",
|
||||
"type": "short_text",
|
||||
"label": {
|
||||
"zh": "公司名称"
|
||||
},
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"id": "email",
|
||||
"type": "email",
|
||||
"label": {
|
||||
"zh": "电子邮箱"
|
||||
},
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"id": "phone",
|
||||
"type": "tel",
|
||||
"label": {
|
||||
"zh": "手机号码"
|
||||
},
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"id": "remarks",
|
||||
"type": "long_text",
|
||||
"label": {
|
||||
"zh": "备注"
|
||||
},
|
||||
"required": false
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
## Troubleshooting Steps
|
||||
1. If API returns format errors, verify endings structure matches the above example
|
||||
2. Ensure all required fields are included with correct types
|
||||
3. Use proper language codes (zh for Chinese)
|
||||
4. Check API key and environmentId are correct
|
||||
5. If browser login fails, use API authentication instead
|
||||
|
||||
## Verification
|
||||
After creation, verify survey exists by:
|
||||
1. Using GET /api/v1/management/surveys to list surveys
|
||||
2. Checking the survey appears in the list
|
||||
3. Retrieving the survey details to confirm all questions are present
|
||||
|
||||
## Notes
|
||||
- The survey will be created in the production environment
|
||||
- The share link can be obtained from the survey details after creation
|
||||
- If issues persist, check Formbricks API documentation for latest format requirements
|
||||
@@ -0,0 +1,43 @@
|
||||
---
|
||||
name: formbricks-endings-format
|
||||
description: Formbricks API 创建问卷时 endings 部分的正确格式
|
||||
---
|
||||
|
||||
# Formbricks API 创建问卷时 endings 部分的正确格式
|
||||
|
||||
## 问题背景
|
||||
|
||||
在尝试使用 Formbricks Management API 创建客户信息收集问卷时,遇到了 "Fields are missing or incorrectly formatted" 错误,特别是 endings 部分的格式问题。
|
||||
|
||||
## 技术发现
|
||||
|
||||
基于对现有问卷的分析,endings 应该使用以下格式:
|
||||
|
||||
```json
|
||||
{
|
||||
"endings": {
|
||||
"thankyou": {
|
||||
"title": "Thank you!",
|
||||
"description": "Your response has been recorded.",
|
||||
"buttonLabel": "Finish"
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## 验证方法
|
||||
|
||||
1. 查看现有问卷的 API 响应,复制其 endings 格式
|
||||
2. 使用最小化格式测试,确保 API 调用成功
|
||||
3. 逐步添加其他字段进行验证
|
||||
|
||||
## 注意事项
|
||||
|
||||
- endings 是必填字段
|
||||
- 格式必须严格遵循 JSON 结构
|
||||
- "thankyou" 是默认的感谢页面配置
|
||||
- buttonLabel 是必填字段
|
||||
|
||||
## 下一步
|
||||
|
||||
需要进一步验证这个格式是否正确,或者是否存在其他可选配置。
|
||||
@@ -0,0 +1,121 @@
|
||||
---
|
||||
title: Formbricks Seafile Image Upload
|
||||
overview: Skill for handling image uploads to Seafile when creating Formbricks surveys, including fallback strategies when Seafile authentication fails.
|
||||
name: formbricks-seafile-image-upload
|
||||
description: Complete workflow for uploading images to Seafile when creating Formbricks surveys, with authentication troubleshooting and multiple fallback strategies for when Seafile fails.
|
||||
---
|
||||
|
||||
# Formbricks Seafile Image Upload Skill
|
||||
|
||||
## Context
|
||||
When creating Formbricks surveys that require image assets (like exercise diagrams for medical conditions), images need to be hosted somewhere accessible. Seafile was the intended hosting solution but authentication challenges require fallback strategies.
|
||||
|
||||
## Prerequisites
|
||||
- Formbricks Management API configured with:
|
||||
- Base URL: https://form.140103.xyz
|
||||
- API Key: 33513637d4161852807df0eeb734da61
|
||||
- environmentId: cmlw3055s0008xh6f9aod3sko
|
||||
- Seafile server configured at: https://ftp.140103.xyz
|
||||
- Local image files available for upload
|
||||
|
||||
## Workflow
|
||||
|
||||
### 1. Primary Approach: Seafile Upload
|
||||
```bash
|
||||
# Get upload link
|
||||
curl -s \
|
||||
-H "Authorization: Token YOUR_TOKEN" \
|
||||
"$SEAFILE_URL/api2/repos/$REPO_ID/upload-link/?p=/"
|
||||
|
||||
# Upload file
|
||||
curl -X POST "upload-link" \
|
||||
-H "Authorization: Token YOUR_TOKEN" \
|
||||
-F "file=@local/path.jpg" \
|
||||
-F "parent_dir=/" \
|
||||
-F "replace=1"
|
||||
```
|
||||
|
||||
### 2. Authentication Troubleshooting
|
||||
If Seafile authentication fails:
|
||||
```bash
|
||||
# Try getting new token
|
||||
curl -X POST "$SEAFILE_URL/api2/auth-token/" \
|
||||
-H "Content-Type: application/x-www-form-urlencoded" \
|
||||
-d "username=admin@formbricks.com&password=formbricks123"
|
||||
|
||||
# Verify token validity
|
||||
curl -s "$SEAFILE_URL/api2/repos/" \
|
||||
-H "Authorization: Token YOUR_TOKEN"
|
||||
```
|
||||
|
||||
### 3. Fallback Strategies When Seafile Fails
|
||||
|
||||
#### Option A: Local File Sharing
|
||||
- Provide direct file paths for manual download
|
||||
- Use SCP/SFTP for secure transfer
|
||||
- Create ZIP archive for bulk download
|
||||
|
||||
#### Option B: Alternative File Sharing Services
|
||||
```bash
|
||||
# file.io (temporary)
|
||||
curl -F "file=@local/path.jpg" https://file.io
|
||||
|
||||
# transfer.sh (if available)
|
||||
curl --upload-file local/path.jpg https://transfer.sh/path.jpg
|
||||
|
||||
# catbox.moe (for images)
|
||||
curl -F "reqtype=fileupload" -F "fileToUpload=@local/path.jpg" https://catbox.moe/user/api.php
|
||||
```
|
||||
|
||||
#### Option C: Direct URL Hosting
|
||||
- Use existing web hosting services
|
||||
- Upload to GitHub Pages
|
||||
- Use cloud storage with public links
|
||||
|
||||
## Error Handling
|
||||
|
||||
### Common Seafile Errors
|
||||
- **401 Invalid token**: Re-authenticate or use backup token
|
||||
- **404 Repository not found**: Verify REPO_ID is correct
|
||||
- **500 Server error**: Check Seafile server status
|
||||
|
||||
### Fallback Triggers
|
||||
Switch to fallback when:
|
||||
- Seafile authentication fails 3+ times
|
||||
- API returns 401/403 consistently
|
||||
- Server response time > 5 seconds
|
||||
|
||||
## Integration with Formbricks
|
||||
|
||||
### Image URL Format for Formbricks
|
||||
```
|
||||
https://seafile.example.com/d/SHARE_CODE/files/?p=/path/to/image.jpg&dl=1
|
||||
```
|
||||
|
||||
### Survey Creation with Images
|
||||
1. Upload images first
|
||||
2. Get public URLs
|
||||
3. Create Formbricks survey with image URLs
|
||||
4. Test survey rendering
|
||||
|
||||
## Best Practices
|
||||
|
||||
1. **Always verify authentication** before bulk operations
|
||||
2. **Have multiple fallback options** prepared
|
||||
3. **Test image accessibility** after upload
|
||||
4. **Document token rotation** procedures
|
||||
5. **Keep local copies** of important assets
|
||||
|
||||
## Example Use Case
|
||||
Creating a "Lumbar Muscle Strain Exercises" survey:
|
||||
1. Download exercise images from Bing
|
||||
2. Upload to Seafile (primary) or file.io (fallback)
|
||||
3. Create Formbricks survey with image URLs
|
||||
4. Provide both direct file access and survey link to user
|
||||
|
||||
## Notes
|
||||
- Seafile token format: "Token YOUR_TOKEN"
|
||||
- Repository ID must be correct for API calls
|
||||
- Some file sharing services have size limits
|
||||
- Temporary services may delete files after time limit
|
||||
- Always verify final image URLs work in Formbricks
|
||||
@@ -0,0 +1,58 @@
|
||||
---
|
||||
title: Formbricks Survey Creation Workflow
|
||||
author: Hermes Agent
|
||||
description: Complete workflow for creating Formbricks Link Survey questionnaires with API and browser fallback
|
||||
name: formbricks-survey-creation
|
||||
---
|
||||
|
||||
## 创建Formbricks问卷的工作流
|
||||
|
||||
### 触发条件
|
||||
- 需要创建Formbricks Link Survey问卷
|
||||
- 需要添加必填问题字段
|
||||
- 需要设置欢迎页和结束页
|
||||
- 需要获取分享链接
|
||||
|
||||
### 步骤
|
||||
1. **API端点测试**
|
||||
- 测试GET /api/v1/management/surveys
|
||||
- 如果返回404,尝试GET /api/v1/management
|
||||
- 如果都失败,切换到浏览器工具
|
||||
|
||||
2. **API认证**
|
||||
- 使用x-api-key头进行认证
|
||||
- Bearer前缀无效,直接使用API Key
|
||||
- 测试认证: GET /api/v1/management
|
||||
|
||||
3. **创建问卷**
|
||||
- 如果API可用: POST /api/v1/management/surveys
|
||||
- 如果API失败: 使用浏览器工具创建空白问卷
|
||||
|
||||
4. **配置Survey Type**
|
||||
- 通过API: PATCH /api/v1/management/surveys/{id}
|
||||
- 通过UI: 找到Survey Type下拉菜单选择Link Survey
|
||||
|
||||
5. **添加问题**
|
||||
- 通过API: POST /api/v1/management/questions
|
||||
- 通过UI: 点击Add Question按钮逐个添加
|
||||
|
||||
6. **设置欢迎页和结束页**
|
||||
- 通过API: PATCH /api/v1/management/surveys/{id}
|
||||
- 通过UI: 找到相应设置页面
|
||||
|
||||
7. **获取分享链接**
|
||||
- 通过API: GET /api/v1/management/surveys/{id}
|
||||
- 通过UI: 在问卷列表中找到分享链接
|
||||
|
||||
### 常见问题
|
||||
- API端点404: 检查Base URL是否正确
|
||||
- 认证401: 检查API Key格式和权限
|
||||
- 浏览器工具导航: 可能跳转到其他标签页,需要重新定位
|
||||
- questions格式: API要求严格的JSON结构
|
||||
|
||||
### 验证步骤
|
||||
- 问卷类型是否为Link Survey
|
||||
- 所有必填问题是否已添加
|
||||
- 欢迎页和结束页内容是否正确
|
||||
- 分享链接是否可访问
|
||||
- 问卷是否已发布可用
|
||||
Reference in New Issue
Block a user