SessionAttr.exists - REST API

Overview

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

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/session/attr/exists

Request

NameDatatypeOptionalNotes
current_uststring---Current user's session token (UST)
target_uststring---Target session's UST, the one that is being accessed (may be the same as current_ust)
current_appstring---Name of application that the call is attempted from
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/session/attr/exists -d '
  {
    "current_ust": "gAAAAABavmAV3rw6fQ...",
    "target_ust": "gAAAAABavk-65BuvKI0...",
    "current_app": "CRM",
    "name": "my-attribute"
  }
  '

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