Updating a complex obs

I am trying to store an image in complex obs. Create and delete is working fine, but the update is not working.

Here is the error Paste Bin

@darius @dkayiwa

Can you give more details of the REST call that you are making and what you expect?

I am trying to update the complex obs.

post method : “/openmrs/ws/rest/v1/obs/{uuid}” resources : file = file.jpeg json = { “concept”: “complexObs_uuid”, “encounter”: “enocunter_uuid”, obsDatetime: “time”, “person”: “person_uuid” }

And how are you creating it?

postURL “/openmrs/ws/rest/v1/obs/” resources: file= file.jpeg json= { “concept”: “complexObs_uuid”, “encounter”: “enocunter_uuid”, “obsDatetime”: “time”, “person”: “person_uuid” }

What is the difference between those two calls?

Both are POST request but one is to create an obs whereas the other is to update the obs.

That is why in create POST request we are calling “/openmrs/ws/rest/v1/obs” and to update "openmrs/ws/rest/v1/obs/{uuid}

Can you share the exact REST calls you are making, with each and every details and values?

To Create: First, I create a concept with datatype “complex” and handler as “ImageHandler”. then I did a post request “/openmrs/ws/rest/v1/obs” with 2 resources

  1. file of type file
  2. json of json object(this contains information of person, encounter, concept and obstime.) { “concept”: “concept uuid that I created”, “person”:“person_uuid”, “encounter”: “encounter_uuid”, “obsDatetime”: “current_time” }

Hope this make sense.

What i mean is the details that i would need for those two calls on this page: https://demo.openmrs.org/openmrs/module/webservices/rest/test.htm