nextcloud / photos

📸 Your memories under your control
GNU Affero General Public License v3.0
552 stars 61 forks source link

Does photos provide an API similar to the gallery app? #205

Open vauvenal5 opened 4 years ago

vauvenal5 commented 4 years ago

Pretty much what the title says. I was not able to find any issues or documentation about this topic.

In case there is non, is an API planned?

skjnldsv commented 4 years ago

What kind of API do you have in mind?

vauvenal5 commented 4 years ago

The gallery app provided a BETA state REST API: https://github.com/nextcloud/gallery/wiki/RESTful-API

skjnldsv commented 4 years ago

Ah, well we have indeed the album & shared album entrypoints here. We could indeed create a proper api doc

Any specific project you would need this for? :)

vauvenal5 commented 4 years ago

I am considering to write an Android Gallery App in which Nextcloud is a first class citizen. Currently I am still evaluating if a new project is the best approach or if I can build upon something existing.

skjnldsv commented 4 years ago

cc @jancborchardt

thibaultamartin commented 4 years ago

@skjnldsv @jancborchardt stabilized APIs could be useful to integrate with GNOME Photos as well. Nextcloud could be a first class citizen there :)

See the relevant issue on GNOME's Gitlab.

thibaultamartin commented 4 years ago

@skjnldsv may I suggest to version the API? Prefixing the API with /v1 will allow to ship a new /v2 API which breaks retro-compatbility if you ever need to, and deprecate the /v1.

Then you can support /v1 and /v2 APIs concurrently during a year or so, before removing support for the /v1 API. This would both give clients some stability and time to adapt, and give you some flexibility to suit your needs.

skjnldsv commented 4 years ago

cc @rullzer

rullzer commented 4 years ago

All fine with me.

Yes versioned APIs if we want to expose them make a ton of sense :) Would probably need to be OCS for the albums stuff to make it work out of the box with clients.

thibaultamartin commented 4 years ago

@rullzer which should be the best way to authenticate against this API? Using the token granted with the Login Flow v2?

Hugo-Trentesaux commented 4 years ago

Do you mean like described in this issue : https://github.com/nextcloud/gallery/issues/63 ?

skjnldsv commented 4 years ago

@rullzer which should be the best way to authenticate against this API? Using the token granted with the Login Flow v2?

Like any ocs call, see documentation :) https://docs.nextcloud.com/server/stable/admin_manual/configuration_user/instruction_set_for_users.html

thibaultamartin commented 4 years ago

Do you mean like described in this issue : nextcloud/gallery#63 ?

@Hugo-Trentesaux This is a different matter. GNOME Photos is a desktop app to manage your photos. I don't want to "embed" a Nextcloud Photos widget. I'd rather access the actual photos, thumbnails, albums and metadata.

Like any ocs call, see documentation :)

@skjnldsv There probably is a misunderstanding here :)

The documentation you sent me is about user management. I don't want to add/remove or do anything with the users. I would like to know, as a third party completely outside of Nextcloud, what I should put in my Authorization header so I can perform actions as an authenticated user.

skjnldsv commented 4 years ago

The documentation you sent me is about user management. I don't want to add/remove or do anything with the users. I would like to know, as a third party completely outside of Nextcloud, what I should put in my Authorization header so I can perform actions as an authenticated user.

No, we have a standard about apis in nextcloud: OCS. Reaching the OCS api is the same for every of our apps. Users management, apps management, sharing management... etc :)

Sorry, this link should explain a bit more in depth: https://docs.nextcloud.com/server/stable/developer_manual/client_apis/OCS/index.html