REST API doesn't work in TeamCity build

rezeda mindubaeva February 26, 2021

So here's the problem:

I try to get some info from confluence page using python requests.

The code looks something like this

requests.get(f"{confluence_url}/rest/api/content/{page_id}",
auth=(USER, PWD),
params={'expand': 'version,body.storage'})

URL: https://confluence.mycompany.com/rest/api/content/(page_id)?expand=version%2Cbody.storage

I can access the page locally and it works just fine, even with the basic auth.

But when I try to run TC build that executes this code (using the same credentials) I get the following error:

{"statusCode":404,"data":{"authorized":false,"valid":true,"allowedInReadOnlyMode":true,"errors":[],"successful":false},"message":"No content found with id: ContentId{id=(page_id))}","reason":"Not Found"}

Although this page exists and judging by log, URL is not modified in any way.

This TC build also uses other Atlassian rest apis (jira, bitbucket) and there are no errors.

1 answer

0 votes
Fabian Lim
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 24, 2021

HI @rezeda,

Try the recommendations posted in here and see if they resolve your issue: https://community.atlassian.com/t5/Confluence-questions/Unable-to-find-space-through-REST-API-in-postman-but-working/qaq-p/1084773

Regdrs

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events