Browser and command line API responses do not match (with example)

I’m using Python and requests/json libraries to use the Confluence API. The most explicit example I can provide for the API responses not matching is:
https://mybaselink.com/rest/api/content/theexactpageid

Submitting that request in the browser yields a json object with relevant information. Submitting it using Python (used command line to run the code) yielded a 404 response. My best guess is that I hit a limit of sorts. But I never specified a limit in the browser, so both API queries should yield the same json object, right?

Hello @ekern,

There are two possible ways to hit an HTTP status 404 for /rest/api/content/{contentId}:

  1. There’s no content with the given content ID
  2. The user does not have permission to view the content

Since you were able to see the content via browser using the same content ID, then we can rule #1 out; we are now left with #2 as the probable cause. Are you using the same user for browser and CLI? If you are, how are you calling the REST API via Python?

Cheers,
Ian