Closed bhavens17 closed 1 year ago
I don't believe the download url is included, you can see this samples where we use the webDavUrl value to run the download. Alternatively, you can make a request to the graph drive item and get additional details that way (though I recognize that is an extra request).
I did try to go the route of using the access token used during the file picker process as a bearer auth token w/ the webDavUrl to request the selected files, but was getting an unauthorized response for that. Was just hoping to avoid having to run a second process to actually download the file.
I faced the exact same issue and as a work around, here's what i did: After I selected the file(s) from file picker, I extracted the selected file Id's and then made an api call to microsoft graph end point (/me/drive) for each file id to get '@microsoft.graph.downloadUrl' for each file . @patrick-rodgers Ideally this should be included in pick command. The file picker should give this pre-authenticated download url
@microsoft.graph.downloadUrl from the selected files is valid only for an hour. It is mentioned in documentation. Documentation link: Link
Going to close this as the returned object contains enough information to construct a valid Graph URL to get the file contents without the presence of the @microsoft.graph.downloadUrl field.
Recently updated docs describe this. To get the content you can add /content
.
GET @sharePoint.endpoint + /drives/ + parentReference.driveId + /items/ + id + /content
I've implemented the Javascript client logic into my app and can successfully show the file picker to a user and allow them to select file(s) from their OneDrive, however when I receive the file information in the message handler after selecting the files there doesn't appear to be a 'Download Url' value. I was expecting to receive a '@microsoft.graph.downloadUrl' (or similar) value. The values that I'm receiving instead are:
Is there a certain param value that's required in order to get a download URL for the selected files? Or some other way to retrieve this information?
My current params are: