跳到正文

获取所有表单 GET ​

获取你账户中的所有表单,按创建时间从新到旧排列。

接口地址 ​

GET https://api.pocketalert.app/v1/forms

身份验证 ​

必填

在请求中包含以下任一请求头:

  • Token: <your-api-key> — 从 API 密钥 页面获取
  • Authorization: Bearer <jwt-token> — 来自 登录 接口

请求 ​

请求头 ​

请求头必填说明
Token✅你的 API 密钥
Authorization✅Bearer <jwt-token>

请求示例 ​

bash
curl -X GET "https://api.pocketalert.app/v1/forms" \
  -H "Token: your-api-key"
javascript
const response = await fetch('https://api.pocketalert.app/v1/forms', {
  headers: { 'Token': 'your-api-key' }
});

const forms = await response.json();
forms.forEach((form) => console.log(form.name, `https://frms.click/${form.tid}`));
python
import requests

response = requests.get(
    'https://api.pocketalert.app/v1/forms',
    headers={'Token': 'your-api-key'}
)

for form in response.json():
    print(form['name'], f"https://frms.click/{form['tid']}")
php
$forms = Http::withHeaders([
    'Token' => 'your-api-key',
])->get('https://api.pocketalert.app/v1/forms')->json();

foreach ($forms as $form) {
    echo $form['name'].' https://frms.click/'.$form['tid'].PHP_EOL;
}

响应 ​

成功响应 ​

200 OK

返回表单数组。如果账户中没有表单,则返回 []。

字段类型说明
tidstring表单标识符,公开链接为 https://frms.click/{tid}
namestring内部名称,显示在你的控制台中
fieldsarray表单字段,参见 创建表单
settingsobject标题、文本和设计,参见 创建表单
application_tidstring提交内容所属的应用(无则为空)
device_tidstring目标设备 TID、all,或为空表示所有设备
default_levelint | null应用于提交内容的优先级(-2..2)
push_titlestring推送标题模板(为空时使用 Form: {name})
allowed_originsarray允许嵌入和提交表单的主机(为空表示不限制)
max_responsesint回复数量上限,0 表示不限
closes_atstring | null截止时间,UTC 时区的 RFC 3339 格式
closedboolean表单当前是否拒绝提交
is_activeboolean所有者的启用/停用开关
submissions_countint目前已收到的回复数
last_submission_atstring最近一次回复时间,使用你账户的时区
created_atstring创建日期,使用你账户的时区
json
[
  {
    "tid": "vml19aihrga216gt8apc5e3m9",
    "name": "Contact form",
    "fields": [
      { "id": "name", "type": "text", "label": "Name", "placeholder": "Jane Doe", "required": true },
      { "id": "email", "type": "email", "label": "Email", "placeholder": "[email protected]", "required": true }
    ],
    "settings": {
      "title": "Get in touch",
      "top_text": "Leave your details and we will get back to you shortly.",
      "primary_color": "#3f5cad",
      "submit": { "text": "Submit", "color": "", "size": "md" }
    },
    "application_tid": "qm47b9pzxzx7applfd0",
    "device_tid": "",
    "default_level": null,
    "push_title": "New lead: {Name}",
    "allowed_origins": ["example.com"],
    "max_responses": 0,
    "closes_at": null,
    "closed": false,
    "is_active": true,
    "submissions_count": 12,
    "last_submission_at": "23.09.2026 14:05:11",
    "created_at": "20.09.2026 09:12:40"
  }
]

错误响应 ​

状态码说明
401未授权,令牌无效或缺失
500加载表单失败

Pocket Alert 文档