blpapi.Identity

class blpapi.Identity

Provides access to the entitlements for a specific user.

An unauthorized Identity is created using createIdentity(). Once an Identity has been created it can be authorized using sendAuthorizationRequest(). The authorized Identity can then be queried or used in subscribe() or sendRequest() calls.

Once authorized, an Identity has access to the entitlements of the user which it was validated for.

Identity objects are always created by the API, never directly by the application.

The class attributes represent the various seat types.

BPS = 0

Bloomberg Professional Service

INVALID_SEAT = -1

Unknown seat type

NONBPS = 1

Non-BPS

destroy()

Destructor.

Destroying the last Identity for a specific user cancels any authorizations associated with it.

getFailedEntitlements(service, entitlements)
Parameters
  • service (Service) – Service to check authorization for

  • entitlements ([int] or Element) – EIDs to check authorization for

Returns

Tuple where the boolean is True if this Identity is authorized for the specified service and all of the specified entitlements, and the list is a subset of entitlements for which this Identity is not authorized.

Return type

(bool, [int])

Note

The contents of the returned list are not specified if this identity is not authorized for service.

getSeatType()
Returns

Seat type of this identity.

Return type

int

The class attributes of Identity represent the seat types.

hasEntitlements(service, entitlements)
Parameters
  • service (Service) – Service to check authorization for

  • entitlements ([int] or Element) – EIDs to check authorization for

Returns

True if this Identity is authorized for the specified service and for each of the entitlement IDs contained in the specified entitlements.

Return type

bool

If Element is supplied for entitlements, it must be an array of integers.

isAuthorized(service)
Parameters

service (Service) – Service to check authorization for

Returns

True if this Identity is authorized for the specified service, False otherwise.

Return type

bool