I have a sharepoint server 2016 like the one I show in the attached image.

I want, through a java code, to read the metadata of the document notes.txt, but I do not know what url endpoint to use for it.

Can someone solve my doubt?

Thank you.

My Sharepoint site

1 Answer 1


You can use the SharePoint REST API for files and folders to get the metadata (or content) of the file.

For your example, the server-relative endpoint URL would be:

  • The file with basic metadata:

    /my/personal/KIEWB/_api/web/getfilebyserverrelativeurl('/my/personal/KIEWB/Documentos compartidos/notas.txt')

  • The file content:

    /my/personal/KIEWB/_api/web/getfilebyserverrelativeurl('/my/personal/KIEWB/Documentos compartidos/notas.txt')/$value

  • The list item metadata for the file:

    /my/personal/KIEWB/_api/web/getfilebyserverrelativeurl('/my/personal/KIEWB/Documentos compartidos/notas.txt')/ListItemAllFields

  • ok, thank you.If I want to add metadata from an external application, should I use these endpoints as well? Commented Feb 25, 2019 at 10:52
  • Yes. But of course you will also have to authenticate the user first before you are able to use the endpoint.
    – Anon
    Commented Feb 25, 2019 at 11:00
  • You will need the request/form digest and it would need a two-phase approach to update the data.
    – vol7ron
    Commented Feb 25, 2019 at 15:34
  • I can do a get of the metadata, and I can also upload a file with my code, but if I try to change the value of a metadata, it shows me a 403 error. This is part of the code: Commented Feb 28, 2019 at 15:34
  • 1
    Try adding the header "IF-MATCH": "*". It seams to have to do with the ETag which is used to determine the sequence for and managing of concurrent updates. Providing a wildcard * will ignore the ETag. Marc Anderson (SPServices author) wrote a blog post about that.
    – Anon
    Commented Mar 14, 2019 at 16:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.