Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

API requests returning a 403 error...(this one has a twist)

Steve Suranie
Contributor
June 6, 2023

My company is in the process of an M&A and I am trying to access the acquired company's Confluence instance through the API. I have access to the site, in fact, I am the site administrator...

admin-me.png

I can do all the stuff not working below on the parent company site. 

And I can plug a API query using the merged company's Atlassian URL into the browser and get results...

https://xxxxxxxxx.atlassian.net/wiki/rest/api/space returns all the site spaces. 

I made a token specifically for queries from the merged company, set it to base64encoded using my email:token format and pass it in the header as Authorization: Basic 64encoded-string

If I try to access using cURL or Python I get the same 'no soup for you' error: 

{

  "message""Current user not permitted to use Confluence",

  "statusCode"403

}

My cURL code: 

curl -D \

   -X GET \

   -H "Authorization: Basic a3RjQGthcmdvLmNvbTpldVFvbXhwd3RtaGpxxxxxxxxxxxxxx \

   -H "Content-Type: application/json" \

   "https://xxxxxxxx.atlassian.net/wiki/rest/api/space"| jq '.' -S

With Python I am using the Atlassian module. So initialize a Confluence class instance: 

commConfluence = Confluence(
url='https://xxxxxxxx.atlassian.net',
username="ssuranie@kargo.com",
password="
a3RjQGthcmdvLmNvbTpldVFvbXhwd3RtaGpBUUh1UW10VDVBNjQ=",
cloud=True)

and then I call it like: 

dictPage = commConfluence.get_page_by_id(strId, expand="body.storage", status=None, version=None)

Again, I can get this to work on the parent company Atlassian address but not the merged company. Am I missing something here? 

Thanks!

1 answer

0 votes
Gonchik Tsymzhitov
Community Champion
August 25, 2023
Steve Suranie
Contributor
August 28, 2023

Hi Gonchik, 

Not sure what you mean, I mentioned I have a token for the other site in my original post: 

I made a token specifically for queries from the merged company, set it to base64encoded using my email:token format and pass it in the header as Authorization: Basic 64encoded-string



Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events