6.3.6 Pro - api broken + User Feedback As I Go + Conclusion

Hi @MrMoronIV,

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.

Many Thanks!

Thanks xiez!

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…

cheers!

Currently there is no way to do pagination in list dir entries API, we will enhance this api in the future as well as whether file is starred.

You can open feature request in https://forum.seafile.com/c/feature if you want API enhancements.

Best regards

Manual error: https://manual.seafile.com/develop/web_api_v2.1.html#download-directory

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

Seahub: Download Folder As Zip seems to be broken

API: zip creation and download works fine!

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 would be nice to get a password:true/false parameter when listing the existing shared links:
GET https://cloud.seafile.com/api/v2.1/upload-links/

So we can check if the existing link has password enabled

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

It seems that the access log of a file is not exposed via the API, would be nice if it was :slight_smile:

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…

Manual: https://manual.seafile.com/develop/web_api_v2.1.html#view-file-through-owa

I tried all the curl examples, making sure they are exactly the same (only with my details) and ran it on the command line, still same result :frowning:

In addition, OpenOffice runs perfectly fine using Seahub

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

Documentation error: there seem to be functions to handle library trash, none of them are listed in the index at the top of the manual

It would be great if the search results return whether the library the file is in is encrypted or not.

https://cloud.seafile.com/api2/search/

Hmm, on second thought, it is stated that files in encrypted libraries are not indexed. Then why is there a search result coming back from one :slight_smile:

EDIT: same goes for starred results, would like to know if repo it’s from is encrypted or not

Starred files that you no longer have access to (e.g. when shared library is unshared) still show up in the “get all starred files” list:

https://cloud.seafile.com/api2/starredfiles/

IF you want to download mulitple files/folders but only provide dirents one file it says folder not found:and refuses to create the zip (no token)

GET https://cloud.seafile.com/api/v2.1/repos/{repo-id}/zip-task/?parent_dir={parent_dir}&dirents={dir,file}

However, you can provide a single folder, just not a single file

I’ve gone through most of the API and here are my Feature requests:

This will conclude this topic for me. I hope someone at seafile takes a look at the above topic :slight_smile: