# 场景应用：包裹更新提醒

顾客成功下单后，如果曾经按照 [场景应用：推送订单回执](https://docs.bothub.ai/advanced-tool/ec-bot/order-receipt) 中采用了 Checkbox 插件的方式关联了 custom user id，那么你就可以调用电商机器人提供的 API 向用户推送发货提醒和物流更新提醒，增加与每位顾客互动的机会，提升了用户体验。

![发送包裹更新提示](/files/-LFS5yRkb5WX2zHxHY62)

下面，我将为你说明配置方法：

## 创建 API Key，配置接口

首先，前往“API 对接” -> ”密钥管理“处，新建一个 API Key。

![创建 API Key](/files/-LFS6DcXiR1oVmqFlOEZ)

## 调用物流更新API

至“API 对接” -> “API 管理” -> “物流更新”，选择刚刚创建的 Key，切换“用户”选项为“用户ID”，在右侧空格中填写用户在您网站上的ID。只要此用户在您的网站上在Checkbox插件上打过勾以确认收取订单回执和发货提醒，那么您就可以获取下方的 CURL命令并执行以发送物流更新了。

实际使用中，您应该在订单实际发货的时候，通过您的后台，以与此CURL命令相同的格式调用我们的API，即可发送物流更新提醒。数据应替换成您订单物流状态实际的数据。数据格式可以参照下列页面中的”JSON“部分。

![执行 CURL](/files/-LFtn1Ksh26qRFcZLUqI)

接下来，详细介绍一下要发送的数据。

### **数据**

```
{
  "request": {
    "method": "send_template",
    "id": "test_1523960374_wERGZIon",
    "page_id": "176029956384795",
    "template_name": "Shipping Status Update Push"
  },
  "recipient": {
    "username": "custom user id"
  },
  "params": {
    "package_number": "zvfVUREPVPUQ1oMl",
    "package_status_description": "Status: enroute by UPS \n Exp. Delivery: 03, Jan, 2018",
    "image_url": "https://unsplash.it/120/120/?random",
    "detailed_tracking_url": "http://shop.bothub.ai",
    "fb_first_name": "Peter",
    "package_status": "shipped"
  }
}
```

### **数据说明**

以下数据将用于，生成对应的包裹更新详情。其中，

* package\_number 为运单号
* package\_status 为包裹状态
* package\_status\_description 为包裹状态详情
* image\_url 为包裹图片
* detailed\_tracking\_url 为包裹详情查询链接
* fb\_first\_name 为用户名
* 我们将验证以上数据格式，并在验证通过后向顾客发送消息

### **返回值**

#### **成功**

```
{
  "request_id": "test_1523960966_EnPC3z5h",
  "recipient_id": "1602407863220595"
}
```

#### **失败**

```
{
  "error": {
    "code": 10010,
    "error_subcode": 0,
    "type": "",
    "message": "Recipient not found",
    "request_id": "test_1523960966_EnPC3z5h"
  }
}
```

现在，你可以随时通过 API 调用的方式，向顾客发送物流更新提醒。


---

# 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://bothub.gitbook.io/project/advanced-tool/ec-bot/package-update.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.
