How to fetch all the data associated with the document/file on sharepoint

Pratik, Uddeshya 26 Reputation points
2020-08-21T10:26:12.127+00:00

I am looking for an API that will help me to fetch all the column's values and associated data for a specific file on SharePoint.

Currently, I am using below URL to fetch the metadata of a file:

https://{{sitename}}/_api/web/getFileByServerRelativeUrl('{{docpath}}/Shared%20Documents/Test13.docx')/listItemAllFields

Which is showing various details, but it is not showing the corresponding workflow status for associated with the file(Please check the attached screenshot in the URL)

Please refer the below link for more description:

https://answers.microsoft.com/en-us/msoffice/forum/msoffice_sharepoint-mso_win10-mso_o365b/how-to-fetch-all-the-data-associated-with-the/ec1e5d38-e8fc-42d5-9ea9-54040bda3415?tm=1597910908279

Microsoft 365 and Office | SharePoint | For business | Windows
0 comments No comments
{count} votes

Answer accepted by question author
  1. Baker Kong-MSFT 3,801 Reputation points
    2020-08-24T03:11:51.893+00:00

    Hi PratikUddeshya-7348,

    I create a document library and attach a workflow then test the above endpoint:

    19801-image.png

    However when i call the endpoint '.../listItemAllFields', it will return workflow status:

    19566-image.png

    Could you please check it again at your end? And how about getting all fields from its associated item?

    /_api/Web/Lists(guid'61bf90e1-1a2f-4686-b689-c1e7c0991284')/Items(184)/FieldValuesAsText

    Best Regards,
    Baker Kong


1 additional answer

Sort by: Most helpful
  1. MBS 0 Reputation points
    2023-04-08T00:02:52.96+00:00

    is it possible to post back an approval status change?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.