Skip to content

YammerClient

Attributes

TRIGGER_OPERATIONS module-attribute

TRIGGER_OPERATIONS: Dict[str, Dict[str, Any]] = {'OnNewMessagesFollowingV2': {'operation_id': 'OnNewMessagesFollowingV2', 'path': '/{connectionId}/v2/trigger/messages/following.json', 'method': 'get', 'required_parameters': [], 'callback_payload_type': 'MessageList'}, 'OnNewMessagesInGroupV2': {'operation_id': 'OnNewMessagesInGroupV2', 'path': '/{connectionId}/v2/trigger/in_group/{group_id}.json', 'method': 'get', 'required_parameters': ['group_id'], 'callback_payload_type': 'MessageList'}}

Classes

Network dataclass

Network(id: Optional[str] = None, name: Optional[str] = None, permalink: Optional[str] = None)

Response for Get my networks

Attributes

id class-attribute instance-attribute
id: Optional[str] = None

Unique identifier of the network.

name class-attribute instance-attribute
name: Optional[str] = None

Summary of the network.

permalink: Optional[str] = None

Web link to the network page.

YammerEntity dataclass

YammerEntity(type_: Optional[str] = None, id: Optional[int] = None, full_name: Optional[str] = None)

Response for Get groups

Attributes

type_ class-attribute instance-attribute
type_: Optional[str] = field(default=None, metadata={'wire_name': 'type'})

Details of the Viva Engage entity.

id class-attribute instance-attribute
id: Optional[int] = None

Unique identifier of the group.

full_name class-attribute instance-attribute
full_name: Optional[str] = None

Name of the Viva Engage entity.

User dataclass

User(name: Optional[str] = None, job_title: Optional[str] = None, location: Optional[str] = None, full_name: Optional[str] = None, first_name: Optional[str] = None, last_name: Optional[str] = None, web_url: Optional[str] = None, email: Optional[str] = None, birth_date: Optional[str] = None, mugshot_url: Optional[str] = None)

Response for Get user details

Attributes

name class-attribute instance-attribute
name: Optional[str] = None

Username.

job_title class-attribute instance-attribute
job_title: Optional[str] = None

User job title.

location class-attribute instance-attribute
location: Optional[str] = None

User location.

full_name class-attribute instance-attribute
full_name: Optional[str] = None

User full name.

first_name class-attribute instance-attribute
first_name: Optional[str] = None

User first name.

last_name class-attribute instance-attribute
last_name: Optional[str] = None

User last name.

web_url class-attribute instance-attribute
web_url: Optional[str] = None

User profile url.

email class-attribute instance-attribute
email: Optional[str] = None

User email.

birth_date class-attribute instance-attribute
birth_date: Optional[str] = None

User birth date.

mugshot_url class-attribute instance-attribute
mugshot_url: Optional[str] = None

User photo url.

PageableMessageList dataclass

PageableMessageList(value: Optional[List[Message]] = None)

Response for Get all messages

MessageList dataclass

MessageList(messages: Optional[List[Message]] = None)

Response for When there is a new message in my followed feed

Attributes

messages class-attribute instance-attribute
messages: Optional[List[Message]] = None

messages

Message dataclass

Message(id: Optional[int] = None, content_excerpt: Optional[str] = None, sender_id: Optional[int] = None, replied_to_id: Optional[int] = None, created_at: Optional[str] = None, network_id: Optional[int] = None, message_type: Optional[str] = None, sender_type: Optional[str] = None, url: Optional[str] = None, web_url: Optional[str] = None, group_id: Optional[int] = None, body: Optional[MessageBody] = None, thread_id: Optional[int] = None, direct_message: Optional[bool] = None, client_type: Optional[str] = None, client_url: Optional[str] = None, language: Optional[str] = None, notified_user_ids: Optional[List[int]] = None, privacy: Optional[str] = None, liked_by: Optional[LikedBy] = None, system_message: Optional[bool] = None)

Definition: Message

Attributes

id class-attribute instance-attribute
id: Optional[int] = None

ID associated with the post.

content_excerpt class-attribute instance-attribute
content_excerpt: Optional[str] = None

Text Content of the post.

sender_id class-attribute instance-attribute
sender_id: Optional[int] = None

Unique ID of user who posted the message.

replied_to_id class-attribute instance-attribute
replied_to_id: Optional[int] = None

ID of the message to which this message is a reply.

created_at class-attribute instance-attribute
created_at: Optional[str] = None

Time at which the message was created.

network_id class-attribute instance-attribute
network_id: Optional[int] = None

Id of the network message is associated with.

message_type class-attribute instance-attribute
message_type: Optional[str] = None

Description of the message type.

sender_type class-attribute instance-attribute
sender_type: Optional[str] = None

Description of the type of sender.

url class-attribute instance-attribute
url: Optional[str] = None

API url of the post.

web_url class-attribute instance-attribute
web_url: Optional[str] = None

Web url of the post.

group_id class-attribute instance-attribute
group_id: Optional[int] = None

Unique ID of group who posted the message.

thread_id class-attribute instance-attribute
thread_id: Optional[int] = None

Unique ID of thread.

direct_message class-attribute instance-attribute
direct_message: Optional[bool] = None

Flag to specify if the post is a a direct message.

client_type class-attribute instance-attribute
client_type: Optional[str] = None

Type of the client.

client_url class-attribute instance-attribute
client_url: Optional[str] = None

Web link of the client.

language class-attribute instance-attribute
language: Optional[str] = None

Language used in the message.

notified_user_ids class-attribute instance-attribute
notified_user_ids: Optional[List[int]] = None

Details of users notified.

privacy class-attribute instance-attribute
privacy: Optional[str] = None

Details of the privacy associated with the message.

system_message class-attribute instance-attribute
system_message: Optional[bool] = None

Flag to specify if the post is a system generated message or not.

Topic dataclass

Topic(id: Optional[int] = None, name: Optional[str] = None)

Definition: Topic

Attributes

id class-attribute instance-attribute
id: Optional[int] = None

Unique identifier of the topic.

name class-attribute instance-attribute
name: Optional[str] = None

Name of the topic.

PostOperationRequest dataclass

PostOperationRequest(group_id: Optional[int] = None, body: Optional[str] = None, replied_to_id: Optional[int] = None, direct_to_id: Optional[int] = None, broadcast: Optional[bool] = None, title: Optional[str] = None)

Definition: PostOperationRequest

Attributes

group_id class-attribute instance-attribute
group_id: Optional[int] = None

The group to post a message to (0 = All Company/Network).

body class-attribute instance-attribute
body: Optional[str] = None

Your message to be posted into your network.

replied_to_id class-attribute instance-attribute
replied_to_id: Optional[int] = None

The message ID this message is in reply to.

direct_to_id class-attribute instance-attribute
direct_to_id: Optional[int] = None

If set, a private message will be sent directly to the user with the indicated ID.

broadcast class-attribute instance-attribute
broadcast: Optional[bool] = None

Post message as an announcement to all users in a group.

title class-attribute instance-attribute
title: Optional[str] = None

Title of the message to be posted.

MessageBody dataclass

MessageBody(parsed: Optional[str] = None, plain: Optional[str] = None, rich: Optional[str] = None)

Definition: MessageBody

Attributes

parsed class-attribute instance-attribute
parsed: Optional[str] = None

Parsed text format.

plain class-attribute instance-attribute
plain: Optional[str] = None

Plain text format.

rich class-attribute instance-attribute
rich: Optional[str] = None

Rich text format.

LikedBy dataclass

LikedBy(count: Optional[int] = None, names: Optional[List[Dict[str, Any]]] = None)

Definition: LikedBy

Attributes

count class-attribute instance-attribute
count: Optional[int] = None

Number of distinct likes.

names class-attribute instance-attribute
names: Optional[List[Dict[str, Any]]] = None

List of people who liked the post.

YammerClient

YammerClient(connection_runtime_url: str, token_provider: Optional[TokenProvider] = None, options: Optional[ConnectorClientOptions] = None)

Bases: ConnectorClientBase

Typed client for yammer connector.

Initialize a YammerClient.

Parameters:

Name Type Description Default
connection_runtime_url str

The connection runtime URL from Azure Portal.

required
token_provider Optional[TokenProvider]

Optional token provider. Defaults to ManagedIdentityTokenProvider.

None
options Optional[ConnectorClientOptions]

Optional connector client options.

None

Methods:

get_networks_async async
get_networks_async() -> dict[str, Any] | None

Get my networks

Gets all the networks that the user belongs to.

get_groups_async async
get_groups_async(network_id: Optional[str] = None, mine: Optional[int] = None, show_all_company_group: Optional[int] = None) -> dict[str, Any] | None

Get groups

Gets all groups. If mine = 1, get only groups to which the user belongs

get_user_details_by_id_async async
get_user_details_by_id_async(user_id: int) -> dict[str, Any] | None

Get user details

This operation returns user profile details.

like_message_async async
like_message_async(message_id: str) -> None

Like message

This operation is used to like the specified message.

get_all_messages_async async
get_all_messages_async(network_id: Optional[str] = None, older_than: Optional[int] = None, newer_than: Optional[int] = None, threaded: Optional[str] = None, limit: Optional[int] = None) -> dict[str, Any] | None

Get all messages

This operation returns all public messages in the logged in user's Viva Engage network. Corresponds to "All" conversations in the Viva Engage web interface.

get_messages_following_async async
get_messages_following_async(network_id: Optional[str] = None, older_than: Optional[int] = None, newer_than: Optional[int] = None, threaded: Optional[str] = None, limit: Optional[int] = None) -> dict[str, Any] | None

Get the messages from my Following feed

This operation returns the messages from Following feed which is conversations involving people, groups and topics that the user is following.

get_messages_in_group_async async
get_messages_in_group_async(group_id: int, network_id: Optional[str] = None, older_than: Optional[int] = None, newer_than: Optional[int] = None, threaded: Optional[str] = None, limit: Optional[int] = None) -> dict[str, Any] | None

Get messages in a group

This operation returns the messages posted in a group.

get_messages_in_thread_async async
get_messages_in_thread_async(thread_id: int) -> dict[str, Any] | None

Get messages in a thread

This operation returns the messages posted in a thread.

post_message_async async
post_message_async(input: PostOperationRequest, network_id: Optional[str] = None) -> dict[str, Any] | None

Post message

This operation is used to post a Message to a Group or All Company Feed. If group ID is provided, message will be posted to the specified group else it will be posted in All Company Feed.