What you're describing would technically work and would not contradict any hard rules.
However there are some conventions. For example that the path structure reflects the object structure a bit. That means GET https://myApi.com/docs
should normally list all documents, just like a directory.
Also, by convention URIs should be things (resources), not verbs, so findAll
sounds off a bit.
Also, if you want to retrieve data from the server (read-only operation), those should be GET
operations, not POST
.
Again, these are just conventions, and you can safely ignore them if you wanthave reason to do so. URIs can be basically anything you wish. They can contain IDs of any sort, numbers or strings, they can "overload" the ID namespace with special values (like findAll
) or none of the above. It is up to the server.