/** * Gets the metadata for all the file revisions (up to a limit) for a given path. * * See <a href="https://www.dropbox.com/developers/core/docs#revisions">/revisions</a>. * * @param string path * The Dropbox path that you want file revision metadata for (UTF-8). * * @param int|null limit * The maximum number of revisions to return. * * @return array|null * A list of <a href="https://www.dropbox.com/developers/core/docs#metadata-details>metadata * objects</a>, one for each file revision. The later revisions appear first in the list. * If <code>null</code>, then there were too many revisions at that path. * * @throws Exception */ function getRevisions($path, $limit = null) { Path::checkArgNonRoot("path", $path); Checker::argIntPositiveOrNull("limit", $limit); $response = $this->doGet($this->apiHost, $this->appendFilePath("1/revisions", $path), array("rev_limit" => $limit)); if ($response->statusCode === 406) { return null; } if ($response->statusCode !== 200) { throw RequestUtil::unexpectedStatus($response); } return RequestUtil::parseResponseJson($response->body); }