Move a folder to the trash. The recursive parameter must be included in order to delete folders that aren't empty. This example deletes the folder w/ id = 47885473705. An empty 204 response will be returned upon successful deletion. An error is thrown if the folder is not empty and the ‘recursive’ parameter is not included.
curl https://api.box.com/2.0/folders/47885473705?recursive=true \
-H "Authorization: Bearer BOX_ACCESS_TOKEN" \
-X DELETE
Chilkat.Rest rest = new Chilkat.Rest();
bool success;
// URL: https://api.box.com/2.0/folders/47885473705?recursive=true
bool bTls = true;
int port = 443;
bool bAutoReconnect = true;
success = await rest.ConnectAsync("api.box.com",port,bTls,bAutoReconnect);
if (success != true) {
Debug.WriteLine("ConnectFailReason: " + Convert.ToString(rest.ConnectFailReason));
Debug.WriteLine(rest.LastErrorText);
return;
}
rest.AddHeader("Authorization","Bearer BOX_ACCESS_TOKEN");
Chilkat.StringBuilder sbResponseBody = new Chilkat.StringBuilder();
success = await rest.FullRequestNoBodySbAsync("DELETE","/2.0/folders/47885473705?recursive=true",sbResponseBody);
if (success != true) {
Debug.WriteLine(rest.LastErrorText);
return;
}