UserAttr.exists - REST API

Overview

Returns a boolean flag or flags to indicate, respectively, if an input attribute or attributes exist for a user.

If only the very existence of attributes needs to be checked, it is faster and less resource-extensive to invoke this endpoint than using get.

While the call's Python equivalent has two versions, one for individual and the other for multiple attributes, with REST there is a single endpoint to cover both cases. Yet, just like in the Python call, it is more efficient to check multiple attributes in one REST call instead of repeatedly checking multiple attributes.

  • HTTP method: GET
  • URL path: /zato/sso/user/attr/exists

Request

NameDatatypeOptionalNotes
uststring---Current user's session token (UST)
current_appstring---Name of application that the call is attempted from
user_idstringYesID of the user to check an attribute or attributes of
namestringYesIf a single attribute is to be checked, the attribute's name
datalistYesIf multiple attributes are to be checked, this is a list of their names

Response

NameDatatypeOptionalNotes
cidstring---Correlation ID assigned to request
statusstring---Overall status code
sub_statuslistYesReturned only if status is not "ok", a list of error or warning codes
resultbool/list---If a single attribute was requested, a boolean flag to express if that attribute exists or not. With multiple attributes, a list of dictionaries with flags, one for each input attribute name.

Usage

$ curl -XGET localhost:17010/zato/sso/user/attr/exists -d '
  {
    "current_ust": "gAAAAABavmAV3rw6fQUS-HgR...",
    "current_app": "CRM",
    "user_id": "zusr6fh6fdgd4997ksjkpx7qnk659q",
    "name": "my-attribute"
  }
  '

  {
    "status": "ok",
    "cid": "22fdd109d125f302d3c862db",
    "result": true
  }