PHP Classes
Icontem copy folder

Recommend this page to a friend!

      PHP OAuth Library API  >  All threads  > copy folder  >  (Un) Subscribe thread alerts copy folder
Summary:Looking for example of the copy folder
Author:George Lerma
Date:2013-11-21 23:47:35
Update:2013-11-27 06:02:09

  1. copy folder   Reply   Report abuse  
George Lerma - 2013-11-21 23:47:35

Thank you for creating this great class. I am trying to understand how the format of the associative array would be when performing a POST on a copy of folder action on the V2 API. I am having trouble getting it to be in the correct format.

Here is the API action reference:

The box API document specifies up to three attributes for the call:
1. parent - Object representing the new location of the folder.
2. id - The ID of the destination folder.
3. name - An optional new name for the folder.

Here is a curl example:
curl \
-H "Authorization: Bearer ACCESS_TOKEN" \
-d '{"parent": {"id" : DESTINATION_FOLDER_ID}}' \

How would i do this using your class?

George lerma

  2. Re: copy folder   Reply   Report abuse  
Manuel Lemos - 2013-11-27 06:02:09 - In reply to message 1 from George Lerma
I have not tried it yet but you may want to try this:

$parent = new stdClass;
$parent->id = 'DESTINATION_FOLDER_ID';
$values = new stdClass;
$values->parent = $parent;
$success = $client->CallAPI(
'POST', $values, array('FailOnAccessError'=>true), $result);