Activity › Forums › Salesforce® Discussions › Can I have a public APEX REST API in Salesforce?
Tagged: Apex REST API, Content Type, HTTP Header, JSON, JSON Response, Public Access Settings, Rest API, Salesforce Apex Class, Salesforce REST API
-
Can I have a public APEX REST API in Salesforce?
Posted by Suraj on April 28, 2017 at 1:39 PMCan I have a public APEX REST API?
Parul replied 7 years, 7 months ago 3 Members · 3 Replies -
3 Replies
-
Hi Suraj
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.
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.
Hope it may help you:
- [adinserter block='9']
-
You will need to configure a public site and make the webservice available through it.
-
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.
Log In to reply.