Skip to content

Commit

Permalink
paper update, returnData fix
Browse files Browse the repository at this point in the history
  • Loading branch information
lukeb2014 committed Feb 8, 2019
1 parent c4677dc commit 9c6e7fd
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
10 changes: 5 additions & 5 deletions sdk/Dropbox/Files.php
Original file line number Diff line number Diff line change
Expand Up @@ -244,14 +244,14 @@ public function download($path, $target) {
"Content-Type: ",
"Dropbox-API-Arg: {\"path\": \"$path\"}"
);
$data = Dropbox::postRequest($endpoint, $headers, '', FALSE);
$returnData = Dropbox::postRequest($endpoint, $headers, '', FALSE);
if ($target !== false) {
$file = fopen($target, 'w');
fwrite($file, $data);
fwrite($file, $returnData);
fclose($file);
}
else {
return $data;
return $returnData;
}
}

Expand Down Expand Up @@ -291,7 +291,7 @@ public function get_preview($path, $target) {
}
else {
$file = fopen($target, 'w');
fwrite($file, $data);
fwrite($file, $returnData);
fclose($file);
}
}
Expand Down Expand Up @@ -339,7 +339,7 @@ public function get_thumbnail($path, $target, $format = 'jpeg', $size = 'w64h64'
}
else {
$file = fopen($target, 'w');
fwrite($file, $data);
fwrite($file, $returnData);
fclose($file);
}
}
Expand Down
24 changes: 12 additions & 12 deletions sdk/Dropbox/Paper.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public function download($doc_id, $export_format) {
* shared on the folder are listed and for team folders all non-team users shared on the folder are returned.
*/
public function folder_users_list($doc_id, $limit = 1000) {
$endpoint = "https//api.dropboxapi.com/2/docs/folder_users/list";
$endpoint = "https//api.dropboxapi.com/2/paper/docs/folder_users/list";
$headers = array(
"Content-Type: application/json"
);
Expand All @@ -98,7 +98,7 @@ public function folder_users_list($doc_id, $limit = 1000) {
* Once a cursor has been retrieved from docs/folder_users/list, use this to paginate through all users on the Paper folder.
*/
public function folder_users_list_continue($doc_id, $cursor) {
$endpoint = "https//api.dropboxapi.com/2/docs/folder_users/list/continue";
$endpoint = "https//api.dropboxapi.com/2/paper/docs/folder_users/list/continue";
$headers = array(
"Content-Type: application/json"
);
Expand Down Expand Up @@ -134,7 +134,7 @@ public function get_folder_info($doc_id) {
* Returns the list of all Paper docs according to the argument specifications.
*/
public function llist($filter_by = "docs_accessed", $sort_by = "accessed", $sort_order = "ascending", $limit = 1000) {
$endpoint = "https//api.dropboxapi.com/2/docs/list";
$endpoint = "https//api.dropboxapi.com/2/paper/docs/list";
$headers = array(
"Content-Type: application/json"
);
Expand All @@ -143,7 +143,7 @@ public function llist($filter_by = "docs_accessed", $sort_by = "accessed", $sort
}

public function list_continue($cursor) {
$endpoint = "https//api.dropboxapi.com/2/docs/list/continue";
$endpoint = "https//api.dropboxapi.com/2/paper/docs/list/continue";
$headers = array(
"Content-Type: application/json"
);
Expand All @@ -161,7 +161,7 @@ public function list_continue($cursor) {
* permanently deletes the given Paper doc.
*/
public function permanently_delete($doc_id) {
$endpoint = "https//api.dropboxapi.com/2/docs/permanently_delete";
$endpoint = "https//api.dropboxapi.com/2/paper/docs/permanently_delete";
$headers = array(
"Content-Type: application/json"
);
Expand All @@ -179,7 +179,7 @@ public function permanently_delete($doc_id) {
* returns the default sharing policy for the given Paper doc
*/
public function sharing_policy_get($doc_id) {
$endpoint = "https//api.dropboxapi.com/2/docs/sharing_policy/get";
$endpoint = "https//api.dropboxapi.com/2/paper/docs/sharing_policy/get";
$headers = array(
"Content-Type: application/json"
);
Expand All @@ -201,7 +201,7 @@ public function sharing_policy_get($doc_id) {
* because this setting can be changed only via the team admin console.
*/
public function sharing_policy_set($doc_id, $public_sharing_policy, $team_sharing_policy = "") {
$endpoint = "https//api.dropboxapi.com/2/docs/sharing_policy/set";
$endpoint = "https//api.dropboxapi.com/2/paper/docs/sharing_policy/set";
$headers = array(
"Content-Type: application/json"
);
Expand All @@ -219,7 +219,7 @@ public function sharing_policy_set($doc_id, $public_sharing_policy, $team_sharin
* updates an existing Paper doc with the provided content
*/
public function update($doc_id, $doc_update_policy, $revision, $import_format) {
$endpoint = "https//api.dropboxapi.com/2/docs/update";
$endpoint = "https//api.dropboxapi.com/2/paper/docs/update";
$headers = array(
"Content-Type: application/json"
);
Expand All @@ -239,7 +239,7 @@ public function update($doc_id, $doc_update_policy, $revision, $import_format) {
* please read the documentation for the $members format
*/
public function users_add($doc_id, $members, $quiet = false, $custom_message = null) {
$endpoint = "https//api.dropboxapi.com/2/docs/users/add";
$endpoint = "https//api.dropboxapi.com/2/paper/docs/users/add";
$headers = array(
"Content-Type: application/json"
);
Expand All @@ -260,7 +260,7 @@ public function users_add($doc_id, $members, $quiet = false, $custom_message = n
* lists all users who visited the Paper doc or users with explicit access.
*/
public function users_list($doc_id, $limit = 1000, $filter_by = "shared") {
$endpoint = "https//api.dropboxapi.com/2/docs/users/list";
$endpoint = "https//api.dropboxapi.com/2/paper/docs/users/list";
$headers = array(
"Content-Type: application/json"
);
Expand All @@ -275,7 +275,7 @@ public function users_list($doc_id, $limit = 1000, $filter_by = "shared") {
}

public function users_list_continue($doc_id, $cursor) {
$endpoint = "https//api.dropboxapi.com/2/docs/users/list/continue";
$endpoint = "https//api.dropboxapi.com/2/paper/docs/users/list/continue";
$headers = array(
"Content-Type: application/json"
);
Expand All @@ -293,7 +293,7 @@ public function users_list_continue($doc_id, $cursor) {
* Allows an owner or editor to remove users from a Paper doc using their email address or Dropbox account ID.
*/
public function users_remove($doc_id, $member) {
$endpoint = "https//api.dropboxapi.com/2/docs/users/remove";
$endpoint = "https//api.dropboxapi.com/2/paper/docs/users/remove";
$headers = array(
"Content-Type: application/json"
);
Expand Down

0 comments on commit 9c6e7fd

Please sign in to comment.