-
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Hi @beschick |
Beta Was this translation helpful? Give feedback.
-
Thanks for your response @baywet! I think I am not even struggling specifically with Go in that matter, but more with the right method to Patch a list item in SharePoint with GRAPH REST API in general. The endpoint to get a list item's field is:
The payload of an existing item for that specific column, looks like that. The response object is truncated for clarity. "fields": {
"Title": "GUEST WIFI access code hotspot 1",
"Accesscode": "123456",
"Region": "EMEA",
"PortalLink": {
"Description": "Portal 1",
"Url": "https://guestportal1.company.com"
},
"Comments": "test",
"id": "1",
"ContentType": "Item",
}
The equivalent REST API endpoint to UPDATE (PATCH) an SPO item is the following: A working PATCH body would be this: {
"Accesscode": "125669"
} I was expecting to work it the same way with an URL field when patching it, but that does not work out obviously {
"PortalLink": {
"Url": "https://guestportal1A.company.com",
"Description": "WIFI portal 1A"
}
} By trying this with REST, I recognize that even that payload does not work with JSON.
So, my summary is: I am not able to componse the proper PATCH payload as it seems :( Reference: https://learn.microsoft.com/en-us/graph/api/listitem-update?view=graph-rest-1.0&tabs=http |
Beta Was this translation helpful? Give feedback.
Thanks for your response @baywet!
I think I am not even struggling specifically with Go in that matter, but more with the right method to Patch a list item in SharePoint with GRAPH REST API in general.
The endpoint to get a list item's field is:
The payload of an existing item for that specific column, looks like that. The response object is truncated for clarity.