I am making a call to Dynamics 365 incidents entity and I am updating few fields like 'notes' by passing the key value in Body of the HTTP call. URL is something like below:
PATCH https://<>.crm.dynamics.com/api/data/v9.0/incidents(e34d7dd4-b0cc-4e6d-a8e4-9a18b3341830)
The call works via Postman and returns a status code of 204 No Content.
I get it that the operation was successful and there was no content to return, hence the status. But is there any way to return 1 or many fields in response by modifying the request in postman, like we do in a GET call by passing below query param. I mean returning some values in response with 200 ok, will be helpful. That will also help with C# implementation.
$select=incidentid,notes
OData-MaxVersion:4.0
OData-Version:4.0
Accept:application/json
Content-Type:application/json; charset=utf-8
The header
"Prefer": "return=representation"
will return the record after the PATCH call, I am not aware of a similar functionality using the C# SDK (so if you use the C# SDK you will need to do a Retrieve after the Update).
You can use my tool Dataverse REST Builder to generate Web API calls.