Y360 Orglib
Tools collection to work with Y360 API
Audit Log API Clients
Audit Log module for interacting with the Y360 audit log API.
Details https://yandex.ru/dev/api360/doc/ru/ref/AuditLogService/ https://yandex.ru/dev/api360/doc/ru/audit-logs/
- class y360_orglib.audit.AuditMail(api_key, org_id, ssl_verify=True, log_level=20)[source]
Mail Audit API client.
- Parameters:
api_key (str) – The API key.
org_id (str) – The organization ID.
ssl_verify (bool, optional) – Whether to verify SSL certificates. Defaults to True.
log_level (int, optional) – The logging level. Defaults to logging.INFO.
- get_logs_page(page, per_page=10, page_token='')[source]
Get a page of mail audit log events.
- Parameters:
page (int) – The page number.
per_page (int, optional) – The number of events per page. Defaults to 10.
page_token (str, optional) – The page token. Defaults to ‘’.
- Returns:
The page of MailEvent events.
- Return type:
- Raises:
MailAuditError – If there is an error getting the events page.
- class y360_orglib.audit.MailEventsPage(*, events, nextPageToken='')[source]
Audit logs mail Events page Details https://yandex.ru/dev/api360/doc/ru/ref/AuditLogService/AuditLogService_Mail
- Parameters:
events (List[MailEvent])
nextPageToken (str | None)
- nextPageToken
Next page token (if exists)
- Type:
Optional[str]
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class y360_orglib.audit.MailEvent(*, clientIp, date, eventType, orgId, requestId, source, uniqId, userLogin, userName, userUid, actorUid=None, bcc=None, cc=None, to=None, destMid=None, folderName=None, folderType=None, from_s=None, labels=None, mid=None, msgId=None)[source]
Audit logs mail Event Details https://yandex.ru/dev/api360/doc/ru/ref/AuditLogService/AuditLogService_Mail#v1mailevent
- Parameters:
clientIp (str)
date (str)
eventType (Literal['mailbox_send', 'message_receive', 'message_seen', 'message_unseen', 'message_forward', 'message_purge', 'message_trash', 'message_spam', 'message_unspam', 'message_move', 'message_copy', 'message_answer'])
orgId (int)
requestId (str)
source (str)
uniqId (str)
userLogin (str)
userName (str)
userUid (str)
actorUid (str | None)
bcc (str | None)
cc (str | None)
to (str | None)
destMid (str | None)
folderName (str | None)
folderType (Literal['inbox', 'sent', 'trash', 'spam', 'drafts', 'outbox', 'archive', 'template_', 'discount', 'restored', 'reply_later', 'user'] | None)
from_s (str | None)
labels (List[str] | None)
mid (str | None)
msgId (str | None)
- client_ip
Client IP
- Type:
str
- date
Event date
- Type:
str
- event_type
Event type (mailbox_send, message_receive, message_seen, message_unseen, message_forward, message_purge, message_trash, message_spam, message_unspam, message_move, message_copy, message_answer)
- Type:
Literal
- org_id
Organization ID
- Type:
int
- request_id
System request ID (may be Not unique)
- Type:
str
- source
Event source (server, imap, pop3, native)
- Type:
str
- uniq_id
Unique event ID
- Type:
str
- user_login
User login
- Type:
str
- user_name
User name
- Type:
str
- user_uid
User ID
- Type:
str
- actor_uid
Mailbox Actor ID (if exists)
- Type:
Optional[str]
- bcc
BCC address (if exists)
- Type:
Optional[str]
- cc
CC address (if exists)
- Type:
Optional[str]
- to
To address (if exists)
- Type:
Optional[str]
- dest_mid
New email id on copy (if exists)
- Type:
Optional[str]
- folder_name
Personal folder name (if exists)
- Type:
Optional[str]
- folder_type
Folder type (inbox, sent, trash, spam, drafts, outbox, archive, discount, restored, reply_later, user)
- Type:
Optional[Literal]
- from_s
From address (if exists)
- Type:
Optional[str]
- labels
System email labels (if exists) (seen, attached, undo, delayed)
- Type:
Optional[List[str]]
- mid
Email Id (if exists)
- Type:
Optional[str]
- msg_id
Message-ID header value (if exists)
- Type:
Optional[str]
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class y360_orglib.audit.AuditEvents(api_key, org_id, ssl_verify=True)[source]
Client for Yandex 360 Audit Events Cloud API Allows to get organization audit logs. See more details: https://yandex.ru/dev/api360/doc/ru/audit-logs/get-logs :param api_key: OAuth token :param org_id: Organization ID :param ssl_verify: Verify SSL certificate
- Parameters:
api_key (str)
org_id (str)
- get_events(started_at, ended_at, count=100, iteration_key=0, **kwargs)[source]
Get events page from Audit Events API :param started_at: Start date and time of the period to get events from. ISO 8601 format. Example: 2024-01-31T23:59:59+00:00 :param ended_at: End time of the period to get events from. ISO 8601 format. Example: 2024-01-31T23:59:59+00:00 :param count: Number of events to get. Maximum value is 100. Default value is 100. :param iteration_key: Iteration key to get next page of events :param Other arguments are passed as kwargs for details see https: //yandex.ru/dev/api360/doc/ru/audit-logs/get-logs
- Return type:
List[EnrichedEvent]
- class y360_orglib.audit.AuditLogEventsPage(*, iteration_key=None, items)[source]
Audit log events page :param iteration_key: Next page iteration key :type iteration_key: str :param items: List of audit log EnrichedEvents :type items: list[EnrichedEvent]
- Parameters:
iteration_key (str | None)
items (List[EnrichedEvent])
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class y360_orglib.audit.AuditLogEvent(*, status, idempotency_id, uid=0, service, ip, occurred_at, org_id, is_system=False, meta, request_id, type)[source]
Audit log event :param status: Request status& Success or Error :type status: str :param idempotency_id: Event ID :type idempotency_id: str :param uid: ID of initiator User of the event :type uid: int :param service: Service name of the event. Possible values: Web, Desktop, Mobile, Api, Synchronization, ID, Internal, Unknown :type service: str :param ip: User or source service IP address. For auto initiated events is localhost :type ip: str :param occurred_at: Occurred at of the event in ISO 8601 format :type occurred_at: str :param org_id: Organization ID :type org_id: str :param is_system: Not in use. Always false :type is_system: bool :param meta: Additional event data in JSON format :type meta: dict :param request_id: ID of request :type request_id: str :param type: Type of the event. See https://yandex.ru/dev/api360/doc/ru/audit-logs/get-logs#types for details :type type: str
- Parameters:
status (str)
idempotency_id (str)
uid (int | None)
service (Literal['Web', 'Desktop', 'Mobile', 'Api', 'Synchronization', 'ID', 'Internal', 'Unknown'])
ip (str)
occurred_at (str)
org_id (str)
is_system (bool)
meta (dict)
request_id (str)
type (str)
- model_config: ClassVar[ConfigDict] = {'coerce_numbers_to_str': True}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class y360_orglib.audit.EnrichedEvent(*, user_login, user_name, event)[source]
Audit log event with data :param user_login: User login :type user_login: str :param user_name: User name :type user_name: str :param event: Audit log event itself :type event: AuditLogEvent
- Parameters:
user_login (str)
user_name (str)
event (AuditLogEvent)
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
Directory API Client
Directory API module for interacting with the Y360 Directory API
- class y360_orglib.directory.DirectoryClient(api_key, org_id, ssl_verify=True, log_level=20)[source]
Directory API Client
- Parameters:
api_key (str) – API key
org_id (str) – Organization ID
ssl_verify (bool, optional) – Verify SSL certificate. Defaults to True.
log_level (int, optional) – Log level. Defaults to logging.INFO.
- add_user_to_group(user_id, group_id)[source]
Add user to a group Use API v1 method: https://yandex.ru/dev/api360/doc/ru/ref/GroupService/GroupService_AddMember
- Parameters:
user_id (str) – User ID
group_id (int) – Group ID
- Returns:
Response
- Return type:
dict
- count_pages()[source]
Get number of pages in users list response
- Returns:
(users_count, pages_count)
- Return type:
Tuple[int, int]
- Raises:
DirectoryClientError – If error occurs
- get_all_users()[source]
Get all users of an organization.
- Returns:
List of User objects
- Return type:
List[User]
- get_group_members_v2(group_id)[source]
Get members of a group Use API v2 method: https://yandex.ru/dev/api360/doc/ru/ref/GroupV2Service/GroupService_ListMembers
- Parameters:
group_id (number) – Group ID number. Use get_groups(page, per_page) to get IDs
- Returns:
Object with lists of group members
- Return type:
- get_groups_page(page=1, per_page=100)[source]
Get groups of an organization Use API v1 method: https://yandex.ru/dev/api360/doc/ru/ref/GroupService/GroupService_List
- Parameters:
page (int, optional) – Page number. Defaults to 1.
per_page (int, optional) – Number of groups per page. Defaults to 10.
- Returns:
List of groups
- Return type:
- get_user_2fa(user_id)[source]
Get 2fa status of a user Use API v2 method: https://yandex.ru/dev/api360/doc/ru/ref/UserService/UserService_Get2fa
- Parameters:
user_id (str) – User ID
- Returns:
Object with 2fa status
- Return type:
User2fa
- class y360_orglib.directory.Contact(*, type, value, main=False, alias=False, synthetic=False)[source]
User contact model Details https://yandex.ru/dev/api360/doc/ru/ref/UserService/UserService_List#v1usercontact
- Parameters:
type (Literal['email', 'phone_extension', 'phone', 'site', 'icq', 'twitter', 'skype', 'staff'])
value (str)
main (bool)
alias (bool)
synthetic (bool)
- contact_type
Contact type
- Type:
str
- value
Contact value
- Type:
str
- main
Is main contact or alternate
- Type:
bool
- alias
Is alias contact
- Type:
bool
- synthetic
Is synthetic contact (auto-generated)
- Type:
bool
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class y360_orglib.directory.GroupMembers2(*, groups, users)[source]
Group members v2 model Details https://yandex.ru/dev/api360/doc/ru/ref/GroupV2Service/GroupService_ListMembers
- Parameters:
groups (List[ShortGroup])
users (List[ShortUser])
- groups
List of groups
- Type:
List[ShortGroup]
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class y360_orglib.directory.GroupsPage(*, groups, page, pages, perPage, total)[source]
List of Groups
- Parameters:
groups (list[Group])
page (int)
pages (int)
perPage (int)
total (int)
- page
Current page
- Type:
int
- pages
Total pages
- Type:
int
- per_page
Groups per page
- Type:
int
- total
Total groups in org
- Type:
int
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class y360_orglib.directory.User(*, id, nickname, departmentId, email, gender, position, avatarId, name, isEnabled, isEnabledUpdatedAt=None, about, birthday, externalId, isAdmin, isRobot, isDismissed, timezone, language, createdAt, updatedAt, displayName='', groups, contacts, aliases)[source]
User information model Details https://yandex.ru/dev/api360/doc/ru/ref/UserService/UserService_List#v1user
- Parameters:
id (str)
nickname (str)
departmentId (int)
email (str)
gender (str)
position (str)
avatarId (str)
name (Name)
isEnabled (bool)
isEnabledUpdatedAt (str | None)
about (str)
birthday (str)
externalId (str)
isAdmin (bool)
isRobot (bool)
isDismissed (bool)
timezone (str)
language (str)
createdAt (str)
updatedAt (str)
displayName (str)
groups (List[int])
contacts (List[Contact])
aliases (List[str])
- is_enabled
Is user enabled
- Type:
bool
- about
User description
- Type:
str
- birthday
User birthday
- Type:
str
- external_id
User external ID
- Type:
str
- is_admin
Is user admin
- Type:
bool
- is_robot
Is user robot
- Type:
bool
- is_dismissed
Is user dismissed
- Type:
bool
- timezone
User timezone
- Type:
str
- language
User language
- Type:
str
- created_at
User creation date
- Type:
str
- updated_at
User update date
- Type:
str
- display_name
User display name
- Type:
str
- groups
User groups
- Type:
List[int]
- aliases
User aliases
- Type:
List[str]
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class y360_orglib.directory.UsersPage(*, page, pages, perPage, total, users)[source]
List of users
- Parameters:
page (int)
pages (int)
perPage (int)
total (int)
users (List[User])
- page
Current page
- Type:
int
- pages
Total pages
- Type:
int
- per_page
Users per page
- Type:
int
- total
Total users in organization
- Type:
int
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class y360_orglib.directory.ShortGroup(*, id, name, membersCount)[source]
Short Group model Details https://yandex.ru/dev/api360/doc/ru/ref/GroupService/GroupService_DeleteMembers#v1shortgroup
- Parameters:
id (int)
name (str)
membersCount (int)
- group_id
Group ID
- Type:
int
- name
Group name
- Type:
str
- members_count
Group members count
- Type:
int
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class y360_orglib.directory.ShortUser(*, id, nickname, departmentId, email, gender, position, avatarId, name)[source]
Short user information model Details https://yandex.ru/dev/api360/doc/ru/ref/GroupService/GroupService_DeleteMembers#v1shortuser
- Parameters:
id (str)
nickname (str)
departmentId (int)
email (str)
gender (str)
position (str)
avatarId (str)
name (Name)
- uid
User ID
- Type:
str
- nickname
User nickname
- Type:
str
- department_id
Department ID
- Type:
int
- email
User email
- Type:
str
- gender
User gender
- Type:
str
- position
User position
- Type:
str
- class Name(*, first, last, middle)[source]
User Name model
- Parameters:
first (str)
last (str)
middle (str)
- first
User first name
- Type:
str
- last
User last name
- Type:
str
- middle
User middle name
- Type:
str
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class y360_orglib.directory.Group(*, id, name, membersCount, type, description, label, email, aliases, externalId, removed, members, memberOf, createdAt)[source]
Group model Details https://yandex.ru/dev/api360/doc/ru/ref/GroupService/GroupService_List#v1group
- Parameters:
id (int)
name (str)
membersCount (int)
type (str)
description (str)
label (str)
email (str)
aliases (List[str])
externalId (str)
removed (bool)
members (List[GroupMember])
memberOf (List[int])
createdAt (str)
- type
Group type name
- Type:
str
- description
Group description
- Type:
str
- label
Group label
- Type:
str
- email
Group email
- Type:
str
- aliases
Group email aliases
- Type:
List[str]
- external_id
Group external ID
- Type:
str
- removed
Is group deleted
- Type:
bool
- members
Group members
- Type:
List[GroupMember]
- member_of
Group member of
- Type:
List[int]
- created_at
Group creation date
- Type:
str
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class y360_orglib.directory.GroupMember(*, id, type)[source]
Group member model Details https://yandex.ru/dev/api360/doc/ru/ref/GroupService/GroupService_Get#v1groupmember
- Parameters:
id (str)
type (Literal['user', 'group', 'department'])
- member_id
Group member ID
- Type:
str
- type
Member type (user, group, department)
- Type:
str
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
Disk API Client
Disk Client module for interacting with the Y360 Disk
Details https://yandex.ru/dev/disk-api/doc/ru/
- class y360_orglib.disk.DiskClient(token, ssl_verify=True, log_level=20)[source]
Yandex Disk client
- Parameters:
token (str) – Disk User’s token
ssl_verify – Verify SSL certificate
log_level – Log level
- get_public_resources(limit=100, offset=0)[source]
Get list of public resources from Yandex Disk
- Parameters:
limit (int) – Number of resources to return
offset (int) – Offset of the first resource to return
- Returns:
List of public resources
- Return type:
List[Resource]
- Raises:
DiskClientError – If failed to get public resources
- class y360_orglib.disk.PublicResourcesList(*, items, limit, offset)[source]
Public Resources List model Details https://yandex.ru/dev/disk-api/doc/ru/reference/response-objects#publicresourcelist
- Parameters:
items (List[Resource])
limit (int)
offset (int)
- limit
Limit of resources
- Type:
int
- offset
Offset of resources
- Type:
int
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class y360_orglib.disk.Resource(*, public_key, public_url, name, created, modified, path, type, mime_type='', size=0)[source]
Resource model Details https://yandex.ru/dev/disk-api/doc/ru/reference/response-objects#resource
- Parameters:
public_key (str)
public_url (str)
name (str)
created (str)
modified (str)
path (str)
type (Literal['file', 'dir'])
mime_type (str)
size (int)
- public_key
Public resource key
- Type:
str
- public_url
Public resource url
- Type:
str
- name
Name of the resource (filename or folder)
- Type:
str
- created
Resource creation date
- Type:
str
- modified
Resource modify date
- Type:
str
- path
Full resource path on Disk
- Type:
str
- type
Resource type (dir, file)
- Type:
str
- mime_type
Resource MIME-type
- Type:
str
- size
Resource file size
- Type:
int
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class y360_orglib.disk.BaseAccess(*, macros=[], type, rights=[])[source]
Base Public Access model Details https://yandex.ru/dev/disk-api/doc/ru/reference/response-objects#publicaccesses
- Parameters:
macros (List[str])
type (str)
rights (List[str])
- access_type
Access type (macro, user, group, department)
- Type:
str
- rights
List of rights
- Type:
List[str]
- macros
List of macro accesses
- Type:
List[str]
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class y360_orglib.disk.UserAccess(*, macros=[], type, rights=[], org_id=None, id)[source]
User Accesses model
- Parameters:
access_type (str) – Access type (user, group, department)
org_id (int) – Organization ID (only for macro type employees)
user_id (int) – User ID
macros (List[str])
type (Literal['user', 'group', 'department', 'owner'])
rights (List[str])
id (int)
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class y360_orglib.disk.MacroAccess(*, macros=[], type, rights=[])[source]
Macro Accesses model
- Parameters:
access_type (str) – Access type (macro)
rights (List[str]) – List of rights
macros (List[str]) – List of macro accesses
type (Literal['macro'])
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class y360_orglib.disk.PublicSettings(*, available_until, accesses)[source]
Public settings model Details https://yandex.ru/dev/disk-api/doc/ru/reference/response-objects#publicsettings
- Parameters:
available_until (str | int | None)
accesses (List[MacroAccess | UserAccess])
- available_until
Resource link lifetime
- Type:
str
- public_accesses
List of public accesses
- Type:
List[Union[MacroAccess, UserAccess]]
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class y360_orglib.disk.DiskAdminClient(token, org_id, ssl_verify=True, log_level=20)[source]
Disk Admin Client Uses admin access rights to find shared resources More info https://yandex.ru/dev/disk-api/doc/ru/reference/public-owned-by-user
- Parameters:
token (str)
org_id (str)
- get_public_settings_by_key(public_key)[source]
Get public settings by public key (hash) .. attribute:: public_key
Public key (hash)
- type:
str
- Returns:
Public settings
- Return type:
- Raises:
DiskClientError – If failed to get public settings
- Parameters:
public_key (str)
- get_public_settings_by_path(user_id, path)[source]
Get public settings by path .. attribute:: user_id
User ID
- type:
str
- path
Path to resource
- Type:
str
- Returns:
Public settings
- Return type:
- Raises:
DiskClientError – If failed to get public settings
- Parameters:
user_id (str)
path (str)
- get_user_public_resources(user_id, limit=100, offset=0)[source]
Get list of public resources shared by User .. attribute:: user_id
User ID
- type:
str
- limit
Number of resources to return
- Type:
int
- offset
Offset of the first resource to return
- Type:
int
- Returns:
All user shared resources
- Return type:
List[ResourceShort]
- Raises:
DiskClientError – If failed to get shared resources
- Parameters:
user_id (str)
limit (int)
offset (int)
- class y360_orglib.disk.ResourceListShort(*, items, limit, offset)[source]
Short Resource List model Details https://yandex.ru/dev/disk-api/doc/ru/reference/response-objects#resourceshort
- Parameters:
items (List[ResourceShort])
limit (int)
offset (int)
- limit
Limit of resources
- Type:
int
- offset
Offset of resources
- Type:
int
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class y360_orglib.disk.ResourceShort(*, public_hash, created_at, modified_at, name, path, type)[source]
Short Resource model Details https://yandex.ru/dev/disk-api/doc/ru/reference/response-objects#resourceshort
- Parameters:
public_hash (str | None)
created_at (str)
modified_at (str)
name (str)
path (str)
type (Literal['file', 'dir'])
- public_hash
Published resource key. Only if resource is published
- Type:
str
- created_at
Resource creation date in ISO 8601 format
- Type:
str
- modified_at
Resource modify date in ISO 8601 format
- Type:
str
- name
Resource name (filename or folder name)
- Type:
str
- path
Full resource path on Disk
- Type:
str
- type
Resource type (dir, file)
- Type:
str
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
Service Applications Client
ServiceApps module for interacting with the Y360 Service Applications API.
- class y360_orglib.service_app.ServiceAppClient(client_id, client_secret, ssl_verify=True)[source]
Service App Client
- Parameters:
client_id – Service App Client ID
client_secret – Service App Client Secret
ssl_verify – Verify SSL certificate
- get_service_app_token(subject_token, subject_token_type='urn:yandex:params:oauth:token-type:email')[source]
Get a service app token for for given User (subject_token)
- Parameters:
subject_token – User Id or Email
subject_token_type –
The type of the subject token.
If the subject_token is a User ID, the subject_token_type should be ‘urn:yandex:params:oauth:token-type:uid’.
If the subject_token is an Email, the subject_token_type should be ‘urn:yandex:params:oauth:token-type:email’.
Default value is ‘urn:yandex:params:oauth:token-type:email’.
- Returns:
Response with service app token for provided User
- Return type:
- Raises:
ServiceAppError – If failed to get service app token
- class y360_orglib.service_app.ServiceAppTokenResponse(*, access_token, expires_in=3600, issued_token_type='', scope='', token_type='')[source]
Response from the service app token endpoint Details https://yandex.ru/support/yandex-360/business/admin/ru/security-service-applications
- Parameters:
access_token (str)
expires_in (int)
issued_token_type (str)
scope (str)
token_type (str)
- access_token
The access token
- Type:
str
- expires_in
The number of seconds the token is valid for (always 3600)
- Type:
int
- issued_token_type
The type of token issued (always access_token)
- Type:
str
- scope
The scope of the token
- Type:
str
- token_type
The type of token (always bearer)
- Type:
str
- property auth_header: dict
Return the authorization header format for this token
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].