mattermost_api 0.1.2 copy "mattermost_api: ^0.1.2" to clipboard
mattermost_api: ^0.1.2 copied to clipboard

outdated

An implementation of the Mattermost API as of 4.0.0.

example/mattermost_api_example.dart

import 'dart:convert';
import 'package:mattermost_api/api.dart';

void debug(Object s) {
  var enc = JsonEncoder.withIndent('  ');
  print(enc.convert(s));
}

void main() async {
  late MattermostApiClient client;
  client = MattermostApiClient(
    basePath: 'https://your-server.tld/api/v4',
    authentication: MattermostOAuth(accessToken: 'YOUR TOKEN'),
  );
  client = MattermostApiClient(
    basePath: 'https://your-server.tld/api/v4',
    authentication: MattermostHttpBasicAuthentication(
      username: 'USERNAME',
      password: 'PASSWORD',
    ),
  );
  client = MattermostApiClient(
    basePath: 'https://your-server.tld/api/v4',
    authentication: MattermostApiKeyAuthentication(
      HttpLocation.query,
      'PARAM_NAME',
      'API_KEY',
      apiKeyPrefix: 'PREFIX',
    ),
  );
  client = MattermostApiClient(
    basePath: 'https://your-server.tld/api/v4',
    authentication: MattermostHttpBearerAuthentication('YOUR TOKEN'),
  );
  client = MattermostApiClient(
    basePath: 'https://your-server.tld/api/v4',
    authentication: MattermostHttpBearerAuthentication(() => 'ACCESS TOKEN FROM FUNCTION'),
  );

  client.channels.getChannel('1234567');
}
3
likes
0
pub points
47%
popularity

Publisher

verified publisherjeffmikels.com

An implementation of the Mattermost API as of 4.0.0.

Homepage
Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

http

More

Packages that depend on mattermost_api