Quantcast
Channel: SharePoint 2013 - Development and Programming forum
Viewing all articles
Browse latest Browse all 7589

Graph API for C#: Is it possible to Update a Drive in /Groups using Graph API?

$
0
0

Hello,

I am working with Groups on Graph API. I have read some documentation, but I could not find the final result I wish to achieve.

I have created a code that creates a Group. I would like to know if it is possible to modify the URL of Library on the group in that link (see red circle in the next picture)

I have checked the REST API and this endpoint

https://graph.microsoft.com/v1.0/groups/XXXX-XXXX-XXX-XXX/drive

and it shows the next result (The WebUrl is the same of the Link)

{"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#drives/$entity","createdDateTime": "2020-06-03T03:40:41Z","description": "","id": "b!GjGHU7U6LU2f82kfs0686NMGuRQeAbRGjFmGwROY_5uxrFg8zmvHTLrKhj1N6QNY","lastModifiedDateTime": "2020-06-03T03:40:41Z","name": "Documents","webUrl": "https://SharePointSite.com/sites/xxx/Shared%20Documents","driveType": "documentLibrary","createdBy": {"user": {"displayName": "System Account"
        }
    },"quota": {"deleted": 0,"remaining": 0,"total": 0,"used": 0
    }
}

Is it possible to change it to a different SharePoint Library? I have tried to use this, but it throws an error that PATCH is not allow

 var updatedDrive = graphClient.Groups[updateGroupDriveRequest.GroupId.ToString()]
                        .Drives
                        .Request()
                        .AddAsync(new Drive { 
                            Name = updateGroupDriveRequest.Name,
                            WebUrl = updateGroupDriveRequest.FolderUrl
                        }).Result;

I would like how to change the same link in Teams too which is the same of Groups. 

Thank you!


Viewing all articles
Browse latest Browse all 7589

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>