mattermost-api-50200.11.0: Client API for Mattermost chat system
Safe HaskellNone
LanguageHaskell2010

Network.Mattermost.Endpoints

Synopsis

Documentation

Endpoints

Brand

Channels

mmGetChannelMembersForUser :: UserParam -> TeamId -> Session -> IO (Seq ChannelMember) Source #

Get all channel members on a team for a user.

Permissions: Logged in as the user and view_team permission for the team. Having manage_system permission voids the previous requirements.

mmGetChannelsForUser :: UserParam -> TeamId -> Session -> IO (Seq Channel) Source #

Get all the channels on a team for a user.

Permissions: Logged in as the user, or have edit_other_users permission, and view_team permission for the team.

mmViewChannel :: UserParam -> ChannelId -> Maybe ChannelId -> Session -> IO () Source #

Perform all the actions involved in viewing a channel. This includes marking channels as read, clearing push notifications, and updating the active channel.

Permissions: Must be logged in as user or have edit_other_users permission.

mmCreateGroupMessageChannel :: Seq UserId -> Session -> IO Channel Source #

Create a new group message channel to group of users. If the logged in user's id is not included in the list, it will be appended to the end.

Permissions: Must have create_group_channel permission.

mmGetUnreadMessages :: UserParam -> ChannelId -> Session -> IO ChannelUnread Source #

Get the total unread messages and mentions for a channel for a user.

Permissions: Must be logged in as user and have the read_channel permission, or have edit_other_usrs permission.

mmGetListOfChannelsByIds :: TeamId -> Seq ChannelId -> Session -> IO (Seq Channel) Source #

Get a list of public channels on a team by id.

Permissions: view_team for the team the channels are on.

mmPatchChannel :: ChannelId -> ChannelPatch -> Session -> IO Channel Source #

Partially update a channel by providing only the fields you want to update. Omitted fields will not be updated. The fields that can be updated are defined in the request body, all other provided fields will be ignored.

Permissions: If updating a public channel, manage_public_channel_members permission is required. If updating a private channel, manage_private_channel_members permission is required.

mmCreateDirectMessageChannel :: (UserId, UserId) -> Session -> IO Channel Source #

Create a new direct message channel between two users.

Permissions: Must be one of the two users and have create_direct_channel permission. Having the manage_system permission voids the previous requirements.

mmGetChannelPinnedPosts :: ChannelId -> Session -> IO Posts Source #

Get a list of pinned posts for channel.

mmGetChannelStatistics :: ChannelId -> Session -> IO ChannelStats Source #

Get statistics for a channel.

Permissions: Must have the read_channel permission.

mmUpdateChannelNotifications :: ChannelId -> UserId -> ChannelNotifyProps -> Session -> IO () Source #

Update a user's notification properties for a channel.

Permissions: Must be logged in as the user or have edit_other_users permission.

mmAddUser :: ChannelId -> MinChannelMember -> Session -> IO ChannelMember Source #

Add a user to the channel.

mmCreateChannel :: MinChannel -> Session -> IO Channel Source #

Create a new channel.

Permissions: If creating a public channel, create_public_channel permission is required. If creating a private channel, create_private_channel permission is required.

mmGetChannelByName :: TeamId -> Text -> Session -> IO Channel Source #

Gets channel from the provided team id and channel name strings.

Permissions: read_channel permission for the channel.

mmGetChannel :: ChannelId -> Session -> IO Channel Source #

Get channel from the provided channel id string.

Permissions: read_channel permission for the channel.

mmDeleteChannel :: ChannelId -> Session -> IO () Source #

Delete a channel based from provided channel id string.

Permissions: delete_public_channel permission if the channel is public,

delete_private_channel permission if the channel is private,

or have manage_system permission.

mmGetChannelMember :: ChannelId -> UserParam -> Session -> IO ChannelMember Source #

Get a channel member.

Permissions: read_channel permission for the channel.

mmRemoveUserFromChannel :: ChannelId -> UserParam -> Session -> IO () Source #

Delete a channel member, effectively removing them from a channel.

Permissions: manage_public_channel_members permission if the channel is public.

manage_private_channel_members permission if the channel is private.

Cluster

Commands

mmExecuteCommand :: MinCommand -> Session -> IO CommandResponse Source #

Execute a command on a team.

Permissions: Must have use_slash_commands permission for the team the command is in.

Compliance

Elasticsearch

Emoji

mmSearchCustomEmoji :: Text -> Session -> IO [Emoji] Source #

Search custom emoji using an infix match. (Does not support the prefix_only option).

Permissions: Must be authenticated.

mmGetListOfCustomEmoji :: Maybe Integer -> Maybe Integer -> Session -> IO [Emoji] Source #

Get a page of metadata for custom emoji on the system.

Permissions: Must be authenticated.

Files

mmGetFile :: FileId -> Session -> IO ByteString Source #

Gets a file that has been uploaded previously.

Permissions: Must have read_channel permission or be uploader of the file.

mmUploadFile :: ChannelId -> String -> ByteString -> Session -> IO UploadResponse Source #

Uploads a file that can later be attached to a post.

Permissions: Must have upload_file permission.

mmGetMetadataForFile :: FileId -> Session -> IO FileInfo Source #

Gets a file's info.

Permissions: Must have read_channel permission or be uploader of the file.

Jobs

LDAP

OAuth

Posts

mmCreatePost :: RawPost -> Session -> IO Post Source #

Create a new post in a channel. To create the post as a comment on another post, provide root_id.

Permissions: Must have create_post permission for the channel the post is being created in.

mmSearchForTeamPosts :: TeamId -> SearchPosts -> Session -> IO Posts Source #

Search posts in the team and from the provided terms string.

Permissions: Must be authenticated and have the view_team permission.

mmPinPostToChannel :: PostId -> Session -> IO StatusOK Source #

Pin a post to a channel it is in based from the provided post id string.

Permissions: Must be authenticated and have the read_channel permission to the channel the post is in.

mmGetThread :: PostId -> Session -> IO Posts Source #

Get a post and the rest of the posts in the same thread.

Permissions: Must have read_channel permission for the channel the post is in or if the channel is public, have the read_public_channels permission for the team.

mmUpdatePost :: PostId -> PostUpdate -> Session -> IO Post Source #

Update a post. Only the fields listed below are updatable, omitted fields will be treated as blank.

Permissions: Must have edit_post permission for the channel the post is in.

mmGetPost :: PostId -> Session -> IO Post Source #

Get a single post.

Permissions: Must have read_channel permission for the channel the post is in or if the channel is public, have the read_public_channels permission for the team.

mmDeletePost :: PostId -> Session -> IO () Source #

Soft deletes a post, by marking the post as deleted in the database. Soft deleted posts will not be returned in post queries.

Permissions: Must be logged in as the user or have delete_others_posts permission.

mmGetListOfFlaggedPosts :: UserParam -> FlaggedPostsQuery -> Session -> IO Posts Source #

Get a page of flagged posts of a user provided user id string. Selects from a channel, team or all flagged posts by a user.

Permissions: Must be user or have manage_system permission.

mmUnpinPostToChannel :: PostId -> Session -> IO StatusOK Source #

Unpin a post to a channel it is in based from the provided post id string.

Permissions: Must be authenticated and have the read_channel permission to the channel the post is in.

mmPatchPost :: PostId -> PostUpdate -> Session -> IO Post Source #

Partially update a post by providing only the fields you want to update. Omitted fields will not be updated. The fields that can be updated are defined in the request body, all other provided fields will be ignored.

Permissions: Must have the edit_post permission.

mmGetPostsForChannel :: ChannelId -> PostQuery -> Session -> IO Posts Source #

Get a page of posts in a channel. Use the query parameters to modify the behaviour of this endpoint. The parameters since, before and after must not be used together.

Permissions: Must have read_channel permission for the channel.

Preferences

mmGetSpecificUserPreference :: UserParam -> Text -> Text -> Session -> IO Preference Source #

Gets a single preference for the current user with the given category and name.

Permissions: Must be logged in as the user being updated or have the edit_other_users permission.

mmSaveUsersPreferences :: UserParam -> Seq Preference -> Session -> IO () Source #

Save a list of the user's preferences.

Permissions: Must be logged in as the user being updated or have the edit_other_users permission.

mmGetUsersPreferences :: UserParam -> Session -> IO (Seq Preference) Source #

Get a list of the user's preferences.

Permissions: Must be logged in as the user being updated or have the edit_other_users permission.

mmDeleteUsersPreferences :: UserParam -> Seq Preference -> Session -> IO () Source #

Delete a list of the user's preferences.

Permissions: Must be logged in as the user being updated or have the edit_other_users permission.

mmListUsersPreferencesByCategory :: UserParam -> Text -> Session -> IO (Seq Preference) Source #

Lists the current user's stored preferences in the given category.

Permissions: Must be logged in as the user being updated or have the edit_other_users permission.

Reactions

SAML

Statuses

System

mmGetClientConfiguration :: Maybe Text -> Session -> IO ClientConfig Source #

Get a subset of the server configuration needed by the client.

Permissions: No permission required.

mmUpdateConfiguration :: ServerConfig -> Session -> IO ServerConfig Source #

Submit a new configuration for the server to use.

Permissions: Must have manage_system permission.

mmGetConfiguration :: Session -> IO ServerConfig Source #

Retrieve the current server configuration

Permissions: Must have manage_system permission.

Teams

mmGetTeamMember :: TeamId -> UserParam -> Session -> IO TeamMember Source #

Get a team member on the system.

Permissions: Must be authenticated and have the view_team permission.

mmRemoveUserFromTeam :: TeamId -> UserParam -> Session -> IO () Source #

Delete the team member object for a user, effectively removing them from a team.

Permissions: Must be logged in as the user or have the remove_user_from_team permission.

mmGetPublicChannels :: TeamId -> Maybe Int -> Maybe Int -> Session -> IO (Seq Channel) Source #

Get a page of public channels on a team based on query string parameters - page and per_page.

Permissions: Must be authenticated and have the list_team_channels permission.

mmCreateTeam :: TeamsCreate -> Session -> IO Team Source #

Create a new team on the system.

Permissions: Must be authenticated and have the create_team permission.

mmGetTeams :: Maybe Integer -> Maybe Integer -> Session -> IO (Seq Team) Source #

For regular users only returns open teams. Users with the "manage_system" permission will return teams regardless of type. The result is based on query string parameters - page and per_page.

Permissions: Must be authenticated. "manage_system" permission is required to show all teams.

mmSearchTeams :: Text -> Session -> IO (Seq Team) Source #

Search teams based on search term provided in the request body.

Permissions: Logged in user only shows open teams

Logged in user with "manage_system" permission shows all teams

mmSearchChannels :: TeamId -> Text -> Session -> IO (Seq Channel) Source #

Search public channels on a team based on the search term provided in the request body.

Permissions: Must have the list_team_channels permission.

mmGetUsersTeams :: UserParam -> Session -> IO (Seq Team) Source #

Get a list of teams that a user is on.

Permissions: Must be authenticated as the user or have the manage_system permission.

mmGetTeamMembersByIds :: TeamId -> Seq UserId -> Session -> IO (Seq TeamMember) Source #

Get a list of team members based on a provided array of user ids.

Permissions: Must have view_team permission for the team.

mmGetTeamMembersForUser :: UserParam -> Session -> IO (Seq TeamMember) Source #

Get a list of team members for a user. Useful for getting the ids of teams the user is on and the roles they have in those teams.

Permissions: Must be logged in as the user or have the edit_other_users permission.

mmAddUserToTeam :: TeamId -> TeamMember -> Session -> IO TeamMember Source #

Add user to the team by user_id.

Permissions: Must be authenticated and team be open to add self. For adding another user, authenticated user must have the add_user_to_team permission.

mmGetTeamByName :: Text -> Session -> IO Team Source #

Get a team based on provided name string

Permissions: Must be authenticated, team type is open and have the view_team permission.

mmGetTeam :: TeamId -> Session -> IO Team Source #

Get a team on the system.

Permissions: Must be authenticated and have the view_team permission.

Users

mmSearchUsers :: UserSearch -> Session -> IO (Seq User) Source #

Get a list of users based on search criteria provided in the request body. Searches are typically done against username, full name, nickname and email unless otherwise configured by the server.

Permissions: Requires an active session and read_channel and/or view_team permissions for any channels or teams specified in the request body.

mmGetUsersByUsernames :: Seq Text -> Session -> IO (Seq User) Source #

Get a list of users based on a provided list of usernames. The input usernames must be usernames without sigils (@).

Permissions: Requires an active session but no other permissions.

mmUpdateUsersRoles :: UserId -> Text -> Session -> IO () Source #

Update a user's system-level roles. Valid user roles are "system_user", "system_admin" or both of them. Overwrites any previously assigned system-level roles.

Permissions: Must have the manage_roles permission.

mmGetUsersByIds :: Seq UserId -> Session -> IO (Seq User) Source #

Get a list of users based on a provided list of user ids.

Permissions: Requires an active session but no other permissions.

mmGetUser :: UserParam -> Session -> IO User Source #

Get a user a object. Sensitive information will be sanitized out.

Permissions: Requires an active session but no other permissions.

mmDeactivateUserAccount :: UserParam -> Session -> IO () Source #

Deactivates the user by archiving its user object.

Permissions: Must be logged in as the user being deactivated or have the edit_other_users permission.

mmCreateUser :: UsersCreate -> Session -> IO User Source #

Create a new user on the system.

Permissions: No permission required but user creation can be controlled by server configuration.

mmGetUsers :: UserQuery -> Session -> IO (Seq User) Source #

Get a page of a list of users. Based on query string parameters, select users from a team, channel, or select users not in a specific channel.

Since server version 4.0, some basic sorting is available using the sort query parameter. Sorting is currently only supported when selecting users on a team.

Permissions: Requires an active session and (if specified) membership to the channel or team being selected from.

mmAutocompleteUsers :: Maybe TeamId -> Maybe ChannelId -> Text -> Session -> IO UserAutocomplete Source #

Get a list of users for the purpose of autocompleting based on the provided search term. Specify a combination of team_id and channel_id to filter results further.

Permissions: Requires an active session and view_team and read_channel on any teams or channels used to filter the results further.

mmAutocompleteChannels :: TeamId -> Text -> Session -> IO (Seq Channel) Source #

Get a list of channels for the purpose of autocompleting based on the provided search term.

Webhooks

User Statuses

data Emoji Source #

Constructors

Emoji 

Fields

Instances

Instances details
Eq Emoji Source # 
Instance details

Defined in Network.Mattermost.Endpoints

Methods

(==) :: Emoji -> Emoji -> Bool #

(/=) :: Emoji -> Emoji -> Bool #

Read Emoji Source # 
Instance details

Defined in Network.Mattermost.Endpoints

Show Emoji Source # 
Instance details

Defined in Network.Mattermost.Endpoints

Methods

showsPrec :: Int -> Emoji -> ShowS #

show :: Emoji -> String #

showList :: [Emoji] -> ShowS #

ToJSON Emoji Source # 
Instance details

Defined in Network.Mattermost.Endpoints

FromJSON Emoji Source # 
Instance details

Defined in Network.Mattermost.Endpoints

Helpers

mmFlagPost :: UserId -> PostId -> Session -> IO () Source #

Add a post to a user's flagged post list. This is a convenience wrapper for the mmSaveUsersPreferences function.

Permissions: Must be logged in as the user being updated or have the edit_other_users permission.

mmUnflagPost :: UserId -> PostId -> Session -> IO () Source #

Remove a post from a user's flagged post list. This is a convenience wrapper for the mmSaveUsersPreferences function.

Permissions: Must be logged in as the user being updated or have the edit_other_users permission.