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". What am I doing wrong here:
$options = array(
"filename_only" => true,
"max_results" => 1,
"file_status" => "active",
"path" => "/some/folder/folder",
"file_extensions" => "txt"
);
$params = array(
"options" => $options,
"query" => "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' );