<?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: API always returns invalid_access_token, 500 error when i go to &amp;quot;my apps&amp;quot; in Dropbox API Support &amp; Feedback</title>
    <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/API-always-returns-invalid-access-token-500-error-when-i-go-to/m-p/247188#M14131</link>
    <description>Thanks for the report! The 500 on the web site definitely sounds like a bug on our side. We're looking into it.&lt;BR /&gt;&lt;BR /&gt;For the `invalid_access_token` issue, can you share the code you're using to generate and use the access token? Thanks in advance!</description>
    <pubDate>Mon, 16 Oct 2017 13:54:25 GMT</pubDate>
    <dc:creator>Greg-DB</dc:creator>
    <dc:date>2017-10-16T13:54:25Z</dc:date>
    <item>
      <title>API always returns invalid_access_token, 500 error when i go to "my apps"</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/API-always-returns-invalid-access-token-500-error-when-i-go-to/m-p/247027#M14116</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I understand that there was some service disruption about 10 hours ago. However, I believe this has been resolved now.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I generate an access token using the dropbox java sdk on my Android app, it is generating an access token fine. However, when I use this access token to authorise my account and run something like dbxClientV2.getUsers().getCurrentAccount(), it always returns an error:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;{"error_summary": "invalid_access_token/..", "error": {".tag": "invalid_access_token"}}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tried to generate several tokens and they all return the same error.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also, when I logon as a developer and go to "My Apps" it is returning me a 500 error. Does this mean that there are some API issues?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help would be appreciated.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 29 May 2019 09:18:14 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/API-always-returns-invalid-access-token-500-error-when-i-go-to/m-p/247027#M14116</guid>
      <dc:creator>overjeer</dc:creator>
      <dc:date>2019-05-29T09:18:14Z</dc:date>
    </item>
    <item>
      <title>Re: API always returns invalid_access_token, 500 error when i go to "my apps"</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/API-always-returns-invalid-access-token-500-error-when-i-go-to/m-p/247188#M14131</link>
      <description>Thanks for the report! The 500 on the web site definitely sounds like a bug on our side. We're looking into it.&lt;BR /&gt;&lt;BR /&gt;For the `invalid_access_token` issue, can you share the code you're using to generate and use the access token? Thanks in advance!</description>
      <pubDate>Mon, 16 Oct 2017 13:54:25 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/API-always-returns-invalid-access-token-500-error-when-i-go-to/m-p/247188#M14131</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2017-10-16T13:54:25Z</dc:date>
    </item>
    <item>
      <title>Re: API always returns invalid_access_token, 500 error when i go to "my apps"</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/API-always-returns-invalid-access-token-500-error-when-i-go-to/m-p/247266#M14145</link>
      <description>&lt;P&gt;Thanks for your response. Here is the code:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It is for my android app. I have to add that until friday it was working OK.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;- First I redirect the user to authorise my app. This is done by redirecting them to a URL that gets generated by this code:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;val request = DbxWebAuth.newRequestBuilder()
                .withDisableSignup(true)
                .withNoRedirect()
                .build()
        return mWebAuth.authorize(request)&lt;/PRE&gt;
&lt;P&gt;where mWebAuth is&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;mWebAuth = DbxWebAuth(mConfig, mAppInfo)&lt;/PRE&gt;
&lt;P&gt;the user is redirected&amp;nbsp;to a webview and if she authorises my app, a token gets generated. This token is&amp;nbsp;stored and a simple command is run for verifying whether the token is valid. For this I need an instance of the DbxClientV2 so I create one:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;DbxClientV2(mConfig, "token code")&lt;/PRE&gt;
&lt;P&gt;Then I run the command to see whether the token generated is valid or not:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;client.users()?.currentAccount&lt;/PRE&gt;
&lt;P&gt;This is where I get an exception:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt; {"error_summary": "invalid_access_token/.", "error": {".tag": "invalid_access_token"}}&lt;/PRE&gt;</description>
      <pubDate>Mon, 16 Oct 2017 20:14:32 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/API-always-returns-invalid-access-token-500-error-when-i-go-to/m-p/247266#M14145</guid>
      <dc:creator>overjeer</dc:creator>
      <dc:date>2017-10-16T20:14:32Z</dc:date>
    </item>
    <item>
      <title>Re: API always returns invalid_access_token, 500 error when i go to "my apps"</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/API-always-returns-invalid-access-token-500-error-when-i-go-to/m-p/247272#M14147</link>
      <description>&lt;P&gt;You mentioned this is for an Android app, but the&amp;nbsp;DbxWebAuth you're using isn't meant for Android. The API v2 Java SDK does have specific support for Android though. There's an example Android app using it &lt;A href="https://github.com/dropbox/dropbox-sdk-java/tree/master/examples/android" target="_self"&gt;here&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;- To set that up, your AndroidManifest.xml should be set up as shown &lt;A href="https://github.com/dropbox/dropbox-sdk-java/blob/master/examples/android/src/main/AndroidManifest.xml#L33" target="_self"&gt;here&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;- You start the flow by calling startOAuth2Authentication as shown &lt;A href="https://github.com/dropbox/dropbox-sdk-java/blob/master/examples/android/src/main/java/com/dropbox/core/examples/android/UserActivity.java#L36" target="_self"&gt;here&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;- You complete the flow by calling getOAuth2Token as shown &lt;A href="https://github.com/dropbox/dropbox-sdk-java/blob/master/examples/android/src/main/java/com/dropbox/core/examples/android/DropboxActivity.java#L22" target="_self"&gt;here&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;- Your app can store and re-use the resulting access token for that user, as the example does &lt;A href="https://github.com/dropbox/dropbox-sdk-java/blob/master/examples/android/src/main/java/com/dropbox/core/examples/android/DropboxActivity.java#L24" target="_self"&gt;here&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;- Once you have an access token, you can make a client as shown &lt;A href="https://github.com/dropbox/dropbox-sdk-java/blob/395d463840778b4c6ec730aef82b0a9dbee10f8e/examples/android/src/main/java/com/dropbox/core/examples/android/DropboxClientFactory.java#L21" target="_self"&gt;here&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For the code you are currently using though, it looks like you're getting that 'invalid_access_token' error because you're supplying an authorization code, instead of an access token.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When using DbxWebAuth, you get back an "authorization code", which is not an access token. You need to exchange that authorization code for an access token, as shown &lt;A href="https://github.com/dropbox/dropbox-sdk-java/blob/7ecc15cf0f51d6ae2ba5cdb334aac2c2f3474b87/examples/web-file-browser/src/main/java/com/dropbox/core/examples/web_file_browser/DropboxAuth.java#L71" target="_self"&gt;here&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Mon, 16 Oct 2017 20:41:44 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/API-always-returns-invalid-access-token-500-error-when-i-go-to/m-p/247272#M14147</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2017-10-16T20:41:44Z</dc:date>
    </item>
    <item>
      <title>Re: API always returns invalid_access_token, 500 error when i go to "my apps"</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/API-always-returns-invalid-access-token-500-error-when-i-go-to/m-p/247280#M14148</link>
      <description>thanks mate. I will give this a go and come back to you. Thanks so much for coming back so swiftly!</description>
      <pubDate>Mon, 16 Oct 2017 21:35:32 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/API-always-returns-invalid-access-token-500-error-when-i-go-to/m-p/247280#M14148</guid>
      <dc:creator>overjeer</dc:creator>
      <dc:date>2017-10-16T21:35:32Z</dc:date>
    </item>
    <item>
      <title>Re: API always returns invalid_access_token, 500 error when i go to "my apps"</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/API-always-returns-invalid-access-token-500-error-when-i-go-to/m-p/247356#M14157</link>
      <description>&lt;P&gt;That worked! &lt;img class="lia-deferred-image lia-image-emoji" src="https://www.dropboxforum.com/html/@13532C4C3505179FBF012F1C117AE2EB/emoticons/1f604.png" alt=":grinning_face_with_smiling_eyes:" title=":grinning_face_with_smiling_eyes:" /&gt; thanks so much Greg.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also the 500 error is gone so we can close this one. Thanks again!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;By the by, I *had* forgotten a crucial step in the way I was authorising the app - to run:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;AuthFinish&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;I wrote my own Webview that was generating the token quite well but I think not running auth finish was detrimental to the process &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;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;cheers mate!&lt;/P&gt;</description>
      <pubDate>Tue, 17 Oct 2017 11:20:23 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/API-always-returns-invalid-access-token-500-error-when-i-go-to/m-p/247356#M14157</guid>
      <dc:creator>overjeer</dc:creator>
      <dc:date>2017-10-17T11:20:23Z</dc:date>
    </item>
    <item>
      <title>Re: API always returns invalid_access_token, 500 error when i go to "my apps"</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/API-always-returns-invalid-access-token-500-error-when-i-go-to/m-p/247363#M14160</link>
      <description>We did find and resolve the issue causing the 500 late yesterday. Thanks for confirming!</description>
      <pubDate>Tue, 17 Oct 2017 11:41:15 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/API-always-returns-invalid-access-token-500-error-when-i-go-to/m-p/247363#M14160</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2017-10-17T11:41:15Z</dc:date>
    </item>
  </channel>
</rss>

