Customizing attributes returned by calls to the REST API
search cancel

Customizing attributes returned by calls to the REST API

book

Article ID: 368159

calendar_today

Updated On:

Products

CA Privileged Access Manager (PAM)

Issue/Introduction

When accessing several REST API methods, a default set of all possible attributes for an object are returned

For instance let's take the REST call for returning the attributes of a Group once its Id is known

We can see highlighted in red the default fields returned by the call. Specifying, for instance, id 46002, the result would be:

However, there are many other attributes of the Group Object which are not returned in this call, such as its assigned role, or the users which belong to it, for instance

The question arises whether it is possible to make all these attributes be returned by the REST API GET query

Environment

CA PAM all versions at least up to 4.1.7

Resolution

This is actually possible, not only for this example but for all REST API calls which contain a default list of attributes to return.

A first approach is to use * in the fields textbox instead of a list of attributes. That will return all the attributes available for the object:

But it is also possible to specify a list of attributes in the fields checkbox other than the default contents, for instance: groupName, roles and groupUsers, and only that subset of attributes for the object will be returned: