This error TypeError: context must be a dict rather than RequestContext. only occurs when you visit api through web page or using cUrl with html header like curl 'https://xxx/api2/ping/' -H 'Accept: text/html' which is not recommended.
The preferred method is curl 'https://xxx/api2/ping/' -H 'Accept: application/json' which works in 6.3.x
Anyway, we will update our code in next version which will fix those errors.
I will continue posting my feedback in this thread when I encounter questions using the API, I hope there will come answers or implementations to my questions as well. E.g.: Is there a way to limit file listing output via pages…
It says: “Perform the following two steps to download directory”. Although it only shows one, then shows “Revert Directory” instructions, and then shows step 2
Question: is there a way to cancel the zip creation task? What if a user doesn’t want to wait for a huge zip, does it continue creating the zip anyway?
There’s a method missing to get the user permissions (read/write or read-only) of a certain folder.
Let’s say I’m user Bob, and I access a single read-only folder in a Read/Write shared library (Sonya is owner). How can Bob find out that the folder is read-only?
It would make sense to use the “Get Directory Detail” API, expecting it would return permission:r but it doesn’t do that.
The library detail returns permission but that’s global to the whole library, which can be different from a specific folder inside the same library.
Seahub returns user_perm r when opening the folder but it uses an internal url for an ajax call: https://domain.com:8000/ajax/lib/d7478d33-fe1a-4018-86bd-708e9351384e/dir/?p=/read-only-folder&thumbnail_size=48&_=1539172930432
How can Bob find out he has read-only access using the API?
It seems to be impossible to get information about a library being shared as public using the repo_id. There’s only a method to get all publicly shared libraries.
GET https://cloud.seafile.com/api2/repos/?type={type}
type org, get public libraires.
A member (Bob) that is an Admin of a group where someone else (Alice) is the owner cannot leave that group.
2018-10-12 20:34:49,990 [ERROR] seahub.api2.endpoints.group_members:211 delete Group staff can not quit group
However, an admin (Bob) cannot remove admin privileges themselves, so an admin is basically stuck in a group unless the group owner (Alice) removes Admin privileges on Bob.
I think a user should always be able to leave a group, admin or not.
I noticed that there isn’t a way to browse snapshots using the API, would be nice if that information is being exposed via the API as well.
Also exposing the notifications would be greatly appreciated. It’s now only possible to get the amount of new notifications (undocumented), but I didn’t encounter a way to retrieve the actual notifications themselves.
the get events method returns the events but sometimes a description is missing (undefined).
For now I encountered it with the etypes: repo-create and repo-delete
PERMISSION FAULT: Error in getting File History information:
When a user tries to get the file history of a file which is read-only the API returns forbidden, although in Seahub the same information can be accessed perfectly fine.
This should be fixed so a user that has read-only access to a file can still read the file history via the API as intended
This one is annoying: when trying to open a file using OWA, it always returns {"error_msg":"path invalid."}
As soon as I use an incorrect filepath it says: {"error_msg":"File /subfolder/DOESNTEXIST.docx not found."}
The path I provide is 100% correct, there are no entries in any of the logs about this failed API call and yet I never get the response I’m looking for…
The recursive dir structure seafile returns is very impractical.
You’d expect some kind of recursive array as in
Library Name
___subfolder
______another subfolder
______subsubfolder
___subfolder
Instead, it just returns a flat list as such:
Library Name
subfolder
another subfolder
subsubfolder
subfolder
with a parent field. It’s really impractical to loop over a flat list and make a tree out of it in HTML
List Directory Entries
GET https://cloud.seafile.com/api2/repos/{repo-id}/dir/
t (optional): If set t argument as f, will only return file entries, and d for only dir entries.
recursive (optional): If set t argument as d AND recursive argument as 1, return all dir entries recursively