avatar

sunday

Sunday's Blog

  • 首页
Home 青龙面板使用api(openapi)接口请求执行任务
文章

青龙面板使用api(openapi)接口请求执行任务

Posted 2024-07-17 Updated 2024-07- 23
By sunday
4~5 min read

1.设置应用权限

在面板菜单系统设置 ——> 应用设置 里创建一个应用,并赋予相应的权限

2.获取访问令牌token /open/auth/token2

本地搭建的就是主机名是:http://locaohost:5700,如果是vps上就是http://your_vps_ip:5700

然后postman访问 http://locaohost:5700/open/auth/token?client_id=your_client_id&clent_secret=your_client_sceret 来获取token

将your_client_id 和your_client_sceret 换成第一步创建的应用client_id 和clent_secret

得到如下响应

{
    "code": 200,
    "data": {
        "token": "35c1e0e4-1b66-4ebe-9789-9ba0e21df33f",
        "token_type": "Bearer",
        "expiration": 1723736341
    }
}

3.axios执行调用任务

比如执行订阅任务

订阅任务的url为/open/subscriptions/run?t={{$timestamp}} timestamp 为时间戳

axios({
  url: 'http://localhost:5700/open/subscriptions/run?t=1234567890',
  headers: {
    Authorization: "Bearer 35c1e0e4-1b66-4ebe-9789-9ba0e21df33f"
  },
  method: 'put',
  data: [1], #这个为订阅任务的ID
})

软件使用
软件使用
License:  CC BY 4.0
Share

Further Reading

Dec 14, 2024

cursor IDE 编辑器从命令行打开

1.打开Cursor应用程序 2.按下 CMD(Ctrl) + Shift + P 打开命令面板

Dec 7, 2024

n8n使用http form-data上传文件

新建一个http node 节点,参数如下图所示,其他参数可自行设置 主要是1.开启 Send Body 2.设置n8n Binary File类型,然后在 input Data Field Name 填入上一个节点的二进制文件名即可 也可复制我的JSON文件到你的n8n上测试 My_workflo

Dec 5, 2024

supabase postgres updatedAt 自动更新时间戳

由于在prisma 创建model时,@updatedAt 不起作用 model Book { id String @id @default(dbgenerated("gen_random_uuid()")) createdAt DateTime @default(dbge

OLDER

nginx设置基础身份验证auth_basic

NEWER

javascript检测键盘是否开启大写状态

Recently Updated

  • nextjs15使用better-sqlite3的连接报错问题
  • nextjs + clerk + supabase + realtime 实时监听数据库更改
  • 解决nextjs15使用useLocalStorage报错的问题
  • mac上使用nodejs appium控制chrome浏览器
  • 2024年终总结

Trending Tags

nginx acme 强制跳转HTTPS nodejs 代理 mac 神器 vue3 工具 docker

Contents

©2025 sunday. Some rights reserved.

Using the Halo theme Chirpy