0

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

1 Answer 1

0

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.