REST API v2: How to update an Entity association to a null value?

I have an Entity (Passenger) with an association attribute (shiftId) which I wanna update via REST v2.

I’ve been trying the following Json objects:

{"anotherProperty" : "dontCare", "shiftId": {"id": None}}

{"anotherProperty" : "dontCare", "shiftId": {"id": ""}}

{"anotherProperty" : "dontCare", "shiftId": {"id": "null"}}

{"anotherProperty" : "dontCare", "shiftId": {}}

{"anotherProperty" : "dontCare", "shiftId": ""}

None of them worked. I’m using python requests and json.dumps() function that translates the 1st dictionary correctly to:

‘{“anotherProperty”: “dontCare”, “shiftId”: {“id”: null}}’

but I get Error [400] with following message:

‘{“error”:“Cannot deserialize an entity from JSON”,“details”:""}’

Just assign null value to the property:

   "anotherProperty" : "dontCare", 
   "shiftId": null
1 Like

It worked! The only python dict I didn’t try was:

{“anotherProperty” : “dontCare”, “shiftId”: None}

Thank you Max!!!