I'm just doing the preparation for an integration with EasyPost's Shipping API, which will be server side C#, but we always build a PostMan collection for new integrations, so that we can test data separately from the application if there's an issue. While I do love the fact that EP provide C# libraries and examples, I'm struggling to find anything that just gives me a list of required headers and the raw JSON format for the body of any requests. It feels a bit like they're just being a little too helpful. I'll be looking at the Orders endpoint probably.

I've got an account, I've checked all their documentation and searched the internet but haven't found anything so I'm hoping I'm not the first developer to want to use a client application for testing outside my code.

3

There are 3 best solutions below

0
On

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"
}
0
On

The curl examples are basically the same as json:

For the Address creation example:

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

is the equivalent of

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

(you might have to escape some characters to be valid json).

Check out How to stimulate cURL request to a request using postman for postman with HTTP Basic Auth.

0
On

Update:

EasyPost now does have a public workspace https://www.postman.com/easypost-api

with at least 1 public collection

Run in Postman