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

# contact.note.updated

> 在更新联系人备注时发生。

使用 `contact.note.updated` 在您的 Webhook 端点处理此事件。

## 触发条件

在更新联系人备注时发生。

在您[配置 Webhook 端点](https://docs.ycloud.com/zh/api-reference/guides/api-fundamentals/configure-webhooks.md)时订阅 `contact.note.updated`。

将备注 `id` 与 `contactId` 分开。`username` 和 `phoneNumber` 可以为 null。

## 语法

YCloud 向您配置的 Webhook URL 发送 HTTP `POST` 请求。以下结构展示了一种有效载荷变体。尖括号中的值为占位符；其类型列在 **参数** 下。可选字段和其他变体在下文进行说明。

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "id": "<ID>",
  "type": "contact.note.updated",
  "apiVersion": "<API_VERSION>",
  "createTime": "<CREATE_TIME>",
  "contactNote": {
    "id": "<ID>",
    "contactId": "<CONTACT_ID>",
    "username": "<USERNAME>",
    "phoneNumber": "<PHONE_NUMBER>",
    "content": "<CONTENT>",
    "createTime": "<CREATE_TIME>",
    "updateTime": "<UPDATE_TIME>"
  }
}
```

## 参数

在处理 JSON 请求体之前验证 `YCloud-Signature` HTTP 请求头。请参阅[签名验证](https://docs.ycloud.com/zh/api-reference/guides/api-fundamentals/configure-webhooks.md)。

### 事件信封

| 参数 | 类型 | 必填 | 描述 |
| - | - | - | - |
| `id` | string | 是 | 事件的唯一 ID。最小长度：`6`。最大长度：`128`。 |
| `type` | string | 是 | 始终为 `contact.note.updated`。 |
| `apiVersion` | string | 是 | 用于呈现此事件的 API 版本。 |
| `createTime` | string (date-time) | 是 | 创建此事件的时间，格式为 [RFC 3339](https://datatracker.ietf.org/doc/html/rfc3339)。例如：`2022-06-01T12:00:00.000Z`。 |

### 事件有效载荷

| 参数 | 类型 | 必填 | 描述 |
| - | - | - | - |
| `contactNote` | object | 否 | 特定于事件的 `contactNote` 有效载荷。 |

四个通用信封字段为必填项。有效载荷字段取决于事件变体。在每个对象表中， **必填** 适用于其父对象存在的情况。可选字段可以省略；示例并不意味着字段为必填。

#### contactNote

| 参数 | 类型 | 必填 | 描述 |
| - | - | - | - |
| `id` | string | 是 | 备注的 ID。最小长度：`24`。最大长度：`24`。格式：`^[0-9a-fA-F]{24}$`。 |
| `contactId` | string | 是 | 拥有该备注的联系人的 ID。 |
| `username` | string or null | 是 | 拥有该备注的联系人的用户名，不含前导 `@`。 |
| `phoneNumber` | string or null | 是 | 拥有该备注的联系人的电话号码，采用 E.164 格式。 |
| `content` | string | 是 | 备注的文本内容。最大长度：`500`。 |
| `createTime` | string (date-time) | 否 | 备注创建的时间，采用 RFC 3339 格式。 |
| `updateTime` | string (date-time) | 否 | 备注上次更新的时间，采用 RFC 3339 格式。 |

## 示例

以下 JSON 是发送给您的接收方的请求体。ID、电话号码和其他账户值仅用于说明。

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "id": "evt_2234567890abcdef12345678",
  "type": "contact.note.updated",
  "apiVersion": "v2",
  "createTime": "2024-01-02T12:00:00.000Z",
  "contactNote": {
    "id": "6a3de646e18f344f743aaa4d",
    "contactId": "1824266594102064128",
    "username": "alice_01",
    "phoneNumber": "+12025550124",
    "content": "Customer now prefers afternoon follow-up.",
    "createTime": "2024-01-01T12:00:00.000Z",
    "updateTime": "2024-01-02T12:00:00.000Z"
  }
}
```

验证签名并持久接收事件后，返回 `2xx` 响应。耗时任务请异步处理。

```http theme={"theme":{"light":"github-light","dark":"github-dark"}}
HTTP/1.1 200 OK
```

有关场景演示，请参阅[带注释的示例](https://docs.ycloud.com/zh/api-reference/guides/examples/webhook-examples/contact-attributes-changed-webhook-examples)。


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.