I need a little help with REST web services

classic Classic list List threaded Threaded
4 messages Options
Jonathan Galingan Jonathan Galingan
Reply | Threaded
Open this post in threaded view
|

I need a little help with REST web services

I'm very sorry, this is my first time to experiment on web services.

I was trying to get a list of persons that have the given name "John"

I tried using 

GET /openmrs/ws/rest/v1/person?q=john

and I get a zero array.

These give me a "method not allowed:"

GET /openmrs/ws/rest/v1/person?name=john
GET /openmrs/ws/rest/v1/person/john
GET /openmrs/ws/rest/v1/person/name?=john

Does anybody know the syntax on how to do this?

thanks

-Jonathan


[hidden email] from OpenMRS Implementers' mailing list
sunbiz sunbiz
Reply | Threaded
Open this post in threaded view
|

Re: I need a little help with REST web services

Hi Jonathan,

This one is the correct one
GET /openmrs/ws/rest/v1/person?q=john

Can you check if you have that person in the system when you are doing search through the web interface of OpenMRS and present in the database??
I have done an installation with demo data and I get the following

HTTP/1.1 200 OK
Expires: Thu, 01 Jan 1970 00:00:00 GMT
Set-Cookie: JSESSIONID=vrre5wt2d7t7;Path=/openmrs
Content-Type: application/json;charset=UTF-8
ETag: "07653cde5bdbdf35c0433e5fba28bef81"
Content-Length: 210
Server: Jetty(6.1.10)

{"results":[{"uuid":"e954a443-e255-11e0-b1ff-5063138e101c","display":"Mr. John D Patient","links":[{"uri":"http://localhost:8080/openmrs/ws/rest/v1/person/e954a443-e255-11e0-b1ff-5063138e101c","rel":"self"}]}]}

What version of the module are you using??
And does it work with the "Administration->REST Web Services->Test" user interface??

---
Regards,
Saptarshi PURKAYASTHA

My Tech Blog:  http://sunnytalkstech.blogspot.com
You Live by CHOICE, Not by CHANCE


On 31 March 2012 03:07, Jonathan Galingan <[hidden email]> wrote:
I'm very sorry, this is my first time to experiment on web services.

I was trying to get a list of persons that have the given name "John"

I tried using 

GET /openmrs/ws/rest/v1/person?q=john

and I get a zero array.

These give me a "method not allowed:"

GET /openmrs/ws/rest/v1/person?name=john
GET /openmrs/ws/rest/v1/person/john
GET /openmrs/ws/rest/v1/person/name?=john

Does anybody know the syntax on how to do this?

thanks

-Jonathan


[hidden email] from OpenMRS Implementers' mailing list


[hidden email] from OpenMRS Implementers' mailing list
Jonathan Galingan Jonathan Galingan
Reply | Threaded
Open this post in threaded view
|

Re: I need a little help with REST web services

Thanks, it worked with curl. 

I think the problem is with the "test" user interface of the webservice. It was the one that gave the zero array.

On Saturday, March 31, 2012, Saptarshi Purkayastha wrote:
Hi Jonathan,

This one is the correct one
GET /openmrs/ws/rest/v1/person?q=john

Can you check if you have that person in the system when you are doing search through the web interface of OpenMRS and present in the database??
I have done an installation with demo data and I get the following

HTTP/1.1 200 OK
Expires: Thu, 01 Jan 1970 00:00:00 GMT
Set-Cookie: JSESSIONID=vrre5wt2d7t7;Path=/openmrs
Content-Type: application/json;charset=UTF-8
ETag: "07653cde5bdbdf35c0433e5fba28bef81"
Content-Length: 210
Server: Jetty(6.1.10)

{"results":[{"uuid":"e954a443-e255-11e0-b1ff-5063138e101c","display":"Mr. John D Patient","links":[{"uri":"http://localhost:8080/openmrs/ws/rest/v1/person/e954a443-e255-11e0-b1ff-5063138e101c","rel":"self"}]}]}

What version of the module are you using??
And does it work with the "Administration->REST Web Services->Test" user interface??

---
Regards,
Saptarshi PURKAYASTHA

My Tech Blog:  http://sunnytalkstech.blogspot.com
You Live by CHOICE, Not by CHANCE


On 31 March 2012 03:07, Jonathan Galingan <<a href="javascript:_e({}, &#39;cvml&#39;, &#39;galinganmd@gmail.com&#39;);" target="_blank">galinganmd@...> wrote:
I'm very sorry, this is my first time to experiment on web services.

I was trying to get a list of persons that have the given name "John"

I tried using 

GET /openmrs/ws/rest/v1/person?q=john

and I get a zero array.

These give me a "method not allowed:"

GET /openmrs/ws/rest/v1/person?name=john
GET /openmrs/ws/rest/v1/person/john
GET /openmrs/ws/rest/v1/person/name?=john

Does anybody know the syntax on how to do this?

thanks

-Jonathan


<a href="javascript:_e({}, &#39;cvml&#39;, &#39;LISTSERV@LISTSERV.IUPUI.EDU?body\x3dSIGNOFF%20openmrs-implement-l&#39;);" target="_blank">Click here to unsubscribe from OpenMRS Implementers' mailing list


<a href="javascript:_e({}, &#39;cvml&#39;, &#39;LISTSERV@LISTSERV.IUPUI.EDU?body\x3dSIGNOFF%20openmrs-implement-l&#39;);" target="_blank">Click here to unsubscribe from OpenMRS Implementers' mailing list


--
Jonathan D. Galingan, MD
Project Manager for Computerization
Philippine General Hospital


[hidden email] from OpenMRS Implementers' mailing list
Mathias Lin Mathias Lin
Reply | Threaded
Open this post in threaded view
|

Re: I need a little help with REST web services

It works with the test user interface as follows:

Type: GET
Url: http://localhost:8080/openmrs/ws/rest/v1/person
Body: q=john
Representation: full

This returns the patient data correctly on-screen.

Regards,
Mathias


On Tue, Apr 10, 2012 at 9:09 AM, Jonathan Galingan <[hidden email]> wrote:

> Thanks, it worked with curl.
>
> I think the problem is with the "test" user interface of the webservice. It
> was the one that gave the zero array.
>
> On Saturday, March 31, 2012, Saptarshi Purkayastha wrote:
>>
>> Hi Jonathan,
>>
>> This one is the correct one
>> GET /openmrs/ws/rest/v1/person?q=john
>>
>> Can you check if you have that person in the system when you are doing
>> search through the web interface of OpenMRS and present in the database??
>> I have done an installation with demo data and I get the following
>>
>> $ curl -i -u "admin:Password1"
>> http://localhost:8080/openmrs/ws/rest/v1/person?q=john
>> HTTP/1.1 200 OK
>> Expires: Thu, 01 Jan 1970 00:00:00 GMT
>> Set-Cookie: JSESSIONID=vrre5wt2d7t7;Path=/openmrs
>> Content-Type: application/json;charset=UTF-8
>> ETag: "07653cde5bdbdf35c0433e5fba28bef81"
>> Content-Length: 210
>> Server: Jetty(6.1.10)
>>
>> {"results":[{"uuid":"e954a443-e255-11e0-b1ff-5063138e101c","display":"Mr.
>> John D
>> Patient","links":[{"uri":"http://localhost:8080/openmrs/ws/rest/v1/person/e954a443-e255-11e0-b1ff-5063138e101c","rel":"self"}]}]}
>>
>> What version of the module are you using??
>> And does it work with the "Administration->REST Web Services->Test" user
>> interface??
>>
>> ---
>> Regards,
>> Saptarshi PURKAYASTHA
>>
>> My Tech Blog:  http://sunnytalkstech.blogspot.com
>> You Live by CHOICE, Not by CHANCE
>>
>>
>> On 31 March 2012 03:07, Jonathan Galingan <[hidden email]> wrote:
>>>
>>> I'm very sorry, this is my first time to experiment on web services.
>>>
>>> I was trying to get a list of persons that have the given name "John"
>>>
>>> I tried using
>>>
>>> GET /openmrs/ws/rest/v1/person?q=john
>>>
>>> and I get a zero array.
>>>
>>> These give me a "method not allowed:"
>>>
>>> GET /openmrs/ws/rest/v1/person?name=john
>>> GET /openmrs/ws/rest/v1/person/john
>>> GET /openmrs/ws/rest/v1/person/name?=john
>>>
>>> Does anybody know the syntax on how to do this?
>>>
>>> thanks
>>>
>>> -Jonathan
>>>

_________________________________________

To unsubscribe from OpenMRS Implementers' mailing list, send an e-mail to [hidden email] with "SIGNOFF openmrs-implement-l" in the  body (not the subject) of your e-mail.

[mailto:[hidden email]?body=SIGNOFF%20openmrs-implement-l]
Mathias LIN
Meta Healthcare Systems Ltd.
20/F Central Tower, 28 Queen's Rd Central, Hong Kong
T +852 8199 9605, M +86 159 0208 1701, Skype: mathias.lin
http://www.metahealthcare.com