4

Could anyone please assist me on how to call an external web service using OAUTH. Could you please show me the base template class I would use. I am given the following instructions on Envisionme. I already have an app on their side with the client_id and client_secret. Im just so frustrated becasue I have been searching documentation for the past two weeks and cant seem to get something to assist me :(. I wanna be able to then have a button on my contact page which will then call the class which will make the callout to that API and retrieve the response.

From what I have heard

Integration is the process which involves authentication. In general ways we use Oath2.0. Steps: 1. We need to get code (authentication code ) from external application 2. Using this code we need to get access token 3. Now you are all set to hit any external api

What I need to know then is how to implement this. Could someone please give me a sample code which I could use to authenticate and start making my posts and gets. Such as the way I would using Ready API

enter image description here

  • What does your code look like so far? – Rob Aug 19 '15 at 9:34
8

You can use the "named credential" feature (new feature released in Spring 15). http://help.salesforce.com/apex/HTViewHelpDoc?id=named_credentials_about.htm&language=en_US

With named credentials the Oauth2 authentication flow is handled automatically, you don't need to implement specific code for it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.