<?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 How to get data in Url by Token flow ? in Discuss Dropbox Developer &amp; API</title>
    <link>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/How-to-get-data-in-Url-by-Token-flow/m-p/726290#M3729</link>
    <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;https://localhost:8080/authorize#access_token=ABCDEFG&amp;amp;token_type=bearer&amp;amp;account_id=dbid%3AAAH4f99T0taONIb-OurWxbNQ6ywGRopQngc&amp;amp;uid=12345&amp;amp;state=[STATE]&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As docs said, the data is behind of # in url, so how can I get them ?&lt;/P&gt;
&lt;P&gt;Thanks in advance!&lt;/P&gt;</description>
    <pubDate>Thu, 02 Nov 2023 13:35:18 GMT</pubDate>
    <dc:creator>Zard</dc:creator>
    <dc:date>2023-11-02T13:35:18Z</dc:date>
    <item>
      <title>How to get data in Url by Token flow ?</title>
      <link>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/How-to-get-data-in-Url-by-Token-flow/m-p/726290#M3729</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;https://localhost:8080/authorize#access_token=ABCDEFG&amp;amp;token_type=bearer&amp;amp;account_id=dbid%3AAAH4f99T0taONIb-OurWxbNQ6ywGRopQngc&amp;amp;uid=12345&amp;amp;state=[STATE]&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As docs said, the data is behind of # in url, so how can I get them ?&lt;/P&gt;
&lt;P&gt;Thanks in advance!&lt;/P&gt;</description>
      <pubDate>Thu, 02 Nov 2023 13:35:18 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/How-to-get-data-in-Url-by-Token-flow/m-p/726290#M3729</guid>
      <dc:creator>Zard</dc:creator>
      <dc:date>2023-11-02T13:35:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to get data in Url by Token flow ?</title>
      <link>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/How-to-get-data-in-Url-by-Token-flow/m-p/726397#M3730</link>
      <description>&lt;P&gt;Hi &lt;a href="https://www.dropboxforum.com/t5/user/viewprofilepage/user-id/1761621"&gt;@Zard&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;There are number of examples showing it. What would be best for you depends on what tools you're using. A good example, I think, can be seen &lt;A title="Takes the user through Dropbox's API OAuth flow" href="https://github.com/dropbox/dropbox-sdk-js/blob/main/examples/javascript/auth/index.html" target="_blank" rel="noopener"&gt;here&lt;/A&gt;. &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;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;</description>
      <pubDate>Thu, 02 Nov 2023 14:40:58 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/How-to-get-data-in-Url-by-Token-flow/m-p/726397#M3730</guid>
      <dc:creator>Здравко</dc:creator>
      <dc:date>2023-11-02T14:40:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to get data in Url by Token flow ?</title>
      <link>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/How-to-get-data-in-Url-by-Token-flow/m-p/726468#M3731</link>
      <description>&lt;P&gt;&lt;a href="https://www.dropboxforum.com/t5/user/viewprofilepage/user-id/1761621"&gt;@Zard&lt;/a&gt; As Здравко noted, you can find an example of getting the information from the URL in &lt;A href="https://github.com/dropbox/dropbox-sdk-js/blob/main/examples/javascript/auth/index.html#L46" target="_blank"&gt;that example in the SDK&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The "token" flow is no longer recommended in general though, in favor of the "code" flow, using PKCE for client-side apps, such as shown in &lt;A href="https://github.com/dropbox/dropbox-sdk-js/blob/main/examples/javascript/pkce-browser/index.html" target="_blank"&gt;this PKCE example in the Dropbox JavaScript SDK&lt;/A&gt;. You can find more information in &lt;A href="https://www.dropbox.com/developers/documentation/http/documentation#authorization" target="_blank"&gt;the authorization documentation&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Thu, 02 Nov 2023 16:16:04 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/How-to-get-data-in-Url-by-Token-flow/m-p/726468#M3731</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2023-11-02T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to get data in Url by Token flow ?</title>
      <link>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/How-to-get-data-in-Url-by-Token-flow/m-p/726671#M3732</link>
      <description>&lt;P&gt;It's my fault, I am using Net Core, the examples&amp;nbsp;code of .net is too old, I can't understanf them.&lt;/P&gt;&lt;P&gt;I try to use Restsharp to post http request. I tried the code flow, but it's complex with OAuth 2.0, and I see Token Flow can get token directly, so I wan to try it, but I can't get data from url easily.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is my first to use OAuth 2.0, When integrating other APIs, they only need apikey, apiSecret, or token to complete authentication, I Just want to use Dropbox api when users are uploading files. and My app is like that:&lt;/P&gt;&lt;P&gt;/contents/authorize: I add this action to get code, but it return me a html code in content of response.&lt;/P&gt;&lt;P&gt;/contents/token: this action to to receive code and to get a token by api.&lt;/P&gt;&lt;P&gt;/contents: upload files and submit form data, but I can not get token directly by one action, it needs to redirect to html and back, that I can not get token directly when submitting form.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;would you help me solve this? Although it can get token by two actions, I just want use api when submit form, thanks a lot.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 03 Nov 2023 01:54:41 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/How-to-get-data-in-Url-by-Token-flow/m-p/726671#M3732</guid>
      <dc:creator>Zard</dc:creator>
      <dc:date>2023-11-03T01:54:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to get data in Url by Token flow ?</title>
      <link>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/How-to-get-data-in-Url-by-Token-flow/m-p/726675#M3733</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://www.dropboxforum.com/t5/user/viewprofilepage/user-id/1761621"&gt;@Zard&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;It's my fault, I am using Net Core, the examples&amp;nbsp;code of .net is too old, I can't understanf them.&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Hi again &lt;a href="https://www.dropboxforum.com/t5/user/viewprofilepage/user-id/1761621"&gt;@Zard&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;Yes, the examples can be more... familiar/convenient to newbie users... for sure.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://www.dropboxforum.com/t5/user/viewprofilepage/user-id/1761621"&gt;@Zard&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;..., and I see Token Flow can get token directly, so I wan to try it, but I can't get data from url easily.&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Keep in mind that all access tokens are short lived, so you cannot use them for long running task! For long term access you need refresh token. Through URL directly can be fetch access token only. That's why you may need to perform code flow as Greg mentioned earlier above.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://www.dropboxforum.com/t5/user/viewprofilepage/user-id/1761621"&gt;@Zard&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;This is my first to use OAuth 2.0, When integrating other APIs, they only need apikey, apiSecret, or token to complete authentication, ...&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;It's similar with Dropbox API too. The only difference is that the token, you're talking about, has to be refresh token, not access token! &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; They are different things.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://www.dropboxforum.com/t5/user/viewprofilepage/user-id/1761621"&gt;@Zard&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;..., I Just want to use Dropbox api when users are uploading files. and My app is like that:&lt;/P&gt;&lt;P&gt;/contents/authorize: I add this action to get code, but it return me a html code in content of response.&lt;/P&gt;&lt;P&gt;/contents/token: this action to to receive code and to get a token by api.&lt;/P&gt;&lt;P&gt;/contents: upload files and submit form data, but I can not get token directly by one action, it needs to redirect to html and back, that I can not get token directly when submitting form.&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&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; Keep in mind that &lt;A title="This starts the OAuth 2.0 authorization flow" href="https://www.dropbox.com/oauth2/authorize" target="_blank" rel="noopener"&gt;/oauth2/authorize&lt;/A&gt; is web page where a user of your application (or you as a user) would start granting access for your application to the corresponding account. It's NOT access point (i.e. something that need to be called)! You have to open it (once prepared) in web browser and copy the authorization code from there by hand (without redirect URL) or 'catch it' using redirect URL in the application. &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; After that, once you have that code, you can use &lt;A title="An app calls this endpoint to acquire a bearer token once the user has authorized the app" href="https://www.dropbox.com/developers/documentation/http/documentation#oauth2-token" target="_blank" rel="noopener"&gt;/oauth2/token&lt;/A&gt; to receive/materialize the code to tokens. Detailed steps can be seen &lt;A href="https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Issue-in-generating-access-token/m-p/592921/highlight/true#M27586" target="_blank" rel="noopener"&gt;here&lt;/A&gt; (without redirect URL).&lt;/P&gt;&lt;P&gt;In .Net you can take a look on the example &lt;A href="https://github.com/dropbox/dropbox-sdk-dotnet/tree/main/dropbox-sdk-dotnet/Examples/OAuthPKCE" target="_blank" rel="noopener"&gt;here&lt;/A&gt;. In &lt;A title="AcquireAccessToken" href="https://github.com/dropbox/dropbox-sdk-dotnet/blob/main/dropbox-sdk-dotnet/Examples/OAuthPKCE/Program.cs#L199" target="_blank" rel="noopener"&gt;Program.cs&lt;/A&gt; can be seen automatic OAuth flow organization alongside other things. If it's too complex for you, replace 'AcquireAccessToken' method with the following:&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;private async Task&amp;lt;string&amp;gt; AcquireAccessToken()
{
    var accessToken = Settings.Default.AccessToken;
    var refreshToken = Settings.Default.RefreshToken;
    var uid = Settings.Default.Uid;

    if (string.IsNullOrEmpty(refreshToken))
    {
        try
        {
            Console.WriteLine("Waiting for credentials.");
            var state = Guid.NewGuid().ToString("N");
            var pkceObject = new PKCEOAuthFlow();
            var authorizeUri = pkceObject.GetAuthorizeUri(
                OAuthResponseType.Code, ApiKey, RedirectUri.ToString(),
                tokenAccessType: TokenAccessType.Offline, state: state,
                includeGrantedScopes: IncludeGrantedScopes.User);
            Console.WriteLine("authorizeUri: {0}", authorizeUri);
            var http = new HttpListener();
            http.Prefixes.Add(LoopbackHost);

            http.Start();

            System.Diagnostics.Process.Start(authorizeUri.ToString());

            var context = await http.GetContextAsync();
            Console.WriteLine("QueryString: {0}", context.Request.Url);

            var responseUri = context.Request.Url;

            context.Response.ContentType = "text/html; charset=utf-8";

            using (var file = File.OpenRead("index.html"))
            {
                file.CopyTo(context.Response.OutputStream);
            }

            context.Response.OutputStream.Close();
            http.Stop();

            OAuth2Response credResponse = await pkceObject.ProcessCodeFlowAsync(responseUri, ApiKey, RedirectUri.ToString(), state);
            Console.WriteLine("credResponse: {0}", credResponse.ToString());

            accessToken = credResponse.AccessToken;
            refreshToken = credResponse.RefreshToken;
            uid = credResponse.Uid;
            Console.WriteLine("ScopeList: {0}", credResponse.ScopeList);
            Settings.Default.AccessToken = accessToken;
            Settings.Default.Uid = uid;
            Settings.Default.RefreshToken = refreshToken;
            Settings.Default.Save();
        }
        catch (Exception e)
        {
            Console.WriteLine("Error: {0}", e.Message);
            return null;
        }
    }

    return uid;
}&lt;/LI-CODE&gt;&lt;P&gt;I think the above is a bit more clear. The file &lt;FONT face="Monospace"&gt;&lt;SPAN&gt;"index.html"&lt;/SPAN&gt;&lt;/FONT&gt; inside is as follows:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;html&amp;gt;
  &amp;lt;head&amp;gt;
    &amp;lt;meta charset="UTF-8"&amp;gt;
    &amp;lt;link href="https://fonts.googleapis.com/css?family=Nunito+Sans:400,400i,700,900&amp;amp;display=swap" rel="stylesheet"&amp;gt;
  &amp;lt;/head&amp;gt;
    &amp;lt;style&amp;gt;
      body {
        text-align: center;
        padding: 40px 0;
        background: #EBF0F5;
      }
        h1 {
          color: #88B04B;
          font-family: "Nunito Sans", "Helvetica Neue", sans-serif;
          font-weight: 900;
          font-size: 40px;
          margin-bottom: 10px;
        }
        p {
          color: #404F5E;
          font-family: "Nunito Sans", "Helvetica Neue", sans-serif;
          font-size:20px;
          margin: 0;
        }
      i {
        color: #9ABC66;
        font-size: 100px;
        line-height: 200px;
        margin-left:-15px;
      }
      .card {
        background: white;
        padding: 60px;
        border-radius: 4px;
        box-shadow: 0 2px 3px #C8D0D8;
        display: inline-block;
        margin: 0 auto;
      }
    &amp;lt;/style&amp;gt;
    &amp;lt;body&amp;gt;
      &amp;lt;div class="card"&amp;gt;
      &amp;lt;div style="border-radius:200px; height:200px; width:200px; background: #F8FAF5; margin:0 auto;"&amp;gt;
        &amp;lt;i class="checkmark"&amp;gt;✓&amp;lt;/i&amp;gt;
      &amp;lt;/div&amp;gt;
        &amp;lt;h1&amp;gt;Успех&amp;lt;/h1&amp;gt; 
        &amp;lt;p&amp;gt;&lt;img class="lia-deferred-image lia-image-emoji" src="https://www.dropboxforum.com/html/@979803B15F03C4CCA8AF02BCB23FDB6A/emoticons/1f389.png" alt=":party_popper:" title=":party_popper:" /&gt; Успешно свързахте приложението си,&amp;lt;br/&amp;gt;може да продължите използването му! &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;&amp;lt;/p&amp;gt;
      &amp;lt;/div&amp;gt;
    &amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;Here everything is performed in one step of redirection - no second needed.&lt;/P&gt;&lt;P&gt;Hope this makes the things much more clear.&lt;/P&gt;</description>
      <pubDate>Fri, 03 Nov 2023 02:51:40 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/How-to-get-data-in-Url-by-Token-flow/m-p/726675#M3733</guid>
      <dc:creator>Здравко</dc:creator>
      <dc:date>2023-11-03T02:51:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to get data in Url by Token flow ?</title>
      <link>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/How-to-get-data-in-Url-by-Token-flow/m-p/726714#M3735</link>
      <description>&lt;P&gt;oh, no , it's not we want to do.&amp;nbsp;we want users to upload files and leave their information, no any other actios, but your request page just upload files and type the poor name, and email is used to receive email.&lt;/P&gt;&lt;P&gt;what we need is just like that:&amp;nbsp;&lt;A href="https://filerequestpro.com/up/demo" target="_blank"&gt;https://filerequestpro.com/up/demo&lt;/A&gt;&lt;/P&gt;&lt;P&gt;why do they can use api directly? not need users to approve the app.&lt;/P&gt;&lt;P&gt;I can't understand why Dropbox use this way to call API, the those apps we used are not like this. &lt;img class="lia-deferred-image lia-image-emoji" src="https://www.dropboxforum.com/html/@60C2DD8702352C87F7CEA8E4E06822AF/emoticons/1f910.png" alt=":zipper_mouth_face:" title=":zipper_mouth_face:" /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 03 Nov 2023 09:55:06 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/How-to-get-data-in-Url-by-Token-flow/m-p/726714#M3735</guid>
      <dc:creator>Zard</dc:creator>
      <dc:date>2023-11-03T09:55:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to get data in Url by Token flow ?</title>
      <link>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/How-to-get-data-in-Url-by-Token-flow/m-p/726767#M3736</link>
      <description>&lt;P&gt;&lt;a href="https://www.dropboxforum.com/t5/user/viewprofilepage/user-id/1761621"&gt;@Zard&lt;/a&gt;, I hope you understood how it works finally. You can do whatever you want once you have client object created and initialized properly (including everything enumerated by you, but not only). Whether it's convenient for you and is it fine for usage - it's your decision. Something more, the frontend of your page has nothing to do with the API (and corresponding provider) you'll choose to use - it can stay the same. &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; API related things will be performed on the back end - inaccessible for the end users (something that they don't need to know anything about).&lt;/P&gt;&lt;P&gt;Good luck.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PS: By the way it's bad practice to embed any token (if it's API related - doesn't matter what API) in the page - this is could be a security compromise! It's predispose your account to be hacked! I hope the one you have embedded in you page is just a hash - otherwise it's matter of time somebody to 'joke' with you. &lt;img class="lia-deferred-image lia-image-emoji" src="https://www.dropboxforum.com/html/@D88F213CAFB196B6AB70612B08AD9D31/emoticons/1f601.png" alt=":beaming_face_with_smiling_eyes:" title=":beaming_face_with_smiling_eyes:" /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 03 Nov 2023 13:26:15 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/How-to-get-data-in-Url-by-Token-flow/m-p/726767#M3736</guid>
      <dc:creator>Здравко</dc:creator>
      <dc:date>2023-11-03T13:26:15Z</dc:date>
    </item>
  </channel>
</rss>

