sharepointgraphmicrosoft-graph-api

Microsoft Graph API, Add SharePoint List Item suddenly throws exception for null strings


I have been successfully making a POST request to the following Graph API endpoint to add items to a SharePoint list: https://graph.microsoft.com/v1.0/sites/[site-id]/lists/[list-id]/items

The request body is:

{
    "fields": {
        "Title": "12345",
        "Description": null,
    }
}

The [Description] column in the list is just a single-line text field that is not required, up until a few days ago this request was working fine however, now it fails with the following exception:

{
    "error": {
        "code": "generalException",
        "message": "General exception while processing",
        "innerError": {
            "date": "2023-05-14T01:09:51",
            "request-id": "f3b94466-e172-49de-8138-c11e0e20e253",
            "client-request-id": "f3b94466-e172-49de-8138-c11e0e20e253"
        }
    }
}

If I change the Description value from null to an empty string the request again succeeds but I have no idea what could have caused the sudden change in behavior?


Solution

  • I tested it in my local environment, and it works fine. Since the error may be a temporary server-side issue, so I recommend waiting for a while before trying to see if the problem persists.

    enter image description here