I need to add attachment via API, but unfortunately I can’t find input structure documentation. My local install version of OpenMRS and online demo version both don’t have description for that on API documentation page because of errors during page loading https://demo.openmrs.org/openmrs/module/webservices/rest/apiDocs.htm
The API docs page is missing info about JSON structure for creating attachment.
I just need to know what exact structure must have JSON in the body of creation request. Something like
{
‘Id’, ‘aaaa-aaaa-aaaa-aaaa’,
‘Name’, ‘Filename/pdf’,
Content, ‘FileBitesHereAsBase64’
}
hello @mksd could we be having a rest api json structure for attachment resource ,i have looked into the openmrs swagger specs of attachment but no resource body.
The properties i see defined here in the attachment resource
@amalukov The json structure can be derived by looking at some of the tests in the module…for example Add these four parameters… unfortunately can’t give u json structure coz am currently replying on phone but I hope that gives u what u need
Hello @mksd sorry for the delayed response ,i was away for the most part of yesterday…
For a resouce to be documented it has to override 1. Model getGETModel(Representation) 2. Model getCREATEModel(Representation)
3. Model getUPDATEModel(Representation)
Hello i created a draft PR here but am blocked with invalidActivationKeyException. according to openmrs api here, it seems this exception is old exception and its nolonger used. kindly guide me cc @mksd@dkayiwa@ibacher@reagan@gcliff thanks
Hello There,
I want to know where these uploaded attachments gets stored. In server side directory or in the database. Because I want to list all the attachments associated with the patients. Thank You.