Create a list of photos with a specific "Tag"

Hello,

How could I make a list of photos with a specific “Tag”. It should be the full path with filename.
I have remote or local access.

regards
Thomas D.

How about API call to:

https://FQDN/remote.php/dav/files/USER/

Type: POST/REPORT

with Body:

<oc:filter-files  xmlns:d="DAV:" xmlns:oc="http://owncloud.org/ns" xmlns:nc="http://nextcloud.org/ns" xmlns:ocs="http://open-collaboration-services.org/ns">
    <d:prop>
        <oc:owner-display-name />
    </d:prop>
    <oc:filter-rules>
        <oc:systemtag>7</oc:systemtag>
    </oc:filter-rules>
</oc:filter-files>

Where <oc:systemtag>7</oc:systemtag> is a Tag number that you need. Check this out how to find all Tags in System:

Answer will be like this, where href you needed:

<?xml version="1.0"?>
<d:multistatus xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns" xmlns:oc="http://owncloud.org/ns" xmlns:nc="http://nextcloud.org/ns">
 <d:response>
  <d:status>HTTP/1.1 200 OK</d:status>
  <d:href>/remote.php/dav/files/USER/45456456456.jpeg</d:href>
  <d:propstat>
   <d:prop>
    <oc:owner-display-name>USER</oc:owner-display-name>
   </d:prop>
   <d:status>HTTP/1.1 200 OK</d:status>
  </d:propstat>
 </d:response>
 <d:response>
  <d:status>HTTP/1.1 200 OK</d:status>
  <d:href>/remote.php/dav/files/USER/123.jpeg</d:href>
  <d:propstat>
   <d:prop>
    <oc:owner-display-name>USER</oc:owner-display-name>
   </d:prop>
   <d:status>HTTP/1.1 200 OK</d:status>
  </d:propstat>
 </d:response>
</d:multistatus>

Hello,

the API Call in the linked site is incorrect, with the correct one, there is an error message.

curl --insecure -u user:pass 'https://172.16.251.130/remote.php/dav/' -X SEARCH -u user:pass -H "content-Type: text/xml" --data '<?xml version="1.0" encoding="UTF-8"?>
<oc:filter-files  xmlns:d="DAV:" xmlns:oc="http://owncloud.org/ns" xmlns:nc="http://nextcloud.org/ns" xmlns:ocs="http://open-collaboration-services.org/ns">
Unexpected document type: {http://owncloud.org/ns}filter-files for this Content-Type, expected {DAV:}searchrequest or {DAV:}query-schema-discovery

How can I change this?

regards
Thomas D

Hello,

ok, everything from the beginning. :slight_smile:

Here is my last script:

curl --insecure \
  -X REPORT \
  --data "@filter-files-criteria2.xml" \
  -u username:pass \
  'https://172.16.251.130/remote.php/dav/files/username'

The XML File:

<?xml version="1.0"?>
<oc:filter-files  xmlns:d="DAV:" xmlns:oc="http://owncloud.org/ns" xmlns:nc="http://nextcloud.org/ns">
         <oc:filter-rules>
                 <oc:systemtag>29</oc:systemtag>
         </oc:filter-rules>
 </oc:filter-files>

regards
Thomas D.

1 Like

Try to add -H "OCS-APIREQUEST: true" by calling with curl.