I need to update the cover image of Events (ListItem Event) on SharePoint using the Graph API. I'm using APP ONLY ACCESS mode for authentication with this endpoint:
https://login.microsoftonline.com/{{tenant_id}}/oauth2/v2.0/token
My Application has the "Sites.Manage.All" scope.
When I call the endpoint to update or create an event, if I include the "BannerUrl" field, I always get the following error:
{
"error": {
"code": "generalException",
"message": "General exception while processing",
"innerError": {
"date": "2024-06-28T11:50:07",
"request-id": "a7f573a1-f7e9-49b8-9e0c-160a1d68cbf7",
"client-request-id": "a7f573a1-f7e9-49b8-9e0c-160a1d68cbf7"
}
}
}
My request:
POST /v1.0/sites/{{site_id}}/lists/{{list_id}}/items HTTP/1.1
Host: graph.microsoft.com
Content-Type: application/json
Authorization: Bearer
Content-Length: 507
{
"fields": {
"Title": "Example",
"EventDate": "2024-07-15 09:00:00+00:00",
"EndDate": "2024-07-15 17:00:00+00:00",
"Category": "Example",
"Description": "Hello world",
"Location": "Avenida Paulista, 1000 - Bela Vista, São Paulo, SP 01313-000, Brazil",
"fAllDayEvent": true,
"BannerUrl": "https://image.jpg"
}
}
If I set the field as NULL, it removes the current cover image. But when I try to pass a value, it doesn't work. How can I resolve this?