-1

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

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

4

3 回答 3

0

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"
}
于 2020-09-12T19:56:57.670 回答
0

curl示例与json基本相同:

对于地址创建示例

-d "address[street1]=417 MONTGOMERY ST"

相当于

{ "address": { "street1": "417 MONTGOMERY ST" } }

(您可能必须转义一些字符才能成为有效的 json)。

查看如何使用 postman为带有 HTTP Basic Auth 的邮递员刺激 cURL 请求。

于 2019-12-16T23:05:26.623 回答
0

更新:

EasyPost 现在确实有一个公共工作区https://www.postman.com/easypost-api

至少有 1 个公共收藏

在邮递员中运行

于 2021-09-01T19:10:41.603 回答