<?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: Dropbox API not returning all files in Dropbox API Support &amp; Feedback</title>
    <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Dropbox-API-not-returning-all-files/m-p/273302#M16263</link>
    <description>For the error you're getting, it looks like you aren't passing in an access token. (I.e., "Bearer" should be followed by the access token.) You'll need to see why that is. It appears you're trying to retrieve it via `session('access_token')`, which apparently isn't working.&lt;BR /&gt;&lt;BR /&gt;Anyway, yes, you can programmatically get an access token for the user using the OAuth 2 app authorization flow:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://www.dropbox.com/developers/reference/oauth-guide" target="_blank"&gt;https://www.dropbox.com/developers/reference/oauth-guide&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;The documentation for that can be found here:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://www.dropbox.com/developers/documentation/http/documentation#authorization" target="_blank"&gt;https://www.dropbox.com/developers/documentation/http/documentation#authorization&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;By the way, the subject for your post seems to be about another issue. If you're having another problem, please feel free to open another thread with the details.</description>
    <pubDate>Fri, 20 Apr 2018 14:21:57 GMT</pubDate>
    <dc:creator>Greg-DB</dc:creator>
    <dc:date>2018-04-20T14:21:57Z</dc:date>
    <item>
      <title>Dropbox API not returning all files</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Dropbox-API-not-returning-all-files/m-p/273257#M16257</link>
      <description>&lt;PRE&gt; public function __construct(Dropbox $dropbox)
    {
        $this-&amp;gt;api_client = $dropbox-&amp;gt;api();
        $this-&amp;gt;content_client = $dropbox-&amp;gt;content();
        $this-&amp;gt;access_token = session('access_token');
    }

      public function dashboard()
    {
        return view('admin.dashboard');
    }

    public function user(){


        //dd($this-&amp;gt;access_token);

        $response = $this-&amp;gt;api_client-&amp;gt;request('POST', '/2/users/get_current_account', [
            'headers' =&amp;gt; [
                'Authorization' =&amp;gt; 'Bearer ' . '&lt;U&gt;$this-&amp;gt;access_token&lt;/U&gt;'
            ]
        ]);

        $user = json_decode($response-&amp;gt;getBody(), true);


        $page_data = [
            'user' =&amp;gt; $user
        ];

        return view('admin.user', $page_data);
    }&lt;/PRE&gt;&lt;P&gt;access_token returns null and yells error:&amp;nbsp;Invalid authorization value in HTTP header "Authorization": "Bearer"&amp;nbsp;&lt;/P&gt;&lt;P&gt;But when I hard code the access_token generated from the developers portal it works fine.&lt;/P&gt;&lt;P&gt;Is there a way to get the access token dynamically ?&lt;/P&gt;&lt;P&gt;Thanks in Advance&lt;/P&gt;</description>
      <pubDate>Wed, 29 May 2019 09:13:48 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Dropbox-API-not-returning-all-files/m-p/273257#M16257</guid>
      <dc:creator>ronS1</dc:creator>
      <dc:date>2019-05-29T09:13:48Z</dc:date>
    </item>
    <item>
      <title>Re: Dropbox API not returning all files</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Dropbox-API-not-returning-all-files/m-p/273302#M16263</link>
      <description>For the error you're getting, it looks like you aren't passing in an access token. (I.e., "Bearer" should be followed by the access token.) You'll need to see why that is. It appears you're trying to retrieve it via `session('access_token')`, which apparently isn't working.&lt;BR /&gt;&lt;BR /&gt;Anyway, yes, you can programmatically get an access token for the user using the OAuth 2 app authorization flow:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://www.dropbox.com/developers/reference/oauth-guide" target="_blank"&gt;https://www.dropbox.com/developers/reference/oauth-guide&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;The documentation for that can be found here:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://www.dropbox.com/developers/documentation/http/documentation#authorization" target="_blank"&gt;https://www.dropbox.com/developers/documentation/http/documentation#authorization&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;By the way, the subject for your post seems to be about another issue. If you're having another problem, please feel free to open another thread with the details.</description>
      <pubDate>Fri, 20 Apr 2018 14:21:57 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Dropbox-API-not-returning-all-files/m-p/273302#M16263</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2018-04-20T14:21:57Z</dc:date>
    </item>
    <item>
      <title>Re: Access Token returns null</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Dropbox-API-not-returning-all-files/m-p/274333#M16333</link>
      <description>&lt;PRE&gt;public function login(Request $request)
    {
       if ($request-&amp;gt;has('code')) {
            $data = [
                'code' =&amp;gt; $request-&amp;gt;input('code'),
                'grant_type' =&amp;gt; 'authorization_code',
                'client_id' =&amp;gt; env('DROPBOX_APP_KEY'),
                'client_secret' =&amp;gt; env('DROPBOX_APP_SECRET'),
                'redirect_uri' =&amp;gt; env('DROPBOX_REDIRECT_URI')
            ];
            $response = $this-&amp;gt;api_client-&amp;gt;request(
                'POST',
                '/oauth2/token',
                ['form_params' =&amp;gt; $data]
            );

            $response_body = json_decode($response-&amp;gt;getBody()-&amp;gt;getContents(), true);
            
            &lt;STRONG&gt;&lt;U&gt;$access_token = $response_body['access_token'];&lt;/U&gt;

            //dd($access_token); //I can access the token here&lt;/STRONG&gt;

            return redirect('dashboard');
        }

        return redirect('/');
    }  &lt;/PRE&gt;
&lt;PRE&gt;public function user(){

        $response = $this-&amp;gt;adminRepo-&amp;gt;apiClient-&amp;gt;request('POST', '/2/users/get_current_account', [
            'headers' =&amp;gt; [
                'Authorization' =&amp;gt; 'Bearer ' . &lt;U&gt;$this-&amp;gt;adminRepo-&amp;gt;accessToken&lt;/U&gt;
            ]&lt;BR /&gt;&lt;EM&gt;         //error : invalid authorization value in HTTP header "Authorization": " (truncated...)&lt;/EM&gt;
        ]);

        $user = json_decode($response-&amp;gt;getBody(), true);


        $page_data = [
            'user' =&amp;gt; $user
        ];

        return view('admin.user', $page_data);
    }&lt;/PRE&gt;
&lt;P&gt;Hey Greg, sorry about the post subject my bad.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Could you please take a look at&amp;nbsp;above two methods in which I am trying to pass the access token generated by /oauth2/token but it returns&amp;nbsp;null and throws an error of bad authorization header.Is there any possible way I can retrieve this token from within my other classes.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you so much for your help. It means a lot me.&lt;/P&gt;</description>
      <pubDate>Mon, 30 Apr 2018 09:32:26 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Dropbox-API-not-returning-all-files/m-p/274333#M16333</guid>
      <dc:creator>ronS1</dc:creator>
      <dc:date>2018-04-30T09:32:26Z</dc:date>
    </item>
    <item>
      <title>Re: Access Token returns null</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Dropbox-API-not-returning-all-files/m-p/274601#M16369</link>
      <description>It sounds like you are able to retrieve the access token from the API, per your "I can access the token here" comment in your code, and that you're now trying to pass that string between your classes.&lt;BR /&gt;&lt;BR /&gt;Unfortunately as that is more about structuring your app and passing data (in this case a string that has the access token) around your app, I'm afraid I can't offer help, as that's not about the Dropbox API itself.&lt;BR /&gt;&lt;BR /&gt;A more general PHP forum may be of more help for guidance on how to pass around data like this between your classes.</description>
      <pubDate>Tue, 01 May 2018 19:19:25 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Dropbox-API-not-returning-all-files/m-p/274601#M16369</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2018-05-01T19:19:25Z</dc:date>
    </item>
    <item>
      <title>Re: Access Token returns null</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Dropbox-API-not-returning-all-files/m-p/274698#M16384</link>
      <description>Yeah, Greg, I figured out the problem, I thank you for your help. There is one particular problem I would like to ask for your advice. As I can list all the files present in my dropbox folders how can I upload it directly to a website without downloading the file on my local machine?&lt;BR /&gt;&lt;BR /&gt;I can generate the downloadable link to store it on my local machine, but as per my requirement, I need to grab a hold of the original file(binary) from Dropbox and import it.&lt;BR /&gt;Could you please shed some light on this is, it would be of a great help&lt;BR /&gt;&lt;BR /&gt;Much appreciated. Thanks in advance</description>
      <pubDate>Wed, 02 May 2018 05:08:31 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Dropbox-API-not-returning-all-files/m-p/274698#M16384</guid>
      <dc:creator>ronS1</dc:creator>
      <dc:date>2018-05-02T05:08:31Z</dc:date>
    </item>
    <item>
      <title>Re: Access Token returns null</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Dropbox-API-not-returning-all-files/m-p/274751#M16385</link>
      <description>I believe I just commented on your StackOverflow post:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://stackoverflow.com/questions/50127717/importing-files-from-dropbox-using-api-v2-to-a-serverweb-to-web" target="_blank"&gt;https://stackoverflow.com/questions/50127717/importing-files-from-dropbox-using-api-v2-to-a-serverweb-to-web&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;I don't have full context on your app, but there are several ways to get the file data. If the Chooser works for your use case though, that's recommended as it's generally easy to use. You can get the link from the Chooser and use a standard HTPS client to GET the content from the link.</description>
      <pubDate>Wed, 02 May 2018 13:32:50 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Dropbox-API-not-returning-all-files/m-p/274751#M16385</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2018-05-02T13:32:50Z</dc:date>
    </item>
    <item>
      <title>Re: Access Token returns null</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Dropbox-API-not-returning-all-files/m-p/275320#M16436</link>
      <description>The context of my app is to upload a whole Dropbox folder to my website and process the files inside it one by one. I can select multiple files from "chooser", but I'm not able to get hold of the actual folder in which the files reside. Can you please educate me on how a user can select a whole folder from his/her's Dropbox and upload it to my website and then I can process the files inside it.</description>
      <pubDate>Mon, 07 May 2018 09:33:49 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Dropbox-API-not-returning-all-files/m-p/275320#M16436</guid>
      <dc:creator>ronS1</dc:creator>
      <dc:date>2018-05-07T09:33:49Z</dc:date>
    </item>
    <item>
      <title>Re: Access Token returns null</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Dropbox-API-not-returning-all-files/m-p/275363#M16440</link>
      <description>If you want an entire folder, you can use the new "folderselect:true" option:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://www.dropbox.com/developers/chooser" target="_blank"&gt;https://www.dropbox.com/developers/chooser&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;That can only be used with "preview" links, but you can modify those links for raw file access as documented here:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://www.dropbox.com/help/desktop-web/force-download" target="_blank"&gt;https://www.dropbox.com/help/desktop-web/force-download&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;For folders, that will give you a zip file. On your server, you can download the zip data, unzip it, and use the resulting files as desired.</description>
      <pubDate>Mon, 07 May 2018 15:27:06 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Dropbox-API-not-returning-all-files/m-p/275363#M16440</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2018-05-07T15:27:06Z</dc:date>
    </item>
  </channel>
</rss>

