-
-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement the "search" API #93
Comments
Hi @ale-rinaldi. Thanks for reaching out. You have several options:
If you use and ❤️ my software, consider buying me a coffee ☕ https://www.paypal.com/paypalme/tomgross42 |
If I could figure out how to import the pcloud api from directory/file (https://stackoverflow.com/questions/67631/how-can-i-import-a-module-dynamically-given-the-full-path) I would be able to write a PR for this to add it..I can add the pcloud module using above link but then it says (after some other errors...): |
When I access
I had to remove all keywords (query, offset, limit) to get a result.. When I do that I get a result back that lists the contents of my root folder only (no recursive - didn't try it) but looks like it gives a field called
@ale-rinaldi If you can find for me any of the working keywords that will go with |
Hello @ikwyl6 , it's difficult to say without looking at your code, but it seems your error does not come from pCloud but from your code itself: it seems like you're calling a function with an argument that is not defined in the function declaration. The search API is used for example by this Raycast extension: https://github.com/raycast/extensions/blob/a8f9bfbab28582353261c3c446c5526fda3a753d/extensions/pcloud/src/providers/SearchProvider.tsx The URL parameters that it accepts are:
The last to ones are typical for pagination: in the first call you usually start with offset 0 and a limit, 10 for example. If the user wants more items you do another call with offset 10 and limit 10; then with offset 20 and limit 10 and so on. This way you can get the items without doing a single, giant query. That's the reason for the "total" field in the answer: if you limit the result, with "total" you can still know how much items you totally have to deal with. Thanks for your effort ;) |
There is a search API method that somehow was forgotten in documentation:
https://api.pcloud.com/search?query=holiday&offset=0&limit=600
It's used by the official frontend but is not mentioned in documentation; however it works correctly even when called with an OAuth authorization.
I think it's worth having it in the API clients.
The text was updated successfully, but these errors were encountered: