36

Can I have a public APEX REST API e.g. APEX REST api that is accessible without authentication?

1 Answer 1

36

Yes you can. You will need to configure a public site and make the webservice available through it. There is an excellent tip on the developerforce blogs explaining it in more detail.

I implemented this a few months ago and ran into some issues, but did get it running :). The biggest of which is that your request must have the proper Content-Type Salesforce restful webservices reject x-www-form-urlencoded and refactoring the legacy system was a bit of a problem.

2
  • which content-type should I use if I want to get back a JSON response?
    – Dedo
    Commented Nov 23, 2012 at 8:42
  • 3
    You will get a JSON response back by default. If necessary, you can force the issue via the Accept: application/json HTTP header or by appending .json to the URL.
    – metadaddy
    Commented Nov 26, 2012 at 19:52

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .