Endpoints¶
Authentication¶
- class mattermostautodriver.endpoints.authentication.Authentication(client)[source]¶
Bases:
Base
- migrate_auth_to_ldap(options=None)[source]¶
Migrate user accounts authentication type to LDAP.
from: The current authentication type for the matched users. match_field: Foreign user field name to match. force:
Read in Mattermost API docs (authentication - MigrateAuthToLdap)
- migrate_auth_to_saml(options=None)[source]¶
Migrate user accounts authentication type to SAML.
from: The current authentication type for the matched users. matches: Users map. auto:
Read in Mattermost API docs (authentication - MigrateAuthToSaml)
Base¶
Bleve¶
Bookmarks¶
- class mattermostautodriver.endpoints.bookmarks.Bookmarks(client)[source]¶
Bases:
Base
- list_channel_bookmarks_for_channel(channel_id, params=None)[source]¶
Get channel bookmarks for Channel
channel_id: Channel GUID bookmarks_since: Timestamp to filter the bookmarks with. If set, the endpoint returns bookmarks that have been added, updated or deleted since its value
Read in Mattermost API docs (bookmarks - ListChannelBookmarksForChannel)
- create_channel_bookmark(channel_id, options)[source]¶
Create channel bookmark
channel_id: Channel GUID file_id: The ID of the file associated with the channel bookmark. Required for bookmarks of type ‘file’ display_name: The name of the channel bookmark link_url: The URL associated with the channel bookmark. Required for bookmarks of type ‘link’ image_url: The URL of the image associated with the channel bookmark. Optional, only applies for bookmarks of type ‘link’ emoji: The emoji of the channel bookmark type: *
link
for channel bookmarks that reference a link.link_url
is requied *file
for channel bookmarks that reference a file.file_id
is requiredRead in Mattermost API docs (bookmarks - CreateChannelBookmark)
- update_channel_bookmark(channel_id, bookmark_id, options)[source]¶
Update channel bookmark
channel_id: Channel GUID bookmark_id: Bookmark GUID file_id: The ID of the file associated with the channel bookmark. Required for bookmarks of type ‘file’ display_name: The name of the channel bookmark sort_order: The order of the channel bookmark link_url: The URL associated with the channel bookmark. Required for type bookmarks of type ‘link’ image_url: The URL of the image associated with the channel bookmark emoji: The emoji of the channel bookmark type: *
link
for channel bookmarks that reference a link.link_url
is requied *file
for channel bookmarks that reference a file.file_id
is requiredRead in Mattermost API docs (bookmarks - UpdateChannelBookmark)
- delete_channel_bookmark(channel_id, bookmark_id)[source]¶
Delete channel bookmark
channel_id: Channel GUID bookmark_id: Bookmark GUID
Read in Mattermost API docs (bookmarks - DeleteChannelBookmark)
- update_channel_bookmark_sort_order(channel_id, bookmark_id, options=None)[source]¶
Update channel bookmark’s order
channel_id: Channel GUID bookmark_id: Bookmark GUID
Read in Mattermost API docs (bookmarks - UpdateChannelBookmarkSortOrder)
Bots¶
- class mattermostautodriver.endpoints.bots.Bots(client)[source]¶
Bases:
Base
- get_bots(params=None)[source]¶
Get bots
page: The page to select. per_page: The number of users per page. include_deleted: If deleted bots should be returned. only_orphaned: When true, only orphaned bots will be returned. A bot is considered orphaned if its owner has been deactivated.
- patch_bot(bot_user_id, options)[source]¶
Patch a bot
bot_user_id: Bot user ID username: display_name: description:
- get_bot(bot_user_id, params=None)[source]¶
Get a bot
bot_user_id: Bot user ID include_deleted: If deleted bots should be returned.
- assign_bot(bot_user_id, user_id)[source]¶
Assign a bot to a user
bot_user_id: Bot user ID user_id: The user ID to assign the bot to.
- set_bot_icon_image(bot_user_id, files, data=None)[source]¶
Set bot’s LHS icon image
bot_user_id: Bot user ID image: SVG icon image to be uploaded
Brand¶
- class mattermostautodriver.endpoints.brand.Brand(client)[source]¶
Bases:
Base
- get_brand_image()[source]¶
Get brand image Read in Mattermost API docs (brand - GetBrandImage)
- delete_brand_image()[source]¶
Delete current brand image Read in Mattermost API docs (brand - DeleteBrandImage)
Channels¶
- class mattermostautodriver.endpoints.channels.Channels(client)[source]¶
Bases:
Base
- get_all_channels(params=None)[source]¶
Get a list of all channels
not_associated_to_group: A group id to exclude channels that are associated with that group via GroupChannel records. This can also be left blank with
not_associated_to_group=
. page: The page to select. per_page: The number of channels per page. exclude_default_channels: Whether to exclude default channels (ex Town Square, Off-Topic) from the results. include_deleted: Include channels that have been archived. This correlates to theDeleteAt
flag being set in the database. include_total_count: Appends a total count of returned channels inside the response object - ex:{ "channels": [], "total_count" : 0 }
. exclude_policy_constrained: If set to true, channels which are part of a data retention policy will be excluded. Thesysconsole_read_compliance
permission is required to use this parameter. Minimum server version: 5.35
- create_channel(options)[source]¶
Create a channel
team_id: The team ID of the team to create the channel on name: The unique handle for the channel, will be present in the channel URL display_name: The non-unique UI name for the channel purpose: A short description of the purpose of the channel header: Markdown-formatted text to display in the header of the channel type: ‘O’ for a public channel, ‘P’ for a private channel
- create_direct_channel(options)[source]¶
Create a direct message channel Read in Mattermost API docs (channels - CreateDirectChannel)
- create_group_channel(options)[source]¶
Create a group message channel Read in Mattermost API docs (channels - CreateGroupChannel)
- search_all_channels(options)[source]¶
Search all private and open type channels across all teams
term: The string to search in the channel name, display name, and purpose. not_associated_to_group: A group id to exclude channels that are associated to that group via GroupChannel records. exclude_default_channels: Exclude default channels from the results by setting this parameter to true. team_ids: Filters results to channels belonging to the given team ids
Minimum server version: 5.26
group_constrained: Filters results to only return channels constrained to a group
Minimum server version: 5.26
exclude_group_constrained: Filters results to exclude channels constrained to a group
Minimum server version: 5.26
public: Filters results to only return Public / Open channels, can be used in conjunction with
private
to return bothpublic
andprivate
channelsMinimum server version: 5.26
private: Filters results to only return Private channels, can be used in conjunction with
public
to return bothprivate
andpublic
channelsMinimum server version: 5.26
deleted: Filters results to only return deleted / archived channels
Minimum server version: 5.26
page: The page number to return, if paginated. If this parameter is not present with the
per_page
parameter then the results will be returned un-paged. per_page: The number of entries to return per page, if paginated. If this parameter is not present with thepage
parameter then the results will be returned un-paged. exclude_policy_constrained: If set to true, only channels which do not have a granular retention policy assigned to them will be returned. Thesysconsole_read_compliance_data_retention
permission is required to use this parameter. Minimum server version: 5.35include_search_by_id: If set to true, returns channels where given search ‘term’ matches channel ID. Minimum server version: 5.35
- search_group_channels(options)[source]¶
Search Group Channels
term: The search term to match against the members’ usernames of the group channels
Read in Mattermost API docs (channels - SearchGroupChannels)
- get_public_channels_by_ids_for_team(team_id, options)[source]¶
Get a list of channels by ids
team_id: Team GUID
Read in Mattermost API docs (channels - GetPublicChannelsByIdsForTeam)
- get_channel_members_timezones(channel_id)[source]¶
Get timezones in a channel
channel_id: Channel GUID
Read in Mattermost API docs (channels - GetChannelMembersTimezones)
- update_channel(channel_id, options)[source]¶
Update a channel
channel_id: Channel GUID id: The channel’s id, not updatable name: The unique handle for the channel, will be present in the channel URL display_name: The non-unique UI name for the channel purpose: A short description of the purpose of the channel header: Markdown-formatted text to display in the header of the channel
- patch_channel(channel_id, options)[source]¶
Patch a channel
channel_id: Channel GUID name: The unique handle for the channel, will be present in the channel URL display_name: The non-unique UI name for the channel purpose: A short description of the purpose of the channel header: Markdown-formatted text to display in the header of the channel
- update_channel_privacy(channel_id, options)[source]¶
Update channel’s privacy
channel_id: Channel GUID privacy: Channel privacy setting: ‘O’ for a public channel, ‘P’ for a private channel
Read in Mattermost API docs (channels - UpdateChannelPrivacy)
- move_channel(channel_id, options)[source]¶
Move a channel
channel_id: Channel GUID team_id: force: Remove members those are not member of target team before moving the channel.
- get_public_channels_for_team(team_id, params=None)[source]¶
Get public channels
team_id: Team GUID page: The page to select. per_page: The number of public channels per page.
Read in Mattermost API docs (channels - GetPublicChannelsForTeam)
- get_private_channels_for_team(team_id, params=None)[source]¶
Get private channels
team_id: Team GUID page: The page to select. per_page: The number of private channels per page.
Read in Mattermost API docs (channels - GetPrivateChannelsForTeam)
- get_deleted_channels_for_team(team_id, params=None)[source]¶
Get deleted channels
team_id: Team GUID page: The page to select. per_page: The number of public channels per page.
Read in Mattermost API docs (channels - GetDeletedChannelsForTeam)
- autocomplete_channels_for_team(team_id, params=None)[source]¶
Autocomplete channels
team_id: Team GUID name: Name or display name
Read in Mattermost API docs (channels - AutocompleteChannelsForTeam)
- autocomplete_channels_for_team_for_search(team_id, params=None)[source]¶
Autocomplete channels for search
team_id: Team GUID name: Name or display name
Read in Mattermost API docs (channels - AutocompleteChannelsForTeamForSearch)
- search_channels(team_id, options)[source]¶
Search channels
team_id: Team GUID term: The search term to match against the name or display name of channels
- search_archived_channels(team_id, options)[source]¶
Search archived channels
team_id: Team GUID term: The search term to match against the name or display name of archived channels
Read in Mattermost API docs (channels - SearchArchivedChannels)
- get_channel_by_name(team_id, channel_name, params=None)[source]¶
Get a channel by name
team_id: Team GUID channel_name: Channel Name include_deleted: Defines if deleted channels should be returned or not (Mattermost Server 5.26.0+)
- get_channel_by_name_for_team_name(team_name, channel_name, params=None)[source]¶
Get a channel by name and team name
team_name: Team Name channel_name: Channel Name include_deleted: Defines if deleted channels should be returned or not (Mattermost Server 5.26.0+)
Read in Mattermost API docs (channels - GetChannelByNameForTeamName)
- get_channel_members(channel_id, params=None)[source]¶
Get channel members
channel_id: Channel GUID page: The page to select. per_page: The number of members per page.
- add_channel_member(channel_id, options)[source]¶
Add user(s) to channel
channel_id: The channel ID user_id: The ID of user to add into the channel, for backwards compatibility. user_ids: The IDs of users to add into the channel, required if ‘user_id’ doess not exist. post_root_id: The ID of root post where link to add channel member originates
- get_channel_members_by_ids(channel_id, options)[source]¶
Get channel members by ids
channel_id: Channel GUID
Read in Mattermost API docs (channels - GetChannelMembersByIds)
- get_channel_member(channel_id, user_id)[source]¶
Get channel member
channel_id: Channel GUID user_id: User GUID
- remove_user_from_channel(channel_id, user_id)[source]¶
Remove user from channel
channel_id: Channel GUID user_id: User GUID
Read in Mattermost API docs (channels - RemoveUserFromChannel)
- update_channel_roles(channel_id, user_id, options)[source]¶
Update channel roles
channel_id: Channel GUID user_id: User GUID roles:
- update_channel_member_scheme_roles(channel_id, user_id, options)[source]¶
Update the scheme-derived roles of a channel member.
channel_id: Channel GUID user_id: User GUID scheme_admin: scheme_user:
Read in Mattermost API docs (channels - UpdateChannelMemberSchemeRoles)
- update_channel_notify_props(channel_id, user_id, options)[source]¶
Update channel notifications
channel_id: Channel GUID user_id: User GUID
Read in Mattermost API docs (channels - UpdateChannelNotifyProps)
- view_channel(user_id, options)[source]¶
View channel
user_id: User ID to perform the view action for channel_id: The channel ID that is being viewed. Use a blank string to indicate that all channels have lost focus. prev_channel_id: The channel ID of the previous channel, used when switching channels. Providing this ID will cause push notifications to clear on the channel being switched to.
- get_channel_members_for_user(user_id, team_id)[source]¶
Get channel memberships and roles for a user
user_id: User GUID team_id: Team GUID
Read in Mattermost API docs (channels - GetChannelMembersForUser)
- get_channels_for_team_for_user(user_id, team_id, params=None)[source]¶
Get channels for user
user_id: User GUID team_id: Team GUID include_deleted: Defines if deleted channels should be returned or not last_delete_at: Filters the deleted channels by this time in epoch format. Does not have any effect if include_deleted is set to false.
Read in Mattermost API docs (channels - GetChannelsForTeamForUser)
- get_channels_for_user(user_id, params=None)[source]¶
Get all channels from all teams
user_id: The ID of the user. This can also be “me” which will point to the current user. last_delete_at: Filters the deleted channels by this time in epoch format. Does not have any effect if include_deleted is set to false. include_deleted: Defines if deleted channels should be returned or not
- get_channel_unread(user_id, channel_id)[source]¶
Get unread messages
user_id: User GUID channel_id: Channel GUID
- update_channel_scheme(channel_id, options)[source]¶
Set a channel’s scheme
channel_id: Channel GUID scheme_id: The ID of the scheme.
Read in Mattermost API docs (channels - UpdateChannelScheme)
- channel_members_minus_group_members(channel_id, params=None)[source]¶
Channel members minus group members.
channel_id: Channel GUID group_ids: A comma-separated list of group ids. page: The page to select. per_page: The number of users per page.
Read in Mattermost API docs (channels - ChannelMembersMinusGroupMembers)
- get_channel_member_counts_by_group(channel_id, params=None)[source]¶
Channel members counts for each group that has atleast one member in the channel
channel_id: Channel GUID include_timezones: Defines if member timezone counts should be returned or not
Read in Mattermost API docs (channels - GetChannelMemberCountsByGroup)
- get_channel_moderations(channel_id)[source]¶
Get information about channel’s moderation.
channel_id: Channel GUID
Read in Mattermost API docs (channels - GetChannelModerations)
- patch_channel_moderations(channel_id, options)[source]¶
Update a channel’s moderation settings.
channel_id: Channel GUID
Read in Mattermost API docs (channels - PatchChannelModerations)
- get_sidebar_categories_for_team_for_user(team_id, user_id)[source]¶
Get user’s sidebar categories
team_id: Team GUID user_id: User GUID
Read in Mattermost API docs (channels - GetSidebarCategoriesForTeamForUser)
- create_sidebar_category_for_team_for_user(team_id, user_id, options)[source]¶
Create user’s sidebar category
team_id: Team GUID user_id: User GUID
Read in Mattermost API docs (channels - CreateSidebarCategoryForTeamForUser)
- update_sidebar_categories_for_team_for_user(team_id, user_id, options)[source]¶
Update user’s sidebar categories
team_id: Team GUID user_id: User GUID
Read in Mattermost API docs (channels - UpdateSidebarCategoriesForTeamForUser)
- get_sidebar_category_order_for_team_for_user(team_id, user_id)[source]¶
Get user’s sidebar category order
team_id: Team GUID user_id: User GUID
Read in Mattermost API docs (channels - GetSidebarCategoryOrderForTeamForUser)
- update_sidebar_category_order_for_team_for_user(team_id, user_id, options)[source]¶
Update user’s sidebar category order
team_id: Team GUID user_id: User GUID
Read in Mattermost API docs (channels - UpdateSidebarCategoryOrderForTeamForUser)
- get_sidebar_category_for_team_for_user(team_id, user_id, category_id)[source]¶
Get sidebar category
team_id: Team GUID user_id: User GUID category_id: Category GUID
Read in Mattermost API docs (channels - GetSidebarCategoryForTeamForUser)
- update_sidebar_category_for_team_for_user(team_id, user_id, category_id, options)[source]¶
Update sidebar category
team_id: Team GUID user_id: User GUID category_id: Category GUID
Read in Mattermost API docs (channels - UpdateSidebarCategoryForTeamForUser)
- remove_sidebar_category_for_team_for_user(team_id, user_id, category_id)[source]¶
Delete sidebar category
team_id: Team GUID user_id: User GUID category_id: Category GUID
Read in Mattermost API docs (channels - RemoveSidebarCategoryForTeamForUser)
Cloud¶
- class mattermostautodriver.endpoints.cloud.Cloud(client)[source]¶
Bases:
Base
- get_cloud_limits()[source]¶
Get cloud workspace limits Read in Mattermost API docs (cloud - GetCloudLimits)
- get_cloud_products()[source]¶
Get cloud products Read in Mattermost API docs (cloud - GetCloudProducts)
- create_customer_payment()[source]¶
Create a customer setup payment intent Read in Mattermost API docs (cloud - CreateCustomerPayment)
- confirm_customer_payment(data=None)[source]¶
Completes the payment setup intent
stripe_setup_intent_id:
Read in Mattermost API docs (cloud - ConfirmCustomerPayment)
- get_cloud_customer()[source]¶
Get cloud customer Read in Mattermost API docs (cloud - GetCloudCustomer)
- update_cloud_customer(options)[source]¶
Update cloud customer
name: email: contact_first_name: contact_last_name: num_employees:
- update_cloud_customer_address(options)[source]¶
Update cloud customer address Read in Mattermost API docs (cloud - UpdateCloudCustomerAddress)
- get_subscription()[source]¶
Get cloud subscription Read in Mattermost API docs (cloud - GetSubscription)
- get_endpoint_for_installation_information()[source]¶
GET endpoint for Installation information Read in Mattermost API docs (cloud - GetEndpointForInstallationInformation)
- get_invoices_for_subscription()[source]¶
Get cloud subscription invoices Read in Mattermost API docs (cloud - GetInvoicesForSubscription)
- get_invoice_for_subscription_as_pdf(invoice_id)[source]¶
Get cloud invoice PDF
invoice_id: Invoice ID
Read in Mattermost API docs (cloud - GetInvoiceForSubscriptionAsPdf)
- post_endpoint_for_cws_webhooks()[source]¶
POST endpoint for CWS Webhooks Read in Mattermost API docs (cloud - PostEndpointForCwsWebhooks)
Cluster¶
Commands¶
- class mattermostautodriver.endpoints.commands.Commands(client)[source]¶
Bases:
Base
- create_command(options)[source]¶
Create a command
team_id: Team ID to where the command should be created method:
'P'
for post request,'G'
for get request trigger: Activation word to trigger the command url: The URL that the command will make the request
- list_commands(params=None)[source]¶
List commands for a team
team_id: The team id. custom_only: To get only the custom commands. If set to false will get the custom if the user have access plus the system commands, otherwise just the system commands.
- list_autocomplete_commands(team_id)[source]¶
List autocomplete commands
team_id: Team GUID
Read in Mattermost API docs (commands - ListAutocompleteCommands)
- list_command_autocomplete_suggestions(team_id, params=None)[source]¶
List commands’ autocomplete data
team_id: Team GUID user_input: String inputted by the user.
Read in Mattermost API docs (commands - ListCommandAutocompleteSuggestions)
- update_command(command_id, options)[source]¶
Update a command
command_id: ID of the command to update
- move_command(command_id, options)[source]¶
Move a command
command_id: ID of the command to move team_id: Destination teamId
- regen_command_token(command_id)[source]¶
Generate a new token
command_id: ID of the command to generate the new token
Compliance¶
- class mattermostautodriver.endpoints.compliance.Compliance(client)[source]¶
Bases:
Base
- create_compliance_report()[source]¶
Create report Read in Mattermost API docs (compliance - CreateComplianceReport)
- get_compliance_reports(params=None)[source]¶
Get reports
page: The page to select. per_page: The number of reports per page.
Read in Mattermost API docs (compliance - GetComplianceReports)
- get_compliance_report(report_id)[source]¶
Get a report
report_id: Compliance report GUID
Read in Mattermost API docs (compliance - GetComplianceReport)
- download_compliance_report(report_id)[source]¶
Download a report
report_id: Compliance report GUID
Read in Mattermost API docs (compliance - DownloadComplianceReport)
Data Retention¶
- class mattermostautodriver.endpoints.data_retention.DataRetention(client)[source]¶
Bases:
Base
- get_team_policies_for_user(user_id, params=None)[source]¶
Get the policies which are applied to a user’s teams
user_id: The ID of the user. This can also be “me” which will point to the current user. page: The page to select. per_page: The number of policies per page.
Read in Mattermost API docs (data_retention - GetTeamPoliciesForUser)
- get_channel_policies_for_user(user_id, params=None)[source]¶
Get the policies which are applied to a user’s channels
user_id: The ID of the user. This can also be “me” which will point to the current user. page: The page to select. per_page: The number of policies per page.
Read in Mattermost API docs (data_retention - GetChannelPoliciesForUser)
- get_data_retention_policy()[source]¶
Get the global data retention policy Read in Mattermost API docs (data_retention - GetDataRetentionPolicy)
- get_data_retention_policies_count()[source]¶
Get the number of granular data retention policies Read in Mattermost API docs (data_retention - GetDataRetentionPoliciesCount)
- get_data_retention_policies(params=None)[source]¶
Get the granular data retention policies
page: The page to select. per_page: The number of policies per page.
Read in Mattermost API docs (data_retention - GetDataRetentionPolicies)
- create_data_retention_policy(options)[source]¶
Create a new granular data retention policy Read in Mattermost API docs (data_retention - CreateDataRetentionPolicy)
- get_data_retention_policy_by_id(policy_id)[source]¶
Get a granular data retention policy
policy_id: The ID of the granular retention policy.
Read in Mattermost API docs (data_retention - GetDataRetentionPolicyByID)
- patch_data_retention_policy(policy_id, options)[source]¶
Patch a granular data retention policy
policy_id: The ID of the granular retention policy.
Read in Mattermost API docs (data_retention - PatchDataRetentionPolicy)
- delete_data_retention_policy(policy_id)[source]¶
Delete a granular data retention policy
policy_id: The ID of the granular retention policy.
Read in Mattermost API docs (data_retention - DeleteDataRetentionPolicy)
- get_teams_for_retention_policy(policy_id, params=None)[source]¶
Get the teams for a granular data retention policy
policy_id: The ID of the granular retention policy. page: The page to select. per_page: The number of teams per page.
Read in Mattermost API docs (data_retention - GetTeamsForRetentionPolicy)
- add_teams_to_retention_policy(policy_id, options)[source]¶
Add teams to a granular data retention policy
policy_id: The ID of the granular retention policy.
Read in Mattermost API docs (data_retention - AddTeamsToRetentionPolicy)
- remove_teams_from_retention_policy(policy_id, params)[source]¶
Delete teams from a granular data retention policy
policy_id: The ID of the granular retention policy.
Read in Mattermost API docs (data_retention - RemoveTeamsFromRetentionPolicy)
- search_teams_for_retention_policy(policy_id, options)[source]¶
Search for the teams in a granular data retention policy
policy_id: The ID of the granular retention policy. term: The search term to match against the name or display name of teams
Read in Mattermost API docs (data_retention - SearchTeamsForRetentionPolicy)
- get_channels_for_retention_policy(policy_id, params=None)[source]¶
Get the channels for a granular data retention policy
policy_id: The ID of the granular retention policy. page: The page to select. per_page: The number of channels per page.
Read in Mattermost API docs (data_retention - GetChannelsForRetentionPolicy)
- add_channels_to_retention_policy(policy_id, options)[source]¶
Add channels to a granular data retention policy
policy_id: The ID of the granular retention policy.
Read in Mattermost API docs (data_retention - AddChannelsToRetentionPolicy)
- remove_channels_from_retention_policy(policy_id, params)[source]¶
Delete channels from a granular data retention policy
policy_id: The ID of the granular retention policy.
Read in Mattermost API docs (data_retention - RemoveChannelsFromRetentionPolicy)
- search_channels_for_retention_policy(policy_id, options)[source]¶
Search for the channels in a granular data retention policy
policy_id: The ID of the granular retention policy. term: The string to search in the channel name, display name, and purpose. team_ids: Filters results to channels belonging to the given team ids
public: Filters results to only return Public / Open channels, can be used in conjunction with
private
to return bothpublic
andprivate
channelsprivate: Filters results to only return Private channels, can be used in conjunction with
public
to return bothprivate
andpublic
channelsdeleted: Filters results to only return deleted / archived channels
Read in Mattermost API docs (data_retention - SearchChannelsForRetentionPolicy)
Elasticsearch¶
- class mattermostautodriver.endpoints.elasticsearch.Elasticsearch(client)[source]¶
Bases:
Base
- test_elasticsearch()[source]¶
Test Elasticsearch configuration Read in Mattermost API docs (elasticsearch - TestElasticsearch)
- purge_elasticsearch_indexes()[source]¶
Purge all Elasticsearch indexes Read in Mattermost API docs (elasticsearch - PurgeElasticsearchIndexes)
Emoji¶
- class mattermostautodriver.endpoints.emoji.Emoji(client)[source]¶
Bases:
Base
- create_emoji(files, data=None)[source]¶
Create a custom emoji
image: A file to be uploaded emoji: A JSON object containing a
name
field with the name of the emoji and acreator_id
field with the id of the authenticated user.
- get_emoji_list(params=None)[source]¶
Get a list of custom emoji
page: The page to select. per_page: The number of emojis per page. sort: Either blank for no sorting or “name” to sort by emoji names. Minimum server version for sorting is 4.7.
- search_emoji(options)[source]¶
Search custom emoji
term: The term to match against the emoji name. prefix_only: Set to only search for names starting with the search term.
- get_emojis_by_names(options)[source]¶
Get custom emojis by name Read in Mattermost API docs (emoji - GetEmojisByNames)
Exports¶
- class mattermostautodriver.endpoints.exports.Exports(client)[source]¶
Bases:
Base
- list_exports()[source]¶
List export files Read in Mattermost API docs (exports - ListExports)
- download_export(export_name)[source]¶
Download an export file
export_name: The name of the export file to download
Files¶
- class mattermostautodriver.endpoints.files.Files(client)[source]¶
Bases:
Base
- upload_file(files, data=None)[source]¶
Upload a file
files: A file to be uploaded channel_id: The ID of the channel that this file will be uploaded to client_ids: A unique identifier for the file that will be returned in the response
- get_file_link(file_id)[source]¶
Get a public file link
file_id: The ID of the file to get a link for
- get_file_public(file_id, params=None)[source]¶
Get a public file
file_id: The ID of the file to get h: File hash
- search_files(team_id, data)[source]¶
Search files in a team
team_id: Team GUID terms: The search terms as inputed by the user. To search for files from a user include
from:someusername
, using a user’s username. To search in a specific channel includein:somechannel
, using the channel name (not the display name). To search for specific extensions includedext:extension
. is_or_search: Set to true if an Or search should be performed vs an And search. time_zone_offset: Offset from UTC of user timezone for date searches. include_deleted_channels: Set to true if deleted channels should be included in the search. (archived channels) page: The page to select. (Only works with Elasticsearch) per_page: The number of posts per page. (Only works with Elasticsearch)
Filtering¶
- class mattermostautodriver.endpoints.filtering.Filtering(client)[source]¶
Bases:
Base
- get_ip_filters()[source]¶
Get all IP filters Read in Mattermost API docs (filtering - GetIPFilters)
- apply_ip_filters(options)[source]¶
Get all IP filters Read in Mattermost API docs (filtering - ApplyIPFilters)
- my_ip()[source]¶
Get all IP filters Read in Mattermost API docs (filtering - MyIP)
Groups¶
- class mattermostautodriver.endpoints.groups.Groups(client)[source]¶
Bases:
Base
- get_groups(params=None)[source]¶
Get groups
page: The page to select. per_page: The number of groups per page. q: String to pattern match the
name
anddisplay_name
field. Will return all groups whosename
anddisplay_name
field match any of the text. include_member_count: Boolean which adds themember_count
attribute to each group JSON object not_associated_to_team: Team GUID which is used to return all the groups not associated to this team not_associated_to_channel: Group GUID which is used to return all the groups not associated to this channel since: Only return groups that have been modified since the given Unix timestamp (in milliseconds). All modified groups, including deleted and created groups, will be returned. Minimum server version: 5.24filter_allow_reference: Boolean which filters the group entries with the
allow_reference
attribute set.
- create_group(options)[source]¶
Create a custom group
group: Group object to create. user_ids: The user ids of the group members to add.
- patch_group(group_id, options)[source]¶
Patch a group
group_id: Group GUID name: display_name: description:
- link_group_syncable_for_team(group_id, team_id)[source]¶
Link a team to a group
group_id: Group GUID team_id: Team GUID
Read in Mattermost API docs (groups - LinkGroupSyncableForTeam)
- unlink_group_syncable_for_team(group_id, team_id)[source]¶
Delete a link from a team to a group
group_id: Group GUID team_id: Team GUID
Read in Mattermost API docs (groups - UnlinkGroupSyncableForTeam)
- link_group_syncable_for_channel(group_id, channel_id)[source]¶
Link a channel to a group
group_id: Group GUID channel_id: Channel GUID
Read in Mattermost API docs (groups - LinkGroupSyncableForChannel)
- unlink_group_syncable_for_channel(group_id, channel_id)[source]¶
Delete a link from a channel to a group
group_id: Group GUID channel_id: Channel GUID
Read in Mattermost API docs (groups - UnlinkGroupSyncableForChannel)
- get_group_syncable_for_team_id(group_id, team_id)[source]¶
Get GroupSyncable from Team ID
group_id: Group GUID team_id: Team GUID
Read in Mattermost API docs (groups - GetGroupSyncableForTeamId)
- get_group_syncable_for_channel_id(group_id, channel_id)[source]¶
Get GroupSyncable from channel ID
group_id: Group GUID channel_id: Channel GUID
Read in Mattermost API docs (groups - GetGroupSyncableForChannelId)
- get_group_syncables_teams(group_id)[source]¶
Get group teams
group_id: Group GUID
Read in Mattermost API docs (groups - GetGroupSyncablesTeams)
- get_group_syncables_channels(group_id)[source]¶
Get group channels
group_id: Group GUID
Read in Mattermost API docs (groups - GetGroupSyncablesChannels)
- patch_group_syncable_for_team(group_id, team_id, options)[source]¶
Patch a GroupSyncable associated to Team
group_id: Group GUID team_id: Team GUID auto_add:
Read in Mattermost API docs (groups - PatchGroupSyncableForTeam)
- patch_group_syncable_for_channel(group_id, channel_id, options)[source]¶
Patch a GroupSyncable associated to Channel
group_id: Group GUID channel_id: Channel GUID auto_add:
Read in Mattermost API docs (groups - PatchGroupSyncableForChannel)
- get_group_users(group_id, params=None)[source]¶
Get group users
group_id: Group GUID page: The page to select. per_page: The number of groups per page.
- delete_group_members(group_id, params)[source]¶
Removes members from a custom group
group_id: The ID of the group to delete. user_ids:
- add_group_members(group_id, options)[source]¶
Adds members to a custom group
group_id: The ID of the group. user_ids:
- get_groups_by_channel(channel_id, params=None)[source]¶
Get channel groups
channel_id: Channel GUID page: The page to select. per_page: The number of groups per page. filter_allow_reference: Boolean which filters the group entries with the
allow_reference
attribute set.
- get_groups_by_team(team_id, params=None)[source]¶
Get team groups
team_id: Team GUID page: The page to select. per_page: The number of groups per page. filter_allow_reference: Boolean which filters in the group entries with the
allow_reference
attribute set.
- get_groups_associated_to_channels_by_team(team_id, params=None)[source]¶
Get team groups by channels
team_id: Team GUID page: The page to select. per_page: The number of groups per page. filter_allow_reference: Boolean which filters in the group entries with the
allow_reference
attribute set. paginate: Boolean to determine whether the pagination should be applied or notRead in Mattermost API docs (groups - GetGroupsAssociatedToChannelsByTeam)
Imports¶
Integration Actions¶
- class mattermostautodriver.endpoints.integration_actions.IntegrationActions(client)[source]¶
Bases:
Base
- open_interactive_dialog(options)[source]¶
Open a dialog
trigger_id: Trigger ID provided by other action url: The URL to send the submitted dialog payload to dialog: Post object to create
Read in Mattermost API docs (integration_actions - OpenInteractiveDialog)
- submit_interactive_dialog(options)[source]¶
Submit a dialog
url: The URL to send the submitted dialog payload to channel_id: Channel ID the user submitted the dialog from team_id: Team ID the user submitted the dialog from submission: String map where keys are element names and values are the element input values callback_id: Callback ID sent when the dialog was opened state: State sent when the dialog was opened cancelled: Set to true if the dialog was cancelled
Read in Mattermost API docs (integration_actions - SubmitInteractiveDialog)
Internal¶
- class mattermostautodriver.endpoints.internal.Internal(client)[source]¶
Bases:
Base
- create_playbook_run_from_dialog(options=None)[source]¶
Create a new playbook run from dialog
type: url: callback_id: Callback ID provided by the integration. state: Stringified JSON with the post_id and the client_id. user_id: ID of the user who submitted the dialog. channel_id: ID of the channel the user was in when submitting the dialog. team_id: ID of the team the user was on when submitting the dialog. submission: Map of the dialog fields to their values cancelled: If the dialog was cancelled.
Read in Mattermost API docs (Internal - createPlaybookRunFromDialog)
- get_checklist_autocomplete(params=None)[source]¶
Get autocomplete data for /playbook check
channel_ID: ID of the channel the user is in.
Read in Mattermost API docs (Internal - getChecklistAutocomplete)
- end_playbook_run_dialog(id)[source]¶
End a playbook run from dialog
id: ID of the playbook run to end.
Read in Mattermost API docs (Internal - endPlaybookRunDialog)
Ip¶
- class mattermostautodriver.endpoints.ip.Ip(client)[source]¶
Bases:
Base
- get_ip_filters()[source]¶
Get all IP filters Read in Mattermost API docs (ip - GetIPFilters)
- apply_ip_filters(options)[source]¶
Get all IP filters Read in Mattermost API docs (ip - ApplyIPFilters)
- my_ip()[source]¶
Get all IP filters Read in Mattermost API docs (ip - MyIP)
Jobs¶
- class mattermostautodriver.endpoints.jobs.Jobs(client)[source]¶
Bases:
Base
- get_jobs(params=None)[source]¶
Get the jobs.
page: The page to select. per_page: The number of jobs per page. job_type: The type of jobs to fetch. status: The status of jobs to fetch.
- create_job(options)[source]¶
Create a new job.
type: The type of job to create data: An object containing any additional data required for this job type
- get_jobs_by_type(type, params=None)[source]¶
Get the jobs of the given type.
type: Job type page: The page to select. per_page: The number of jobs per page.
Ldap¶
- class mattermostautodriver.endpoints.ldap.Ldap(client)[source]¶
Bases:
Base
- get_ldap_groups(params=None)[source]¶
Returns a list of LDAP groups
q: Search term page: The page to select. per_page: The number of users per page. per page.
Logs¶
Migrate¶
- class mattermostautodriver.endpoints.migrate.Migrate(client)[source]¶
Bases:
Base
- migrate_auth_to_ldap(options=None)[source]¶
Migrate user accounts authentication type to LDAP.
from: The current authentication type for the matched users. match_field: Foreign user field name to match. force:
Oauth¶
- class mattermostautodriver.endpoints.oauth.Oauth(client)[source]¶
Bases:
Base
- list_outgoing_o_auth_connections(params=None)[source]¶
List all connections
team_id: Current Team ID in integrations backstage
Read in Mattermost API docs (oauth - ListOutgoingOAuthConnections)
- create_outgoing_o_auth_connection(options=None)[source]¶
Create a connection Read in Mattermost API docs (oauth - CreateOutgoingOAuthConnection)
- get_outgoing_o_auth_connection(params=None)[source]¶
Get a connection
team_id: Current Team ID in integrations backstage
Read in Mattermost API docs (oauth - GetOutgoingOAuthConnection)
- update_outgoing_o_auth_connection(options=None)[source]¶
Update a connection Read in Mattermost API docs (oauth - UpdateOutgoingOAuthConnection)
- delete_outgoing_o_auth_connection()[source]¶
Delete a connection Read in Mattermost API docs (oauth - DeleteOutgoingOAuthConnection)
- validate_outgoing_o_auth_connection(options=None)[source]¶
Validate a connection configuration Read in Mattermost API docs (oauth - ValidateOutgoingOAuthConnection)
Outgoing Connections¶
- class mattermostautodriver.endpoints.outgoing_connections.OutgoingConnections(client)[source]¶
Bases:
Base
- list_outgoing_o_auth_connections(params=None)[source]¶
List all connections
team_id: Current Team ID in integrations backstage
Read in Mattermost API docs (outgoing_connections - ListOutgoingOAuthConnections)
- create_outgoing_o_auth_connection(options=None)[source]¶
Create a connection Read in Mattermost API docs (outgoing_connections - CreateOutgoingOAuthConnection)
- get_outgoing_o_auth_connection(params=None)[source]¶
Get a connection
team_id: Current Team ID in integrations backstage
Read in Mattermost API docs (outgoing_connections - GetOutgoingOAuthConnection)
- update_outgoing_o_auth_connection(options=None)[source]¶
Update a connection Read in Mattermost API docs (outgoing_connections - UpdateOutgoingOAuthConnection)
- delete_outgoing_o_auth_connection()[source]¶
Delete a connection Read in Mattermost API docs (outgoing_connections - DeleteOutgoingOAuthConnection)
- validate_outgoing_o_auth_connection(options=None)[source]¶
Validate a connection configuration Read in Mattermost API docs (outgoing_connections - ValidateOutgoingOAuthConnection)
Outgoing Oauth Connections¶
- class mattermostautodriver.endpoints.outgoing_oauth_connections.OutgoingOauthConnections(client)[source]¶
Bases:
Base
- list_outgoing_o_auth_connections(params=None)[source]¶
List all connections
team_id: Current Team ID in integrations backstage
Read in Mattermost API docs (outgoing_oauth_connections - ListOutgoingOAuthConnections)
- create_outgoing_o_auth_connection(options=None)[source]¶
Create a connection Read in Mattermost API docs (outgoing_oauth_connections - CreateOutgoingOAuthConnection)
- get_outgoing_o_auth_connection(params=None)[source]¶
Get a connection
team_id: Current Team ID in integrations backstage
Read in Mattermost API docs (outgoing_oauth_connections - GetOutgoingOAuthConnection)
- update_outgoing_o_auth_connection(options=None)[source]¶
Update a connection Read in Mattermost API docs (outgoing_oauth_connections - UpdateOutgoingOAuthConnection)
- delete_outgoing_o_auth_connection()[source]¶
Delete a connection Read in Mattermost API docs (outgoing_oauth_connections - DeleteOutgoingOAuthConnection)
- validate_outgoing_o_auth_connection(options=None)[source]¶
Validate a connection configuration Read in Mattermost API docs (outgoing_oauth_connections - ValidateOutgoingOAuthConnection)
Permissions¶
Playbookautofollows¶
- class mattermostautodriver.endpoints.playbookautofollows.PlaybookAutofollows(client)[source]¶
Bases:
Base
- get_auto_follows(id)[source]¶
Get the list of followers’ user IDs of a playbook
id: ID of the playbook to retrieve followers from.
Read in Mattermost API docs (PlaybookAutofollows - getAutoFollows)
Playbookruns¶
- class mattermostautodriver.endpoints.playbookruns.PlaybookRuns(client)[source]¶
Bases:
Base
- list_playbook_runs(params=None)[source]¶
List all playbook runs
team_id: ID of the team to filter by. page: Zero-based index of the page to request. per_page: Number of playbook runs to return per page. sort: Field to sort the returned playbook runs by. direction: Direction (ascending or descending) followed by the sorting of the playbook runs. statuses: The returned list will contain only the playbook runs with the specified statuses. owner_user_id: The returned list will contain only the playbook runs commanded by this user. Specify “me” for current user. participant_id: The returned list will contain only the playbook runs for which the given user is a participant. Specify “me” for current user. search_term: The returned list will contain only the playbook runs whose name contains the search term.
Read in Mattermost API docs (PlaybookRuns - listPlaybookRuns)
- create_playbook_run_from_post(options=None)[source]¶
Create a new playbook run
name: The name of the playbook run. description: The description of the playbook run. owner_user_id: The identifier of the user who is commanding the playbook run. team_id: The identifier of the team where the playbook run’s channel is in. post_id: If the playbook run was created from a post, this field contains the identifier of such post. If not, this field is empty. playbook_id: The identifier of the playbook with from which this playbook run was created.
Read in Mattermost API docs (PlaybookRuns - createPlaybookRunFromPost)
- get_channels(params=None)[source]¶
Get playbook run channels
team_id: ID of the team to filter by. sort: Field to sort the returned channels by, according to their playbook run. direction: Direction (ascending or descending) followed by the sorting of the playbook runs associated to the channels. status: The returned list will contain only the channels whose playbook run has this status. owner_user_id: The returned list will contain only the channels whose playbook run is commanded by this user. search_term: The returned list will contain only the channels associated to a playbook run whose name contains the search term. participant_id: The returned list will contain only the channels associated to a playbook run for which the given user is a participant.
- get_playbook_run_by_channel_id(channel_id)[source]¶
Find playbook run by channel ID
channel_id: ID of the channel associated to the playbook run to retrieve.
Read in Mattermost API docs (PlaybookRuns - getPlaybookRunByChannelId)
- update_playbook_run(id, options=None)[source]¶
Update a playbook run
id: ID of the playbook run to retrieve. active_stage: Zero-based index of the stage that will be made active.
Read in Mattermost API docs (PlaybookRuns - updatePlaybookRun)
- get_playbook_run_metadata(id)[source]¶
Get playbook run metadata
id: ID of the playbook run whose metadata will be retrieved.
Read in Mattermost API docs (PlaybookRuns - getPlaybookRunMetadata)
- restart_playbook_run(id)[source]¶
Restart a playbook run
id: ID of the playbook run to restart.
Read in Mattermost API docs (PlaybookRuns - restartPlaybookRun)
- status(id, options=None)[source]¶
Update a playbook run’s status
id: ID of the playbook run to update. message: The status update message. reminder: The number of seconds until the system will send a reminder to the owner to update the status. No reminder will be scheduled if reminder is 0 or omitted.
- change_owner(id, options=None)[source]¶
Update playbook run owner
id: ID of the playbook run whose owner will be changed. owner_id: The user ID of the new owner.
- add_checklist_item(id, checklist, options=None)[source]¶
Add an item to a playbook run’s checklist
id: ID of the playbook run whose checklist will be modified. checklist: Zero-based index of the checklist to modify. title: The title of the checklist item. state: The state of the checklist item. An empty string means that the item is not done. state_modified: The timestamp for the latest modification of the item’s state, formatted as the number of milliseconds since the Unix epoch. It equals 0 if the item was never modified. assignee_id: The identifier of the user that has been assigned to complete this item. If the item has no assignee, this is an empty string. assignee_modified: The timestamp for the latest modification of the item’s assignee, formatted as the number of milliseconds since the Unix epoch. It equals 0 if the item never got an assignee. command: The slash command associated with this item. If the item has no slash command associated, this is an empty string command_last_run: The timestamp for the latest execution of the item’s command, formatted as the number of milliseconds since the Unix epoch. It equals 0 if the command was never executed. description: A detailed description of the checklist item, formatted with Markdown.
Read in Mattermost API docs (PlaybookRuns - addChecklistItem)
- reoder_checklist_item(id, checklist, options=None)[source]¶
Reorder an item in a playbook run’s checklist
id: ID of the playbook run whose checklist will be modified. checklist: Zero-based index of the checklist to modify. item_num: Zero-based index of the item to reorder. new_location: Zero-based index of the new place to move the item to.
Read in Mattermost API docs (PlaybookRuns - reoderChecklistItem)
- item_rename(id, checklist, item, options=None)[source]¶
Update an item of a playbook run’s checklist
id: ID of the playbook run whose checklist will be modified. checklist: Zero-based index of the checklist to modify. item: Zero-based index of the item to modify. title: The new title of the item. command: The new slash command of the item.
- item_delete(id, checklist, item)[source]¶
Delete an item of a playbook run’s checklist
id: ID of the playbook run whose checklist will be modified. checklist: Zero-based index of the checklist to modify. item: Zero-based index of the item to modify.
- item_set_state(id, checklist, item, options=None)[source]¶
Update the state of an item
id: ID of the playbook run whose checklist will be modified. checklist: Zero-based index of the checklist to modify. item: Zero-based index of the item to modify. new_state: The new state of the item.
- item_set_assignee(id, checklist, item, options=None)[source]¶
Update the assignee of an item
id: ID of the playbook run whose item will get a new assignee. checklist: Zero-based index of the checklist whose item will get a new assignee. item: Zero-based index of the item that will get a new assignee. assignee_id: The user ID of the new assignee of the item.
Read in Mattermost API docs (PlaybookRuns - itemSetAssignee)
Playbooks¶
- class mattermostautodriver.endpoints.playbooks.Playbooks(client)[source]¶
Bases:
Base
- get_playbooks(params=None)[source]¶
List all playbooks
team_id: ID of the team to filter by. page: Zero-based index of the page to request. per_page: Number of playbooks to return per page. sort: Field to sort the returned playbooks by title, number of stages or total number of steps. direction: Direction (ascending or descending) followed by the sorting of the playbooks. with_archived: Includes archived playbooks in the result.
- create_playbook(options=None)[source]¶
Create a playbook
title: The title of the playbook. description: The description of the playbook. team_id: The identifier of the team where the playbook is in. create_public_playbook_run: A boolean indicating whether the playbook runs created from this playbook should be public or private. public: A boolean indicating whether the playbook is licensed as public or private. Required ‘true’ for free tier. checklists: The stages defined by this playbook. member_ids: The identifiers of all the users that are members of this playbook. broadcast_channel_ids: The IDs of the channels where all the status updates will be broadcasted. The team of the broadcast channel must be the same as the playbook’s team. invited_user_ids: A list with the IDs of the members to be automatically invited to the playbook run’s channel as soon as the playbook run is created. invite_users_enabled: Boolean that indicates whether the members declared in invited_user_ids will be automatically invited. default_owner_id: User ID of the member that will be automatically assigned as owner as soon as the playbook run is created. If the member is not part of the playbook run’s channel or is not included in the invited_user_ids list, they will be automatically invited to the channel. default_owner_enabled: Boolean that indicates whether the member declared in default_owner_id will be automatically assigned as owner. announcement_channel_id: ID of the channel where the playbook run will be automatically announced as soon as the playbook run is created. announcement_channel_enabled: Boolean that indicates whether the playbook run creation will be announced in the channel declared in announcement_channel_id. webhook_on_creation_url: An absolute URL where a POST request will be sent as soon as the playbook run is created. The allowed protocols are HTTP and HTTPS. webhook_on_creation_enabled: Boolean that indicates whether the webhook declared in webhook_on_creation_url will be automatically sent. webhook_on_status_update_url: An absolute URL where a POST request will be sent as soon as the playbook run’s status is updated. The allowed protocols are HTTP and HTTPS. webhook_on_status_update_enabled: Boolean that indicates whether the webhook declared in webhook_on_status_update_url will be automatically sent.
Plugins¶
- class mattermostautodriver.endpoints.plugins.Plugins(client)[source]¶
Bases:
Base
- upload_plugin(files, data=None)[source]¶
Upload plugin
plugin: The plugin image to be uploaded force: Set to ‘true’ to overwrite a previously installed plugin with the same ID, if any
- get_plugins()[source]¶
Get plugins Read in Mattermost API docs (plugins - GetPlugins)
- install_plugin_from_url()[source]¶
Install plugin from url Read in Mattermost API docs (plugins - InstallPluginFromUrl)
- get_webapp_plugins()[source]¶
Get webapp plugins Read in Mattermost API docs (plugins - GetWebappPlugins)
- get_plugin_statuses()[source]¶
Get plugins status Read in Mattermost API docs (plugins - GetPluginStatuses)
- install_marketplace_plugin(options)[source]¶
Installs a marketplace plugin
id: The ID of the plugin to install. version: The version of the plugin to install.
Read in Mattermost API docs (plugins - InstallMarketplacePlugin)
- get_marketplace_plugins(params=None)[source]¶
Gets all the marketplace plugins
page: Page number to be fetched. (not yet implemented) per_page: Number of item per page. (not yet implemented) filter: Set to filter plugins by ID, name, or description. server_version: Set to filter minimum plugin server version. (not yet implemented) local_only: Set true to only retrieve local plugins.
Read in Mattermost API docs (plugins - GetMarketplacePlugins)
- get_marketplace_visited_by_admin()[source]¶
Get if the Plugin Marketplace has been visited by at least an admin. Read in Mattermost API docs (plugins - GetMarketplaceVisitedByAdmin)
Posts¶
- class mattermostautodriver.endpoints.posts.Posts(client)[source]¶
Bases:
Base
- create_post(options)[source]¶
Create a post
channel_id: The channel ID to post in message: The message contents, can be formatted with Markdown root_id: The post ID to comment on file_ids: A list of file IDs to associate with the post. Note that posts are limited to 5 files maximum. Please use additional posts for more files. props: A general JSON property bag to attach to the post metadata: A JSON object to add post metadata, e.g the post’s priority
- create_post_ephemeral(options)[source]¶
Create a ephemeral post
user_id: The target user id for the ephemeral post post: Post object to create
- get_post(post_id, params=None)[source]¶
Get a post
post_id: ID of the post to get include_deleted: Defines if result should include deleted posts, must have ‘manage_system’ (admin) permission.
- update_post(post_id, options)[source]¶
Update a post
post_id: ID of the post to update id: ID of the post to update is_pinned: Set to
true
to pin the post to the channel it is in message: The message text of the post has_reactions: Set totrue
if the post has reactions to it props: A general JSON property bag to attach to the post
- set_post_unread(user_id, post_id)[source]¶
Mark as unread from a post.
user_id: User GUID post_id: Post GUID
- patch_post(post_id, options)[source]¶
Patch a post
post_id: Post GUID is_pinned: Set to
true
to pin the post to the channel it is in message: The message text of the post file_ids: The list of files attached to this post has_reactions: Set totrue
if the post has reactions to it props: A general JSON property bag to attach to the post
- get_post_thread(post_id, params=None)[source]¶
Get a thread
post_id: ID of a post in the thread perPage: The number of posts per page fromPost: The post_id to return the next page of posts from fromCreateAt: The create_at timestamp to return the next page of posts from direction: The direction to return the posts. Either up or down. skipFetchThreads: Whether to skip fetching threads or not collapsedThreads: Whether the client uses CRT or not collapsedThreadsExtended: Whether to return the associated users as part of the response or not
- get_flagged_posts_for_user(user_id, params=None)[source]¶
Get a list of flagged posts
user_id: ID of the user team_id: Team ID channel_id: Channel ID page: The page to select per_page: The number of posts per page
Read in Mattermost API docs (posts - GetFlaggedPostsForUser)
- get_file_infos_for_post(post_id, params=None)[source]¶
Get file info for post
post_id: ID of the post include_deleted: Defines if result should include deleted posts, must have ‘manage_system’ (admin) permission.
- get_posts_for_channel(channel_id, params=None)[source]¶
Get posts for a channel
channel_id: The channel ID to get the posts for page: The page to select per_page: The number of posts per page since: Provide a non-zero value in Unix time milliseconds to select posts modified after that time before: A post id to select the posts that came before this one after: A post id to select the posts that came after this one include_deleted: Whether to include deleted posts or not. Must have system admin permissions.
- get_posts_around_last_unread(user_id, channel_id, params=None)[source]¶
Get posts around oldest unread
user_id: ID of the user channel_id: The channel ID to get the posts for limit_before: Number of posts before the oldest unread posts. Maximum is 200 posts if limit is set greater than that. limit_after: Number of posts after and including the oldest unread post. Maximum is 200 posts if limit is set greater than that. skipFetchThreads: Whether to skip fetching threads or not collapsedThreads: Whether the client uses CRT or not collapsedThreadsExtended: Whether to return the associated users as part of the response or not
Read in Mattermost API docs (posts - GetPostsAroundLastUnread)
- search_posts(team_id, options)[source]¶
Search for team posts
team_id: Team GUID terms: The search terms as inputed by the user. To search for posts from a user include
from:someusername
, using a user’s username. To search in a specific channel includein:somechannel
, using the channel name (not the display name). is_or_search: Set to true if an Or search should be performed vs an And search. time_zone_offset: Offset from UTC of user timezone for date searches. include_deleted_channels: Set to true if deleted channels should be included in the search. (archived channels) page: The page to select. (Only works with Elasticsearch) per_page: The number of posts per page. (Only works with Elasticsearch)
- do_post_action(post_id, action_id)[source]¶
Perform a post action
post_id: Post GUID action_id: Action GUID
- get_posts_by_ids(options)[source]¶
Get posts by a list of ids Read in Mattermost API docs (posts - getPostsByIds)
- set_post_reminder(user_id, post_id, options)[source]¶
Set a post reminder
user_id: User GUID post_id: Post GUID target_time: Target time for the reminder
- save_acknowledgement_for_post(user_id, post_id)[source]¶
Acknowledge a post
user_id: User GUID post_id: Post GUID
Read in Mattermost API docs (posts - SaveAcknowledgementForPost)
- delete_acknowledgement_for_post(user_id, post_id)[source]¶
Delete a post acknowledgement
user_id: User GUID post_id: Post GUID
Read in Mattermost API docs (posts - DeleteAcknowledgementForPost)
Preferences¶
- class mattermostautodriver.endpoints.preferences.Preferences(client)[source]¶
Bases:
Base
- update_preferences(user_id, options)[source]¶
Save the user’s preferences
user_id: User GUID
Read in Mattermost API docs (preferences - UpdatePreferences)
- delete_preferences(user_id, options)[source]¶
Delete user’s preferences
user_id: User GUID
Read in Mattermost API docs (preferences - DeletePreferences)
- get_preferences_by_category(user_id, category)[source]¶
List a user’s preferences by category
user_id: User GUID category: The category of a group of preferences
Read in Mattermost API docs (preferences - GetPreferencesByCategory)
- get_preferences_by_category_by_name(user_id, category, preference_name)[source]¶
Get a specific user preference
user_id: User GUID category: The category of a group of preferences preference_name: The name of the preference
Read in Mattermost API docs (preferences - GetPreferencesByCategoryByName)
Reactions¶
- class mattermostautodriver.endpoints.reactions.Reactions(client)[source]¶
Bases:
Base
- save_reaction(options)[source]¶
Create a reaction Read in Mattermost API docs (reactions - SaveReaction)
- delete_reaction(user_id, post_id, emoji_name)[source]¶
Remove a reaction from a post
user_id: ID of the user post_id: ID of the post emoji_name: emoji name
- get_bulk_reactions(options)[source]¶
Bulk get the reaction for posts Read in Mattermost API docs (reactions - GetBulkReactions)
Remote Clusters¶
- class mattermostautodriver.endpoints.remote_clusters.RemoteClusters(client)[source]¶
Bases:
Base
- get_remote_clusters(params=None)[source]¶
Get a list of remote clusters.
page: The page to select per_page: The number of remote clusters per page exclude_offline: Exclude offline remote clusters in_channel: Select remote clusters in channel not_in_channel: Select remote clusters not in this channel only_confirmed: Select only remote clusters already confirmed only_plugins: Select only remote clusters that belong to a plugin exclude_plugins: Select only remote clusters that don’t belong to a plugin
Read in Mattermost API docs (remote_clusters - GetRemoteClusters)
- create_remote_cluster(options=None)[source]¶
Create a new remote cluster.
name: display_name: password: The password to use in the invite code. If empty, the server will generate one and it will be part of the response
Read in Mattermost API docs (remote_clusters - CreateRemoteCluster)
- get_remote_cluster(remote_id)[source]¶
Get a remote cluster.
remote_id: Remote Cluster GUID
Read in Mattermost API docs (remote_clusters - GetRemoteCluster)
- patch_remote_cluster(remote_id, options=None)[source]¶
Patch a remote cluster.
remote_id: Remote Cluster GUID display_name: default_team_id: The team where channels from invites are created
Read in Mattermost API docs (remote_clusters - PatchRemoteCluster)
- delete_remote_cluster(remote_id)[source]¶
Delete a remote cluster.
remote_id: Remote Cluster GUID
Read in Mattermost API docs (remote_clusters - DeleteRemoteCluster)
- generate_remote_cluster_invite(options=None)[source]¶
Generate invite code.
password: The password to encrypt the invite code with.
Read in Mattermost API docs (remote_clusters - GenerateRemoteClusterInvite)
- accept_remote_cluster_invite(options=None)[source]¶
Accept a remote cluster invite code.
invite: name: display_name: password: The password to decrypt the invite code.
Read in Mattermost API docs (remote_clusters - AcceptRemoteClusterInvite)
Reports¶
Roles¶
- class mattermostautodriver.endpoints.roles.Roles(client)[source]¶
Bases:
Base
- get_all_roles()[source]¶
Get a list of all the roles Read in Mattermost API docs (roles - GetAllRoles)
- patch_role(role_id, options)[source]¶
Patch a role
role_id: Role GUID permissions: The permissions the role should grant.
- get_roles_by_names(options)[source]¶
Get a list of roles by name Read in Mattermost API docs (roles - GetRolesByNames)
Root¶
Saml¶
- class mattermostautodriver.endpoints.saml.SAML(client)[source]¶
Bases:
Base
- migrate_auth_to_saml(options=None)[source]¶
Migrate user accounts authentication type to SAML.
from: The current authentication type for the matched users. matches: Users map. auto:
- get_saml_metadata()[source]¶
Get metadata Read in Mattermost API docs (SAML - GetSamlMetadata)
- get_saml_metadata_from_idp(options=None)[source]¶
Get metadata from Identity Provider
saml_metadata_url: The URL from which to retrieve the SAML IDP data.
- upload_saml_idp_certificate(files, data=None)[source]¶
Upload IDP certificate
certificate: The IDP certificate file
Read in Mattermost API docs (SAML - UploadSamlIdpCertificate)
- delete_saml_idp_certificate()[source]¶
Remove IDP certificate Read in Mattermost API docs (SAML - DeleteSamlIdpCertificate)
- upload_saml_public_certificate(files, data=None)[source]¶
Upload public certificate
certificate: The public certificate file
Read in Mattermost API docs (SAML - UploadSamlPublicCertificate)
- delete_saml_public_certificate()[source]¶
Remove public certificate Read in Mattermost API docs (SAML - DeleteSamlPublicCertificate)
- upload_saml_private_certificate(files, data=None)[source]¶
Upload private key
certificate: The private key file
Read in Mattermost API docs (SAML - UploadSamlPrivateCertificate)
- delete_saml_private_certificate()[source]¶
Remove private key Read in Mattermost API docs (SAML - DeleteSamlPrivateCertificate)
- get_saml_certificate_status()[source]¶
Get certificate status Read in Mattermost API docs (SAML - GetSamlCertificateStatus)
- reset_saml_auth_data_to_email(options=None)[source]¶
Reset AuthData to Email
include_deleted: Whether to include deleted users. dry_run: If set to true, the number of users who would be affected is returned. user_ids: If set to a non-empty array, then users whose IDs are not in the array will be excluded.
Read in Mattermost API docs (SAML - ResetSamlAuthDataToEmail)
Schemes¶
- class mattermostautodriver.endpoints.schemes.Schemes(client)[source]¶
Bases:
Base
- get_schemes(params=None)[source]¶
Get the schemes.
scope: Limit the results returned to the provided scope, either
team
orchannel
. page: The page to select. per_page: The number of schemes per page.
- create_scheme(options)[source]¶
Create a scheme
name: The name of the scheme description: The description of the scheme scope: The scope of the scheme (“team” or “channel”)
- patch_scheme(scheme_id, options)[source]¶
Patch a scheme
scheme_id: Scheme GUID name: The human readable name of the scheme description: The description of the scheme
- get_teams_for_scheme(scheme_id, params=None)[source]¶
Get a page of teams which use this scheme.
scheme_id: Scheme GUID page: The page to select. per_page: The number of teams per page.
- get_channels_for_scheme(scheme_id, params=None)[source]¶
Get a page of channels which use this scheme.
scheme_id: Scheme GUID page: The page to select. per_page: The number of channels per page.
Read in Mattermost API docs (schemes - GetChannelsForScheme)
Search¶
- class mattermostautodriver.endpoints.search.Search(client)[source]¶
Bases:
Base
- search_files(team_id, data)[source]¶
Search files in a team
team_id: Team GUID terms: The search terms as inputed by the user. To search for files from a user include
from:someusername
, using a user’s username. To search in a specific channel includein:somechannel
, using the channel name (not the display name). To search for specific extensions includedext:extension
. is_or_search: Set to true if an Or search should be performed vs an And search. time_zone_offset: Offset from UTC of user timezone for date searches. include_deleted_channels: Set to true if deleted channels should be included in the search. (archived channels) page: The page to select. (Only works with Elasticsearch) per_page: The number of posts per page. (Only works with Elasticsearch)
Status¶
- class mattermostautodriver.endpoints.status.Status(client)[source]¶
Bases:
Base
- update_user_status(user_id, options)[source]¶
Update user status
user_id: User ID user_id: User ID status: User status, can be
online
,away
,offline
anddnd
dnd_end_time: Time in epoch seconds at which a dnd status would be unset.
- get_users_statuses_by_ids(options)[source]¶
Get user statuses by id Read in Mattermost API docs (status - GetUsersStatusesByIds)
- update_user_custom_status(user_id, options)[source]¶
Update user custom status
user_id: User ID emoji: Any emoji text: Any custom status text duration: Duration of custom status, can be
thirty_minutes
,one_hour
,four_hours
,today
,this_week
ordate_and_time
expires_at: The time at which custom status should be expired. It should be in ISO format.Read in Mattermost API docs (status - UpdateUserCustomStatus)
- unset_user_custom_status(user_id)[source]¶
Unsets user custom status
user_id: User ID
Read in Mattermost API docs (status - UnsetUserCustomStatus)
- remove_recent_custom_status(user_id, params)[source]¶
Delete user’s recent custom status
user_id: User ID emoji: Any emoji text: Any custom status text duration: Duration of custom status, can be
thirty_minutes
,one_hour
,four_hours
,today
,this_week
ordate_and_time
expires_at: The time at which custom status should be expired. It should be in ISO format.Read in Mattermost API docs (status - RemoveRecentCustomStatus)
- post_user_recent_custom_status_delete(user_id, options)[source]¶
Delete user’s recent custom status
user_id: User ID emoji: Any emoji text: Any custom status text duration: Duration of custom status, can be
thirty_minutes
,one_hour
,four_hours
,today
,this_week
ordate_and_time
expires_at: The time at which custom status should be expired. It should be in ISO format.Read in Mattermost API docs (status - PostUserRecentCustomStatusDelete)
System¶
- class mattermostautodriver.endpoints.system.System(client)[source]¶
Bases:
Base
- get_supported_timezone()[source]¶
Retrieve a list of supported timezones Read in Mattermost API docs (system - GetSupportedTimezone)
- get_ping(params=None)[source]¶
Check system health
get_server_status: Check the status of the database and file storage as well device_id: Check whether this device id can receive push notifications use_rest_semantics: Returns 200 status code even if the server status is unhealthy.
- get_notices(teamId, params=None)[source]¶
Get notices for logged in user in specified team
teamId: ID of the team clientVersion: Version of the client (desktop/mobile/web) that issues the request locale: Client locale client: Client type (web/mobile-ios/mobile-android/desktop)
- mark_notices_viewed(options)[source]¶
Update notices as ‘viewed’ Read in Mattermost API docs (system - MarkNoticesViewed)
- database_recycle()[source]¶
Recycle database connections Read in Mattermost API docs (system - DatabaseRecycle)
- test_email(options)[source]¶
Send a test email Read in Mattermost API docs (system - TestEmail)
- test_s3_connection(options)[source]¶
Test AWS S3 connection Read in Mattermost API docs (system - TestS3Connection)
- get_config()[source]¶
Get configuration Read in Mattermost API docs (system - GetConfig)
- update_config(options)[source]¶
Update configuration Read in Mattermost API docs (system - UpdateConfig)
- reload_config()[source]¶
Reload configuration Read in Mattermost API docs (system - ReloadConfig)
- get_client_config(params=None)[source]¶
Get client configuration
format: Must be
old
, other formats not implemented yet
- get_environment_config()[source]¶
Get configuration made through environment variables Read in Mattermost API docs (system - GetEnvironmentConfig)
- patch_config(options)[source]¶
Patch configuration Read in Mattermost API docs (system - PatchConfig)
- upload_license_file(files, data=None)[source]¶
Upload license file
license: The license to be uploaded
- remove_license_file()[source]¶
Remove license file Read in Mattermost API docs (system - RemoveLicenseFile)
- get_client_license(params=None)[source]¶
Get client license
format: Must be
old
, other formats not implemented yet
- request_license_renewal_link()[source]¶
Request the license renewal link Read in Mattermost API docs (system - RequestLicenseRenewalLink)
- request_trial_license(options)[source]¶
Request and install a trial license for your server
users: Number of users requested (20% extra is going to be added)
- get_prev_trial_license()[source]¶
Get last trial license used Read in Mattermost API docs (system - GetPrevTrialLicense)
- get_audits(params=None)[source]¶
Get audits
page: The page to select. per_page: The number of audits per page.
- invalidate_caches()[source]¶
Invalidate all the caches Read in Mattermost API docs (system - InvalidateCaches)
- get_logs(params=None)[source]¶
Get logs
page: The page to select. logs_per_page: The number of logs per page. There is a maximum limit of 10000 logs per page.
- post_log(options)[source]¶
Add log message
level: The error level, ERROR or DEBUG message: Message to send to the server logs
- get_analytics_old(params=None)[source]¶
Get analytics
name: Possible values are “standard”, “bot_post_counts_day”, “post_counts_day”, “user_counts_with_posts_day” or “extra_counts” team_id: The team ID to filter the data by
- set_server_busy()[source]¶
Set the server busy (high load) flag Read in Mattermost API docs (system - SetServerBusy)
- get_server_busy_expires()[source]¶
Get server busy expiry time. Read in Mattermost API docs (system - GetServerBusyExpires)
- clear_server_busy()[source]¶
Clears the server busy (high load) flag Read in Mattermost API docs (system - ClearServerBusy)
- get_image_by_url()[source]¶
Get an image by url Read in Mattermost API docs (system - GetImageByUrl)
- upgrade_to_enterprise()[source]¶
Executes an inplace upgrade from Team Edition to Enterprise Edition Read in Mattermost API docs (system - UpgradeToEnterprise)
- upgrade_to_enterprise_status()[source]¶
Get the current status for the inplace upgrade from Team Edition to Enterprise Edition Read in Mattermost API docs (system - UpgradeToEnterpriseStatus)
- restart_server()[source]¶
Restart the system after an upgrade from Team Edition to Enterprise Edition Read in Mattermost API docs (system - RestartServer)
- check_integrity()[source]¶
Perform a database integrity check Read in Mattermost API docs (system - CheckIntegrity)
- generate_support_packet(params=None)[source]¶
Download a zip file which contains helpful and useful information for troubleshooting your mattermost instance.
basic_server_logs: Specifies whether the server should include or exclude log files. Default value is true.
Minimum server version: 9.8.0
plugin_packets: Specifies plugin identifiers whose content should be included in the Support Packet.
Minimum server version: 9.8.0
Read in Mattermost API docs (system - GenerateSupportPacket)
- update_marketplace_visited_by_admin(options)[source]¶
Stores that the Plugin Marketplace has been visited by at least an admin. Read in Mattermost API docs (system - UpdateMarketplaceVisitedByAdmin)
Teams¶
- class mattermostautodriver.endpoints.teams.Teams(client)[source]¶
Bases:
Base
- create_team(options)[source]¶
Create a team
name: Unique handler for a team, will be present in the team URL display_name: Non-unique UI name for the team type:
'O'
for open,'I'
for invite only
- get_all_teams(params=None)[source]¶
Get teams
page: The page to select. per_page: The number of teams per page. include_total_count: Appends a total count of returned teams inside the response object - ex:
{ "teams": [], "total_count" : 0 }
. exclude_policy_constrained: If set to true, teams which are part of a data retention policy will be excluded. Thesysconsole_read_compliance
permission is required to use this parameter. Minimum server version: 5.35
- update_team(team_id, options)[source]¶
Update a team
team_id: Team GUID id: display_name: description: company_name: allowed_domains: invite_id: allow_open_invite:
- patch_team(team_id, options)[source]¶
Patch a team
team_id: Team GUID display_name: description: company_name: invite_id: allow_open_invite:
- update_team_privacy(team_id, options)[source]¶
Update teams’s privacy
team_id: Team GUID privacy: Team privacy setting: ‘O’ for a public (open) team, ‘I’ for a private (invitation only) team
- search_teams(options)[source]¶
Search teams
term: The search term to match against the name or display name of teams page: The page number to return, if paginated. If this parameter is not present with the
per_page
parameter then the results will be returned un-paged. per_page: The number of entries to return per page, if paginated. If this parameter is not present with thepage
parameter then the results will be returned un-paged. allow_open_invite: Filters results to teams whereallow_open_invite
is set to true or false, excludes group constrained channels if this filter option is passed. If this filter option is not passed then the query will remain unchanged. Minimum server version: 5.28group_constrained: Filters results to teams where
group_constrained
is set to true or false, returns the union of results when used withallow_open_invite
If the filter option is not passed then the query will remain unchanged. Minimum server version: 5.28exclude_policy_constrained: If set to true, only teams which do not have a granular retention policy assigned to them will be returned. The
sysconsole_read_compliance_data_retention
permission is required to use this parameter. Minimum server version: 5.35
- get_team_members(team_id, params=None)[source]¶
Get team members
team_id: Team GUID page: The page to select. per_page: The number of users per page. sort: To sort by Username, set to ‘Username’, otherwise sort is by ‘UserID’ exclude_deleted_users: Excludes deleted users from the results
- add_team_member_from_invite()[source]¶
Add user to team from invite Read in Mattermost API docs (teams - AddTeamMemberFromInvite)
- remove_team_member(team_id, user_id)[source]¶
Remove user from team
team_id: Team GUID user_id: User GUID
- regenerate_team_invite_id(team_id)[source]¶
Regenerate the Invite ID from a Team
team_id: Team GUID
Read in Mattermost API docs (teams - RegenerateTeamInviteId)
- set_team_icon(team_id, files, data=None)[source]¶
Sets the team icon
team_id: Team GUID image: The image to be uploaded
- update_team_member_roles(team_id, user_id, options)[source]¶
Update a team member roles
team_id: Team GUID user_id: User GUID roles:
- update_team_member_scheme_roles(team_id, user_id, options)[source]¶
Update the scheme-derived roles of a team member.
team_id: Team GUID user_id: User GUID scheme_admin: scheme_user:
Read in Mattermost API docs (teams - UpdateTeamMemberSchemeRoles)
- get_teams_unread_for_user(user_id, params=None)[source]¶
Get team unreads for a user
user_id: User GUID exclude_team: Optional team id to be excluded from the results include_collapsed_threads: Boolean to determine whether the collapsed threads should be included or not
- get_team_unread(user_id, team_id)[source]¶
Get unreads for a team
user_id: User GUID team_id: Team GUID
- invite_users_to_team(team_id, options)[source]¶
Invite users to the team by email
team_id: Team GUID
- invite_guests_to_team(team_id, options)[source]¶
Invite guests to the team by email
team_id: Team GUID emails: List of emails channels: List of channel ids message: Message to include in the invite
- invalidate_email_invites()[source]¶
Invalidate active email invitations Read in Mattermost API docs (teams - InvalidateEmailInvites)
- import_team(team_id, files, data=None)[source]¶
Import a Team from other application
team_id: Team GUID file: A file to be uploaded in zip format. filesize: The size of the zip file to be imported. importFrom: String that defines from which application the team was exported to be imported into Mattermost.
- update_team_scheme(team_id, options)[source]¶
Set a team’s scheme
team_id: Team GUID scheme_id: The ID of the scheme.
- team_members_minus_group_members(team_id, params=None)[source]¶
Team members minus group members.
team_id: Team GUID group_ids: A comma-separated list of group ids. page: The page to select. per_page: The number of users per page.
Read in Mattermost API docs (teams - TeamMembersMinusGroupMembers)
- search_files(team_id, data)[source]¶
Search files in a team
team_id: Team GUID terms: The search terms as inputed by the user. To search for files from a user include
from:someusername
, using a user’s username. To search in a specific channel includein:somechannel
, using the channel name (not the display name). To search for specific extensions includedext:extension
. is_or_search: Set to true if an Or search should be performed vs an And search. time_zone_offset: Offset from UTC of user timezone for date searches. include_deleted_channels: Set to true if deleted channels should be included in the search. (archived channels) page: The page to select. (Only works with Elasticsearch) per_page: The number of posts per page. (Only works with Elasticsearch)
Terms Of Service¶
- class mattermostautodriver.endpoints.terms_of_service.TermsOfService(client)[source]¶
Bases:
Base
- register_terms_of_service_action(user_id, options)[source]¶
Records user action when they accept or decline custom terms of service
user_id: User GUID serviceTermsId: terms of service ID on which the user is acting on accepted: true or false, indicates whether the user accepted or rejected the terms of service.
Read in Mattermost API docs (terms_of_service - RegisterTermsOfServiceAction)
- get_user_terms_of_service(user_id)[source]¶
Fetches user’s latest terms of service action if the latest action was for acceptance.
user_id: User GUID
Read in Mattermost API docs (terms_of_service - GetUserTermsOfService)
- get_terms_of_service()[source]¶
Get latest terms of service Read in Mattermost API docs (terms_of_service - GetTermsOfService)
- create_terms_of_service()[source]¶
Creates a new terms of service Read in Mattermost API docs (terms_of_service - CreateTermsOfService)
Threads¶
- class mattermostautodriver.endpoints.threads.Threads(client)[source]¶
Bases:
Base
- get_user_threads(user_id, team_id, params=None)[source]¶
Get all threads that user is following
user_id: The ID of the user. This can also be “me” which will point to the current user. team_id: The ID of the team in which the thread is. since: Since filters the threads based on their LastUpdateAt timestamp. deleted: Deleted will specify that even deleted threads should be returned (For mobile sync). extended: Extended will enrich the response with participant details. page: Page specifies which part of the results to return, by per_page. per_page: The size of the returned chunk of results. totalsOnly: Setting this to true will only return the total counts. threadsOnly: Setting this to true will only return threads.
- get_thread_mention_counts_by_channel(user_id, team_id)[source]¶
Get all unread mention counts from followed threads, per-channel
user_id: The ID of the user. This can also be “me” which will point to the current user. team_id: The ID of the team in which the thread is.
Read in Mattermost API docs (threads - GetThreadMentionCountsByChannel)
- update_threads_read_for_user(user_id, team_id)[source]¶
Mark all threads that user is following as read
user_id: The ID of the user. This can also be “me” which will point to the current user. team_id: The ID of the team in which the thread is.
Read in Mattermost API docs (threads - UpdateThreadsReadForUser)
- update_thread_read_for_user(user_id, team_id, thread_id, timestamp)[source]¶
Mark a thread that user is following read state to the timestamp
user_id: The ID of the user. This can also be “me” which will point to the current user. team_id: The ID of the team in which the thread is. thread_id: The ID of the thread to update timestamp: The timestamp to which the thread’s “last read” state will be reset.
Read in Mattermost API docs (threads - UpdateThreadReadForUser)
- set_thread_unread_by_post_id(user_id, team_id, thread_id, post_id)[source]¶
Mark a thread that user is following as unread based on a post id
user_id: The ID of the user. This can also be “me” which will point to the current user. team_id: The ID of the team in which the thread is. thread_id: The ID of the thread to update post_id: The ID of a post belonging to the thread to mark as unread.
Read in Mattermost API docs (threads - SetThreadUnreadByPostId)
- start_following_thread(user_id, team_id, thread_id)[source]¶
Start following a thread
user_id: The ID of the user. This can also be “me” which will point to the current user. team_id: The ID of the team in which the thread is. thread_id: The ID of the thread to follow
Read in Mattermost API docs (threads - StartFollowingThread)
- stop_following_thread(user_id, team_id, thread_id)[source]¶
Stop following a thread
user_id: The ID of the user. This can also be “me” which will point to the current user. team_id: The ID of the team in which the thread is. thread_id: The ID of the thread to update
Timeline¶
- class mattermostautodriver.endpoints.timeline.Timeline(client)[source]¶
Bases:
Base
- remove_timeline_event(id, event_id)[source]¶
Remove a timeline event from the playbook run
id: ID of the playbook run whose timeline event will be modified. event_id: ID of the timeline event to be deleted
Read in Mattermost API docs (Timeline - removeTimelineEvent)
Uploads¶
- class mattermostautodriver.endpoints.uploads.Uploads(client)[source]¶
Bases:
Base
- create_upload(options)[source]¶
Create an upload
channel_id: The ID of the channel to upload to. filename: The name of the file to upload. file_size: The size of the file to upload in bytes.
- get_upload(upload_id)[source]¶
Get an upload session
upload_id: The ID of the upload session to get.
Usage¶
- class mattermostautodriver.endpoints.usage.Usage(client)[source]¶
Bases:
Base
- get_posts_usage()[source]¶
Get current usage of posts Read in Mattermost API docs (usage - GetPostsUsage)
- get_storage_usage()[source]¶
Get the total file storage usage for the instance in bytes. Read in Mattermost API docs (usage - GetStorageUsage)
Users¶
- class mattermostautodriver.endpoints.users.Users(client)[source]¶
Bases:
Base
- login(options)[source]¶
Login to Mattermost server
id: login_id: token: device_id: ldap_only: password: The password used for email authentication.
- login_by_cws_token(options)[source]¶
Auto-Login to Mattermost server using CWS token
login_id: cws_token:
- logout()[source]¶
Logout from the Mattermost server Read in Mattermost API docs (users - Logout)
- create_user(options)[source]¶
Create a user
email: username: first_name: last_name: nickname: position: timezone: auth_data: Service-specific authentication data, such as email address. auth_service: The authentication service, one of “email”, “gitlab”, “ldap”, “saml”, “office365”, “google”, and “”. password: The password used for email authentication. locale: props: notify_props:
- get_users(params=None)[source]¶
Get users
page: The page to select. per_page: The number of users per page. in_team: The ID of the team to get users for. not_in_team: The ID of the team to exclude users for. Must not be used with “in_team” query parameter. in_channel: The ID of the channel to get users for. not_in_channel: The ID of the channel to exclude users for. Must be used with “in_channel” query parameter. in_group: The ID of the group to get users for. Must have
manage_system
permission. group_constrained: When used withnot_in_channel
ornot_in_team
, returns only the users that are allowed to join the channel or team based on its group constrains. without_team: Whether or not to list users that are not on any team. This option takes precendence overin_team
,in_channel
, andnot_in_channel
. active: Whether or not to list only users that are active. This option cannot be used along with theinactive
option. inactive: Whether or not to list only users that are deactivated. This option cannot be used along with theactive
option. role: Returns users that have this role. sort: Sort is only available in conjunction with certain options below. The paging parameter is also always available.#####
in_team
Can be “”, “last_activity_at” or “create_at”. When left blank, sorting is done by username. Note that when “last_activity_at” is specified, an additional “last_activity_at” field will be returned in the response packet. Minimum server version: 4.0 #####in_channel
Can be “”, “status”. When left blank, sorting is done by username.status
will sort by User’s current status (Online, Away, DND, Offline), then by Username. Minimum server version: 4.7 #####in_group
Can be “”, “display_name”. When left blank, sorting is done by username.display_name
will sort alphabetically by user’s display name. Minimum server version: 7.7roles: Comma separated string used to filter users based on any of the specified system roles
Example:
?roles=system_admin,system_user
will return users that are either system admins or system usersMinimum server version: 5.26
channel_roles: Comma separated string used to filter users based on any of the specified channel roles, can only be used in conjunction with
in_channel
Example:
?in_channel=4eb6axxw7fg3je5iyasnfudc5y&channel_roles=channel_user
will return users that are only channel users and not admins or guestsMinimum server version: 5.26
team_roles: Comma separated string used to filter users based on any of the specified team roles, can only be used in conjunction with
in_team
Example:
?in_team=4eb6axxw7fg3je5iyasnfudc5y&team_roles=team_user
will return users that are only team users and not admins or guestsMinimum server version: 5.26
- permanent_delete_all_users()[source]¶
Permanent delete all users Read in Mattermost API docs (users - PermanentDeleteAllUsers)
- get_users_by_ids(options)[source]¶
Get users by ids Read in Mattermost API docs (users - GetUsersByIds)
- get_users_by_group_channel_ids(options)[source]¶
Get users by group channels ids Read in Mattermost API docs (users - GetUsersByGroupChannelIds)
- get_users_by_usernames(options)[source]¶
Get users by usernames Read in Mattermost API docs (users - GetUsersByUsernames)
- search_users(options)[source]¶
Search users
term: The term to match against username, full name, nickname and email team_id: If provided, only search users on this team not_in_team_id: If provided, only search users not on this team in_channel_id: If provided, only search users in this channel not_in_channel_id: If provided, only search users not in this channel. Must specifiy
team_id
when using this option in_group_id: If provided, only search users in this group. Must havemanage_system
permission. group_constrained: When used withnot_in_channel_id
ornot_in_team_id
, returns only the users that are allowed to join the channel or team based on its group constrains. allow_inactive: Whentrue
, include deactivated users in the results without_team: Set this totrue
if you would like to search for users that are not on a team. This option takes precendence overteam_id
,in_channel_id
, andnot_in_channel_id
. limit: The maximum number of users to return in the resultsAvailable as of server version 5.6. Defaults to ``100`` if not provided or on an earlier server version.
- autocomplete_users(params=None)[source]¶
Autocomplete users
team_id: Team ID channel_id: Channel ID name: Username, nickname first name or last name limit: The maximum number of users to return in each subresult
Available as of server version 5.6. Defaults to ``100`` if not provided or on an earlier server version.
- get_known_users()[source]¶
Get user IDs of known users Read in Mattermost API docs (users - GetKnownUsers)
- get_total_users_stats()[source]¶
Get total count of users in the system Read in Mattermost API docs (users - GetTotalUsersStats)
- get_total_users_stats_filtered(params=None)[source]¶
Get total count of users in the system matching the specified filters
in_team: The ID of the team to get user stats for. in_channel: The ID of the channel to get user stats for. include_deleted: If deleted accounts should be included in the count. include_bots: If bot accounts should be included in the count. roles: Comma separated string used to filter users based on any of the specified system roles
Example:
?roles=system_admin,system_user
will include users that are either system admins or system userschannel_roles: Comma separated string used to filter users based on any of the specified channel roles, can only be used in conjunction with
in_channel
Example:
?in_channel=4eb6axxw7fg3je5iyasnfudc5y&channel_roles=channel_user
will include users that are only channel users and not admins or gueststeam_roles: Comma separated string used to filter users based on any of the specified team roles, can only be used in conjunction with
in_team
Example:
?in_team=4eb6axxw7fg3je5iyasnfudc5y&team_roles=team_user
will include users that are only team users and not admins or guestsRead in Mattermost API docs (users - GetTotalUsersStatsFiltered)
- get_user(user_id)[source]¶
Get a user
user_id: User GUID. This can also be “me” which will point to the current user.
- update_user(user_id, options)[source]¶
Update a user
user_id: User GUID id: email: username: first_name: last_name: nickname: locale: position: timezone: props: notify_props:
- patch_user(user_id, options)[source]¶
Patch a user
user_id: User GUID email: username: first_name: last_name: nickname: locale: position: timezone: props: notify_props:
- get_profile_image(user_id, params=None)[source]¶
Get user’s profile image
user_id: User GUID _: Not used by the server. Clients can pass in the last picture update time of the user to potentially take advantage of caching
- set_profile_image(user_id, files, data=None)[source]¶
Set user’s profile image
user_id: User GUID image: The image to be uploaded
- set_default_profile_image(user_id)[source]¶
Delete user’s profile image
user_id: User GUID
Read in Mattermost API docs (users - SetDefaultProfileImage)
- get_default_profile_image(user_id)[source]¶
Return user’s default (generated) profile image
user_id: User GUID
Read in Mattermost API docs (users - GetDefaultProfileImage)
- reset_password(options)[source]¶
Reset password
code: The recovery code new_password: The new password for the user
- update_user_mfa(user_id, options)[source]¶
Update a user’s MFA
user_id: User GUID activate: Use
true
to activate,false
to deactivate code: The code produced by your MFA client. Required ifactivate
is true
- update_user_password(user_id, options)[source]¶
Update a user’s password
user_id: User GUID current_password: The current password for the user new_password: The new password for the user
- send_password_reset_email(options)[source]¶
Send password reset email
email: The email of the user
Read in Mattermost API docs (users - SendPasswordResetEmail)
- revoke_session(user_id, options)[source]¶
Revoke a user session
user_id: User GUID session_id: The session GUID to revoke.
- attach_device_id(options)[source]¶
Attach mobile device
device_id: Mobile device id. For Android prefix the id with
android:
and Apple withapple:
- verify_user_email_without_token(user_id)[source]¶
Verify user email by ID
user_id: User GUID
Read in Mattermost API docs (users - VerifyUserEmailWithoutToken)
- switch_account_type(options)[source]¶
Switch login method
current_service: The service the user currently uses to login new_service: The service the user will use to login email: The email of the user password: The password used with the current service mfa_code: The MFA code of the current service ldap_id: The LDAP/AD id of the user
- create_user_access_token(user_id, options)[source]¶
Create a user access token
user_id: User GUID description: A description of the token usage
- get_user_access_tokens_for_user(user_id, params=None)[source]¶
Get user access tokens
user_id: User GUID page: The page to select. per_page: The number of tokens per page.
Read in Mattermost API docs (users - GetUserAccessTokensForUser)
- get_user_access_tokens(params=None)[source]¶
Get user access tokens
page: The page to select. per_page: The number of tokens per page.
- revoke_user_access_token(options)[source]¶
Revoke a user access token
token_id: The user access token GUID to revoke
- disable_user_access_token(options)[source]¶
Disable personal access token
token_id: The personal access token GUID to disable
Read in Mattermost API docs (users - DisableUserAccessToken)
- enable_user_access_token(options)[source]¶
Enable personal access token
token_id: The personal access token GUID to enable
- search_user_access_tokens(options)[source]¶
Search tokens
term: The search term to match against the token id, user id or username.
Read in Mattermost API docs (users - SearchUserAccessTokens)
- update_user_auth(user_id, options)[source]¶
Update a user’s authentication method
user_id: User GUID
- register_terms_of_service_action(user_id, options)[source]¶
Records user action when they accept or decline custom terms of service
user_id: User GUID serviceTermsId: terms of service ID on which the user is acting on accepted: true or false, indicates whether the user accepted or rejected the terms of service.
Read in Mattermost API docs (users - RegisterTermsOfServiceAction)
- get_user_terms_of_service(user_id)[source]¶
Fetches user’s latest terms of service action if the latest action was for acceptance.
user_id: User GUID
- revoke_sessions_from_all_users()[source]¶
Revoke all sessions from all users. Read in Mattermost API docs (users - RevokeSessionsFromAllUsers)
- publish_user_typing(user_id, options=None)[source]¶
Publish a user typing websocket event.
user_id: User GUID channel_id: The id of the channel to which to direct the typing event. parent_id: The optional id of the root post of the thread to which the user is replying. If unset, the typing event is directed at the entire channel.
- get_uploads_for_user(user_id)[source]¶
Get uploads for a user
user_id: The ID of the user. This can also be “me” which will point to the current user.
- get_channel_members_with_team_data_for_user(user_id, params=None)[source]¶
Get all channel members from all teams for a user
user_id: The ID of the user. This can also be “me” which will point to the current user. page: Page specifies which part of the results to return, by perPage. per_page: The size of the returned chunk of results.
Read in Mattermost API docs (users - GetChannelMembersWithTeamDataForUser)
- migrate_auth_to_ldap(options=None)[source]¶
Migrate user accounts authentication type to LDAP.
from: The current authentication type for the matched users. match_field: Foreign user field name to match. force:
- migrate_auth_to_saml(options=None)[source]¶
Migrate user accounts authentication type to SAML.
from: The current authentication type for the matched users. matches: Users map. auto:
- get_users_with_invalid_emails(params=None)[source]¶
Get users with invalid emails
page: The page to select. per_page: The number of users per page.
Read in Mattermost API docs (users - GetUsersWithInvalidEmails)
- convert_bot_to_user(bot_user_id, options)[source]¶
Convert a bot into a user
bot_user_id: Bot user ID email: username: password: first_name: last_name: nickname: locale: position: props: notify_props:
- get_users_for_reporting(params=None)[source]¶
Get a list of paged and sorted users for admin reporting purposes
sort_column: The column to sort the users by. Must be one of (“CreateAt”, “Username”, “FirstName”, “LastName”, “Nickname”, “Email”) or the API will return an error. direction: The direction in which to accept paging values from. Will return values ahead of the cursor if “up”, and below the cursor if “down”. Default is “down”. sort_direction: The sorting direction. Must be one of (“asc”, “desc”). Will default to ‘asc’ if not specified or the input is invalid. page_size: The maximum number of users to return. from_column_value: The value of the sorted column corresponding to the cursor to read from. Should be blank for the first page asked for. from_id: The value of the user id corresponding to the cursor to read from. Should be blank for the first page asked for. date_range: The date range of the post statistics to display. Must be one of (“last30days”, “previousmonth”, “last6months”, “alltime”). Will default to ‘alltime’ if the input is not valid. role_filter: Filter users by their role. team_filter: Filter users by a specified team ID. has_no_team: If true, show only users that have no team. Will ignore provided “team_filter” if true. hide_active: If true, show only users that are inactive. Cannot be used at the same time as “hide_inactive” hide_inactive: If true, show only users that are active. Cannot be used at the same time as “hide_active” search_term: A filtering search term that allows filtering by Username, FirstName, LastName, Nickname or Email
- get_user_count_for_reporting(params=None)[source]¶
Gets the full count of users that match the filter.
role_filter: Filter users by their role. team_filter: Filter users by a specified team ID. has_no_team: If true, show only users that have no team. Will ignore provided “team_filter” if true. hide_active: If true, show only users that are inactive. Cannot be used at the same time as “hide_inactive” hide_inactive: If true, show only users that are active. Cannot be used at the same time as “hide_active” search_term: A filtering search term that allows filtering by Username, FirstName, LastName, Nickname or Email
Read in Mattermost API docs (users - GetUserCountForReporting)
- get_server_limits()[source]¶
Gets the server limits for the server Read in Mattermost API docs (users - GetServerLimits)
Webhooks¶
- class mattermostautodriver.endpoints.webhooks.Webhooks(client)[source]¶
Bases:
Base
- create_incoming_webhook(options)[source]¶
Create an incoming webhook
channel_id: The ID of a public channel or private group that receives the webhook payloads. user_id: The ID of the owner of the webhook if different than the requester. Required for [local mode](https://docs.mattermost.com/administration/mmctl-cli-tool.html#local-mode). display_name: The display name for this incoming webhook description: The description for this incoming webhook username: The username this incoming webhook will post as. icon_url: The profile picture this incoming webhook will use when posting.
Read in Mattermost API docs (webhooks - CreateIncomingWebhook)
- get_incoming_webhooks(params=None)[source]¶
List incoming webhooks
page: The page to select. per_page: The number of hooks per page. team_id: The ID of the team to get hooks for. include_total_count: Appends a total count of returned hooks inside the response object - ex:
{ "incoming_webhooks": [], "total_count": 0 }
.Read in Mattermost API docs (webhooks - GetIncomingWebhooks)
- delete_incoming_webhook(hook_id)[source]¶
Delete an incoming webhook
hook_id: Incoming webhook GUID
Read in Mattermost API docs (webhooks - DeleteIncomingWebhook)
- update_incoming_webhook(hook_id, options)[source]¶
Update an incoming webhook
hook_id: Incoming Webhook GUID id: Incoming webhook GUID channel_id: The ID of a public channel or private group that receives the webhook payloads. display_name: The display name for this incoming webhook description: The description for this incoming webhook username: The username this incoming webhook will post as. icon_url: The profile picture this incoming webhook will use when posting.
Read in Mattermost API docs (webhooks - UpdateIncomingWebhook)
- create_outgoing_webhook(options)[source]¶
Create an outgoing webhook
team_id: The ID of the team that the webhook watchs channel_id: The ID of a public channel that the webhook watchs creator_id: The ID of the owner of the webhook if different than the requester. Required in [local mode](https://docs.mattermost.com/administration/mmctl-cli-tool.html#local-mode). description: The description for this outgoing webhook display_name: The display name for this outgoing webhook trigger_words: List of words for the webhook to trigger on trigger_when: When to trigger the webhook,
0
when a trigger word is present at all and1
if the message starts with a trigger word callback_urls: The URLs to POST the payloads to when the webhook is triggered content_type: The format to POST the data in, eitherapplication/json
orapplication/x-www-form-urlencoded
Read in Mattermost API docs (webhooks - CreateOutgoingWebhook)
- get_outgoing_webhooks(params=None)[source]¶
List outgoing webhooks
page: The page to select. per_page: The number of hooks per page. team_id: The ID of the team to get hooks for. channel_id: The ID of the channel to get hooks for.
Read in Mattermost API docs (webhooks - GetOutgoingWebhooks)
- delete_outgoing_webhook(hook_id)[source]¶
Delete an outgoing webhook
hook_id: Outgoing webhook GUID
Read in Mattermost API docs (webhooks - DeleteOutgoingWebhook)
- update_outgoing_webhook(hook_id, options)[source]¶
Update an outgoing webhook
hook_id: outgoing Webhook GUID id: Outgoing webhook GUID channel_id: The ID of a public channel or private group that receives the webhook payloads. display_name: The display name for this incoming webhook description: The description for this incoming webhook
Read in Mattermost API docs (webhooks - UpdateOutgoingWebhook)
- regen_outgoing_hook_token(hook_id)[source]¶
Regenerate the token for the outgoing webhook.
hook_id: Outgoing webhook GUID
Read in Mattermost API docs (webhooks - RegenOutgoingHookToken)