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
VINODKUMAR REDDY KALUVAVINODKUMAR REDDY KALUVA 

How to Use Dropbox Access Token Visualforce Page in Different Apex Class To Make an HTTP Callout

I have created a visualforce page to get the code initially and after the code with redirect url I'm getting the Access Token for Dropbox.

So I have confused that How I can use this in the real-time apex call to make a callout using HTTP Calls how can we get the Access token from the visualforce page to make a callout in the different apex class.

 

Here is the Blog that I have used for the Access Token DROPBOX:

http://forceguru.blogspot.com/2014/05/dropbox-authentication-in-salesforce.html

But How we can consume this in different apex class because for this visualforce page which we are using for an access token is having redirect URL?

Please let me know if my question is not clear.

 

 

SwethaSwetha (Salesforce Developers) 
HI Vinod,
I see you also posted on https://salesforce.stackexchange.com/a/403630/80089 according to which 

"Ordinarily, you'd store the access token somewhere (e.g. a Custom Setting or Custom Metadata), and then when you need to make the real-time API calls, you'd retrieve that data for use in your callout. You would not want to call this page for every API call.

During the OAuth process, you'll get two tokens: the first is the access token you use for API access, and the second is a refresh token, that you use to get a new access token. Note: you could also just use Named Credentials, which takes care of this process for you."

If this information helps, please mark the answer as best so it can help others too in future. Thank you
VINODKUMAR REDDY KALUVAVINODKUMAR REDDY KALUVA

Thank you so much for your response.

I have two confusions regarding this one:

1. If just use in Custom settings or some where it will be expiring know after 1 day of something access token.

 can you provide me some examples or references how to use Refresh token process.

****************

2. I tried using Named Crends but is given to me below Message and it is expiring after 1 day.

 

The authentication provider didn't provide a refresh token. If the access token expires, your org won't be able to access this named credential.