Getting atl_token for API calls

I’m trying to use Confluence API to export pages to PDFs.
I have an API key, and I can successfully use it to make calls like GET https:///wiki/rest/api/content/.
I also see, in the UI, that each page has in its details a PDF download URL, in the form: https:///wiki/spaces/flyingpdf/pdfpageexport.action?pageId=&atl_token=.
The token appears to be per session.
My problem is that when using the API I don’t have the atl token, and don’t see a way to find it. Without it, I’m getting 403 from the download URL. Is there a way to get an atl token? Alternatively, is there another way to export pages to PDFs using the API?

1 Like

Same issue here. It seems that this atl_token was added with confluence 9 as our script was running fine with 8.5.x

Did you find a solution?

If some one is getting here searching for a solution:

You need to bypass the token by adding

(“X-Atlassian-Token”, “no-check”) into the header.

Maybe like:
conn.setRequestProperty(“X-Atlassian-Token”, “no-check”);

2 Likes