<?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 Error in search... options: expected array, got string in Dropbox API Support &amp; Feedback</title>
    <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Error-in-search-options-expected-array-got-string/m-p/720759#M31878</link>
    <description>&lt;P&gt;I am trying to use search to find any file with txt extension inside a particular path. I get the error: "Error in call to API function "files/search_v2": options: expected array, got string".&amp;nbsp; What am I doing wrong here:&lt;/P&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;LI-CODE lang="php"&gt;    $options = array(
        "filename_only" =&amp;gt; true,
		"max_results" =&amp;gt; 1,
		"file_status" =&amp;gt; "active",
		"path" =&amp;gt; "/some/folder/folder",
		"file_extensions" =&amp;gt; "txt"
    );

    $params = array(
        "options" =&amp;gt; $options,
        "query" =&amp;gt; "txt",
    );

    $headers = array(
        'Authorization: Bearer ' . $auth_token,
        'Content-Type: application/json'
    );

    $ch = curl_init();
    curl_setopt( $ch, CURLOPT_POSTFIELDS, json_encode( $params ) );
    curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true );
    curl_setopt( $ch, CURLOPT_CUSTOMREQUEST, "POST" );
    curl_setopt( $ch, CURLOPT_HTTPHEADER, $headers );
    curl_setopt( $ch, CURLOPT_URL, 'https://api.dropboxapi.com/2/files/search_v2' );&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;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 12 Oct 2023 05:50:58 GMT</pubDate>
    <dc:creator>toki4004</dc:creator>
    <dc:date>2023-10-12T05:50:58Z</dc:date>
    <item>
      <title>Error in search... options: expected array, got string</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Error-in-search-options-expected-array-got-string/m-p/720759#M31878</link>
      <description>&lt;P&gt;I am trying to use search to find any file with txt extension inside a particular path. I get the error: "Error in call to API function "files/search_v2": options: expected array, got string".&amp;nbsp; What am I doing wrong here:&lt;/P&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;LI-CODE lang="php"&gt;    $options = array(
        "filename_only" =&amp;gt; true,
		"max_results" =&amp;gt; 1,
		"file_status" =&amp;gt; "active",
		"path" =&amp;gt; "/some/folder/folder",
		"file_extensions" =&amp;gt; "txt"
    );

    $params = array(
        "options" =&amp;gt; $options,
        "query" =&amp;gt; "txt",
    );

    $headers = array(
        'Authorization: Bearer ' . $auth_token,
        'Content-Type: application/json'
    );

    $ch = curl_init();
    curl_setopt( $ch, CURLOPT_POSTFIELDS, json_encode( $params ) );
    curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true );
    curl_setopt( $ch, CURLOPT_CUSTOMREQUEST, "POST" );
    curl_setopt( $ch, CURLOPT_HTTPHEADER, $headers );
    curl_setopt( $ch, CURLOPT_URL, 'https://api.dropboxapi.com/2/files/search_v2' );&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;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Oct 2023 05:50:58 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Error-in-search-options-expected-array-got-string/m-p/720759#M31878</guid>
      <dc:creator>toki4004</dc:creator>
      <dc:date>2023-10-12T05:50:58Z</dc:date>
    </item>
    <item>
      <title>Re: Error in search... options: expected array, got string</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Error-in-search-options-expected-array-got-string/m-p/720765#M31879</link>
      <description>&lt;P&gt;I tried wrapping options in another array - still get: "options: expected object, got array"&lt;/P&gt;&lt;LI-CODE lang="php"&gt;  $options = array(
		array(
			...
		)
	);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Oct 2023 01:14:52 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Error-in-search-options-expected-array-got-string/m-p/720765#M31879</guid>
      <dc:creator>toki4004</dc:creator>
      <dc:date>2023-10-12T01:14:52Z</dc:date>
    </item>
    <item>
      <title>Re: Error in search... options: expected array, got string</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Error-in-search-options-expected-array-got-string/m-p/720853#M31880</link>
      <description>&lt;P&gt;Yes, let's think a bit: you have parameter name "file_extensions" &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; (plural, not singular)! Here a list of extensions is expected, so even when there is single extension, this extension has to be an only entry in a list and not raw string (as noted in the error message too).&lt;/P&gt;</description>
      <pubDate>Thu, 12 Oct 2023 10:59:45 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Error-in-search-options-expected-array-got-string/m-p/720853#M31880</guid>
      <dc:creator>Здравко</dc:creator>
      <dc:date>2023-10-12T10:59:45Z</dc:date>
    </item>
  </channel>
</rss>

