HubSpot/slack-client

Name: slack-client

Owner: HubSpot

Description: An asynchronous HTTP client for Slack's web API

Created: 2018-03-13 16:04:25.0

Updated: 2018-05-20 17:43:51.0

Pushed: 2018-05-20 17:43:52.0

Homepage:

Size: 219

Language: Java

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

slack-client

license GitHub last commit Build Status GitHub release Maven metadata URI

Overview

An asychronous HTTP client wrapping Slack's RPC-style web api. Provides an extensible API with builder-style parameters and responses, allowing you to focus on your interactions with users, rather than your interactions with Slack. Notably, we:

Features

We currently support:

auth

We happily welcome any PRs for APIs that haven't yet been implemented!

Usage

To use with Maven-based projects, add the following dependencies::

endency>
roupId>com.hubspot.slack</groupId>
rtifactId>slack-base</artifactId>
ersion>{latest version}</version>
pendency>
endency>
roupId>com.hubspot.slack</groupId>
rtifactId>slack-java-client</artifactId>
ersion>{latest  version}</version>
pendency>

Latest version can be seen here, on Maven central.

Seting up Guice

Install the SlackClientModule in the Guice module you want to use to talk to slack.

ic class MyFancyModule extends AbstractModule {
verride
otected void configure() {
install(new SlackClientModule());


Finally inject the factory where you want to build the client:

ic class MySlacker {
ivate final SlackClient slackClient;


blic MySlacker(
  SlackWebClient.Factory clientFactory
{
this.slackClient = clientFactory.build(
    SlackClientRuntimeConfig.builder()
      .setTokenSupplier(() -> "your token here")
      // ... all your configuration here
      .build()
);


 then just use the client!

Using the Client

If you're not familiar with Java 8's CompletableFuture API, know that you can transform this client from an asynchronous one to a synchronous one by calling join on any of the futures returned. To simplify getting started, we've included an example module with some common tasks to give you a feel for how you can interact with the client.

Contributors
License
Copyright 2018 HubSpot, Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.