Hi. I have a question about Confluence's Rest API.
I've been using Google Apps Scripts to get information of confluence pages.
It worked fine until few days ago, but when I ran the script today, it started to return the error below:
Exception: Request failed for myurl returned code 403. Truncated server response: <html>
<head><title>403 Forbidden</title></head>
<body>
<center><h1>403 Forbidden</h1></center>
</body>
</html>
I haven't changed any code, and curl command works fine.
What are possible causes of this mysterious error?
My gas code to get confluence page is below:
function create_headers()
{
return {
'content-type' : 'application/json',
'Authorization': 'Bearer ' + PropertiesService.getScriptProperties().getProperty("CONFLUENCE_TOKEN"),
};
}
function getChildPages(page_id)
{
var headers = create_headers();
var options = {
'headers' : headers,
'method' : 'get',
};
var api_url = myurl + '/rest/api/content/' + page_id + '/child' + '?expand=page';
var response = UrlFetchApp.fetch(api_url, options);
var content_json = JSON.parse(response.getContentText('UTF-8'));
return content_json["page"]["results"];
}
I appreciate your help.
I am also encountering this problem now with the same situation, I can use the Confluence REST API before but now it returns 403 error.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi. I finally solved this problem!
It was web application firewall(WAF) restrictions of Confluence Server(my company's infrastructure team solved it).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.