I am able to use Microsoft API to upload file to folder shared within the same domain. For example, user1@mycompany.com
share a directory to user2@mycompany.com
, then I am able to write to the shared folder via user2@mycompany.com
.
More specifically, I am able to create an upload session using following API:
https://graph.microsoft.com/v1.0/drives/<drive_id>/items/<dir_id>:/<filename>:/createUploadSession
However, the same API would return 404
if the drive_id
and dir_id
is from user of another domain. For example, another@othercompany.com
share folder to user2@mycompany.com
, then upload file via user2@mycompany.com
.
The error message from API is
{
"error": {
"code": "itemNotFound",
"message": "The resource could not be found.",
"innerError": {
"request-id": "526d86bc-c620-4782-a74d-c8cd8284df8b",
"date": "2018-10-19T20:54:37"
}
}
}
Is there any API that would work for OneDrive file upload to shared folder across different domains?