---
title: "Make"
description: "使用 webhook 和 REST API 将 Quire 连接到 Make。"
image: "https://docs.quirelms.com/og.png"
---

> Documentation Index
> Fetch the complete documentation index at: https://docs.quirelms.com/zh-Hans/llms.txt
> Use this file to discover all available pages before exploring further.

# Make

<span id="make"></span>

Make 使用 REST API、webhook 和自身的 HTTP 与 webhook 模块连接 Quire。[API 参考](https://docs.quirelms.com/api/)中的所有功能都可以使用。

## 根据 Quire 事件启动场景 <!--quire:start-a-scenario-from-a-quire-event-->

1. 将 **Webhooks** 模块中的 **Custom webhook** 添加为第一个模块，并复制该模块的地址。
2. 在 Quire 中打开 `/admin/webhooks`，选择**添加订阅**，粘贴地址并选择事件。Quire 的测试事件可以让 Make 获取正文格式：发送测试事件时，请运行一次该模块。
3. 执行任何操作前先验证签名。在 webhook 的高级设置中传递标头，然后按照[开发者指南](/zh-Hans/developer/#webhooks)的说明，使用订阅密钥，根据 `webhook-signature` 验证 `{webhook-id}.{webhook-timestamp}.{body}`。添加筛选器，使验证失败时场景停止。

## 从场景调用 Quire <!--quire:call-quire-from-a-scenario-->

使用 **HTTP** 模块的 **Make a request**：

| 字段 | 值 |
| --- | --- |
| URL | `https://acme.quirelms.com/api/v1/<resource>` |
| 方法 | 按 API 参考中的说明填写 |
| 标头 | `Authorization: Bearer qk_live_...`；写入请求还需 `Idempotency-Key` |
| 正文类型 | 原始数据、JSON |
| 解析响应 | 是 |

请在 `/admin/integrations/api-keys` 为 Make 单独创建密钥，并只授予场景所需的作用范围。查询列表时，如果 `page.has_more` 为 true，请继续传入 `page.next_cursor` 作为 `cursor`：可使用 Make 的 **Repeater** 和一个保存游标的 **Set variable** 模块完成此操作。

如果场景需要以某个人的身份操作，请在 `/admin/integrations/oauth-clients` 注册 OAuth 客户端，并在 Make 的 **HTTP** 模块中使用 **Make an OAuth 2.0 request**。

## 示例：每周完成情况摘要 <!--quire:example-weekly-completion-digest-->

1. **计划**：每周一执行。
2. **HTTP**：`GET /api/v1/course_completions?updated_since=<a week ago>`。
3. 使用 **Iterator** 遍历 `data`，再通过 **Aggregator** 汇总成表格。
4. 通过电子邮件发送表格，或将其发布到其他位置。

Source: https://docs.quirelms.com/zh-Hans/integrations/make/index.mdx
