Git Product home page Git Product logo

Comments (7)

Justintime50 avatar Justintime50 commented on September 7, 2024 1

In Postman, you could use a raw JSON body like the following which works as intended:

curl -X POST https://api.easypost.com/v2/trackers/create_list \
  -u "API_KEY:" \
  -H "Content-Type: application/json" \
  -d '{"trackers":{
    "0":{"tracking_code":"EZ1000000001", "carrier":"USPS"},
    "1":{"tracking_code":"EZ1000000001", "carrier":"USPS"},
    "2":{"tracking_code":"EZ1000000001", "carrier":"USPS"},
    "3":{"tracking_code":"EZ1000000001", "carrier":"USPS"}
  }}'

There is a bug here where the API key is getting the tracking code as a value so the request fails because the tracking code getting passed isn't a valid API key. We'll need to patch this.

from easypost-python.

Justintime50 avatar Justintime50 commented on September 7, 2024

Hey @jmnmv12 thanks for reporting this! Are you able to provide a little snippet of code and/or a couple tracking numbers so we could try recreating this on our end? Most likely this isn't an API key issue but something wrong in the code either in the client library or API.

from easypost-python.

jmnmv12 avatar jmnmv12 commented on September 7, 2024

Hey, yeah of course you can recreate it by running this snippet:

easypost.api_key = "MY_API_KEY"
tracker_list = [
    {
        "tracking_code": "EZ1000000001",
        "carrier": "USPS"
    }
]
easypost.Tracker.create_list(tracker_list)

I used one of your test tracking codes in this case.

from easypost-python.

jmnmv12 avatar jmnmv12 commented on September 7, 2024

I tried to do the same request through Postman and there I don't receive this error, but because I don't know what is the expected request body, I end up receiving a 500 Internal Server Error. Do you know where I should look to understand what type of request you are expecting on this endpoint? I took a look at your documentation but I couldn't find anything about this.

from easypost-python.

jmnmv12 avatar jmnmv12 commented on September 7, 2024

Okay thank you for the help 👌

from easypost-python.

LoganSimonsen avatar LoganSimonsen commented on September 7, 2024

@jmnmv12 I would highly recommend most of our users stick to using our publicly documented endpoint for creating individual trackers https://www.easypost.com/docs/api#create-a-tracker.

Even if you have a high volume of trackers to create, this endpoint should be able to handle high request volume. Feel free to hit up [email protected] if you have any problems.

from easypost-python.

Justintime50 avatar Justintime50 commented on September 7, 2024

This should have been corrected and will be included in v7.0.0; however, I'd also recommend what @LoganSimonsen suggested and use our normal trackers endpoint as it's more stable than creating trackers in bulk.

from easypost-python.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.