Skip to content
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

REST API fixes and extensions #408

Closed
3 of 10 tasks
oparoz opened this issue Oct 5, 2015 · 6 comments
Closed
3 of 10 tasks

REST API fixes and extensions #408

oparoz opened this issue Oct 5, 2015 · 6 comments

Comments

@oparoz
Copy link
Contributor

oparoz commented Oct 5, 2015

Goals: Remove verbs and provide additional functionalities

Note: A node can be a file or a folder

Config

  • /api/config

List and metadata

  • 🆕 /api/nodes/{id} Get metadata for the node identified by its ID
  • 🆕 /api/path:/{path} Get metadata for the node identified by its path
  • 🆕/api/nodes/{id}/children List of images for an album identified by its ID
  • /api/files/list -> /api/path:/{path}:/children Same as above, but using a path instead of an ID

Download

  • /api/files/download/{fileId} -> /api/nodes/{id}/content Downloads a single image or all images contained in the folder (as a zip). Not sure I want to implement the folder part...
  • 🆕 /api/path:/{path}:/content Same as above, but using a path instead of an ID

Preview

  • /api/thumbnails Streamed thumbnails
  • /api/preview/{fileId}/{width}/{height} -> /api/nodes/{id}/preview/{transform} Preview of a files identified by its ID
  • 🆕 /api/path:/{path}:/preview/{transform} Same as above, but using a path instead of an ID

Note: transform would contain comma separated parameters such as w_1920,h_1080
Note2: The preview endpoints may even disappear #404

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

@oparoz oparoz added this to the 9.0-next milestone Oct 5, 2015
@oparoz oparoz changed the title REST API extensions REST API fixes and extensions Oct 5, 2015
@Henni
Copy link
Contributor

Henni commented Oct 6, 2015

@oparoz why don't you use url parameters for width and height instead of {transform}
/api/nodes/{id}/preview?width=1920&height=1080

@oparoz
Copy link
Contributor Author

oparoz commented Oct 6, 2015

@Henni The main reason is so that you can just type a URL and get a result. It can be useful in some situations.

@Henni
Copy link
Contributor

Henni commented Oct 6, 2015

@oparoz I don't see the advantage over appending ?width=1920&height=1080
It's not a big deal, but I think it is cleaner as URL parameters, especially as the order is unimportant.

@oparoz
Copy link
Contributor Author

oparoz commented Oct 6, 2015

I'm not a 100% set on that. I find it easier to read and I saw it in other cloud/image processing APIs, but I don't think there is a rule.

/api/nodes/{id}/preview/w_1920,h_1080,t_crop,b_000033

vs

/api/nodes/{id}/preview/?width=1920&height=1080&t=crop&b=000033

Given how the Appframework works, I would make my life easier by going for parameters.

@oparoz
Copy link
Contributor Author

oparoz commented Oct 8, 2015

On a related note, the preview endpoints may even disappear in 9.0 This ticket tracks the removal of our custom preview endpoints once they're obsolete: #404

@oparoz oparoz added the ready label Oct 12, 2015
@oparoz oparoz modified the milestones: 9.1-next, 9.0-current Feb 11, 2016
@oparoz oparoz modified the milestones: 9.2-next, 9.1-current Jun 13, 2016
@oparoz
Copy link
Contributor Author

oparoz commented Sep 4, 2016

This issue was moved to nextcloud/gallery#95

@oparoz oparoz closed this as completed Sep 4, 2016
@oparoz oparoz removed the ready label Sep 4, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants