Microsoft Graph REST API Create a new item in a list

sktama 0 Reputation points
2024-04-04T04:50:07.1566667+00:00

Nice to meet you everyone

I'm Japanese and can't speak English at all, so I'm using Google Translate to post my questions.

I think there are some parts that are difficult to understand, but I would appreciate it if you could help me solve it.

Now on to the main topic

I'm currently trying to register a new item using the Microsoft Graph REST API. https://learn.microsoft.com/en-us/graph/api/listitem-create?view=graph-rest-1.0&tabs=http

But here's the problem.

The reason is that there are fewer fields in the reference example.

In particular, I would like to know how to set the following items.

  • images
  • hyperlinks
  • locations
  • managed metadata
  • attachments

I didn't know how to set these fields.

After looking into it, it seems that these columns may not be supported by GraphAPI yet, so if anyone has detailed information, please let me know.

Example

POST https://graph.microsoft.com/v1.0/sites/{site-id}/lists/{list-id}/items Content-Type: application/json
{ 
	"fields": 
		{ 
			"Title": 
			"Widget", 
			"Color": "Purple", 
			"Weight": 32 
		} 
}
Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
10,914 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Sourabh Gupta 795 Reputation points Microsoft Vendor
    2024-05-19T10:48:49.3233333+00:00

    Hi sktama,

    Thanks for reaching out,

    Yes, you are very much correct that column type mentioned by you are NOT supported by Graph API as of now.

    However, there are few open issues for hyperlink and attachment type

    For Attachments:

    You can upvote the idea Ability to attach files to list items using Graph API, on graph feedback forum.

    For Hyperlinks:

    Currently, the update of SharePoint list item with hyperlink field is not supported. There was a similar problem on GitHub before, but it has not been resolved yet. As a workaround, you could refer to the rest api in the issue.

    For Others:

    I suggest you submit a user voice to add a support request for updating hyperlink column, and I'll vote for you.

    Hope this helps.

    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have further questions about this answer, please click "Comment".

    0 comments No comments