Microsoft-graph-docs: Create a new list API calls is never success (beta API)

Created on 13 Jul 2017  路  15Comments  路  Source: microsoftgraph/microsoft-graph-docs

Issue:
I try to execute the MS Graph API call described there
https://developer.microsoft.com/en-us/graph/docs/api-reference/beta/api/list_create
It is a creation of a list for a sharepoint site.

I need to create it to be able to make folders in root of my sharepoint sites using the MS graph API .
My initial request and problem was described there https://stackoverflow.com/questions/44900200/ms-graph-api-sharepoint-site-create-a-folder-in-root

Noone offered a solution. It looks like the only way to create folders in root of sites is to use this BETA API to create lists.
However, the API doesn't work as described in docs.

When i try to do

POST https://graph.microsoft.com/beta/sites/{site-id}/lists
Content-Type: application/json

{
  "name": "Books",
  "columns": [
    {
      "name": "Author",
      "text": { }
    },
    {
      "name": "PageCount",
      "number": { }
    }
  ],
  "list": {
    "template": "generic"
  }
}

I have an error response with the message

Cannot define a 'name' for a list as it is assigned by the server. Instead, provide 'displayName'

If i change 'nme' to 'displayName' in the JSON document then error is "One of the provided arguments is not acceptable."

Also i tried to set

,"list":{"template":"documentLibrary"}

and still same errors

What do i do wrong? Or that BETA API just doesn't work ?

Article:
https://developer.microsoft.com/en-us/graph/docs/api-reference/beta/api/list_create

Most helpful comment

Any update on this?

All 15 comments

@rgregg hi ryan, any updates on this problem?

Hi there! I am also a PM on Ryan's team. Sorry that you ran into this issue! We are fixing it now and we expect create lists to start working on the beta endpoint by mid-August.

Any update on this?

Any update on the plan to fix this?

Update:

Now it shows a new error (I have Sites.ReadWrite.All permission)
{ "error": { "code": "unauthenticated", "message": "The caller is not authenticated.", "innerError": { "request-id": "061a3bf1-0ef4-4b60-99e3-7d5d2929aaac", "date": "2017-09-21T22:27:52" } } }

Is there any plan to fix this?

I am also interested in a solution for this.

This API is in v1.0 now: https://developer.microsoft.com/en-us/graph/docs/api-reference/v1.0/api/list_create
Has anyone been able to make successful calls with it?

@DDAndyChen , i tried and i got same wrong results with v1.0 as with beta.
it doesn't work :(

@Gelembjuk

Today I added these permissions then the create list worked for me.

Sites.Manage.All
Sites.FullControl.All

I am still getting the error "The caller is not authenticated."
I also added Sites.Manage.All and Sites.FullControl.All . Saved the app settings.
Received new refresh token .
But still can not create a list

@Gelembjuk
I use oauth2 v2.0 version, Ican make sure the the access token has some thing like this (notice the Sites.Manage.All)

"scp": "Mail.Read Sites.Manage.All User.Read",

use the https://jwt.io/

Otherwise, you access token does not have enough permission.

It works now!
Thanks, guys

I can't add Sites.Manage.All from Azure V2. Any one have ideas on how to fix this?

Seems it still doesn't work. Still reports "Can't define name ... " error with v1.0 API. Any ideas? I have all rights listed above.

dmitrybg: change "name" to "displayName", it works for me

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dcnoren picture dcnoren  路  4Comments

joostvdlinden picture joostvdlinden  路  4Comments

fredericklin picture fredericklin  路  3Comments

aaronrogers picture aaronrogers  路  3Comments

cconrado picture cconrado  路  4Comments