Hi all,
I am trying to create a flow which runs daily and picks up files in a sharepoint folder and uploads them to users one drive. For example, if a file is created in the folder with metadata of a user such as his email id (in a custom column), the flow must upload that document to that users one drive for business .
I am referring documentation from https://docs.microsoft.com/en-us/graph/api/driveitem-createuploadsession?view=graph-rest-1.0
to upload file currently to my one drive in a trial tenant.
I created an Azure app
which has below permissions

Not sure if all these permission are required as i kept adding them depending on errors I got.
Anyway in my flow using http call, I can get the access token. I am then using https://graph.microsoft.com/v1.0/drives/{drive}/items/{itemId}:/{fileName}:/createUploadSession to get the upload url where {drive} is my one drive id, {itemId} is the onedrive folder id and {fileName} is the name of the file with extension.
After that I am using the upload url in the put request as follows but it fails and in the result of the put request, I can see
{
"error": {
"code": "unauthenticated",
"message": "Unauthenticated"
}
}
What is wrong? I am trying to upload the entire file in a single go and not divide it into multiple fragments.





