AnsweredAssumed Answered

Alfresco Cloud API call via AJAX - 403 forbidden

Question asked by haa05 on Dec 9, 2013
Latest reply on Dec 11, 2013 by haa05
Hi,

we would like to create a simple Javascript application that uses the Alfresco Cloud API.
Testing the API with a REST client works fine.

When we use a call like this using jQuery


$.ajax({
  type:"GET",
  url: "https://api.alfresco.com/company.com/public/cmis/versions/1.1/atom/children?id=f3a0dee7-41d3-4fa1-9b7e-bd8c711ec792&orderby=cmis:name ASC",
  crossDomain: "true",
  beforeSend: function (request)
  {
     request.setRequestHeader("Authorization", "Bearer <accessToken)");
  }
})


we get 403 forbidden. If we test with Google Chrome and web-security-disabled it works fine.

This seems to be due to the same origin policy.
Are such calls allowed on Alfresco side (I guess they are)?
Is the browser blocking such requests?
Is there a way to overcome this problem?

I thought the REST based API should make the creation lightweight clients easier.

Thanks in advance!

Regards,
Arno



Outcomes