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
Nelson Chisoko 15Nelson Chisoko 15 

Calling External Web Service using OAUTH

Hello Guys

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 https://api.envisionme.co.za/v1/docs#oauth. 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
sandeep@Salesforcesandeep@Salesforce
Hi Nelson, 

It is very simple to implement.

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

These three steps are most common steps only the thing would change be ways which differs from external servere to server.

I am also writing some related blog in upcoming days.

Sandeep Singhal
http://www.codespokes.com/
Nelson Chisoko 15Nelson Chisoko 15
Hello Sandeep

Thank you so much for the response. Its been a crazy couple of weeks. I understand the steps now but I dunno how to do the implementation.
Could you please provide me sample code I could use for this. For instance using SOAP UI, I provide the following details
User-added image
Now this normally would retrieve the access token.

So how do I do the same thing in apex. Im sorry for the inconvenience Im really new

Regards
Nelson
babitha kurianbabitha kurian
did u get the reponse? even im stuck in similar implementation