# Cumulocity IoT Tips and tricks - Cannot access Cumulocity REST APIs, 'Origin ... is not allowed by Access-Control-Allow-Origin'

**URL:** <https://community.cumulocity.com/t/cumulocity-iot-tips-and-tricks-cannot-access-cumulocity-rest-apis-origin-is-not-allowed-by-access-control-allow-origin/7470>\
**Category:** Knowledge Base\
**Tags:** cumulocity\
**Created:** [March 6, 2019, 11:57am UTC](https://community.cumulocity.com/t/cumulocity-iot-tips-and-tricks-cannot-access-cumulocity-rest-apis-origin-is-not-allowed-by-access-control-allow-origin/7470 "2019-03-06T11:57:48Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Michael\_Welsing](https://avatars.discourse-cdn.com/v4/letter/m/3e96dc/32.png) [@Michael\_Welsing](https://community.cumulocity.com/u/Michael_Welsing)\
**Post date:** [March 6, 2019, 11:57am UTC](https://community.cumulocity.com/t/cumulocity-iot-tips-and-tricks-cannot-access-cumulocity-rest-apis-origin-is-not-allowed-by-access-control-allow-origin/7470/1 "2019-03-06T11:57:48Z")

</div>

If you are developing JavaScript applications and get errors calling Cumulocity REST APIs, here's a likely reason:

"You are serving the JavaScript from an own web server (localhost) and access a different site from the XMLHttpRequest (cumulocity). The "same origin policy" does not permit this ([http://en.wikipedia.org/wiki/Same-origin\_policy](http://en.wikipedia.org/wiki/Same-origin_policy)).

JavaScript development environments usually have a way to work around this. I recommend you to use our tooling based on NPM and grunt, see here: [http://cumulocity.com/guides/web/introduction/](http://cumulocity.com/guides/web/introduction/). We also have JavaScript libraries that solve about all standard use cases in working with the APIs, which should save you some time: [http://resources.cumulocity.com/documentation/jssdk/latest/#/core](http://resources.cumulocity.com/documentation/jssdk/latest/#/core) Both tooling and libraries can also be used for standalone apps, if you do not want to implement plugins to Cumulocity.

As last resort, you can also enable cross-site scripting in Cumulocity in the administration tool. I don't recommend this, though."
