# Webhook 注册与事件

{% hint style="info" %}
遇到 API 接入问题时，可登录 [Eva](https://www.atriptech.com/) 寻求帮助。
{% endhint %}

用这个页面注册 webhook 地址，并在 API 参考层查询事件记录。

### 本页包含内容

* `updateWebhookURL.do`：注册 webhook 地址
* `event/getPageList.do`：查询事件记录

### 典型流程

{% stepper %}
{% step %}

### 注册 webhook 地址

保存 Atlas 要回调的 webhook 地址。
{% endstep %}

{% step %}

### 接收 webhook 事件

处理出票、航变、航司状态、邮件和事件通知。
{% endstep %}

{% step %}

### 必要时查询事件

用事件查询接口对账漏收或未解决的事件。
{% endstep %}
{% endstepper %}

### 适用场景

* 初次配置 webhook
* 更新 webhook 地址
* 事件对账
* 航变或取消后的运营跟进

### 相关页面

* [Webhook 概览](https://resources.atriptech.com/api-wen-dang/ji-cheng-zhi-nan/webhook-gai-lan)
* [事件查询](https://resources.atriptech.com/api-wen-dang/ji-cheng-zhi-nan/webhook-gai-lan/shi-jian-cha-xun)
* [事件通知](https://resources.atriptech.com/api-wen-dang/ji-cheng-zhi-nan/webhook-gai-lan/incident-notification)

## Register Webhook

> \*\*Endpoint:\*\*\
> <https://sandbox.atriptech.com/updateWebhookURL.do>

```json
{"openapi":"3.0.1","info":{"title":"Default module","version":"1.0.0"},"tags":[{"name":"Notifications and Webhook"}],"security":[],"paths":{"/updateWebhookURL.do":{"post":{"summary":"Register Webhook","deprecated":false,"description":"**Endpoint:**\nhttps://sandbox.atriptech.com/updateWebhookURL.do","tags":["Notifications and Webhook"],"parameters":[{"name":"Accept","in":"header","description":"","required":true,"schema":{"type":"string"}},{"name":"Content-Type","in":"header","description":"","required":true,"schema":{"type":"string"}},{"name":"Accept-Encoding","in":"header","description":"","required":true,"schema":{"type":"string"}},{"name":"x-atlas-client-id","in":"header","description":"","required":true,"schema":{"type":"string"}},{"name":"x-atlas-client-secret","in":"header","description":"","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","description":"The URL for receiving webhook notifications"}},"required":["url"]}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"integer"},"msg":{"$ref":"#/components/schemas/ResponseMessage","nullable":true}},"required":["status"]}}},"headers":{}}}}}},"components":{"schemas":{"ResponseMessage":{"type":"string","description":"It serves as an additional description of the response result. Especially when the interface reports an error (`status` !=`0`), it is usually a human-readable error message. Note: Do not use this field in any programming scenarios. For example, do not judge whether the interface responds successfully based on this field. Instead, you should only determine it by checking whether the status is equal to`0`at any time."}}}}
```

## Incident List

> \*\*Endpoint:\*\*\
> <https://sandbox.atriptech.com/event/getPageList.do>

```json
{"openapi":"3.0.1","info":{"title":"Default module","version":"1.0.0"},"tags":[{"name":"Notifications and Webhook"}],"security":[],"paths":{"/event/getPageList.do":{"post":{"summary":"Incident List","deprecated":false,"description":"**Endpoint:**\nhttps://sandbox.atriptech.com/event/getPageList.do","tags":["Notifications and Webhook"],"parameters":[{"name":"Accept","in":"header","description":"","required":true,"schema":{"type":"string"}},{"name":"Content-Type","in":"header","description":"","required":true,"schema":{"type":"string"}},{"name":"Accept-Encoding","in":"header","description":"","required":true,"schema":{"type":"string"}},{"name":"x-atlas-client-id","in":"header","description":"","required":true,"schema":{"type":"string"}},{"name":"x-atlas-client-secret","in":"header","description":"","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"eventId":{"type":"string","description":"Incident ID"},"orderNo":{"type":"string","description":"Order number"},"eventType":{"type":"string","description":"Incident type:\n- `email.schedulechange`: Schedule Change-Email Notification\n- `abnormal.cancelled`: Unacounted Cancellation\n- `order.schedulechange`: Schedule Change-API Notification"},"pnr":{"type":"string","description":"Order's pnr."},"paxName":{"type":"string","description":"Order's passenger names."},"paxEmail":{"type":"string","description":"Order's passenger Email. Email address passed to the Airline."},"airline":{"type":"string","description":"Airline IATA code."},"eventStatus":{"type":"array","items":{"type":"integer"},"description":"A list containing incident stauses\n- `0`: Unconfirmed\n- `1`: Confirmed"},"eventTimeStart":{"type":"string","description":"Incident Receiving Time Start\nFormat: yyyy-MM-dd HH:mm:ss UTC+08:00"},"eventTimeEnd":{"type":"string","description":"Incident Receiving Time End\nFormat: yyyy-MM-dd HH:mm:ss UTC+08:00"},"depTimeStart":{"type":"string","description":"Departure Time Start(Departure local time)\nFormat: yyyy-MM-dd HH:mm:ss"},"depTimeEnd":{"type":"string","description":"Departure Time End(Departure local time)\nFormat: yyyy-MM-dd HH:mm:ss"},"updateTimeStart":{"type":"string"},"pageIndex":{"type":"integer","default":1,"description":"Pagination","nullable":true},"pageSize":{"type":"integer","description":"Number of records per page"}},"required":["pageSize"]}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"integer"},"msg":{"type":"string","nullable":true},"records":{"type":"array","items":{"type":"object","properties":{"eventId":{"type":"string","description":"Incident Id."},"orderNo":{"type":"string","description":"Order Number."},"eventType":{"type":"string","description":"Incident type\n-`email.schedulechange`: Schedule Change-Email Notification\n-`abnormal.cancelled`: Unacounted Cancellation\n-`order.schedulechange`: Schedule Change-API Notification"},"eventStatus":{"type":"integer","description":"Incident staus\n-`0`: Unconfirmed\n-`1`: Confirmed"},"eventTime":{"type":"string","description":"Incident recieving time.\nFormat: yyyy-MM-dd HH:mm:ss UTC+08:00"},"confirmedResult":{"type":"string","description":"Incident Reason. Schedule Change Type & Cancelled Type.","nullable":true},"confirmedRemark":{"type":"string","description":"Remark.","nullable":true},"createTime":{"type":"string","description":"Incident create time.\nFormat: yyyy-MM-dd HH:mm:ss UTC+08:00"},"airline":{"type":"string","description":"Airline IATA code."},"depTime":{"type":"string","description":"Flight depature time. Depature local time."},"confirmTime":{"type":"string","description":"Confirmed Time.\nFormat: yyyy-MM-dd HH:mm:ss UTC+08:00","nullable":true},"notified":{"type":"integer","description":"Send the notification or not. 1: YES. 0: No","nullable":true},"pnr":{"type":"string","description":"Order's pnr."},"paxName":{"type":"string","description":"Order's passenger names."},"paxEmail":{"type":"string","description":"Order's passenger Email. Email address passed to the Airline."}},"required":["eventId","orderNo","eventType","eventStatus","eventTime","createTime","airline","depTime","pnr","paxName","paxEmail"]}},"pageIndex":{"type":"string","description":"Current pagination"},"pageSize":{"type":"string","description":"Page size"},"total":{"type":"string","description":"Total number of records"}},"required":["status","pageIndex","pageSize","total","records"]}}},"headers":{}}}}}}}
```
