<?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 Re: Issue Generating Refresh Token with OAuth Code Flow in Dropbox API Support &amp; Feedback</title>
    <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Issue-Generating-Refresh-Token-with-OAuth-Code-Flow/m-p/653866#M29821</link>
    <description>&lt;P&gt;Hello Greg, first thank you again for the response - that does indeed change my error response however I think I am just a bit off still from your explanation. It sounds like I should remove my app key : app secret and replace it with the two values you stated.&lt;BR /&gt;&lt;BR /&gt;I have gone back to my app console to verify both values are accurate, any idea why it would say one is potentially invalid?&lt;BR /&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot (188).png" style="width: 800px;"&gt;&lt;img src="https://www.dropboxforum.com/t5/image/serverpage/image-id/34694i71857174FF5DD117/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot (188).png" alt="Screenshot (188).png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 25 Jan 2023 17:12:49 GMT</pubDate>
    <dc:creator>ImpulseWebDev</dc:creator>
    <dc:date>2023-01-25T17:12:49Z</dc:date>
    <item>
      <title>Issue Generating Refresh Token with OAuth Code Flow</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Issue-Generating-Refresh-Token-with-OAuth-Code-Flow/m-p/653861#M29818</link>
      <description>&lt;P&gt;Hello, I have been struggling a bit with getting a refresh token or any success response at all from the endpoint '&lt;SPAN&gt;&lt;A href="https://api.dropboxapi.com/oauth2/token" target="_blank" rel="noopener"&gt;https://api.dropboxapi.com/oauth2/token&lt;/A&gt;&lt;/SPAN&gt;' when following the guide here &lt;A href="https://developers.dropbox.com/oauth-guide" target="_blank" rel="noopener"&gt;https://developers.dropbox.com/oauth-guide&lt;/A&gt;.&lt;BR /&gt;&lt;BR /&gt;While the docs show all curl requests, I am attempting to make my request currently from postman, but in the end I would like to do this via a standard fetch request if possible.&lt;BR /&gt;&lt;BR /&gt;However, when making requests to the endpoint above, I always am returned the response&lt;/P&gt;&lt;PRE&gt;{
    "error": "invalid_request",
    "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;/PRE&gt;&lt;P&gt;Here is one example of my request:&lt;/P&gt;&lt;PRE&gt;   var details = {
    'code': 'REDACTED',
    'grant_type': 'authorization_code',
    'REDACTED': 'REDACTED'
  };

  var formBody = [];
  for (var property in details) {
    var encodedKey = encodeURIComponent(property);
    var encodedValue = encodeURIComponent(details[property]);
    formBody.push(encodedKey + "=" + encodedValue);
  }
  formBody = formBody.join("&amp;amp;");

  fetch('&lt;A href="https://api.dropboxapi.com/oauth2/token" target="_blank" rel="noopener noreferrer"&gt;https://api.dropboxapi.com/oauth2/token&lt;/A&gt;', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8'
    },
    body: formBody
  }).then(function(response) { 
    return response.json()
  }).then(function(data) {   
    console.log(data);
  })&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;Here is my postman version&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot (187).png" style="width: 800px;"&gt;&lt;img src="https://www.dropboxforum.com/t5/image/serverpage/image-id/34692i0B5A972B608175D8/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot (187).png" alt="Screenshot (187).png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot (186).png" style="width: 800px;"&gt;&lt;img src="https://www.dropboxforum.com/t5/image/serverpage/image-id/34693iD65104F4DD8909AB/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot (186).png" alt="Screenshot (186).png" /&gt;&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;For the sections covered in red or 'REDACTED':&lt;BR /&gt;The code I am getting via this URL &lt;A href="https://www.dropbox.com/oauth2/authorize?client_id=REDACTED&amp;amp;response_type=code&amp;amp;token_access_type=offline" target="_blank" rel="noopener"&gt;https://www.dropbox.com/oauth2/authorize?client_id=REDACTED&amp;amp;response_type=code&amp;amp;token_access_type=offline&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;The lowest section is my app key and app secret (in that order).&lt;BR /&gt;&lt;BR /&gt;Is it possible to make this POST request to this endpoint in the way I am trying?&lt;BR /&gt;&lt;BR /&gt;If so, is it possible to see an example somewhere in the docs that is not a curl request? // or point me in the direction of what I am not doing correctly by chance?&lt;BR /&gt;&lt;BR /&gt;Edit: I should also note that this account has purchased 'Teams'.&lt;BR /&gt;Thanks in advance!&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jan 2023 16:42:05 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Issue-Generating-Refresh-Token-with-OAuth-Code-Flow/m-p/653861#M29818</guid>
      <dc:creator>ImpulseWebDev</dc:creator>
      <dc:date>2023-01-25T16:42:05Z</dc:date>
    </item>
    <item>
      <title>Re: Issue Generating Refresh Token with OAuth Code Flow</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Issue-Generating-Refresh-Token-with-OAuth-Code-Flow/m-p/653863#M29819</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://www.dropboxforum.com/t5/user/viewprofilepage/user-id/1605646"&gt;@ImpulseWebDev&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;...&lt;BR /&gt;The lowest section is my app key and app secret (in that order).&lt;BR /&gt;&lt;BR /&gt;Is it possible to make this POST request to this endpoint in the way I am trying?&lt;BR /&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/1605646"&gt;@ImpulseWebDev&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;No, It's not! Where you read that you need to post parameter carrying name equal to your app key?&lt;/P&gt;&lt;P&gt;Next the curl examples, there are lists of possible parameters! You have to choose something from there. Possible parameters for passing app key and secret are &lt;U&gt;&lt;STRONG&gt;client_id&lt;/STRONG&gt;&lt;/U&gt; and &lt;U&gt;&lt;STRONG&gt;client_secret&lt;/STRONG&gt;&lt;/U&gt;. Alternative way is passing them in form "&amp;lt;client_id value&amp;gt;:&amp;lt;client_secret value&amp;gt;" as base authentication.&lt;/P&gt;&lt;P&gt;Hope this gives direction.&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jan 2023 17:06:54 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Issue-Generating-Refresh-Token-with-OAuth-Code-Flow/m-p/653863#M29819</guid>
      <dc:creator>Здравко</dc:creator>
      <dc:date>2023-01-25T17:06:54Z</dc:date>
    </item>
    <item>
      <title>Re: Issue Generating Refresh Token with OAuth Code Flow</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Issue-Generating-Refresh-Token-with-OAuth-Code-Flow/m-p/653864#M29820</link>
      <description>&lt;P&gt;Given your redactions and descriptions, it seems like you're sending a parameter with the name being your app key and the value being your app secret, however that is not the correct formatting. When calling &lt;A href="https://www.dropbox.com/developers/documentation/http/documentation#oauth2-token" target="_blank"&gt;/oauth2/token&lt;/A&gt; to exchange the authorization code for an access token/refresh token with the code flow like this, you should send a parameter named "client_id" with the value being your app key, and a parameter named "client_secret" with the value being your app secret. You would do that the same way you already have a parameter named "code" with the value being the authorization code string.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(Note that it's also possible to send the app key and secret as "Basic" authorization, which is what the example in the documentation does using the "-u" curl flag, but that would be encoded and formatted differently. I recommend just using the parameters as described above for simplicity.)&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jan 2023 17:07:13 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Issue-Generating-Refresh-Token-with-OAuth-Code-Flow/m-p/653864#M29820</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2023-01-25T17:07:13Z</dc:date>
    </item>
    <item>
      <title>Re: Issue Generating Refresh Token with OAuth Code Flow</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Issue-Generating-Refresh-Token-with-OAuth-Code-Flow/m-p/653866#M29821</link>
      <description>&lt;P&gt;Hello Greg, first thank you again for the response - that does indeed change my error response however I think I am just a bit off still from your explanation. It sounds like I should remove my app key : app secret and replace it with the two values you stated.&lt;BR /&gt;&lt;BR /&gt;I have gone back to my app console to verify both values are accurate, any idea why it would say one is potentially invalid?&lt;BR /&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot (188).png" style="width: 800px;"&gt;&lt;img src="https://www.dropboxforum.com/t5/image/serverpage/image-id/34694i71857174FF5DD117/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot (188).png" alt="Screenshot (188).png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jan 2023 17:12:49 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Issue-Generating-Refresh-Token-with-OAuth-Code-Flow/m-p/653866#M29821</guid>
      <dc:creator>ImpulseWebDev</dc:creator>
      <dc:date>2023-01-25T17:12:49Z</dc:date>
    </item>
    <item>
      <title>Re: Issue Generating Refresh Token with OAuth Code Flow</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Issue-Generating-Refresh-Token-with-OAuth-Code-Flow/m-p/653869#M29822</link>
      <description>&lt;P&gt;Hello and thanks for the reply.&lt;BR /&gt;&lt;BR /&gt;My apologies, I am not very familiar with Curl request syntax, however I was attempting to reproduce the example from the dropbox endpoint docs here:&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;The last portion '&amp;lt;APP_KEY&amp;gt;:&amp;lt;APP_SECRET&amp;gt;' was why I attempted that method. I have since updated to use the two params suggested, however any idea what would trigger this response? I did return to my app console to verify both key and secret are up to date&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot (188).png" style="width: 800px;"&gt;&lt;img src="https://www.dropboxforum.com/t5/image/serverpage/image-id/34695i9053D0A9033DDBC8/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot (188).png" alt="Screenshot (188).png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jan 2023 17:16:45 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Issue-Generating-Refresh-Token-with-OAuth-Code-Flow/m-p/653869#M29822</guid>
      <dc:creator>ImpulseWebDev</dc:creator>
      <dc:date>2023-01-25T17:16:45Z</dc:date>
    </item>
    <item>
      <title>Re: Issue Generating Refresh Token with OAuth Code Flow</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Issue-Generating-Refresh-Token-with-OAuth-Code-Flow/m-p/653870#M29823</link>
      <description>&lt;P&gt;Final reply: The params suggested do work in my non-postman fetch request and return the success response outlined in the docs. That gets me through- Thank you again!&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jan 2023 17:28:13 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Issue-Generating-Refresh-Token-with-OAuth-Code-Flow/m-p/653870#M29823</guid>
      <dc:creator>ImpulseWebDev</dc:creator>
      <dc:date>2023-01-25T17:28:13Z</dc:date>
    </item>
  </channel>
</rss>

