Forum Discussion

hayat_sama's avatar
9 years ago

Cross Origin Request to API

I am doing R & D, in which I need help regarding call api from another domain using JAVASCRIPT.

For Example, I am calling given api for credentials, 

 

 https://community-name//restapi/vc/authentication/sessions/login?user.login=APIUserName&restapi.response_format=json

 

But in order to call this, request should be raised from same domain, means from community domain only. But I want to access it from another domain for displaying community blog to our website. 

 

Error : XMLHttpRequest cannot load https://community-name//restapi/vc/authentication/sessions/login?user.login=APIUserName&restapi.response_format=json. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'abc_domain' is therefore not allowed access.

 

Is it feasible to use api from another domains ?