You need to sign in to do that
Don't have an account?

REST API Issue
Hello, I'm looking to use the Salesforce REST api to get data from the system into a sharepoint site. We've setup the whitelisted domains in the CORS section but are still getting the "XMLHttpRequest for [URL] required Cross Origin Resource Sharing (CORS)" error.
Our sharepoint site is on our internal network and I was wondering if that's why the whitelisted domain isn't working. Is there a way to get around this?
Here's the javascript call I'm using, just in case I missed something and it's actually a programming error.
Thanks!
Our sharepoint site is on our internal network and I was wondering if that's why the whitelisted domain isn't working. Is there a way to get around this?
Here's the javascript call I'm using, just in case I missed something and it's actually a programming error.
<script> $(document).ready(function() { $.ajax({ url: "https://my.salesforce.com/services/data.json }).done(function(data) { $('.output').append(data); }).fail(function (jqXHR, textStatus) { alert('error: ' + jqXHR); }); }); </script>
Thanks!
When I was researching about this error, i found that this error occurs with internet explorer.Please refer below links.
http://stackoverflow.com/questions/20160003/xmlhttprequest-for-http-required-cross-origin-resource-sharing-cors-and-pre
http://stackoverflow.com/questions/24646732/sec7118-xmlhttprequest-cors-ie-console-message
https://developer.salesforce.com/forums/?id=906F0000000BI96IAG
Hope this helps you!
If this helps you mark it as solved.
Thanks and Regards
Sandhya
XMLHttpRequest cannot load https://my.salesforce.com/services/oauth2/token. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'myorigin.com' is therefore not allowed access.
Also, I tried using the code locally outside of sharepoint and it works fine, it just fails on the company sharepoint site.
Did you ever get this to work? We have a similar situation since our SharePoint instance not exposed to the Internet.
Thanks!