ChatGPT 集成

在 ChatGPT 中使用 Bink

创建一个连接到你 Bink 页面的自定义 GPT,用自然语言管理一切:链接、表单、数据分析、预约、消息。

自定义 GPT

为 Bink 创建自定义 GPT

打造一个 GPT,把 Bink 的 REST API 用作 Actions,来管理你的 Bink 页面。

  1. 获取个人访问令牌

    前往 在你的助手中使用 Bink 页面,点击「生成密钥」。把它复制下来:身份验证时会用到。

  2. 新建一个 GPT

    前往 ChatGPT → 探索 GPT → 创建。给它起个名字,比如「我的 Bink 管家」,然后添加以下指令:

    Instructions
    你是 Bink 页面管理员。你帮助用户管理他们的 Bink 页面(一个 link-in-bio 平台)。你可以添加、编辑、删除和重新排序区块(链接、标题、社交图标)。你可以查看数据分析,管理表单和表单回复,处理收件箱消息,并管理预约。执行具有破坏性的操作之前,务必先请用户确认。
  3. 添加 Actions

    在 GPT 编辑器中,点击「创建新操作」(Create new action)。将身份验证(Authentication)设为「API 密钥」(API Key),请求头名称填写「Authorization」,值为:

    Authorization
    Bearer bink_your_token_here

    然后把下面的 OpenAPI schema 粘贴到 schema 字段中。

    OpenAPI Schema
    {
      "openapi": "3.1.0",
      "info": {
        "title": "Bink API",
        "version": "1.0.0",
        "description": "Manage your Bink page"
      },
      "servers": [
        { "url": "https://bink4.me" }
      ],
      "paths": {
        "/api/blocks": {
          "get": {
            "operationId": "listBlocks",
            "summary": "List all blocks on the page",
            "responses": { "200": { "description": "Array of blocks" } }
          },
          "post": {
            "operationId": "createBlock",
            "summary": "Create a new block",
            "requestBody": {
              "required": true,
              "content": {
                "application/json": {
                  "schema": {
                    "type": "object",
                    "properties": {
                      "type": { "type": "string", "enum": ["link", "header", "social", "text", "image", "video", "divider"] },
                      "title": { "type": "string" },
                      "url": { "type": "string" },
                      "active": { "type": "boolean" }
                    },
                    "required": ["type"]
                  }
                }
              }
            },
            "responses": { "200": { "description": "Created block" } }
          }
        },
        "/api/blocks/{id}": {
          "put": {
            "operationId": "updateBlock",
            "summary": "Update a block",
            "parameters": [{ "name": "id", "in": "path", "required": true, "schema": { "type": "string" } }],
            "requestBody": {
              "content": {
                "application/json": {
                  "schema": {
                    "type": "object",
                    "properties": {
                      "title": { "type": "string" },
                      "url": { "type": "string" },
                      "active": { "type": "boolean" }
                    }
                  }
                }
              }
            },
            "responses": { "200": { "description": "Updated block" } }
          },
          "delete": {
            "operationId": "deleteBlock",
            "summary": "Delete a block",
            "parameters": [{ "name": "id", "in": "path", "required": true, "schema": { "type": "string" } }],
            "responses": { "200": { "description": "Deleted" } }
          }
        },
        "/api/analytics": {
          "get": {
            "operationId": "getAnalytics",
            "summary": "Get page analytics (views, clicks, top blocks)",
            "responses": { "200": { "description": "Analytics data" } }
          }
        },
        "/api/bookings": {
          "get": {
            "operationId": "listBookings",
            "summary": "List bookings",
            "responses": { "200": { "description": "Array of bookings" } }
          }
        },
        "/api/bookings/{id}": {
          "put": {
            "operationId": "updateBookingStatus",
            "summary": "Confirm or cancel a booking",
            "parameters": [{ "name": "id", "in": "path", "required": true, "schema": { "type": "string" } }],
            "requestBody": {
              "content": {
                "application/json": {
                  "schema": {
                    "type": "object",
                    "properties": {
                      "status": { "type": "string", "enum": ["confirmed", "cancelled"] }
                    }
                  }
                }
              }
            },
            "responses": { "200": { "description": "Updated booking" } }
          }
        },
        "/api/page/settings": {
          "get": {
            "operationId": "getPageSettings",
            "summary": "Get page settings",
            "responses": { "200": { "description": "Page settings" } }
          },
          "put": {
            "operationId": "updatePageSettings",
            "summary": "Update page title, description, SEO",
            "requestBody": {
              "content": {
                "application/json": {
                  "schema": {
                    "type": "object",
                    "properties": {
                      "title": { "type": "string" },
                      "description": { "type": "string" }
                    }
                  }
                }
              }
            },
            "responses": { "200": { "description": "Updated settings" } }
          }
        },
        "/api/forms": {
          "get": {
            "operationId": "listForms",
            "summary": "List all forms",
            "responses": { "200": { "description": "Array of forms" } }
          }
        },
        "/api/forms/{id}/responses": {
          "get": {
            "operationId": "getFormResponses",
            "summary": "Get form responses",
            "parameters": [{ "name": "id", "in": "path", "required": true, "schema": { "type": "string" } }],
            "responses": { "200": { "description": "Array of responses" } }
          }
        }
      }
    }
  4. 测试并发布

    在预览面板中测试命令,例如「列出我的区块」或「显示我的数据分析」。满意后,可以发布给自己使用,也可以分享给别人。

REST API

可用的 API 端点

以下是你的自定义 GPT 可以调用的主要 API 端点。所有端点都需要在 Authorization 请求头中提供 Bearer 令牌。

方法Path说明
GET/api/blocksList all blocks
POST/api/blocksCreate a new block
PUT/api/blocks/{id}Update a block
DELETE/api/blocks/{id}Delete a block
POST/api/blocks/reorderReorder blocks
GET/api/page/settingsGet page settings
PUT/api/page/settingsUpdate page settings
GET/api/page/themeGet page theme
PUT/api/page/themeUpdate page theme
POST/api/page/publishToggle page publish
GET/api/formsList forms
GET/api/forms/{id}Get form details
POST/api/formsCreate a form
PUT/api/forms/{id}Update a form
GET/api/forms/{id}/responsesGet form responses
GET/api/analyticsGet page analytics
GET/api/bookingsList bookings
PUT/api/bookings/{id}Update booking status
提示词示例

可以问你的 GPT 什么

自定义 GPT 配置好之后,试试这些提示词。

页面管理

  • “列出我页面上的所有区块”
  • “添加一个指向我 Instagram 主页的新链接”
  • “删除标题区块”
  • “把我的页面标题改成「我的链接」”

Analytics

  • “显示我页面的数据分析”
  • “我点击最多的链接是哪些?”

表单与消息

  • “显示我联系表单的回复”
  • “我有多少条未读消息?”

预约

  • “列出所有待处理的预约”
  • “确认明天的那个预约”

准备好打造你的 GPT 了吗?

创建个人访问令牌,开始为 Bink 打造你的自定义 GPT。