Creat new REST endpoints in my module

I’m having difficulty in creating the new endpoints. I’ve already looked at prior posts. I could not find any complete examples not outside of core endpoints. Much appreciated if someone can check my code at https://github.com/levine12/rest I would like to use a GET to retrieve all items from the database, as well as a POST to create a new item. Any help is much appreciated.

@levine have u had a look at this https://wiki.openmrs.org/display/docs/Adding+a+Web+Service+Step+by+Step+Guide+for+Module+Developers

1 Like

Sure, I checked that site and added the dependency, added the files ItemResource.java and BasicexampleResourceController.java Much appreciated if you would check those files to ensure they look good.

you can share those files here and we have a look

indent preformatted text by 4 spaces

BasicexampleResourceController.txt (877 Bytes) Item.txt (1.9 KB) ItemResource.txt (3.3 KB)

Of course, these are all .java files @gcliff, thanks much for your assistance

@levine do u mind using https://pastebin.com/, for easy readability

If your sure your service classes are rightly configured and they can transact with your DB , your rest end points shuld be able to work. i’ve taken a look at your ItemResource.java. and you should be able to see it in your Swagger document given you run these platform versions "2.2.*","2.3.*"

I’ve pasted the code Here

@levine what exactly is the difficulty that you are facing?

@dkayiwa I"ll have to get back in just over a week since I’m leaving town - I’ll be sure to get back. Thanks much