Skip to main content

🪗 Expanding Responses

Many resources (SSO connections, applications ... etc) allow you to request additional information about associated resources. The associated resource is by default present in the form of an identifier (ID).

Indeed it is common for an object to contain the ID of a nested resource in its attributes in the Cryptr API response. For example, a token can have an associated user ID. These resources can be developed online with the preload request parameter. ID fields that can be expanded in a resource are marked "expandable".

You can dynamically expand multiple related resources by specifying nested fields after a period (.). For example, asking for role.users.authorizations.tokens will expand the list of tokens in the authorizations of users belonging to a certain role.

Expansions have a maximum depth of three levels (so, for example, when listing roles, users.authorizations is the deepest allowed).

You can develop several objects at the same time by identifying several elements by referring to the same resource.