+ Start a Discussion
vishal@forcevishal@force 

REST API help!

Hi force.com-geeks!

 

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.

Navatar_DbSupNavatar_DbSup

Hi,

 

Use remote access to specify remote access applications, that is, applications external to salesforce.com that use the OAuth protocol to verify both the salesforce.com 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. Salesforce.com introduced support for Draft 10 of OAuth 2.0 in the winter '11 release of Force.com; 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

http://www.salesforce.com/us/developer/docs/api_rest/api_rest.pdf

 

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

 

vishal@forcevishal@force

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

 

SuperfellSuperfell

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