We are developing a Web application, in which we need to display documents linked to several different channels for some group of users (e.g. I am “user1” and other users, lets say “user2” and “user3”, can share their documents with me if I have access to their channels, so as “user1” I’m able to access all of the documents). We know this can be done for mobile applications through sync gateway by downloading all the documents in a pull replication.
Is there a way to implement access to all the documents linked to several different channels using the sync gateway public API in the same way a pull replication does?
If you know the set of channels, you can issue a one-shot changes request with a channels filter to get the set of documents in those channels.
If you don’t know the channels (and just want to get all documents available for a given user), you can issue a one-shot changes request as the given user - either using basic auth to authenticate the request as the user, or by first creating a session for the user via the admin REST API and using the session token to authenticate.
Details on the changes request functionality here: