Unable to make API requests against openmrs-core

I recently cloned the openmrs-core repo and modified the following lines on the docker-compose.yml file for the api service:

image: openmrs/openmrs-core:${TAG:-2.6.0}

Once the docker containers are up and running and I go to http://localhost:8080/openmrs/ I get a page that says:

If you are seeing this page, it means that the OpenMRS Platform is running successfully, but no user interface module is installed. Learn about the available User Interface Modules

If you are a developer, you can access the REST API. (See REST documentation for clients)

However when I make an HTTP GET request to the following endpoint: http://localhost:8080/openmrs/ws/rest/v1/systeminformation, I get this error:

HTTP Status 404 – Not Found

The origin server did not find a current representation for the target resource or is not willing to disclose that one exists.

I looked at the backend logs and I get this warning:

No mapping for GET /openmrs/ws/rest/v1/systeminformation`

I also use Basic Auth to provide the username and password to authenticate the request however I don’t think the authentication is the issue here. When I change the endpoint to https://test3.openmrs.org/openmrs/ws/rest/v1/systeminformation it seems to work just fine.

I also get a 404 error when going to http://localhost:8080/openmrs/admin which I believe should display a page for administrative functions like module management etc.

Any solutions I can try to get this backend running on my local machine?

openmrs-core does not bundle any module. It is the openmrs platform distribution that has a bundled REST API module. The admin functions like module management require installation of the legacyui module.

The If you are a developer, you can access the REST API. message assumes that you are running the platform distribution which by default comes with a bundled REST API module.

What happens when you replace:

image: openmrs/openmrs-core:${TAG:-2.6.0}


image: openmrs/openmrs-platform:${TAG:-2.6.0}

1 Like

@dkayiwa Thank you for the clarification.

Looking at openmrs-platform, it doesn’t seem to have a 2.6.0 tag so I used nightly instead:

image: openmrs/openmrs-platform:${TAG:-nightly}

When I tried making an API request against it, I still got the same result (404 error).

I’ll try to clone the openmrs-distro-platform and work off of that instead. Thank you for looking into this!

I got it working by cloning the openmrs-distro-platform instead of the openmrs-core. Thank you @dkayiwa!

1 Like