首页 > 解决方案 > EasyPost 是否有任何文档显示请求的原始 JSON,包括标头?或者例如邮递员系列?

问题描述

我只是在为与 EasyPost 的 Shipping API 的集成做准备,这将是服务器端 C#,但我们总是为新的集成构建一个 PostMan 集合,这样如果出现问题,我们可以独立于应用程序测试数据。虽然我确实喜欢 EP 提供 C# 库和示例这一事实,但我正在努力寻找任何只为我提供所需标头列表和任何请求正文的原始 JSON 格式的东西。感觉有点像他们只是有点有帮助了。我可能会查看 Orders 端点。

我有一个帐户,我检查了他们的所有文档并搜索了互联网,但没有找到任何东西,所以我希望我不是第一个想要使用客户端应用程序在我的代码之外进行测试的开发人员。

标签: jsoneasypost

解决方案


EasyPost does not provide a public Postman collection; however, here is an example of a shipment Postman body (raw) that could be used. You can adjust the values, actions, objects, etc to your needs.

Using the following, you shouldn't need to pass any headers. You'll pass your API key under the username field with the Basic Auth authorization type.

{
    "shipment": {
        "to_address": {
            "id": "adr_123..."
        },
        "from_address": {
            "id": "adr_123..."
        },
        "parcel": {
            "id": "prcl_123..."
        },
        "carrier_accounts": {
            "id": "ca_123..."
        },
        "options": {
            "address_validation_level": "0"
        }
    },
    "format": "json",
    "controller": "shipments",
    "action": "create"
}

推荐阅读