public thumbnails ( string[optional] $path, string[optional] $size = 'small', string[optional] $format = 'jpeg', bool[optional] $sandbox = false ) : string | ||
$path | string[optional] | |
$size | string[optional] | |
$format | string[optional] | |
$sandbox | bool[optional] | |
Результат | string | An array with the content-type and the data as a base64-encoded string. |
public function thumbnails($path, $size = 'small', $format = 'jpeg', $sandbox = false)
{
// build url
$url = '1/thumbnails/';
$url .= $sandbox ? 'sandbox/' : 'dropbox/';
$url .= trim((string) $path, '/');
// build parameters
$parameters['size'] = (string) $size;
$parameters['format'] = (string) $format;
// make the call
return $this->doCall($url, $parameters, 'GET', null, false, true);
}
/** * Tests Dropbox->thumbnails() */ public function testThumbnails() { $response = $this->dropbox->thumbnails(BASE_PATH . 'image.png'); $this->assertArrayHasKey('content_type', $response); $this->assertArrayHasKey('data', $response); }