> ## 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.

# whatsapp.call.transcription.updated

> 当源自 API 的 WhatsApp 通话转录变为可用或永久失败时发生。

使用 `whatsapp.call.transcription.updated` 在您的 Webhook 端点处理此事件。

## 触发条件

当源自 API 的 WhatsApp 通话转录变为可用或永久失败时发生。

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

此事件报告源自 API 的通话媒体资源的最终状态。当 `status` 为 `AVAILABLE` 时，将 `mediaAssetId` 与通话媒体下载 API 配合使用。当 `status` 为 `FAILED` 时，请检查 `error`。

## 语法

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

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "id": "<ID>",
  "type": "whatsapp.call.transcription.updated",
  "apiVersion": "<API_VERSION>",
  "createTime": "<CREATE_TIME>",
  "callingTranscription": {
    "wacid": "<WACID>",
    "phoneId": "<PHONE_ID>",
    "mediaAssetId": "<MEDIA_ASSET_ID>",
    "status": "<STATUS>",
    "error": {
      "code": "<CODE>",
      "retryable": "<RETRYABLE_VALUE>"
    }
  }
}
```

## 参数

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

### 事件外层结构

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

### 事件载荷

| 参数 | 类型 | 必填 | 说明 |
| - | - | - | - |
| `callingTranscription` | object | 否 | 事件特有的 `callingTranscription` 载荷。 |

四个通用外层字段为必填项。载荷字段取决于事件变体。在每个对象表格中， **必填** 适用于其父对象存在的情况。可选字段可以省略；示例并不代表字段是必填项。

#### callingTranscription

| 参数 | 类型 | 必填 | 说明 |
| - | - | - | - |
| `wacid` | string | 是 | WhatsApp 通话 ID。 |
| `phoneId` | string | 是 | 用于交付已授权资源的 WhatsApp 商业电话号码 ID。 |
| `mediaAssetId` | string | 是 | 与通话媒体下载 API 配合使用的 YCloud 媒体资源 ID。 |
| `status` | string | 是 | 可选值：`AVAILABLE`、`FAILED`。 |
| `error` | object | 否 | 仅在 `status` 为 `FAILED` 时出现。 |

> [accordion] callingTranscription.error
>
> | 参数 | 类型 | 必填 | 说明 |
> | - | - | - | - |
> | `code` | string | 是 | 固定失败代码。 |
> | `retryable` | boolean | 是 | 重试上游媒体操作是否可能成功。 |

## 示例

以下 JSON 是发送至接收端的请求体。ID、电话号码和其他账户值仅供说明之用。

源自 API 的通话转录永久失败时的示例载荷

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "id": "evt_call_transcription_01JZ8K5A9C4D7E0F3G6H9J2K5M",
  "type": "whatsapp.call.transcription.updated",
  "apiVersion": "v2",
  "createTime": "2026-08-04T08:01:00.000Z",
  "callingTranscription": {
    "wacid": "wacid.HBgNNjI4MTM2MTkwNTEzMxUCABE",
    "phoneId": "461269257068832",
    "mediaAssetId": "66b1f0d9e4b05c2d8f1a3b48",
    "status": "FAILED",
    "error": {
      "code": "CALLING_TRANSCRIPTION_PROCESSING_FAILED",
      "retryable": false
    }
  }
}
```

验证签名并持久接收事件后，返回 `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/whatsapp-calling-terminate-webhook-examples)。


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