<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Issue in generating access token in Dropbox API Support &amp; Feedback</title>
    <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Issue-in-generating-access-token/m-p/592667#M27563</link>
    <description>&lt;P&gt;Hello, I faced many issues in generating access token&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;First, I have here access code generated &amp;lt;REDACTED&amp;gt;&lt;STRIKE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/STRIKE&gt;Second trying to execute this curl :&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;curl https://api.dropbox.com/oauth2/token \ &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;-d code=&lt;SPAN&gt;&amp;lt;REDACTED&amp;gt;&lt;/SPAN&gt; \ &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;-d grant_type=authorization_code \ &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;-d redirect_uri=https://api.dropbox.com/oauth2/token \ &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;-u &amp;lt;REDACTED&amp;gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;It prints every time :&amp;nbsp;&lt;BR /&gt;&lt;STRONG&gt;{&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;"error": "invalid_grant",&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;"error_description": "redirect_uri mismatch"&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;}&lt;BR /&gt;&lt;/STRONG&gt;However I have here the redirected links&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="MostafaEzzat_0-1650622387439.png" style="width: 400px;"&gt;&lt;img src="https://www.dropboxforum.com/t5/image/serverpage/image-id/28945i151DCF16176C5590/image-size/medium?v=v2&amp;amp;px=400" role="button" title="MostafaEzzat_0-1650622387439.png" alt="MostafaEzzat_0-1650622387439.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 22 Apr 2022 15:05:18 GMT</pubDate>
    <dc:creator>Mostafa Ezzat</dc:creator>
    <dc:date>2022-04-22T15:05:18Z</dc:date>
    <item>
      <title>Issue in generating access token</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Issue-in-generating-access-token/m-p/592667#M27563</link>
      <description>&lt;P&gt;Hello, I faced many issues in generating access token&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;First, I have here access code generated &amp;lt;REDACTED&amp;gt;&lt;STRIKE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/STRIKE&gt;Second trying to execute this curl :&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;curl https://api.dropbox.com/oauth2/token \ &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;-d code=&lt;SPAN&gt;&amp;lt;REDACTED&amp;gt;&lt;/SPAN&gt; \ &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;-d grant_type=authorization_code \ &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;-d redirect_uri=https://api.dropbox.com/oauth2/token \ &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;-u &amp;lt;REDACTED&amp;gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;It prints every time :&amp;nbsp;&lt;BR /&gt;&lt;STRONG&gt;{&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;"error": "invalid_grant",&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;"error_description": "redirect_uri mismatch"&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;}&lt;BR /&gt;&lt;/STRONG&gt;However I have here the redirected links&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="MostafaEzzat_0-1650622387439.png" style="width: 400px;"&gt;&lt;img src="https://www.dropboxforum.com/t5/image/serverpage/image-id/28945i151DCF16176C5590/image-size/medium?v=v2&amp;amp;px=400" role="button" title="MostafaEzzat_0-1650622387439.png" alt="MostafaEzzat_0-1650622387439.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Apr 2022 15:05:18 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Issue-in-generating-access-token/m-p/592667#M27563</guid>
      <dc:creator>Mostafa Ezzat</dc:creator>
      <dc:date>2022-04-22T15:05:18Z</dc:date>
    </item>
    <item>
      <title>Re: Issue in generating access token</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Issue-in-generating-access-token/m-p/592736#M27569</link>
      <description>&lt;P&gt;The "redirect_uri mismatch" error indicates that this call failed because the redirect_uri used on &lt;A href="https://www.dropbox.com/developers/documentation/http/documentation#oauth2-authorize" target="_self"&gt;/oauth2/authorize&lt;/A&gt; to get that authorization code does not match the redirect_uri used when calling &lt;A href="https://www.dropbox.com/developers/documentation/http/documentation#oauth2-token" target="_self"&gt;/oauth2/token&lt;/A&gt;. These two values need to match exactly. Or, if you didn't set redirect_uri on &lt;A href="https://www.dropbox.com/developers/documentation/http/documentation#oauth2-authorize" target="_self"&gt;/oauth2/authorize&lt;/A&gt;, you should likewise omit it when calling &lt;A href="https://www.dropbox.com/developers/documentation/http/documentation#oauth2-token" target="_self"&gt;/oauth2/token&lt;/A&gt; as well.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, note that the four dropbox.com/dropboxapi.com URIs you have registered for your app are part of Dropbox itself, and would not be redirect URIs you use for your app. For example, &lt;A href="https://api.dropbox.com/oauth2/token" target="_blank"&gt;https://api.dropbox.com/oauth2/token&lt;/A&gt; is the endpoint for retrieving access tokens after the user has authorized the app; it is not a redirect URI for your app. The redirect URI would be some address that your app controls where it can receive the authorization result. Or as noted above, you can omit a redirect URI entirely.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can find more information on how this flow works in &lt;A href="https://developers.dropbox.com/oauth-guide" target="_self"&gt;the OAuth Guide&lt;/A&gt; and &lt;A href="https://www.dropbox.com/developers/documentation/http/documentation#authorization" target="_self"&gt;authorization documentation&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Fri, 22 Apr 2022 15:11:32 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Issue-in-generating-access-token/m-p/592736#M27569</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2022-04-22T15:11:32Z</dc:date>
    </item>
    <item>
      <title>Re: Issue in generating access token</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Issue-in-generating-access-token/m-p/592749#M27572</link>
      <description>&lt;P&gt;I'll present the new steps I've taken&amp;nbsp;&lt;BR /&gt;First : I replaced app key value with mine and I got the code&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;https://www.dropbox.com/oauth2/authorize?client_id=&amp;lt;APP_KEY&amp;gt;&amp;amp;token_access_type=offline&amp;amp;response_type=code&lt;/PRE&gt;
&lt;P&gt;second&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;curl https://api.dropbox.com/oauth2/token \ &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;-d code=&amp;lt;AUTHORIZATION_CODE&amp;gt; \ &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;-d grant_type=authorization_code \ &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;-d redirect_uri=&amp;lt;REDIRECT_URI&amp;gt; \ &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;-u &amp;lt;APP_KEY&amp;gt;:&amp;lt;APP_SECRET&amp;gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp; and replaced with my values&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;curl https://api.dropbox.com/oauth2/token \     -d code=&amp;lt;REDACTED&amp;gt; \     -d grant_type=authorization_code \     -d redirect_uri=https://www.dropbox.com/oauth2/authorize?client_id=2hver24zt8u8zdv&amp;amp;token_access_type=offline&amp;amp;response_type=code  \     -u &amp;lt;REDACTED&amp;gt;&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&amp;nbsp;it prints this error&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;{
    "error": "invalid_request",
    "error_description": "unknown field \"token_access_type\""
}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I also tried&amp;nbsp;&lt;SPAN&gt;Auth URL for code flow and prints the same error, Do I miss something? Thanks in advance.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;curl https://api.dropbox.com/oauth2/token \     -d code=&amp;lt;REDACTED&amp;gt; \     -d grant_type=authorization_code \     -d redirect_uri=https://www.dropbox.com/oauth2/authorize?client_id=&amp;lt;APP_KEY&amp;gt;&amp;amp;response_type=code
 \     -u &amp;lt;REDACTED&amp;gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Apr 2022 16:10:46 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Issue-in-generating-access-token/m-p/592749#M27572</guid>
      <dc:creator>Mostafa Ezzat</dc:creator>
      <dc:date>2022-04-22T16:10:46Z</dc:date>
    </item>
    <item>
      <title>Re: Issue in generating access token</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Issue-in-generating-access-token/m-p/592756#M27574</link>
      <description>&lt;P&gt;I see you're not setting a redirect_uri on /oauth2/authorize, so you should also not set a redirect_uri when calling /oauth2/token. Remove that '-d redirect_uri=...' from your /oauth2/token call and try again.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;By the way, as a matter of security, do not post your authorization code or app secret.&lt;/P&gt;</description>
      <pubDate>Fri, 22 Apr 2022 16:12:19 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Issue-in-generating-access-token/m-p/592756#M27574</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2022-04-22T16:12:19Z</dc:date>
    </item>
    <item>
      <title>Re: Issue in generating access token</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Issue-in-generating-access-token/m-p/592781#M27579</link>
      <description>&lt;P&gt;Thanks It works after removing -d from the code.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I just have another problem that the generate access code lasts for one request within an hour, So how can I make a request to generate a one with each request along with the access token like parsing the content of this link and get the result then use it for curl request. or should I use refresh token&amp;nbsp; Thanks in advance.&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;https://www.dropbox.com/oauth2/authorize?client_id=&amp;lt;APP_KEY&amp;gt;&amp;amp;response_type=code&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Apr 2022 18:37:46 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Issue-in-generating-access-token/m-p/592781#M27579</guid>
      <dc:creator>Mostafa Ezzat</dc:creator>
      <dc:date>2022-04-22T18:37:46Z</dc:date>
    </item>
    <item>
      <title>Re: Issue in generating access token</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Issue-in-generating-access-token/m-p/592788#M27581</link>
      <description>&lt;P&gt;The authorization code can only be used once. Once you use it to get an access token and optional refresh token by calling /oauth2/token with 'grant_type=authorization_code', you can throw away the authorization code and store and re-use the access token and optional refresh token instead.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can use a refresh token to get new short-lived access tokens on demand without manual user interaction by calling /oauth2/token with 'grant_type=refresh_token' as shown &lt;A href="https://www.dropbox.com/developers/documentation/http/documentation#oauth2-token" target="_self"&gt;under "Example: refresh token request"&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Fri, 22 Apr 2022 19:01:56 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Issue-in-generating-access-token/m-p/592788#M27581</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2022-04-22T19:01:56Z</dc:date>
    </item>
    <item>
      <title>Re: Issue in generating access token</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Issue-in-generating-access-token/m-p/592798#M27582</link>
      <description>&lt;P&gt;I'm trying to get refresh token from the given example but what string value should I give to&amp;nbsp;REFRESH_TOKEN parameter I tried to use my past access token but it prints this error&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;"error_description": "refresh token is malformed"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I don't know even if the past token is the right parameter&amp;nbsp;&lt;BR /&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;curl https://api.dropbox.com/oauth2/token \ &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;-d grant_type=refresh_token \ &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;-d refresh_token=&amp;lt;REFRESH_TOKEN&amp;gt; \ &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;-u &amp;lt;APP_KEY&amp;gt;:&amp;lt;APP_SECRET&amp;gt;&lt;/PRE&gt;&lt;P&gt;And as a Plan B I want to generate access code with a Curl request so is that possible?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Apr 2022 20:19:18 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Issue-in-generating-access-token/m-p/592798#M27582</guid>
      <dc:creator>Mostafa Ezzat</dc:creator>
      <dc:date>2022-04-22T20:19:18Z</dc:date>
    </item>
    <item>
      <title>Re: Issue in generating access token</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Issue-in-generating-access-token/m-p/592802#M27583</link>
      <description>&lt;P&gt;The REFRESH_TOKEN value should be the 'refresh_token' returned by /oauth2/token when you called /oauth2/token with 'grant_type=authorization_code'. That's different from the 'access_token'; the two are not interchangeable.&lt;/P&gt;</description>
      <pubDate>Fri, 22 Apr 2022 20:39:50 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Issue-in-generating-access-token/m-p/592802#M27583</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2022-04-22T20:39:50Z</dc:date>
    </item>
    <item>
      <title>Re: Issue in generating access token</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Issue-in-generating-access-token/m-p/592815#M27584</link>
      <description>&lt;P&gt;I'm sorry for this but it doesn't work, I also tried with no quotes&amp;nbsp;&amp;nbsp;&lt;STRONG&gt;refresh_token=refresh_token&amp;nbsp;&lt;/STRONG&gt;it prints this error&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;    "error_description": "The request parameters do not match any of the supported authorization flows. Please refer to the API documentation for the correct parameters."&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;curl https://api.dropbox.com/oauth2/token \ &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;-d grant_type=refresh_token \ &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;-d refresh_token='refresh_token' \ &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;-u mykey:mykey&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;&amp;nbsp;May I ask something if this the return of the refresh token but the&amp;nbsp;access_token is totally different size from the one which genrated by the first curl so is that normal with this access token I'll be able to execute some curl codes? . Thanks in advance&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;{ "access_token": "sl.abcd1234efg", &amp;nbsp;&amp;nbsp;"expires_in": "13220", &amp;nbsp;&amp;nbsp;"token_type": "bearer", &amp;nbsp;&amp;nbsp;}&lt;/PRE&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;</description>
      <pubDate>Fri, 22 Apr 2022 21:40:44 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Issue-in-generating-access-token/m-p/592815#M27584</guid>
      <dc:creator>Mostafa Ezzat</dc:creator>
      <dc:date>2022-04-22T21:40:44Z</dc:date>
    </item>
    <item>
      <title>Re: Issue in generating access token</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Issue-in-generating-access-token/m-p/592921#M27586</link>
      <description>&lt;P&gt;Hi &lt;a href="https://www.dropboxforum.com/t5/user/viewprofilepage/user-id/1536241"&gt;@Mostafa Ezzat&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;Let's try some authentication process step by step. &lt;img class="lia-deferred-image lia-image-emoji" src="https://www.dropboxforum.com/html/@FBF7D2AB59A0D6E861EBF6A36F93B7E2/emoticons/1f642.png" alt=":slightly_smiling_face:" title=":slightly_smiling_face:" /&gt; It may succeed.&lt;/P&gt;&lt;P&gt;At the beginning make sure you have your App key and App secret at hand from &lt;A href="https://www.dropbox.com/developers/apps" target="_blank" rel="noopener"&gt;App Console&lt;/A&gt; page. Select desired application there and once got there in and scroll to field "App key" and "App secret" (for the secret "Show" should be used) keep the browser window accessible, so would be able take a look there when needed.&lt;/P&gt;&lt;P&gt;Next, open a new browser window and put into address line following:&lt;/P&gt;&lt;PRE&gt;https://www.dropbox.com/oauth2/authorize?token_access_type=offline&amp;amp;response_type=code&amp;amp;client_id=&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&amp;lt;&lt;/SPAN&gt;App&lt;/SPAN&gt; &lt;SPAN class=""&gt;key&lt;/SPAN&gt;&lt;SPAN class=""&gt;&amp;gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;Where "&amp;lt;App key&amp;gt;" is the one from you previous browser window. Next the confirmation you will get a code (alphanumeric sequence). The same could be received automatic when redirect URL is in use (either direct or PKCE code flow), but here we will perform it in such a way for clarity.&lt;/P&gt;&lt;P&gt;Next step will be to "materialize" the received code. In a terminal window execute following curl command:&lt;/P&gt;&lt;PRE&gt;curl https://api.dropbox.com/oauth2/token -d code=&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&amp;lt;&lt;/SPAN&gt;received&lt;/SPAN&gt; &lt;SPAN class=""&gt;code&lt;/SPAN&gt;&lt;SPAN class=""&gt;&amp;gt;&lt;/SPAN&gt;&lt;/SPAN&gt; -d grant_type=authorization_code -u &lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&amp;lt;&lt;/SPAN&gt;App&lt;/SPAN&gt; &lt;SPAN class=""&gt;key&lt;/SPAN&gt;&lt;SPAN class=""&gt;&amp;gt;&lt;/SPAN&gt;&lt;/SPAN&gt;:&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&amp;lt;&lt;/SPAN&gt;App&lt;/SPAN&gt; &lt;SPAN class=""&gt;secret&lt;/SPAN&gt;&lt;SPAN class=""&gt;&amp;gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;Where "&amp;lt;received code&amp;gt;" is the code shown up in the second browser window after confirmation. "&amp;lt;App key&amp;gt;" and "&amp;lt;App secret&amp;gt;" come from the first browser window. As a result you will get in your terminal something like:&lt;/P&gt;&lt;PRE&gt;{"access_token": "sl.abcdefg123456789AbCdEf-GHijKLmn0U", "token_type": "bearer", "expires_in": 14400, "refresh_token": "oDfT54975DfGh12345KlMnOpQrSt01a", "scope": "account_info.read files.content.read etc.", "uid": "123456789", "account_id": "dbid:ABCDEF5g8HijklMNopQ2Rs5tUV_wxy5z_YO4"}&lt;/PRE&gt;&lt;P&gt;Of course, you will receive different values filling the pattern. Here "sl.abcdefg123456789AbCdEf-GHijKLmn0U" is access token you can use in every regular API call for "14400" second since current moment until expires. "oDfT54975DfGh12345KlMnOpQrSt01a" is your refresh token. The one that will never expire (or till revoke).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When currently received access token expires, you can perform following curl call:&lt;/P&gt;&lt;PRE&gt;curl https://api.dropbox.com/oauth2/token -d grant_type=refresh_token -d refresh_token=oDfT54975DfGh12345KlMnOpQrSt01a -u &lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&amp;lt;&lt;/SPAN&gt;App &lt;SPAN class=""&gt;key&lt;/SPAN&gt;&lt;SPAN class=""&gt;&amp;gt;&lt;/SPAN&gt;&lt;/SPAN&gt;:&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&amp;lt;&lt;/SPAN&gt;App &lt;SPAN class=""&gt;secret&lt;/SPAN&gt;&lt;SPAN class=""&gt;&amp;gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;Where "oDfT54975DfGh12345KlMnOpQrSt01a" is the refresh token "materialized" from code at the beginning. "&amp;lt;App key&amp;gt;" and "&amp;lt;App secret&amp;gt;" come again from the first browser window. As a result you will get in your terminal something like:&lt;/P&gt;&lt;PRE&gt;{"access_token": "sl.abcdefg123456789AbCdEf-OPqrSTuv1W", "token_type": "bearer", "expires_in": 14400}&lt;/PRE&gt;&lt;P&gt;Again "sl.abcdefg123456789AbCdEf-OPqrSTuv1W" is an access token usable in regular API calls for "14400" seconds (i.e. 4 hours). The last call need to be used every time you need valid access token and the previous one got expired. For the test here you don't have to wait 4 hours. You can call it immediately. &lt;img class="lia-deferred-image lia-image-emoji" src="https://www.dropboxforum.com/html/@41457EF40051AFF130FDBFE21B496926/emoticons/1f609.png" alt=":winking_face:" title=":winking_face:" /&gt; Completes everything successfully?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Every time you do receive access token, it can be use for as many seconds as denoted in "expires_in" field. The access token itself is a ASCII chars sequence and you should be ready to process such a sequence as presented (including different length).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this gives direction and clarifies matter with the step by step processing.&lt;/P&gt;</description>
      <pubDate>Sun, 24 Apr 2022 00:47:36 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Issue-in-generating-access-token/m-p/592921#M27586</guid>
      <dc:creator>Здравко</dc:creator>
      <dc:date>2022-04-24T00:47:36Z</dc:date>
    </item>
    <item>
      <title>Re: Issue in generating access token</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Issue-in-generating-access-token/m-p/593173#M27594</link>
      <description>&lt;P&gt;&lt;a href="https://www.dropboxforum.com/t5/user/viewprofilepage/user-id/1536241"&gt;@Mostafa Ezzat&lt;/a&gt; I see Здравко very helpfully offered a detailed walk-through of this flow. Please let us know if this still isn't working for you.&lt;/P&gt;</description>
      <pubDate>Mon, 25 Apr 2022 15:38:36 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Issue-in-generating-access-token/m-p/593173#M27594</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2022-04-25T15:38:36Z</dc:date>
    </item>
    <item>
      <title>Re: Issue in generating access token</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Issue-in-generating-access-token/m-p/593372#M27599</link>
      <description>&lt;P&gt;Thanks for all it's working&lt;/P&gt;</description>
      <pubDate>Tue, 26 Apr 2022 10:49:52 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Issue-in-generating-access-token/m-p/593372#M27599</guid>
      <dc:creator>Mostafa Ezzat</dc:creator>
      <dc:date>2022-04-26T10:49:52Z</dc:date>
    </item>
    <item>
      <title>Re: Issue in generating access token</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Issue-in-generating-access-token/m-p/605779#M28102</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;A href="https://www.dropboxforum.com/t5/user/viewprofilepage/user-id/422790" target="_self"&gt;&lt;SPAN class=""&gt;Здравко&lt;/SPAN&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It's possible obtain the code in this call :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;https://www.dropbox.com/oauth2/authorize?token_access_type=offline&amp;amp;response_type=code&amp;amp;client_id=&lt;SPAN class=""&gt;&amp;lt;App key&amp;gt;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;permanently? When I send a request, the code is only available for a first time, when I used in a future call, the code is invalid.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for all&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jun 2022 10:00:01 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Issue-in-generating-access-token/m-p/605779#M28102</guid>
      <dc:creator>FARO</dc:creator>
      <dc:date>2022-06-27T10:00:01Z</dc:date>
    </item>
    <item>
      <title>Re: Issue in generating access token</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Issue-in-generating-access-token/m-p/605976#M28106</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://www.dropboxforum.com/t5/user/viewprofilepage/user-id/1552456"&gt;@FARO&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;... When I send a request, the code is only available for a first time, when I used in a future call, the code is invalid.&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Hi &lt;a href="https://www.dropboxforum.com/t5/user/viewprofilepage/user-id/1552456"&gt;@FARO&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&lt;img class="lia-deferred-image lia-image-emoji" src="https://www.dropboxforum.com/html/@FBF7D2AB59A0D6E861EBF6A36F93B7E2/emoticons/1f642.png" alt=":slightly_smiling_face:" title=":slightly_smiling_face:" /&gt;How long you expect a code to be used?! 🧐&lt;/P&gt;&lt;P&gt;Let's see. If you forget your credentials to some service and there is a option to receive a recovery code throughout a registered phone number with SMS (for example), how many times you can use received code??? &lt;img class="lia-deferred-image lia-image-emoji" src="https://www.dropboxforum.com/html/@9AD39CA637682E9616FBE31CDAF1B6C4/emoticons/1f914.png" alt=":thinking_face:" title=":thinking_face:" /&gt; Would be reliable and secure if such code can be used for multiple recovering? (such codes are usually relatively short and simple, so easy to use, but to guess too) &lt;img class="lia-deferred-image lia-image-emoji" src="https://www.dropboxforum.com/html/@D6F1E7339C4A1D356873D19B1E420FB0/emoticons/1f62f.png" alt=":hushed_face:" title=":hushed_face:" /&gt; That's why such codes are "single shot" (i.e. one time use) and usually for limited time.&lt;/P&gt;&lt;P&gt;The code you are talking about is a member of the same "team" of codes. It's used for one time authorization (together with all other provided information). The refresh token you are receiving on call authenticated successfully with this code can be used multiple times, not the code itself! &lt;img class="lia-deferred-image lia-image-emoji" src="https://www.dropboxforum.com/html/@41457EF40051AFF130FDBFE21B496926/emoticons/1f609.png" alt=":winking_face:" title=":winking_face:" /&gt; Take care! As far as I can guess, according your description, you ignored actual refresh token all the time. Don't ignore it, but keep and use it on followup access token refresh (exactly as mentioned - follow it exactly and don't try to interpret and modify, if your aren't sure what exactly you are doing).&lt;/P&gt;&lt;P&gt;Hope this clarifies matter.&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jun 2022 22:26:46 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Issue-in-generating-access-token/m-p/605976#M28106</guid>
      <dc:creator>Здравко</dc:creator>
      <dc:date>2022-06-27T22:26:46Z</dc:date>
    </item>
    <item>
      <title>Re: Issue in generating access token</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Issue-in-generating-access-token/m-p/606155#M28109</link>
      <description>&lt;P&gt;&lt;a href="https://www.dropboxforum.com/t5/user/viewprofilepage/user-id/1552456"&gt;@FARO&lt;/a&gt; Здравко is correct; that code is an "authorization code", which can only be used once each. You should process that and instead store and re-use the "refresh token", which can be used repeatedly. Check out &lt;A href="https://developers.dropbox.com/oauth-guide" target="_self" rel="noopener noreferrer"&gt;the OAuth Guide&lt;/A&gt; and &lt;A href="https://www.dropbox.com/developers/documentation/http/documentation#authorization" target="_self" rel="noopener noreferrer"&gt;authorization documentation&lt;/A&gt; for more information.&lt;/P&gt;</description>
      <pubDate>Tue, 28 Jun 2022 13:35:53 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Issue-in-generating-access-token/m-p/606155#M28109</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2022-06-28T13:35:53Z</dc:date>
    </item>
    <item>
      <title>Re: Issue in generating access token</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Issue-in-generating-access-token/m-p/615015#M28383</link>
      <description>&lt;P&gt;I'm&amp;nbsp; getting the following error:&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;"error"&lt;/SPAN&gt;&lt;SPAN&gt;:&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;"invalid_request"&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;"error_description"&lt;/SPAN&gt;&lt;SPAN&gt;:&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;"Bad&amp;nbsp;\"Authorization\"&amp;nbsp;header:&amp;nbsp;'ascii'&amp;nbsp;codec&amp;nbsp;can't&amp;nbsp;decode&amp;nbsp;byte&amp;nbsp;0xe2&amp;nbsp;in&amp;nbsp;position&amp;nbsp;15:&amp;nbsp;ordinal&amp;nbsp;not&amp;nbsp;in&amp;nbsp;range(128)"&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 09 Aug 2022 23:43:19 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Issue-in-generating-access-token/m-p/615015#M28383</guid>
      <dc:creator>matthewknill</dc:creator>
      <dc:date>2022-08-09T23:43:19Z</dc:date>
    </item>
    <item>
      <title>Re: Issue in generating access token</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Issue-in-generating-access-token/m-p/615019#M28384</link>
      <description>&lt;P&gt;Hi &lt;a href="https://www.dropboxforum.com/t5/user/viewprofilepage/user-id/1563966"&gt;@matthewknill&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;The message, you posted, is clear enough - your authorization header is malformed. Are you certain your header matches the pattern:&lt;/P&gt;&lt;PRE&gt;Authorization: Bearer &lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&amp;lt;&lt;/SPAN&gt;Your&lt;/SPAN&gt; &lt;SPAN class=""&gt;access&lt;/SPAN&gt; &lt;SPAN class=""&gt;token&lt;/SPAN&gt; &lt;SPAN class=""&gt;here&lt;/SPAN&gt;&lt;SPAN class=""&gt;&amp;gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;According to the data in your post, it's not. &lt;img class="lia-deferred-image lia-image-emoji" src="https://www.dropboxforum.com/html/@9AD39CA637682E9616FBE31CDAF1B6C4/emoticons/1f914.png" alt=":thinking_face:" title=":thinking_face:" /&gt; How exactly have you formatted it?&lt;/P&gt;&lt;P&gt;Hope this gives direction.&lt;/P&gt;</description>
      <pubDate>Wed, 10 Aug 2022 00:01:32 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Issue-in-generating-access-token/m-p/615019#M28384</guid>
      <dc:creator>Здравко</dc:creator>
      <dc:date>2022-08-10T00:01:32Z</dc:date>
    </item>
    <item>
      <title>Re: Issue in generating access token</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Issue-in-generating-access-token/m-p/615021#M28385</link>
      <description>&lt;P&gt;I've followed process exactly then used the following to get the refresh token:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;curl https://api.dropbox.com/oauth2/token \
-d code=&amp;lt;Access Code&amp;gt; \
-d grant_type=authorization_code \
-u &amp;lt;App key&amp;gt;:&amp;lt;App secret&amp;gt;&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 10 Aug 2022 00:07:24 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Issue-in-generating-access-token/m-p/615021#M28385</guid>
      <dc:creator>matthewknill</dc:creator>
      <dc:date>2022-08-10T00:07:24Z</dc:date>
    </item>
    <item>
      <title>Re: Issue in generating access token</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Issue-in-generating-access-token/m-p/615025#M28386</link>
      <description>&lt;P&gt;In such a case it sounds like some copy/paste error. Make sure that everything enlabeled like "&amp;lt;something&amp;gt;" is replaced exactly to what the something means! 🤷 Don't put anything more or less there. That's it.&lt;/P&gt;</description>
      <pubDate>Wed, 10 Aug 2022 00:14:28 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Issue-in-generating-access-token/m-p/615025#M28386</guid>
      <dc:creator>Здравко</dc:creator>
      <dc:date>2022-08-10T00:14:28Z</dc:date>
    </item>
    <item>
      <title>Re: Issue in generating access token</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Issue-in-generating-access-token/m-p/615026#M28387</link>
      <description>&lt;P&gt;Hmm, I thought I did copy it accurately but maybe not, I did it again and it seemed to work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks and sorry for the hassle...&lt;/P&gt;</description>
      <pubDate>Wed, 10 Aug 2022 00:30:45 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Issue-in-generating-access-token/m-p/615026#M28387</guid>
      <dc:creator>matthewknill</dc:creator>
      <dc:date>2022-08-10T00:30:45Z</dc:date>
    </item>
  </channel>
</rss>

