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

REST API help!



I wanted to try and implement creating REST API's using Apex REST. As per the documentation provided, I did understand the steps for it. (referred this : Creating_REST_APIs_using_Apex_REST)


Once I create an endpoint, I am unable to know how exactly should I be able to access it through some other Salesforce Org. I know it requires authentication process, but since most of the examples show configuration from a java app or a desktop app, I don't know how do I configure my Remote Access and what should be the callback url if I want to access the API class through some other salesforce dev org.


Can anyone please guide me for configuring the Remote Access and how to authenticate the destination org (where the API exists) from the source dev org.




Use remote access to specify remote access applications, that is, applications external to that use the OAuth protocol to verify both the user and the external application . For this go to App Setup ->Develop ->Remote Access -> Click on new button. After creating new remote access you will get Consumer Key and Consumer Secret.


Now for Authentication you can make use of OAuth 2.0. introduced support for Draft 10 of OAuth 2.0 in the winter '11 release of; this version continues to be supported in spring '11.

After Authentication we can make use of REST API's for sending request.


For more details regarding REST Api follow the below links


Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved. 



Hi Navatar_DbSup, 


Thanks for the quick reply. I know I have to configure my Remote Access Settings and I will have to use OAuth for authentication.


What I am looking for is some sample code on how to do the OAuth for one salesforce org from another salesforce org (right now I only came across where a salesforce org is being authenticated from some application and not from another salesforce org).

Similarly, regarding the Remote Access settings, I don't know what should be my settings when I want to set it up to be accessed from a different salesforce org instead of some application.

Ranu JainRanu Jain

Hii ,

 i also find this prob ......when i sending the request  an error is occuring 


Error : grant type is not supported


i have given the grant type --password


if u find any solution please let me know...thnks



You probably didn't set the content-type header correctly. post your code.