symphony.bdk.core.service.presence.presence_service.OboPresenceService#

class symphony.bdk.core.service.presence.presence_service.OboPresenceService(presence_api: symphony.bdk.gen.pod_api.presence_api.PresenceApi, auth_session: symphony.bdk.core.auth.auth_session.AuthSession, retry_config: symphony.bdk.core.config.model.bdk_retry_config.BdkRetryConfig)#

Bases: object

Service class exposing OBO-enabled endpoints to manage user presence information.

This service is used for retrieving information about the presence of the OBO user or a specified user or all users in the pod, and perform some actions related to the user presence information like:

  • Set Presence to calling user

  • Set Presence to a specified user

  • Create a presence feed

  • Read a created presence feed

  • Delete a created presence feed

__init__(presence_api: symphony.bdk.gen.pod_api.presence_api.PresenceApi, auth_session: symphony.bdk.core.auth.auth_session.AuthSession, retry_config: symphony.bdk.core.config.model.bdk_retry_config.BdkRetryConfig)#

Methods

__init__(presence_api, auth_session, ...)

create_presence_feed()

Creates a new stream capturing online status changes ("presence feed") for the company (pod) and returns the ID of the new feed.

delete_presence_feed(feed_id)

Delete the specified presence feed that was created.

external_presence_interest(user_ids)

Register interest in a list of external users to get their presence info.

get_all_presence(last_user_id, limit)

Get the presence info of all users in a pod.

get_presence()

Get the online status (presence info) of the calling user.

get_user_presence(user_id, local)

Get the presence info of a specified user.

read_presence_feed(feed_id)

Reads the specified presence feed that was created.

set_presence(status, soft)

Set the presence info of the calling user.

set_user_presence(user_id, status, soft)

Set the presence state of a another user.

create_presence_feed() str#

Creates a new stream capturing online status changes (“presence feed”) for the company (pod) and returns the ID of the new feed. The feed will return the presence of users whose presence status has changed since it was last read. See: Create Presence Feed.

Returns

Presence feed Id

delete_presence_feed(feed_id: str) str#

Delete the specified presence feed that was created. See: Delete Presence Feed.

Parameters

feed_id – The presence feed id to be deleted.

Returns

The id of the deleted presence feed.

external_presence_interest(user_ids: List[int])#

Register interest in a list of external users to get their presence info. See: External Presence Interest.

Parameters

user_ids – List of user ids to be registered.

async get_all_presence(last_user_id: int, limit: int) List[symphony.bdk.gen.pod_model.v2_presence.V2Presence]#

Get the presence info of all users in a pod. See: Get All Presence.

Parameters
  • last_user_id – Last user ID retrieved, used for paging. If provided, results skip users with IDs less than this parameter.

  • limit – Maximum number of records to return. The maximum supported value is 5000.

Returns

Presence info of the looked up user.

get_presence() symphony.bdk.gen.pod_model.v2_presence.V2Presence#

Get the online status (presence info) of the calling user. See: Get Presence.

Returns

Presence info of the calling user.

get_user_presence(user_id: int, local: bool) symphony.bdk.gen.pod_model.v2_presence.V2Presence#

Get the presence info of a specified user. See: Get User Presence.

Parameters
  • user_id – User Id

  • local – If true then Perform a local query and set the presence to OFFLINE for users who are not local to the calling user’s pod. If false or absent then query the presence of all local and external users who are connected to the calling user.

Returns

Presence info of the looked up user.

read_presence_feed(feed_id: str) List[symphony.bdk.gen.pod_model.v2_presence.V2Presence]#

Reads the specified presence feed that was created. The feed returned includes the user presence statuses that have changed since they were last read. See: Read Presence Feed.

Parameters

feed_id – The presence feed id to be read.

Returns

The list of user presences has changed since the last presence read.

set_presence(status: symphony.bdk.core.service.presence.presence_service.PresenceStatus, soft: bool) symphony.bdk.gen.pod_model.v2_presence.V2Presence#

Set the presence info of the calling user. See: Set Presence.

Parameters
  • status – The new presence state for the user. Possible values are AVAILABLE, BUSY, AWAY, ON_THE_PHONE, BE_RIGHT_BACK, IN_A_MEETING, OUT_OF_OFFICE, OFF_WORK.

  • soft – If true, the user’s current status is taken into consideration. If the user is currently OFFLINE, the user’s presence will still be OFFLINE, but the new presence will take effect when the user comes online. If the user is currently online, the user’s activity state will be applied to the presence if applicable. (e.g. if you are setting their presence to AVAILABLE, but the user is currently idle, their status will be represented as AWAY)

Returns

Presence info of the calling user.

set_user_presence(user_id: int, status: symphony.bdk.core.service.presence.presence_service.PresenceStatus, soft: bool) symphony.bdk.gen.pod_model.v2_presence.V2Presence#

Set the presence state of a another user. See: Set Other User’s Presence - Admin V3.

Parameters
  • user_id – The id of the specified user.

  • status – Presence state to set. Possible values are AVAILABLE, BUSY, AWAY, ON_THE_PHONE, BE_RIGHT_BACK, IN_A_MEETING, OUT_OF_OFFICE, OFF_WORK.

  • soft – If true, the user’s current status is taken into consideration. If the user is currently OFFLINE, the user’s presence will still be OFFLINE, but the new presence will take effect when the user comes online. If the user is currently online, the user’s activity state will be applied to the presence if applicable. (e.g. if you are setting their presence to AVAILABLE, but the user is currently idle, their status will be represented as AWAY)

Returns

The presence info of the specified user.