I have been working on a Java project where I have to create a server (Tomcat) and generate an API using Jersey and Java. Currently I am able to get a single user detail using the following code.
@POST
@Path("Singleuser")
@Consumes({MediaType.APPLICATION_JSON , MediaType.APPLICATION_XML})
public Singleuserdetails CreateIteration(Singleuserdetails IT1) {
repo.create(IT1);
return IT1;
}
If I run the below API, I am able to get single user.
http://localhost:8080/PersonFinder/webapi/Singleuserdetails/Singleuser/DS-011
I need one more API to retrieve multiple users based on multiple ids. Similar to below example
http://localhost:8080/PersonFinder/webapi/MulitpleUser/id=DS-011?id=SS-067
How can I alter the above method such that I will be able to retrieve multiple ids?
Note: My users are more than 100 in such case. Should I pass all of them as a parameter? is there any other way to make the API work based on N number of inputs from the user? Thanks in advance.