Sage CRM Rest API DELETE requests fail with a 400 error

1 minute read time.

We recently had a case where a BP were upgrading a client to Sage CRM 2023 R2.2 and have struck an issue where Sage CRM Rest API DELETE requests fail with a 400 error, and nothing is logged to current_sdata2.log etc.

The same requests works as expected in Sage CRM 2021 R1.

Steps to reproduce:

  1. Create a Note via the UI.
  2. Get the note via the REST API e.g.

GET http://besw16e66c20v01/sdata/crmj/sagecrm2/-/Notes('1')?SID=31551930037123

  1. Delete the note via the REST API e.g.               

DELETE http://besw16e66c20v01/sdata/crmj/sagecrm2/-/Notes('1')?SID=31551930037123

Expected behaviour (occurs in Sage CRM 2021 R1):

A 200 response is received.

 

Actual behaviour (occurs in Sage CRM 2023 R2.2):

A 400 response (HTTP Status 400 – Bad Request) is received.

Nothing is logged in current_sdata2.log.

The reason for the failure is that, somewhere between 2021R1 and 2023R2.2, Delete requests’ bodies now need to include an empty JSON object (i.e. {}).

In the body, see SageCRM 2024R1 postman collection:

DELETE requests fail unless Content-type is application/json, and Sage CRM now requires an empty object ({}) in the body. We are unaware of what changes could have occurred since 2021. Nor do we have any documentation with any relevant information on the matter. However we thought this would be helpful for the community to know should they bump into this issue also.