# 消息状态

## 状态报告

### 消息状态事件

#### **whatsapp\_message\_status\_updated**

<table data-header-hidden><thead><tr><th width="142.5390625"></th><th width="111.2265625"></th><th width="103.0703125"></th><th></th></tr></thead><tbody><tr><td>字段</td><td>数据类型</td><td>是否必填</td><td>描述</td></tr><tr><td>id</td><td>String</td><td>是</td><td>Message Id</td></tr><tr><td>accountName</td><td>String</td><td>是</td><td>API账号</td></tr><tr><td>wabaId</td><td>String</td><td>是</td><td>Waba Id</td></tr><tr><td>status</td><td>String</td><td>是</td><td>发送状态：<code>delivered</code>、<code>read</code>、<code>failed</code>、<code>SMECL:FAILED</code></td></tr><tr><td>wamid</td><td>String</td><td>是</td><td>WhatsApp消息Id</td></tr><tr><td>sendPhone</td><td>String</td><td>是</td><td>WhatsAppp用户号码</td></tr><tr><td>uid</td><td>String</td><td>否</td><td>客户批次号，客户发送的批次号（uid）</td></tr><tr><td>conversation</td><td>JOSN</td><td>否</td><td>会话信息，status是delivered时有值</td></tr><tr><td>errorData</td><td>JOSN</td><td>否</td><td>错误消息，status是failed时有值</td></tr></tbody></table>

#### conversation 对象

| 字段           | 数据类型   | 是否必填 | 描述                                                                                                             |
| ------------ | ------ | ---- | -------------------------------------------------------------------------------------------------------------- |
| initiateType | String | 是    | 会话发起类型 **business\_initiated**：商家发起会话**referral\_conversion**：免费入口发起会话，这类会话由用户发起**customer\_initiated**：用户发起会话 |
| expireAt     | String | 是    | 会话过期时间，eg: 2023-02-22 12:00:00                                                                                 |

#### errorData 对象

| 字段           | 数据类型   | 是否必填 | 描述       |
| ------------ | ------ | ---- | -------- |
| errorCode    | String | 是    | Meta错误码  |
| errorMessage | String | 是    | Meta错误描述 |

### **响应报文示例**

#### **delivered:响应示例**

```json
{
    "id": "e5cb1bc6-ad90-419d-8f83-aa394c0b7cc7",
    "type": "whatsapp_message_status_updated",
    "eventTime": "2023-02-22T12:00:00.000Z",
    "body": {
        "id": "356139161272397824",
        "accountName": "IW123456",
        "wabaId": "11231231212331",
        "wamid": "wamid.BgNODYxN...", 
        "status": "delivered",
        "uid":"2002302023002010121",
        "sendPhone":"65123101212312",
        "conversation": {
            "id": "00e5a7e14a588d96bd2343d105d03ec5",
            "initiateType": "business_initiated",
            "expireAt": "2023-02-23T12:00:00.000Z"
        },
        "currency": "USD"
    }
}
```

#### **read:响应示例**

```json
{
    "id": "cd0a316c-a781-4589-9f5f-5502ccf1f60f",
    "type": "whatsapp_message_status_updated",
    "eventTime": "2023-05-26T02:18:44.115Z",
    "body": {
        "accountName": "15902677617",
        "id": "356139161272397824",
        "status": "read",
        "uid":"2002302023002010121",
        "sendPhone":"65123101212312",
        "wabaId": "WHATSAPP_BUSINESS_ACCOUNT_ID",
        "wamid": "wamid.HBgNODYxNjY4NTE3NzYxMhUCABEYEjQ0RTYyQTM5QzAyMkU0QkNERgA="
    }
}
```

#### **failed:响应示例**

```json
{
    "id": "e5cb1bc6-ad90-419d-8f83-aa394c0b7cc7",
    "type": "whatsapp_message_status_updated",
    "eventTime": "2023-05-25T10:31:08.167Z",
    "body": {
        "accountName": "15902677617",
        "errorData": {
            "errorCode": "131014",
            "errorMessage": "Request for url https://URL.jpg failed with error: 404 (Not Found)"
        },
        "id": "356139161272397824",
        "status": "failed",
         "uid":"2002302023002010121",
        "sendPhone":"65123101212312",
        "wabaId": "WHATSAPP_BUSINESS_ACCOUNT_ID",
        "wamid": "wamid.HBgNODYxNjY4NTE3NzYxMhUCABEYEjQ0RTYyQTM5QzAyMkU0QkNERgA="
    }
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.innopaas.com/api-reference/whatsapp-business-api/webhook/xiao-xi-zhuang-tai.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
