function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
basil rakawibasil rakawi 

REST API from *.force.com site

When invoking the chatter REST API from a force.com page I get:

Origin
https://*.ap1.force.com is not allowed by Access-Control-Allow-Origin.

 

How do I add my force.com site to the allow list?

 

Basil Rakawi

ChrisOctagonChrisOctagon

Are you running into the Single Origin Policy here? If so, Salesforce has an Ajax proxy you can use to tunnel your callout through the Salesforce server, it's doc'd halfway down this page: http://www.salesforce.com/us/developer/docs/ajax/Content/sforce_api_ajax_queryresultiterator.htm

 

There is also a whitelist of sites that your pages are allowed to call out to, which you can access in Setup, under Remote Site Settings: http://login.salesforce.com/help/doc/en/configuring_remoteproxy.htm