WebService::Mattermost::V4::API::Resource::Post
use WebService::Mattermost; my $mm = WebService::Mattermost->new({ authenticate => 1, username => 'email@address.com', password => 'passwordhere', base_url => 'https://my.mattermost.server.com/api/v4/', }); my $resource = $mm->api->post;
get()
Get a post
my $response = $resource->get('ID-HERE');
delete()
Delete a post
my $response = $resource->delete('ID-HERE');
update()
Update a post
Fields not sent will be treated as blank (and unset). Use patch() for updating individual fields.
patch()
my $response = $resource->update('ID-HERE', { # Optional parameters: is_pinned => \0, # or \1 for true message => '...', file_ids => [ '...' ], has_reactions => \0, # or \1 for true props => {}, });
Patch a post
my $response = $resource->patch('ID-HERE', { # Optional parameters: is_pinned => \0, # or \1 for true message => '...', file_ids => [ '...' ], has_reactions => \0, # or \1 for true props => {}, });
thread()
Get a thread
my $response = $resource->thread('ID-HERE');
files()
Get file info for post
my $response = $resource->files('ID-HERE');
pin()
Pin a post to the channel
my $response = $resource->pin('ID-HERE');
unpin()
Unpin a post from the channel
my $response = $resource->unpin('ID-HERE');
reactions()
Get a list of reactions to a post
my $response = $resource->reactions('ID-HERE');
perform_action()
Perform a post action
my $response = $resource->perform_action('POST-ID-HERE', 'REACTION-ID-HERE');
Mike Jones email:mike@netsplit.org.uk
To install WebService::Mattermost, copy and paste the appropriate command in to your terminal.
cpanm
cpanm WebService::Mattermost
CPAN shell
perl -MCPAN -e shell install WebService::Mattermost
For more information on module installation, please visit the detailed CPAN module installation guide.