question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Tracker create_list() function keeps retuning a 403

See original GitHub issue

When I try to use the Tracker.create_list() operation I keep receiving the following error:

Traceback (most recent call last):
  File "<console>", line 1, in <module>
  File "/env/lib/python3.7/site-packages/easypost/__init__.py", line 800, in create_list
    response, api_key = requestor.request("post", url, params)
  File "/env/lib/python3.7/site-packages/easypost/__init__.py", line 208, in request
    response = self.interpret_response(http_body, http_status)
  File "/env/lib/python3.7/site-packages/easypost/__init__.py", line 273, in interpret_response
    self.handle_api_error(http_status, http_body, response)
  File "/env/lib/python3.7/site-packages/easypost/__init__.py", line 337, in handle_api_error
    raise Error(error.get("message", ""), http_status, http_body)
easypost.Error: This api key is no longer active. Please use a different api key or reactivate this key.

I have confirmed multiple times that the key is valid and I am able to do other requests with the same key, for example, I can create individual trackers through the following operation Tracker.create() with the same API key.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
Justintime50commented, Nov 5, 2021

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.

0reactions
Justintime50commented, Apr 13, 2022

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

403 Forbidden Error: What It Is and How to Fix It - Airbrake Blog
This occurs when attempting to access an invalid or forbidden URL that the web server software has restricted. For example, Apache servers ...
Read more >
403 error: how to solve - SupportHost
The 403 error is used to identify web pages or resources that cannot be accessed. However, it may happen that the 403 Forbidden...
Read more >
403 Forbidden - HTTP - MDN Web Docs - Mozilla
The HTTP 403 Forbidden response status code indicates that the server understands the request but refuses to authorize it.
Read more >
What Is the 403 Forbidden Error and How to Fix It (8 Methods ...
Another possible cause triggering HTTP 403 errors is incorrect permissions for files or folders. In general, when files are created, they come with...
Read more >
Implementing a bittorent client and I get 403 from the tracker
I downloaded and managed to succesfully decode the torrent file, however when I try to do the GET request at the tracker I...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found