Access denied on creating List with Graph API
Frage
I'm trying to create a new List
in specific Site
with my own Sharepoint Application
and I'm getting Access denied
error when I send the request to API.
My application have Sites.ReadWrite.All
, this is the permission required to do this process following documentation
I don't know what is the problem or what I'm doing wrong with this process:
Public Async Sub CreateList(siteId As String, name As String)
Try
Dim list As New List()
Dim info As New ListInfo()
info.Template = "genericList"
Dim col As New ColumnDefinition()
col.Name = "Code"
col.Text = New TextColumn
Dim coll As New ListColumnsCollectionPage
coll.Add(col)
list.DisplayName = name
list.ListInfo = info
list.Columns = coll
Await GraphClient.Sites(siteId).Lists.Request.AddAsync(list)
Catch ex As Exception
Console.WriteLine(ex.Message) 'Access denied
End Try
End Sub
Lösung
Finally, I found the issue.
I have tested different permissions with Application and granted admin consent to that new permissions and that runs perfectly without errors, so I think that Microsoft Documentation
is a bit obsolete.
This procedure runs me with Sites.FullControl.All
permission.
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit sharepoint.stackexchange