NAME

WebService::Mattermost::V4::API::Resource::Post - Wrapped API methods for the post API endpoints.

VERSION

version 0.29

DESCRIPTION

USAGE

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;

METHODS

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.

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()

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');

AUTHOR

Mike Jones <mike@netsplit.org.uk>

COPYRIGHT AND LICENSE

This software is Copyright (c) 2020 by Mike Jones.

This is free software, licensed under:

The MIT (X11) License