Hi,
I'm trying to connect to our confluence cloud wiki via the REST Api. This is done in javascript with a jQuery ajax request:
url = 'https://???.atlassian.net/wiki/rest/api/content/1409034?expand=body.view'; var encode = Base64.encode("EMAIL:PASSWORD"); $.ajax({ type: "GET", url: url, dataType: 'json', crossDomain: true, beforeSend: function (xhr) { xhr.setRequestHeader("Authorization", "Basic "+encode); }, success: function (){ console.log("success"); } });
This request leads to the following CORS error:
XMLHttpRequest cannot load https://smashdocs.atlassian.net/wiki/rest/api/content/1409034?expand=body.view. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost' is therefore not allowed access.
I have activated the Remote API and the anonymous access to the Remote API in the confluence administration settings, but that doesn't solve the problem.
Any ideas? Or is this impossible with the cloud version confluence?
Community moderators have prevented the ability to post new answers.
Hey Phil, were you ever able to resolve this? We're hitting a similar wall with Confluence Cloud and Support wasn't able to assist.
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.
Hi Sash,
yes, I have tried that. This leads to the next error:
Refused to execute script from 'https://???.atlassian.net/wiki/rest/api/content/1409034?expand=body.view&callback=jQuery110202722693895921111_1421155061833&_=1421155061834' because its MIME type ('application/json') is not executable, and strict MIME type checking is enabled.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Have you tried setting dataType to jsonp?
dataType: 'jsonp', crossDomain: true,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Community moderators have prevented the ability to post new answers.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.