AI动作集成平台
    AI动作集成平台
    • 搜索相关动作
      POST
    • 开始
      POST
    • 多账号选择
      POST
    • 执行动作
      POST
    • 连续对话接口
      POST

      执行动作

      POST
      /v1/api/AI-action/ai_actions

      请求参数

      Header 参数
      Authorization
      string 
      必需
      用户token. 固定结构"bearer + 空格 + token"
      示例值:
      bearer xeoYWPcn7WXdAFrEkPjffRN5BS1ZSIDiFXbuWf4DFMuJyEIt9qFseEvqG7bKez9S
      Body 参数application/json
      chat_id
      string 
      对话唯一标识
      必需
      status
      string 
      请求状态
      必需
      step
      string 
      请求的生命周期所处阶段
      必需
      user_id
      string 
      嵌入方的用户唯一标识
      必需
      return_amount
      string 
      最大返回几个匹配动作
      必需
      app_name_filter
      string 
      用于排除指定应用(关键词包含)
      必需
      content
      string 
      用户的对话内容
      必需
      data
      object 
      必需
      appkey
      string 
      应用id
      必需
      actionkey
      string 
      动作key
      必需
      appName
      string 
      应用名称
      必需
      actionName
      string 
      动作名称
      必需
      description
      string 
      动作描述
      必需
      account_id
      integer 
      账户id
      必需
      account_name
      string 
      账户名称
      必需
      示例
      {
          "chat_id": "InNrOTE2N18xNzI0MDMxMzAyNzM0XzAi.Pn79ncl-ToQy47BElVKMze0dh24",
          "status": "auth_account_select",
          "step": "ACTION_CONFIG",
          "user_id": "bai-du-123",
          "return_amount": "3",
          "stream": false,
          "app_name_filter": "webhook,钉钉自建",
          "content": "将你好发送到企业微信群机器人的发送文本消息",
          "data": {
              "appkey": "84",
              "actionkey": "198",
              "appName": "企业微信群机器人",
              "actionName": "发送文本消息",
              "description": "发送文本消息到企业微信群",
              "account_id": 187610,
              "account_name": "AI-action测试1"
          }
      }

      示例代码

      Shell
      JavaScript
      Java
      Swift
      Go
      PHP
      Python
      HTTP
      C
      C#
      Objective-C
      Ruby
      OCaml
      Dart
      R
      请求示例请求示例
      Shell
      JavaScript
      Java
      Swift
      curl --location --request POST '/v1/api/AI-action/ai_actions' \
      --header 'Authorization: bearer xeoYWPcn7WXdAFrEkPjffRN5BS1ZSIDiFXbuWf4DFMuJyEIt9qFseEvqG7bKez9S' \
      --header 'Content-Type: application/json' \
      --data-raw '{
          "chat_id": "InNrOTE2N18xNzI0MDMxMzAyNzM0XzAi.Pn79ncl-ToQy47BElVKMze0dh24",
          "status": "auth_account_select",
          "step": "ACTION_CONFIG",
          "user_id": "bai-du-123",
          "return_amount": "3",
          "stream": false,
          "app_name_filter": "webhook,钉钉自建",
          "content": "将你好发送到企业微信群机器人的发送文本消息",
          "data": {
              "appkey": "84",
              "actionkey": "198",
              "appName": "企业微信群机器人",
              "actionName": "发送文本消息",
              "description": "发送文本消息到企业微信群",
              "account_id": 187610,
              "account_name": "AI-action测试1"
          }
      }'

      返回响应

      🟢200成功
      application/json
      Body
      Code
      integer 
      必需
      Data
      object 
      必需
      chat_id
      string 
      会话id
      必需
      data
      object 
      必需
      description
      string 
      描述信息
      必需
      status
      string 
      请求状态
      必需
      action_found: 找到多个可用动作需返回给用户请求、
      action_not_found:没有找到可匹配的动作
      auth_required: 执行可用动作时,需要用户进行账户授权
      auth_account_select: 用户同一个应用下授权过多个账户,需要选择
      action_field_required:执行动作时有必填字段需要用户提供信息
      action_preview: 用户设置了动作预览后执行,返回动作执行预览,等待用户确认。
      action_done:动作成功执行,返回成功信息
      action_error:动作执行失败,返回失败信息
      step
      string 
      请求的生命周期所处阶段
      必需
      user_id
      string 
      嵌入方的用户唯一标识
      必需
      Msg
      string 
      必需
      示例
      {"Code":2000,"Data":{"chat_id":"InNrOTE2N18xNzI0MDMxMzAyNzM0XzAi.Pn79ncl-ToQy47BElVKMze0dh24","data":{"input":{"content":"你好"},"log_url":null,"output":{"sendrst":true}},"description":"动作执行成功","status":"action_done","step":"ACTION_RUN","user_id":"bai-du-123"},"Msg":"成功"}
      
      修改于 2025-04-16 06:38:13
      上一页
      多账号选择
      下一页
      连续对话接口
      Built with