I'm having trouble getting both the document URL and list item ID from a document library using the REST API.
I have a custom list and a document library. One of the list fields is a lookup to the document library to allow one more documents to be associated with a list item. I'm working with the REST API using Javascript and jQuery in a visual webpart to provide a front-end for these lists so that documents can be dragged and dropped onto the list items to associate them.
I'm currently expanding the list data to include the ID and title field of associated documents. I can get the document list item ID and Title field using _api/web/lists/getbytitle('doclibname')/items but this doesn't include the document file name or URL, and I can get the file information using _api/web/lists/getbytitle('doclibname')/rootfolder/files but this doesn't included the list item ID.
Is there any way to get the list item ID and file name or URL for a document using the REST API? Ideally I would like to have one call to return all of the data from my list including the ID and URL of all associated documents. Failing that, can anyone suggest an alternative approach?
Thanks!