How to make POST/PATCH request to add Hyperlink/Picture field in List?

Vikharankar, Vishakha 25 Reputation points
2023-10-05T07:51:12.9966667+00:00

I am trying to make a POST Request via Microsoft Graph Explorer Version v1 as well as Beta, to a list that has field of type HyperLink/Picture. I added request body for that field as

{  
	"fields": {
		"fieldName": {
            "Description": "This is desc",
            "Url": "abc.com"
        }
	}
}

But, this is giving invalidRequest error, which looks like

{
    "error": {
        "code": "invalidRequest",
        "message": "Invalid request",
        "innerError": {
            "date": "2023-10-05T07:49:15",
            "request-id": "XXXXXXXX-96c4-4a63-abcd-XXXXXXXXXXX",
            "client-request-id": ""
        }
    }
}

I went through a existing similar query - https://learn.microsoft.com/en-us/answers/questions/648271/upload-image-to-sharepoint-list-using-graph-api which was posted in 2021, but there is no solution to it. What is the issue? How can I make this request using GraphAPI?

Microsoft 365 and Office | SharePoint | Development
Microsoft Security | Microsoft Graph
{count} votes

Answer accepted by question author
  1. RaytheonXie_MSFT 40,486 Reputation points Microsoft External Staff
    2023-10-05T08:48:21.3266667+00:00

    Hi @Vikharankar, Vishakha,

    Per my research, currently we are still unable to update Hyperlink column by graph api. As a workaround, I would recommend you to use rest api to update the column. Here is a similar issue with yours to reference

    https://sharepoint.stackexchange.com/questions/88540/how-do-i-update-a-hyperlink-field-using-the-rest-api


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

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    2 people found this answer helpful.

3 additional answers

Sort by: Most helpful
  1. Michael Weinhardt 15 Reputation points
    2024-11-21T05:57:03.1566667+00:00

    Currently, if this still isn't supported, that's lame.

    3 people found this answer helpful.
    0 comments No comments

  2. Stefaan De Vreese 5 Reputation points
    2025-03-11T17:24:06.7533333+00:00

    Still not possible, it's 2025 people! come on! how hard can it be to add this to the graph api...

    1 person found this answer helpful.
    0 comments No comments

  3. Yuriy Zahreva 5 Reputation points
    2025-12-04T12:34:33.9566667+00:00

    Hi @Vikharankar, Vishakha,

    I came across a solution on Stack Overflow that should resolve this issue.

    You just need to add to the request header:

     Prefer: apiversion=2.1
    
    

    Full request looks should looks like this:

    PATCH /v1.0/sites/{site_id}/list/{list_id}/items/{list_item_id}/fields
    Prefer:apiversion=2.1
    {
        "myUrl": {
            "Description": "http://www.google.com",
            "Url": "http://www.google.com"
        }
    }
    

    Could you please check if this works on your side?

    Thanks,

    Yuriy

    1 person found this answer helpful.
    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.