How to use FreeMed Rest API with Android

109 views
Skip to first unread message

reshmak...@gmail.com

unread,
Jul 7, 2014, 8:49:29 AM7/7/14
to freemed...@googlegroups.com
Hi,
I have an android app on PHR and i want to use FreeMED EHR Rest API with my app. 
How to do this?Please Help

Thanks in advance

Jeff

unread,
Jul 8, 2014, 10:57:26 AM7/8/14
to FreeMED Support
Sure -- it's pretty simple.

1) Make sure you have a running FreeMED instance. You should be able to login via the web UI.

2) Set up a login mechanism. To do this, you should be calling http://server/freemed/relay.php/json/org.freemedsoftware.public.Login.Validate?param1=user&param2=password ; this will give you a login cookie.

3) Understand the JSON "relay". This will take some perusing of the codebase, but the relay essentially allows you to call any public method in the directory structure under lib (except for org.freemedsoftware.core, as that's reserved for internal stuff) using the following conventions:

lib/org/freemedsoftware/org/freemedsoftware/api/Fax.class.php for example, has a method called AddLocalFile. To access it, you would use:


This would return a JSON response which is essentially the return value of the function, wrapped in a JSON wrapper. Anything in the "org.freemedsoftware.public" namespace is accessible without any authentication at all.

Let me know if you have any further issues -- and I'd love to see what you're developing! ;)

--
Thanks,
Jeff
(je...@freemedsoftware.org)
FreeMED Software Foundation, Inc
http://freemedsoftware.org/
Reply all
Reply to author
Forward
0 new messages