I have a doctor entity with a attribute named photo as type of image . how to register the photo with web api?
I try to do first to post an base64 encode image to api/fileResources, but got this:
{“httpStatus”:“Internal Server Error”,“httpStatusCode”:500,“status”:“ERROR”,“message”:“Current request is not a multipart request”}
I created a photo attribute and added it to a test program on play version 40. When I uploaded the image to the photo attribute, it created the following request:
You can see that the attribute with id c8U82T7gsLW above has the value Y0rnoxv7MhZ which is the id of the image.
So to post an image attribute, you first need to upload it to the fileResources endpoint and get the id of the image from the response, and then using the tracker endpoint, in the attributes field use the attribute id and give it the value the id of the image you uploaded.