Hi,
I am using a method to get the list of all the users as below,
@GetMapping(value="/users")
@ResponseBody
public ResponseEntity<String> users(HttpServletRequest request, HttpServletResponse response) {
HttpHeaders headers = new HttpHeaders();
headers.setContentType(MediaType.APPLICATION_JSON);
headers.set("Authorization", "Bearer " + controller.getManagementApiToken());
HttpEntity<String> entity = new HttpEntity<String>(headers);
RestTemplate restTemplate = new RestTemplate();
ResponseEntity<String> result = restTemplate.exchange("https://" + domain + "/api/v2/users", HttpMethod.GET, entity, String.class);
System.out.println(result);
return result;
}
Now, in the documentation, it was mentioned that we can select specific fields and only retrive those. How can I do this? I tried to set the parameters in the headers (both ‘fields’ and ‘include_fields’) but it’s not getting the expected result. I am just starting to use this. Would love to get an answer.
Thank you!