You’re on the right track. Files are accessible from the URL you’ve provided ie. /remote.php/dav/files/USERNAME/myfile.txt or /remote.php/dav/files/USERNAME/my/folder/file.txt .
IMO It’s a missing GUI feature. We should get a button to copy the Webdav URL in the file context menu.
Most spots across the various NC manuals have sections about accessing files through WebDAV via cURL. Even if you’re not using cURL, those spots will provide hints for the URLs and access methods necessary for doing various things in your own scripts:
And that’s just using WebDAV… There are also loads of APIs that can be accessed - and more all the time - to do various things or access functionality provided by apps.
Way beyond what you asked, but figured a decent spot to drop these links for future searchers. Good luck!