Get openmrs concept translation(of patient attribute) from odoo, using api

Hello,

I’ve a patient attribute which is getting synced as the Fully Specified Name in English from openmrs to Odoo. The values are getting saved in res_partner_attributes table.

I think, I can get the required local language translation by making an api request to /openmrs/ws/rest/v1/concept?s=byFullySpecifiedName&v=full&name from Odoo using python’s requests.get()

But, for this, I assume, I’d need to pass the username & password of openmrs as hard-coded.

Is there an alternate way to achieve this? Any way to send api requests using api-key instead of username & password ?

Thanks for any hints.

1 Like

It depends on which auth scheme you use in OpenMRS.

By default it would be basic auth and so yes, you’d need to pass the basic credentials each time you make a request (I think, right @Mekom?)

Alternatively you could switch to OAuth2, in which case you could use the token of a service account to transact with OpenMRS.

1 Like

Yes, OpenMRS does support cookie-based authentication. Once you’re authenticated, a cookie is cached or set in your browser, and this cookie is used for subsequent requests. This means you don’t need to pass the basic credentials each time you make a request.

1 Like

Thanks for the responses.

1 Like