Welcome to the new Box Support website. Check out all the details here on what’s changed.

FOLDER CREATION

New post

Comments

1 comment

  • Dom Elliott

    You need an access token and you also need to send the post data in json format.

    The following worked for me:

            $parent = array();
            $parent['id'] = $parent_id;              
            $params = array();
            $params['name'] = $name;
            $params['parent'] = $parent;   
            $params = json_encode($params);           
            $results = $this->httpClient->request('POST', 'https://api.box.com/2.0/folders',
                                                  [
                                                    'headers' => [
                                                      'Authorization' => 'Bearer ' . $access_token,
                                                      'Content-type: application/json'],
                                                    'body' => $params,
                                                  ]);

    0
    Comment actions Permalink

Post is closed for comments.