Data pipeline export request fails with XSRF check failed error
プラットフォームについて: Data Center のみ - この記事は、Data Center プラットフォームのアトラシアン製品にのみ適用されます。
問題
When attempting to export data using the data pipeline API in Confluence via the command line, the export fails with the following error in the console:
XSRF check failed
原因
The Confluence REST API is protected from Cross Site Request Forgery (XSRF/CSRF) attacks for security reasons.
ソリューション
To call protected APIs from your command line or external systems you can add the X-Atlassian-Token
header to each request, and set the value to no-check
. Adding this header to a request bypasses the server-side XSRF check and allows the request to be fulfilled. This is only available for requests made by command line tools or external systems, not browser requests.
Here's an example export request with the X-Atlassian-Token
header. We used cURL and a personal access token for this request.
curl -H "Authorization:Bearer <personal-access-token>" -H "X-Atlassian-Token: no-check"
-X POST http://<base-url>/rest/datapipeline/latest/export
This issue only affects Confluence.