Closed mascon closed 11 years ago
BoxUserClient.GetItems(Folder.Root)
returns all the items in the folder (not just the subfolders.) As a result I suspect the call is failing because you then end up executing GetFolder(id) with a file id.
For your purposes, this might work better:
Dim rootFolder = BoxUserClient.GetFolder(Folder.Root)
For Each FolderReturned In rootFolder.Folders
Yep that solved the issue. I see the logic now. But I now have the same issue with the collaborations. Sometimes they come back empty too. How can a folder in a users root have no collaborations on it. It should at least have thier own.
I am basicly looking to see if the user is a owner or co-owner of any of the folders in their root tree. So I check all the returned folders for the owners value but for the co-ownership I have to check collaboration right?
And I receive a lot of nothings coming back on the folders. I have added a IsNothing check to stop it crashing.for now.
I did some more digging at the JSON response from box.
It does appear that you can get a collaboration with the AccessibleBy entry as NULL. That is very strange and I will discuss this with BOX to see if these are orphaned entries caused after a user is deleted.
As of now you can for me close this non issue and put it down to a fault between the chair and the desk :-)
As of now you can for me close this non issue
Ok, no problem! But real quick:
I receive a lot of nothings coming back on the folders. I have added a IsNothing check to stop it crashing.for now.
I'd like to learn more about what's happening here. Do you have a bit of code that will reproduce this?
Here is a sample response, I have changed the values in places to protect from spammers and hacker :-)
{
"type": "collaboration",
"id": "30735166",
"created_by": {
"type": "user",
"id": "183923453",
"name": "Mr A User",
"login": "a-user@a-company.com"
},
"created_at": "2012-12-21T02:59:39-08:00",
"modified_at": "2013-01-10T01:30:35-08:00",
"expires_at": null,
"status": "accepted",
"accessible_by": null,
"role": "editor",
"acknowledged_at": "2013-01-10T01:30:35-08:00",
"item": {
"type": "folder",
"id": "437870908",
"sequence_id": "3",
"etag": "3",
"name": "ICT Customers"
}
}
You will clearly see that the "accessible_by" value is NULL. I see no reason at all for this response from BOX and as such I will talk to the team about why they send this information in the JSON response.
Also I have noted that it makes no difference to the return information if I use
For Each collaboration In BoxUserClient.GetCollaborations(FolderReturned.Id).Entries
or
For Each collaboration In BoxUserClient.GetCollaborations(FolderReturned.Id, True).Entries
So maybe we have a bug here or Box is not listening to the request your sending.
Good catch John, We are looking into it.
That one was all Simon. :)
When running the following code the SDK chokes on a valid folder ID
PostMan and the headers and folderID returns successfully.