When I am sending a single observation then it is getting created but for multiple observations it is throwing an error 500.
For single observations my query is -
TYPE- POST
URI - /openmrs-standalone/ws/rest/v1/obs
BODY-
{
“concept” : “5086AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA”,
“person” : “610b0696-7529-4b4a-b65b-37336a75962a”,
“obsDatetime”: “2017-07-24T15:33:49+05:30”,
“encounter”: “3bc0672d-ebc6-4e65-aae1-8a1d4de759bf”,
“value” : “90”
}
For multiple I am sending
TYPE- POST
URI - /openmrs-standalone/ws/rest/v1/obs
BODY-
[{“concept” : "5089AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA ",
“person” : “610b0696-7529-4b4a-b65b-37336a75962a”,
“obsDatetime”: “2017-07-24T15:33:49+05:30”,
“encounter”: “3bc0672d-ebc6-4e65-aae1-8a1d4de759bf”,
“value” : “99”
},
{
“concept” : “5090AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA”,
“person” : “610b0696-7529-4b4a-b65b-37336a75962a”,
“obsDatetime”: “2017-07-24T15:33:49+05:30”,
“encounter”: “3bc0672d-ebc6-4e65-aae1-8a1d4de759bf”,
“value” : “185”
}]
The error is here https://pastebin.com/uBaJmZa9
@darius and @dkayiwa
Is there a way of creating sessions in openMRS. I mean to say that I am sending too many REST request with username and password. Is it possible that some of my REST POST queries are not working because there’s already the user logged in. If I could somehow create a session through REST and then send all the request and finally close the session.
Thanks @darius
I found out that for sending REST request one “needs” to send a request header of Authorization:Basic = username:password or one has to set a cookie of sessionId.
Eg-
URL: http://localhost:8083/openmrs-standalone/ws/rest/v1/visit
METHOD: POST