How to get files from a public share via OCS Share API without credentials

Thanks so much @marcelklehr!

I can query all files in the public folder “website” with my user “website”. The Request looks something like this: https://cloud.example.com/remote.php/dav/files/website/website

The response for each image in the folder (sanitized & shortened) looks like this:

<d:response>
	<d:href>/remote.php/dav/files/website/website/293A8324.jpg</d:href>
	<d:propstat>
		<d:prop>
			<d:getlastmodified>Sat, 09 Jul 2022 14:41:47 GMT</d:getlastmodified>
			<d:getcontentlength>1218515</d:getcontentlength>
			<d:resourcetype/>
			<d:getetag>&quot;8aecb51e4916ef3f7321cc6f8b4fd0ec&quot;</d:getetag>
			<d:getcontenttype>image/jpeg</d:getcontenttype>
		</d:prop>
		<d:status>HTTP/1.1 200 OK</d:status>
	</d:propstat>
	<d:propstat>
		<d:prop>
			<d:quota-used-bytes/>
			<d:quota-available-bytes/>
		</d:prop>
		<d:status>HTTP/1.1 404 Not Found</d:status>
	</d:propstat>
</d:response>

I’m than extracting the file names from the href attribute to put them into an array which I than iterate over using the https://cloud.example.com/remote.php/dav/files/website/website/FILENAME endpoint to finally get all the images.

It isn’t as easy as I’d like it to be, but it works, so I won’t start complaining :smile:

Thanks a lot!