I have created webservice class with Get method.
I have created Connected app and I have consumer key and consumer secret.But I don't have knowledge on how to use it.
When external app is calling they are getting <errorCode>INVALID_SESSION_ID</errorCode> <message>Session expired or invalid</message>
.
How can I resolve this error.
Best Answer
First you need to get the access token from the Connect app tokens.
Here is a sample code for your reference
Now using this access token you need to make request to your custom Rest endpoint then you will get expected details.
Your sample code would be
Step Two: Set Up Authorization
Oauth Implementation