I can't believe this is so difficult. Here is what I need and I just seem to be chasing my tail and not getting anywhere.
- In my local database I have stored the path and the file id of files that are in SharePoint, along with some other meta-data.
- Pulling the path and file ID, I can use the _api/web/lists/getbyTitle('')/items() to find this file object. I can see the return results in Postman.
This works fine.
Second 1. I can search for a file in SharePoint using the _api/search/query?queryText='' This return a list of search results with data that I need to diplay to the user. Namely, the Path, ServerRedirectedURL, ServerRedirectedEmbedURL, and ServerRedirectedPreviewURL.
Upon suggestions from other great folks here, I put /?$expand=file to the end of the first search but still do not see these attributes for the file. So:
- Is there a way to pull these attributes using the _api/web/lists/getbyTitle/item api call? If not, then:
- can I pull an attribute from the file object and use that in the search object? For example, the "GUID" field?
I would even make two calls to the API if needed to get this done, I just can't believe that there isn't a way to do a search with an ID or GUID through the API to pull back a file, or a way to get the full attribute data of a file that is returned by the search.
Any help to this end would be much, much appreciated.