# New REST Implementation for SystemInformation

**URL:** <https://talk.openmrs.org/t/new-rest-implementation-for-systeminformation/11829>\
**Category:** Development\
**Tags:** restws, rest\
**Created:** [June 11, 2017, 10:06am UTC](https://talk.openmrs.org/t/new-rest-implementation-for-systeminformation/11829 "2017-06-11T10:06:42Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![suthagar23](https://talk.openmrs.org/user_avatar/talk.openmrs.org/suthagar23/32/6342_2.png) [@suthagar23](https://talk.openmrs.org/u/suthagar23)\
**Post date:** [June 11, 2017, 10:06am UTC](https://talk.openmrs.org/t/new-rest-implementation-for-systeminformation/11829/1 "2017-06-11T10:06:42Z")

</div>

I want to create REST implementation for System Information which is under Legacy-UI module. I have identified the required SystemInfo code base files in module repo.

> <https://github.com/openmrs/openmrs-module-legacyui/blob/master/omod/src/main/java/org/openmrs/web/controller/maintenance/SystemInformationController.java>

Now I want to implement REST for this functionality. I have referred Wiki tutorials also. (For [Module developers](https://wiki.openmrs.org/display/docs/Adding+a+Web+Service+Step+by+Step+Guide+for+Module+Developers) and for [Core developers](https://wiki.openmrs.org/display/docs/Adding+a+Web+Service+Step+by+Step+Guide+for+Core+Developers)). But I couldn’t find out the exact to way to perform this task.

Can someone help me to implement REST for this functionality? (It would be better If anyone mentions the extract ways)

---

<div class="post-metadata">

**Author:** ![harsha89](https://talk.openmrs.org/user_avatar/talk.openmrs.org/harsha89/32/8073_2.png) [@harsha89](https://talk.openmrs.org/u/harsha89)\
**Post date:** [June 11, 2017, 10:43am UTC](https://talk.openmrs.org/t/new-rest-implementation-for-systeminformation/11829/2 "2017-06-11T10:43:57Z")

</div>

@suthagar23 will [https://wiki.openmrs.org/display/docs/Adding+a+Web+Service+Step+by+Step+Guide+for+Module+Developers](https://wiki.openmrs.org/display/docs/Adding+a+Web+Service+Step+by+Step+Guide+for+Module+Developers) help?

---

<div class="post-metadata">

**Author:** ![darius](https://talk.openmrs.org/user_avatar/talk.openmrs.org/darius/32/8082_2.png) [@darius](https://talk.openmrs.org/u/darius)\
**Post date:** [June 11, 2017, 9:17pm UTC](https://talk.openmrs.org/t/new-rest-implementation-for-systeminformation/11829/3 "2017-06-11T21:17:26Z")

</div>

A very similar example would be the `orderentryconfig` resource in the REST web services module:

- [https://github.com/openmrs/openmrs-module-webservices.rest/blob/master/omod-1.10/src/main/java/org/openmrs/module/webservices/rest/web/v1\_0/resource/openmrs1\_10/OrderEntryConfigResource1\_10.java](https://github.com/openmrs/openmrs-module-webservices.rest/blob/master/omod-1.10/src/main/java/org/openmrs/module/webservices/rest/web/v1_0/resource/openmrs1_10/OrderEntryConfigResource1_10.java)
- [https://github.com/openmrs/openmrs-module-webservices.rest/blob/master/omod-1.10/src/test/java/org/openmrs/module/webservices/rest/web/v1\_0/resource/openmrs1\_10/OrderEntryConfigResource1\_10Test.java](https://github.com/openmrs/openmrs-module-webservices.rest/blob/master/omod-1.10/src/test/java/org/openmrs/module/webservices/rest/web/v1_0/resource/openmrs1_10/OrderEntryConfigResource1_10Test.java)

---

<div class="post-metadata">

**Author:** ![suthagar23](https://talk.openmrs.org/user_avatar/talk.openmrs.org/suthagar23/32/6342_2.png) [@suthagar23](https://talk.openmrs.org/u/suthagar23)\
**Post date:** [June 14, 2017, 7:56am UTC](https://talk.openmrs.org/t/new-rest-implementation-for-systeminformation/11829/5 "2017-06-14T07:56:51Z")

</div>

Thank you @harsha89 and @darius for the tips. I am new to REST development and I have created the [SystemInfomationResource1\_8](https://gist.github.com/suthagar23/15a60915010404ba49b0cf15cccb9b57).

Using this resource I can get the System information objects using REST Test part.

 ![](https://talk.openmrs.org/uploads/default/original/2X/d/d2899fb943292aeaae89769a08b33203d5d56887.PNG)

* * *

But I got this following error when I try to catch the GET request using my browser ,

 ![](https://talk.openmrs.org/uploads/default/original/2X/d/dd69685d9eefafa8c031948f4f7c6600d20ab855.PNG)

What is the missing part in my [SystemInfomationResource1\_8](https://gist.github.com/suthagar23/15a60915010404ba49b0cf15cccb9b57). Can somebody help me to resolve this?

---

<div class="post-metadata">

**Author:** ![suthagar23](https://talk.openmrs.org/user_avatar/talk.openmrs.org/suthagar23/32/6342_2.png) [@suthagar23](https://talk.openmrs.org/u/suthagar23)\
**Post date:** [June 14, 2017, 11:54am UTC](https://talk.openmrs.org/t/new-rest-implementation-for-systeminformation/11829/6 "2017-06-14T11:54:14Z")

</div>

This is the error log for the exceptions here : [https://pastebin.com/uEv518DW](https://pastebin.com/uEv518DW)

How can I resolve this problem?

---

<div class="post-metadata">

**Author:** ![darius](https://talk.openmrs.org/user_avatar/talk.openmrs.org/darius/32/8082_2.png) [@darius](https://talk.openmrs.org/u/darius)\
**Post date:** [June 14, 2017, 1:20pm UTC](https://talk.openmrs.org/t/new-rest-implementation-for-systeminformation/11829/7 "2017-06-14T13:20:11Z")

</div>

What happens if you access this URL using postman or some other REST client (specifically, with the Accept header set to application/json)? I.e. this might just be a problem in converting the response to XML…

(Also you could try adding .json to the url in the browser.)
