As you are asking about verification of response, you seems to be interested in automation of APIs. You can perform API automation using Java language as well through RestAssured library, it is easy way for API testing. For this, you can create easy framework to create/manage the test scripts.
Let’s take below example:
Here you must use the JSON format to send the body request and you will receive the response in JSON as well.
Request format:
String body = "{"+
"\"name\":\""+userName+"\","+
"\"action_id\":1,"+
"}";
// POST the request and save the response.
Response response = postRequest(body, url);
// Now you need to parse the response in order to verify the response status and userID, which is generated on sending user details.
JSONObject JSONResponseBody = new JSONObject(response.body().asString());
//Asserting that Status code is 200. [200 is used for success status]
Assert.assertEquals(response.getStatusCode(), 200);
// Get the ID of user
String userId = (Integer)JSONResponseBody.get(“id”);
In the same way, you can parse all the fields returned in response through JSON.
Hope this information is helpful for you.