Describe the problem/error/question
Hello all,
I need to get the IDs of Nextcloud Folders and Files to create correct Links and to sync the Data Structure between Nextcloud and a Database. Actually I can only create a Link, based of the Filesharing. But I want to avoid the Filesharing, because the Users are still logged in by Nextcloud and could open the Files without sharing.
When I use the Nextcloud Node I won’t get any IDs. Just eTags, who are not constant by changing the Folder/File. The other Information about the Folder/Files doesn’t care in this case.
Trying to use the HTTP-Node didn’t bring me forward. In Postman I get the IDs, but in the Node I don’t.
Postman:
PROPFIND https://your-nextcloud.com/remote.php/dav/files/wilano/projects
Body as Text:
<d:propfind xmlns:d="DAV:" xmlns:oc="http://owncloud.org/ns" xmlns:nc="http://nextcloud.org/ns">
<d:prop>
<oc:fileid />
</d:prop>
</d:propfind>
Response:
<?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:href>/remote.php/dav/files/wilano/projects/</d:href>
<d:propstat>
<d:prop>
<oc:fileid>82</oc:fileid>
</d:prop>
<d:status>HTTP/1.1 200 OK</d:status>
</d:propstat>
</d:response>
<d:response>
<d:href>/remote.php/dav/files/wilano/projects/ProjectA/</d:href>
<d:propstat>
<d:prop>
<oc:fileid>141</oc:fileid>
</d:prop>
<d:status>HTTP/1.1 200 OK</d:status>
</d:propstat>
</d:response>
</d:multistatus>
In the HTTP Node the PROPFIND Call doesn’t exist. But when I import the curl Code from Postman, it will switch to PROPFIND but alerts me that the Value ist not supported.
The Response in the HTTP Node:
<?xml version="1.0"?>\n<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:href>/remote.php/dav/files/wilano/projects/</d:href><d:propstat><d:prop><d:getlastmodified>Tue, 26 Sep 2023 06:41:31 GMT</d:getlastmodified><d:resourcetype><d:collection/></d:resourcetype><d:quota-used-bytes>408037</d:quota-used-bytes><d:quota-available-bytes>-3</d:quota-available-bytes><d:getetag>"65127d1bba144"</d:getetag></d:prop><d:status>HTTP/1.1 200 OK</d:status></d:propstat></d:response><d:response><d:href>/remote.php/dav/files/wilano/projects/ProjectA/</d:href><d:propstat><d:prop><d:getlastmodified>Tue, 26 Sep 2023 06:41:31 GMT</d:getlastmodified><d:resourcetype><d:collection/></d:resourcetype><d:quota-used-bytes>408037</d:quota-used-bytes><d:quota-available-bytes>-3</d:quota-available-bytes><d:getetag>"65127d1bba144"</d:getetag></d:prop><d:status>HTTP/1.1 200 OK</d:status></d:propstat></d:response></d:multistatus>\n
Ok, the Body in the Node wasn’t pasted correctly. So I changed the Body value from:
<d:propfind xmlns:d
To:
<d:propfind xmlns:d="DAV:" xmlns:oc="http://owncloud.org/ns" xmlns:nc="http://nextcloud.org/ns">
<d:prop>
<oc:fileid />
</d:prop>
</d:propfind>
Response:
<?xml version="1.0"?>\n<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:href>/remote.php/dav/files/wilano/projects/</d:href><d:propstat><d:prop><d:getlastmodified>Tue, 26 Sep 2023 06:41:31 GMT</d:getlastmodified><d:resourcetype><d:collection/></d:resourcetype><d:quota-used-bytes>408037</d:quota-used-bytes><d:quota-available-bytes>-3</d:quota-available-bytes><d:getetag>"65127d1bba144"</d:getetag></d:prop><d:status>HTTP/1.1 200 OK</d:status></d:propstat></d:response><d:response><d:href>/remote.php/dav/files/wilano/projects/ProjectA/</d:href><d:propstat><d:prop><d:getlastmodified>Tue, 26 Sep 2023 06:41:31 GMT</d:getlastmodified><d:resourcetype><d:collection/></d:resourcetype><d:quota-used-bytes>408037</d:quota-used-bytes><d:quota-available-bytes>-3</d:quota-available-bytes><d:getetag>"65127d1bba144"</d:getetag></d:prop><d:status>HTTP/1.1 200 OK</d:status></d:propstat></d:response></d:multistatus>\n
Also switching the Authentication to Predefined Credential Type brings the same response.
What can I do? Without getting the IDs, Nextcloud is not practicable for my Project. But thats the only Issue - the other Features are still fine.
Please share your workflow
Share the output returned by the last node
<?xml version="1.0"?>\n<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:href>/remote.php/dav/files/wilano/projects/</d:href><d:propstat><d:prop><d:getlastmodified>Tue, 26 Sep 2023 06:41:31 GMT</d:getlastmodified><d:resourcetype><d:collection/></d:resourcetype><d:quota-used-bytes>408037</d:quota-used-bytes><d:quota-available-bytes>-3</d:quota-available-bytes><d:getetag>"65127d1bba144"</d:getetag></d:prop><d:status>HTTP/1.1 200 OK</d:status></d:propstat></d:response><d:response><d:href>/remote.php/dav/files/wilano/projects/ProjectA/</d:href><d:propstat><d:prop><d:getlastmodified>Tue, 26 Sep 2023 06:41:31 GMT</d:getlastmodified><d:resourcetype><d:collection/></d:resourcetype><d:quota-used-bytes>408037</d:quota-used-bytes><d:quota-available-bytes>-3</d:quota-available-bytes><d:getetag>"65127d1bba144"</d:getetag></d:prop><d:status>HTTP/1.1 200 OK</d:status></d:propstat></d:response></d:multistatus>\n
Information on your n8n setup
- n8n version: 1.7.1
- Database (default: SQLite): default
- n8n EXECUTIONS_PROCESS setting (default: own, main): default
- Running n8n via (Docker, npm, n8n cloud, desktop app): Docker
- Operating system: Debian 11.7