NAME
WebService::Mattermost - Perl client library for Mattermost's REST API and websocket gateway
VERSION
version 0.30
DESCRIPTION
WebService::Mattermost provides websocket and REST API integrations for Mattermost, and supercedes Net::Mattermost::Bot
, replacing all functionality.
See the repository for more information.
SYNOPSIS
See WebService::Mattermost::V4::API for all available API integrations.
use WebService::Mattermost;
my $mm = WebService::Mattermost->new({
# Required
base_url => 'https://my.mattermost.server.com/api/v4/',
# Optional
authenticate => 1, # Trigger a "login" to the Mattermost server
debug => 1, # Debug via Mojo::Log
username => 'MyUsername', # Login credentials for the server
password => 'MyPassword',
});
# Example REST API calls
my $emojis = $mm->api->emoji->custom;
my $user = $mm->api->users->search_by_email('someone@somewhere.com');
Where appropriate, a response object or list of objects may be returned. You can access these via (using the custom emoji search above as an example):
# First item only
my $item = $emojis->item;
# All items
my $items = $emoji->items;
METHODS
This class has no public methods.
ATTRIBUTES
base_url
-
The base URL of your Mattermost server. Should contain the
/api/v4/
section. username
-
An optional username for logging into Mattermost.
password
-
An optional password for logging into Mattermost.
authenticate
-
If this value is true, an authentication attempt will be made against your Mattermost server.
auth_token
-
Set after a successful login and used for authentication for the successive API calls.
api
-
A containing class for the available resources for API version 4.
SEE ALSO
- Bug tracker and source
- https://api.mattermost.com/
-
Plain Mattermost API documentation.
- WebService::Mattermost::V4::API
-
Containing object for resources for version 4 of the Mattermost REST API. Accessible from this class via the
api
attribute.
AUTHOR
Mike Jones <mike@netsplit.org.uk>
COPYRIGHT AND LICENSE
This software is Copyright (c) 2023 by Mike Jones.
This is free software, licensed under:
The MIT (X11) License