The ConnectivityDemos project contains many sample services that demonstrates a REST service definition via JAX-RS annotations. See for instance the com.axonivy.connectivity.rest.provider.PersonService.

With 6.0 or older REST API definition is not supported. But you can anyway provide a simple HTTP service that can be used by REST clients by applying the following solutions:

PROVIDE DATA (Axon.ivy 6.0 and older)

If you just want to send business-data (java objects) to a REST client the solution is quit simple. :

Create a new RequestStart event as entry URL for the REST request. The start event should not have any input parameters or result configured.

Load the data to return (either in plain java or with a process flow)

Let the process flow end on a Script activity. This activity is responsible to end the Request and write the serialized JSON directly to the HTTP response. See ch.ivyteam.q.and.a.RestRequest.sendAsResponse(String) in the sample project

Solution if you need to get JSON parameters from the client as input, process them and return a result in JSON format.

Create a new RequestStart event as entry URL for the REST request. The start event must have a single String parameter which will receive the serialized JSON object(s) from the REST client.

De-serialize the input parameter within a Script activity. Use Gson or a similar library for the conversion from JSON to java. Map the de-serialized java object to the process data.

Load the data to return (either in plain java or with a process flow)

Let the process flow end on a Script activity. This activity is responsible to end the Request and write the serialized JSON directly to the HTTP response. See ch.ivyteam.q.and.a.RestRequest.sendAsResponse(String) in the sample project

See simpleRestProvider_51-v2.iarcustomers/filter.ivp for a sample. For quick review open the java class ch.ivyteam.q.and.a.TestRestMethods, open the context menu of the editor, choose: run as, junit test