Unable to successfully make an API call to the login endpoint of openmrs server setup using the sdk

Hi, I set up a server using the openmrs-sdk. I am currently working on the platformui open web application. However, when I make a GET request to log in at /openmrs/ws/rest/v1/session with an Authorization header containing the username and password, I get a 400 Bad request response. The same platformui application works as expected when I installed it in the standalone version. This is the error response:

Any Ideas on what could be causing this?

Can you share details of the request that you are making?

It would also help to post the server log at pastebin.com

I am making a GET http request to /openmrs/ws/rest/v1/session. Username: admin Password: Admin123 Authorization code is a base64 code of the username and password.

Nothing is logged on making the request both in the openmrs.log file in the server directory and the console where I started the server from. I don’t know if there is another place where such actions are logged.

Are you running the exact same versions of openmrs platform and modules on both instances?

No.

Instance set up with sdk:

  • Platform version: 2.2.0-snapshot
  • Owa omod version 1.10.0
  • Rest web services version 2.21.0

Instance of openmrs-standalone (reference application):

  • Platform version: 2.1.3
  • Owa omod version 1.9.0
  • Rest web services version 2.22.0

Platform version

Does it still fail if you run the same?

Let me set up an instance with the same version using the sdk and try it.

It works with instance of openmrs platform version 2.1.3.

replace it with the snapshot version of the platform and run again.

I don’t understand what you mean by that. I already have 2 instances. A server running 2.1.3 and another one running the snapshot version (2.2.0-SNAPSHOT). I know I can replace omods and owa however, I don’t know how to replace the version platform version itself. I usually setup a new instance when I want a different version of the platform.

Ping me for a call when you are free and you take me through the problem.

After a call with @dkayiwa, we realised I was running an old version of the web services rest module. Version 2.21.0. Installed a newer version 2.23.0-SNAPSHOT and it worked like a charm. However, you can always get the latest release from this link: https://addons.openmrs.org/show/org.openmrs.module.webservices-rest.