├── test ├── test_helper.exs └── slackex_test.exs ├── .gitignore ├── doc ├── fonts │ ├── icomoon.eot │ ├── icomoon.ttf │ ├── icomoon.woff │ └── icomoon.svg ├── index.html ├── 404.html ├── Slackex.Emoji.html ├── Slackex.Auth.html ├── Slackex.Api.html ├── Slackex.RTM.html ├── Slackex.Supervisor.html ├── Slackex.OAuth.html ├── Slackex.UserGroups.Users.html ├── dist │ └── sidebar_items.js ├── Slackex.Search.html ├── Slackex.Chat.html ├── Slackex.Team.html ├── Slackex.Files.Comments.html ├── Slackex.Pins.html ├── Slackex.Stars.html ├── Slackex.Files.html ├── Slackex.UserGroups.html ├── Slackex.Reactions.html ├── Slackex.DoNotDisturb.html ├── Slackex.IM.html ├── Slackex.Users.html ├── Slackex.MPIM.html ├── api-reference.html ├── Slackex.Channels.html └── Slackex.Groups.html ├── lib ├── slackex │ ├── emoji.ex │ ├── api.ex │ ├── auth.ex │ ├── rtm.ex │ ├── supervisor.ex │ ├── team.ex │ ├── oauth.ex │ ├── usergroups.users.ex │ ├── search.ex │ ├── stars.ex │ ├── chat.ex │ ├── files.ex │ ├── files.comments.ex │ ├── pins.ex │ ├── dnd.ex │ ├── usergroups.ex │ ├── reactions.ex │ ├── users.ex │ ├── instant_message.ex │ ├── multiparty_instant_message.ex │ ├── channels.ex │ └── groups.ex └── slackex.ex ├── mix.lock ├── LICENSE ├── README.md └── mix.exs /test/test_helper.exs: -------------------------------------------------------------------------------- 1 | ExUnit.start() 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /_build 2 | /cover 3 | /deps 4 | erl_crash.dump 5 | *.ez 6 | /config/dev.secret.exs -------------------------------------------------------------------------------- /doc/fonts/icomoon.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/davidstump/slackex/HEAD/doc/fonts/icomoon.eot -------------------------------------------------------------------------------- /doc/fonts/icomoon.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/davidstump/slackex/HEAD/doc/fonts/icomoon.ttf -------------------------------------------------------------------------------- /doc/fonts/icomoon.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/davidstump/slackex/HEAD/doc/fonts/icomoon.woff -------------------------------------------------------------------------------- /test/slackex_test.exs: -------------------------------------------------------------------------------- 1 | defmodule SlackexTest do 2 | use ExUnit.Case 3 | doctest Slackex 4 | 5 | test "the truth" do 6 | assert 1 + 1 == 2 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /lib/slackex/emoji.ex: -------------------------------------------------------------------------------- 1 | defmodule Slackex.Emoji do 2 | @moduledoc """ 3 | Gets custom Emojis for a team. 4 | """ 5 | 6 | @doc """ 7 | This method lists the custom emoji for a team. 8 | """ 9 | def list(options \\ %{}) do 10 | Slackex.request("emoji.list", options) 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /lib/slackex/api.ex: -------------------------------------------------------------------------------- 1 | defmodule Slackex.Api do 2 | @moduledoc """ 3 | API Test Calls for Slack 4 | """ 5 | 6 | @doc """ 7 | Returns an "ok" message when a 8 | successfull connection to the Slack 9 | API is made 10 | """ 11 | 12 | def test do 13 | Slackex.request("api.test") 14 | end 15 | 16 | end 17 | -------------------------------------------------------------------------------- /lib/slackex/auth.ex: -------------------------------------------------------------------------------- 1 | defmodule Slackex.Auth do 2 | @moduledoc """ 3 | Authentication Calls for Slack 4 | """ 5 | 6 | @doc """ 7 | Checks Slack Authentication and tells 8 | the user who they are. 9 | """ 10 | 11 | def test(options \\ %{}) do 12 | Slackex.request("auth.test", options) 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /doc/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | slackex v0.0.1 – Documentation 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /lib/slackex/rtm.ex: -------------------------------------------------------------------------------- 1 | defmodule Slackex.RTM do 2 | @moduledoc """ 3 | Manage Slack Real Time Messaging Session 4 | """ 5 | 6 | @doc """ 7 | This method starts a Real Time Messaging API session. 8 | Refer to the RTM API documentation for full details on 9 | how to use the RTM API. 10 | """ 11 | def start(options \\ %{}) do 12 | Slackex.request("rtm.start", options) 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /mix.lock: -------------------------------------------------------------------------------- 1 | %{"certifi": {:hex, :certifi, "0.3.0"}, 2 | "earmark": {:hex, :earmark, "0.2.0"}, 3 | "ex_doc": {:hex, :ex_doc, "0.11.3"}, 4 | "exjsx": {:hex, :exjsx, "3.2.0"}, 5 | "hackney": {:hex, :hackney, "1.4.8"}, 6 | "httpoison": {:hex, :httpoison, "0.8.0"}, 7 | "idna": {:hex, :idna, "1.0.3"}, 8 | "jsx": {:hex, :jsx, "2.6.2"}, 9 | "mimerl": {:hex, :mimerl, "1.0.2"}, 10 | "ssl_verify_hostname": {:hex, :ssl_verify_hostname, "1.0.5"}} 11 | -------------------------------------------------------------------------------- /lib/slackex/supervisor.ex: -------------------------------------------------------------------------------- 1 | defmodule Slackex.Supervisor do 2 | use Supervisor 3 | 4 | def start_link do 5 | :supervisor.start_link(__MODULE__, []) 6 | end 7 | 8 | def init([]) do 9 | children = [ 10 | # Define workers and child supervisors to be supervised 11 | # worker(Mandrill.Worker, []) 12 | ] 13 | 14 | # See http://elixir-lang.org/docs/stable/Supervisor.Behaviour.html 15 | # for other strategies and supported options 16 | supervise(children, strategy: :one_for_one) 17 | end 18 | end 19 | -------------------------------------------------------------------------------- /lib/slackex/team.ex: -------------------------------------------------------------------------------- 1 | defmodule Slackex.Team do 2 | @moduledoc """ 3 | Get info on your team 4 | """ 5 | 6 | @doc """ 7 | This method is used to get the access logs for 8 | users on a team. 9 | """ 10 | def access_logs(options \\ %{}) do 11 | Slackex.request("team.accessLogs", options) 12 | end 13 | 14 | @doc """ 15 | This method provides information about your team. 16 | """ 17 | def info(options \\ %{})do 18 | Slackex.request("team.info", options) 19 | end 20 | 21 | @doc """ 22 | This method lists the integration activity logs for 23 | a team, including when integrations are added, modified 24 | and removed. This method can only be called by Admins. 25 | """ 26 | def integration_logs(options \\ %{}) do 27 | Slackex.request("team.integrationLogs", options) 28 | end 29 | end 30 | -------------------------------------------------------------------------------- /lib/slackex/oauth.ex: -------------------------------------------------------------------------------- 1 | defmodule Slackex.OAuth do 2 | @moduledoc """ 3 | Exchanges a temporary OAuth code for an API token. 4 | """ 5 | 6 | @doc """ 7 | This method allows you to exchange a temporary OAuth 8 | code for an API access token. This is used as part of 9 | the OAuth authentication flow. 10 | 11 | As discussed in RFC 6749 it is possible to supply the 12 | Client ID and Client Secret using the HTTP Basic 13 | authentication scheme. If HTTP Basic authentication is 14 | used you do not need to supply the client_id and 15 | client_secret parameters as part of the request. 16 | """ 17 | def access(client_id, client_secret, code, options \\ %{}) do 18 | params = options |> Map.merge(%{ 19 | client_id: client_id, 20 | client_secret: client_secret, 21 | code: code 22 | }) 23 | 24 | Slackex.request("oauth.access", params) 25 | end 26 | end 27 | -------------------------------------------------------------------------------- /lib/slackex/usergroups.users.ex: -------------------------------------------------------------------------------- 1 | defmodule Slackex.UserGroups.Users do 2 | @moduledoc """ 3 | Get information on users in usergroups 4 | """ 5 | 6 | @doc """ 7 | This method returns a list of all users within 8 | a user group. 9 | """ 10 | def list(usergroup, options \\ %{}) do 11 | params = options |> Map.merge(%{usergroup: usergroup}) 12 | Slackex.request("usergroup.users.list", params) 13 | end 14 | 15 | @doc """ 16 | This method updates the list of users that belong to 17 | a user group. This method replaces all users in a user 18 | group with the list of users provided in the users 19 | parameter. 20 | """ 21 | def update(usergroup, users, options \\ %{}) do 22 | params = options |> Map.merge(%{ 23 | usergroup: usergroup, 24 | users: users, 25 | }) 26 | 27 | Slackex.request("usergroups.users.update", params) 28 | end 29 | end 30 | -------------------------------------------------------------------------------- /lib/slackex/search.ex: -------------------------------------------------------------------------------- 1 | defmodule Slackex.Search do 2 | @moduledoc """ 3 | Search your team's files and messages. 4 | """ 5 | 6 | @doc """ 7 | This method allows to to search both messages 8 | and files in a single call. 9 | """ 10 | def all(query, options \\ %{}) do 11 | params = options |> Map.merge(%{query: query}) 12 | Slackex.request("search.all", params) 13 | end 14 | 15 | @doc """ 16 | This method returns files matching a search query. 17 | """ 18 | def files(query, options \\ %{}) do 19 | params = options |> Map.merge(%{query: query}) 20 | Slackex.request("search.files", params) 21 | end 22 | 23 | @doc """ 24 | This method returns messages matching a search query. 25 | """ 26 | def messages(query, options \\ %{}) do 27 | params = options |> Map.merge(%{query: query}) 28 | Slackex.request("search.messages", params) 29 | end 30 | end 31 | -------------------------------------------------------------------------------- /lib/slackex/stars.ex: -------------------------------------------------------------------------------- 1 | defmodule Slackex.Stars do 2 | @moduledoc """ 3 | Manage Slack Stars 4 | """ 5 | 6 | @doc """ 7 | This method adds a star to an item (message, file, 8 | file comment, channel, private group, or DM) on behalf 9 | of the authenticated user. One of file, file_comment, 10 | channel, or the combination of channel and timestamp 11 | must be specified. 12 | """ 13 | def add(options \\ %{}) do 14 | Slackex.request("stars.add", options) 15 | end 16 | 17 | @doc """ 18 | This method lists the items starred by a user. 19 | """ 20 | def list(options \\ %{}) do 21 | Slackex.request("stars.list", options) 22 | end 23 | 24 | @doc """ 25 | This method removes a star from an item (message, 26 | file, file comment, channel, private group, or DM) 27 | on behalf of the authenticated user. One of file, 28 | file_comment, channel, or the combination of channel 29 | and timestamp must be specified. 30 | """ 31 | def remove(options \\ %{}) do 32 | Slackex.request("stars.remove", options) 33 | end 34 | end 35 | -------------------------------------------------------------------------------- /lib/slackex/chat.ex: -------------------------------------------------------------------------------- 1 | defmodule Slackex.Chat do 2 | @moduledoc """ 3 | Post chat messages to Slack. 4 | """ 5 | 6 | @doc """ 7 | This method deletes a message from a channel. 8 | """ 9 | def delete(channel, timestamp, options \\ %{}) do 10 | params = options |> Map.merge(%{channel: channel, ts: timestamp}) 11 | Slackex.request("chat.delete", params) 12 | end 13 | 14 | @doc """ 15 | This method posts a message to a public channel, 16 | private group, or IM channel. 17 | """ 18 | def post_message(channel, text, options \\ %{}) do 19 | params = options |> Map.merge(%{ 20 | channel: channel, 21 | text: text 22 | }) 23 | 24 | Slackex.request("chat.postMessage", params) 25 | end 26 | 27 | @doc """ 28 | This method updates a message in a channel. 29 | """ 30 | def update(channel, timestamp, text, options \\ %{}) do 31 | params = options |> Map.merge(%{ 32 | channel: channel, 33 | timestamp: timestamp, 34 | options: options 35 | }) 36 | 37 | Slackex.request("chat.update", params) 38 | end 39 | end 40 | -------------------------------------------------------------------------------- /lib/slackex/files.ex: -------------------------------------------------------------------------------- 1 | defmodule Slackex.Files do 2 | @moduledoc """ 3 | Get info on files uploaded to Slack, upload 4 | new files to Slack. 5 | """ 6 | 7 | @doc """ 8 | This method deletes a file from your team. 9 | """ 10 | def delete(file, options \\ %{}) do 11 | params = options |> Map.merge(%{file: file}) 12 | Slackex.request("files.delete", params) 13 | end 14 | 15 | @doc """ 16 | This method returns information about a file in 17 | your team. 18 | """ 19 | def info(file, options \\ %{}) do 20 | params = options |> Map.merge(%{file: file}) 21 | Slackex.request("files.info", params) 22 | end 23 | 24 | @doc """ 25 | This method returns a list of files within the team. 26 | It can be filtered and sliced in various ways. 27 | """ 28 | def list(options \\ %{}) do 29 | Slackex.request("files.list", options) 30 | end 31 | 32 | @doc """ 33 | This method allows you to create or upload an existing file. 34 | """ 35 | def upload(file, options \\ %{}) do 36 | params = options |> Map.merge(%{file: file}) 37 | Slackex.request("files.upload", params) 38 | end 39 | end 40 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 David Stump 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /lib/slackex/files.comments.ex: -------------------------------------------------------------------------------- 1 | defmodule Slackex.Files.Comments do 2 | @moduledoc """ 3 | Handles comments on files 4 | """ 5 | 6 | @doc """ 7 | Add a comment to an existing file. 8 | """ 9 | def add(file, comment, options \\ %{}) do 10 | params = options |> Map.merge(%{file: file, comment: comment}) 11 | Slackex.request("files.comments.add", params) 12 | end 13 | 14 | @doc """ 15 | Delete an existing comment on a file. Only the 16 | original author of the comment or a team 17 | administrator may delete a file comment. 18 | """ 19 | def delete(file, id, options \\ %{}) do 20 | params = options |> Map.merge(%{file: file, id: id}) 21 | Slackex.request("files.comments.delete", params) 22 | end 23 | 24 | @doc """ 25 | Edit an existing comment on a file. Only the user who 26 | created a comment may make edits. Teams may configure 27 | a limited time window during which file comment edits 28 | are allowed. 29 | """ 30 | def edit(file, id, comment, options \\ %{}) do 31 | params = options |> Map.merge(%{file: file, id: id, comment: comment}) 32 | Slackex.request("files.comments.edit", params) 33 | end 34 | end 35 | -------------------------------------------------------------------------------- /lib/slackex/pins.ex: -------------------------------------------------------------------------------- 1 | defmodule Slackex.Pins do 2 | @moduledoc """ 3 | Manage Slack Pins 4 | """ 5 | 6 | @doc """ 7 | This method pins an item (file, file comment, channel 8 | message, or group message) to a particular channel. 9 | The channel argument is required and one of file, 10 | file_comment, or timestamp must also be specified. 11 | """ 12 | def add(channel, options \\ %{}) do 13 | params = options |> Map.merge(%{channel: channel}) 14 | Slackex.request("pins.add", params) 15 | end 16 | 17 | @doc """ 18 | This method lists the items pinned to a channel. 19 | """ 20 | def list(channel, options \\ %{}) do 21 | params = options |> Map.merge(%{channel: channel}) 22 | Slackex.request("pins.list", params) 23 | end 24 | 25 | @doc """ 26 | This method un-pins an item (file, file comment, 27 | channel message, or group message) from a channel. 28 | The channel argument is required and one of file, 29 | file_comment, or timestamp must also be specified. 30 | """ 31 | def remove(channel, options \\ %{}) do 32 | params = options |> Map.merge(%{channel: channel}) 33 | Slackex.request("pins.remove", params) 34 | end 35 | end 36 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Slackex 2 | 3 | A Slack wrapper for Elixir 4 | Requires an active account with Slack (http://slack.com). 5 | 6 | Provides a wrapper for every API endpoint listed in the [official slack developer documentation](https://api.slack.com/web) 7 | 8 | ## Installation 9 | 10 | Slackex can be installed as: 11 | 12 | 1. Add slackex to your list of dependencies in `mix.exs`: 13 | 14 | def deps do 15 | [{:slackex, "~> 0.0.1"}] 16 | end 17 | 18 | 2. Ensure slackex is started before your application: 19 | 20 | def application do 21 | [applications: [:slackex]] 22 | end 23 | 24 | 3. Obtain a Slack token and set it as a System ENV as `SLACK_TOKEN` 25 | 26 | 27 | ## Examples 28 | 29 | Just a few small examples to get you started. Details documentation is linked below. 30 | 31 | To list all of your Slack channels: 32 | 33 | ``` 34 | channels = Slackex.Channels.list 35 | ``` 36 | 37 | To create a new channel 38 | 39 | ``` 40 | new_channel = Slackex.Channels.create("My New Channel") 41 | ``` 42 | 43 | ## Documentation 44 | 45 | For more detailed documentation visit: 46 | 47 | * Slackex Documentation: [http://hexdocs.pm/slackex](http://hexdocs.pm/slackex) 48 | * Slack API Methods: [https://api.slack.com/methods](https://api.slack.com/methods) 49 | -------------------------------------------------------------------------------- /lib/slackex/dnd.ex: -------------------------------------------------------------------------------- 1 | defmodule Slackex.DoNotDisturb do 2 | @moduledoc """ 3 | Adjust and view Do Not Disturb settings for 4 | team members 5 | """ 6 | 7 | @doc """ 8 | Ends the user's currently scheduled Do Not Disturb session immediately. 9 | """ 10 | def end_dnd(options \\ %{}) do 11 | Slackex.request("dnd.endDnd", options) 12 | end 13 | 14 | @doc """ 15 | Ends the current user's snooze mode immediately. 16 | """ 17 | def end_snooze(options \\ %{}) do 18 | Slackex.request("dnd.endSnooze", options) 19 | end 20 | 21 | @doc """ 22 | Provides information about a user's current 23 | Do Not Disturb settings. 24 | """ 25 | def info(options \\ %{}) do 26 | Slackex.request("dnd.info", options) 27 | end 28 | 29 | @doc """ 30 | Adjusts the snooze duration for a user's Do Not 31 | Disturb settings. If a snooze session is not 32 | already active for the user, invoking this method 33 | will begin one for the specified duration. 34 | """ 35 | def set_snooze(num_minutes, options \\ %{}) do 36 | params = options |> Map.merge(%{num_minutes: num_minutes}) 37 | Slackex.request("dnd.setSnooze", params) 38 | end 39 | 40 | @doc """ 41 | Provides information about the current Do Not Disturb 42 | settings for users of a Slack team. 43 | """ 44 | def team_info(options \\ %{}) do 45 | Slackex.request("dnd.teamInfo", options) 46 | end 47 | end 48 | -------------------------------------------------------------------------------- /lib/slackex/usergroups.ex: -------------------------------------------------------------------------------- 1 | defmodule Slackex.UserGroups do 2 | @moduledoc """ 3 | Get info on your team's user groups. 4 | """ 5 | 6 | @doc """ 7 | This method is used to create a user group. 8 | """ 9 | def create(name, options) do 10 | params = options |> Map.merge(%{name: name}) 11 | Slackex.request("usergroups.create", params) 12 | end 13 | 14 | @doc """ 15 | This method disables an existing user group. 16 | """ 17 | def disable(usergroup, options \\ %{}) do 18 | params = options |> Map.merge(%{usergroup: usergroup}) 19 | Slackex.request("usergroups.disable", params) 20 | end 21 | 22 | @doc """ 23 | This method enables a user group which was 24 | previously disabled. 25 | """ 26 | def enable(usergroup, options \\ %{}) do 27 | params = options |> Map.merge(%{usergroup: usergroup}) 28 | Slackex.request("usergroup.enable", params) 29 | end 30 | 31 | @doc """ 32 | This method returns a list of all user groups in the 33 | team. This can optionally include disabled user groups. 34 | """ 35 | def list(options \\ %{}) do 36 | Slackex.request("usergroups.list", options) 37 | end 38 | 39 | @doc """ 40 | This method updates the properties of an existing 41 | user group. 42 | """ 43 | def update(usergroup, options \\ %{}) do 44 | params = options |> Map.merge(%{usergroup: usergroup}) 45 | Slackex.request("usergroups.update", params) 46 | end 47 | end 48 | -------------------------------------------------------------------------------- /mix.exs: -------------------------------------------------------------------------------- 1 | defmodule Slackex.Mixfile do 2 | use Mix.Project 3 | 4 | def project do 5 | [app: :slackex, 6 | version: "0.0.1", 7 | elixir: "~> 1.2", 8 | description: description, 9 | package: package, 10 | build_embedded: Mix.env == :prod, 11 | start_permanent: Mix.env == :prod, 12 | deps: deps] 13 | end 14 | 15 | # Configuration for the OTP application 16 | # 17 | # Type "mix help compile.app" for more information 18 | def application do 19 | [applications: [:logger, :httpoison, :exjsx], 20 | mod: {Slackex, []}] 21 | end 22 | 23 | # Dependencies can be Hex packages: 24 | # 25 | # {:mydep, "~> 0.3.0"} 26 | # 27 | # Or git/path repositories: 28 | # 29 | # {:mydep, git: "https://github.com/elixir-lang/mydep.git", tag: "0.1.0"} 30 | # 31 | # Type "mix help deps" for more examples and options 32 | defp deps do 33 | [ 34 | {:httpoison, "~> 0.8"}, 35 | {:exjsx, "~> 3.2.0", app: false}, 36 | {:earmark, "~> 0.1", only: :dev}, 37 | {:ex_doc, "~> 0.11", only: :dev} 38 | ] 39 | end 40 | 41 | defp description do 42 | """ 43 | A Slack wrapper for Elixir 44 | Requires an active account with Slack (http://slack.com). 45 | """ 46 | end 47 | 48 | defp package do 49 | [ files: [ "lib", "mix.exs", "README.md", "LICENSE" ], 50 | maintainers: [ "David Stump" ], 51 | licenses: [ "MIT" ], 52 | links: %{ "GitHub" => "https://github.com/davidstump/slackex" } ] 53 | end 54 | end 55 | -------------------------------------------------------------------------------- /lib/slackex/reactions.ex: -------------------------------------------------------------------------------- 1 | defmodule Slackex.Reactions do 2 | @moduledoc """ 3 | Manage Slack Reactions 4 | """ 5 | 6 | @doc """ 7 | This method adds a reaction (emoji) to an item 8 | (file, file comment, channel message, group message, 9 | or direct message). One of file, file_comment, or 10 | the combination of channel and timestamp must be 11 | specified. 12 | """ 13 | def add(name, options \\ %{}) do 14 | params = options |> Map.merge(%{name: name}) 15 | Slackex.request("reactions.add", params) 16 | end 17 | 18 | @doc """ 19 | This method returns a list of all reactions for a single 20 | item (file, file comment, channel message, group message, 21 | or direct message). 22 | """ 23 | def get(options \\ %{}) do 24 | Slackex.request("reactions.get", options) 25 | end 26 | 27 | @doc """ 28 | This method returns a list of all items (file, file comment, 29 | channel message, group message, or direct message) reacted 30 | to by a user. 31 | """ 32 | def list(options \\ %{}) do 33 | Slackex.request("reactions.list", options) 34 | end 35 | 36 | @doc """ 37 | This method removes a reaction (emoji) from an item (file, 38 | file comment, channel message, group message, or direct 39 | message). One of file, file_comment, or the combination of 40 | channel and timestamp must be specified. 41 | """ 42 | def remove(name, options \\ %{}) do 43 | params = options |> Map.merge(%{name: name}) 44 | Slackex.request("reactions.remove", params) 45 | end 46 | end 47 | -------------------------------------------------------------------------------- /lib/slackex/users.ex: -------------------------------------------------------------------------------- 1 | defmodule Slackex.Users do 2 | @moduledoc """ 3 | Get info on members of your Slack team. 4 | """ 5 | 6 | @doc """ 7 | This method lets you find out information about 8 | a user's presence. Consult the presence documentation 9 | for more details. 10 | """ 11 | def get_presence(user, options \\ %{}) do 12 | params = options |> Map.merge(%{user: user}) 13 | Slackex.request("users.getPresence", params) 14 | end 15 | 16 | @doc """ 17 | This method returns information about a team member. 18 | """ 19 | def info(user, options \\ %{}) do 20 | params = options |> Map.merge(%{user: user}) 21 | Slackex.request("users.info", params) 22 | end 23 | 24 | @doc """ 25 | This method returns a list of all users in the team. This 26 | includes deleted/deactivated users. 27 | """ 28 | def list(options \\ %{}) do 29 | Slackex.request("users.list", options) 30 | end 31 | 32 | @doc """ 33 | This method lets the slack messaging server know that the 34 | authenticated user is currently active. Consult the 35 | presence documentation for more details. 36 | """ 37 | def set_active(options \\ %{}) do 38 | Slackex.request("users.setActive", options) 39 | end 40 | 41 | @doc """ 42 | This method lets you set the calling user's manual presence. 43 | Consult the presence documentation for more details. 44 | """ 45 | def set_presence(presence, options \\ %{}) do 46 | params = options |> Map.merge(%{presence: presence}) 47 | Slackex.request("users.setPresence", params) 48 | end 49 | end 50 | -------------------------------------------------------------------------------- /lib/slackex/instant_message.ex: -------------------------------------------------------------------------------- 1 | defmodule Slackex.IM do 2 | @moduledoc """ 3 | Get info on your direct messages. 4 | """ 5 | 6 | @doc """ 7 | This method closes a direct message channel. 8 | """ 9 | def close(channel, options \\ %{}) do 10 | params = options |> Map.merge(%{channel: channel}) 11 | Slackex.request("im.close", params) 12 | end 13 | 14 | @doc """ 15 | This method returns a portion of messages/events 16 | from the specified direct message channel. To read 17 | the entire history for a direct message channel, call 18 | the method with no latest or oldest arguments, and 19 | then continue paging using the instructions below. 20 | """ 21 | def history(channel, options \\ %{}) do 22 | params = options |> Map.merge(%{channel: channel}) 23 | Slackex.request("im.history", params) 24 | end 25 | 26 | @doc """ 27 | This method returns a list of all im channels that 28 | the user has. 29 | """ 30 | def list(options \\ %{}) do 31 | Slackex.request("im.list", options) 32 | end 33 | 34 | @doc """ 35 | This method moves the read cursor in a direct message 36 | channel. 37 | """ 38 | def mark(channel, timestamp, options \\ %{}) do 39 | params = options |> Map.merge(%{channel: channel, ts: timestamp}) 40 | Slackex.request("im.mark", params) 41 | end 42 | 43 | @doc """ 44 | This method opens a direct message channel with 45 | another member of your Slack team. 46 | """ 47 | def open(user, options \\ %{}) do 48 | params = options |> Map.merge(%{user: user}) 49 | Slackex.request("im.open", params) 50 | end 51 | end 52 | -------------------------------------------------------------------------------- /lib/slackex/multiparty_instant_message.ex: -------------------------------------------------------------------------------- 1 | defmodule Slackex.MPIM do 2 | @moduledoc """ 3 | Get info on your multiparty direct messages. 4 | """ 5 | 6 | @doc """ 7 | Get info on your multiparty direct messages. 8 | """ 9 | def close(channel, options \\ %{}) do 10 | params = options |> Map.merge(%{channel: channel}) 11 | Slackex.request("mpim.close", params) 12 | end 13 | 14 | @doc """ 15 | This method returns a portion of messages/events 16 | from the specified multiparty direct message channel. 17 | To read the entire history for a multiparty direct 18 | message, call the method with no latest or oldest 19 | arguments, and then continue paging using the 20 | instructions below. 21 | """ 22 | def history(channel, options \\ %{}) do 23 | params = options |> Map.merge(%{channel: channel}) 24 | Slackex.request("mpim.history", params) 25 | end 26 | 27 | @doc """ 28 | This method returns a list of all multiparty direct 29 | message channels that the user has. 30 | """ 31 | def list(options \\ %{}) do 32 | Slackex.request("mpim.list", options) 33 | end 34 | 35 | @doc """ 36 | This method moves the read cursor in a multiparty 37 | direct message channel. 38 | """ 39 | def mark(channel, timestamp, options \\ %{}) do 40 | params = options |> Map.merge(%{channel: channel, ts: timestamp}) 41 | Slackex.request("mpim.mark", params) 42 | end 43 | 44 | @doc """ 45 | This method opens a multiparty direct message. 46 | 47 | Opening a multiparty direct message takes a list of 48 | up-to 8 encoded user ids. If there is no MPIM already 49 | created that includes that exact set of members, a 50 | new MPIM will be created. Subsequent calls to mpim.open 51 | with the same set of users will return the already 52 | existing MPIM conversation. 53 | """ 54 | def open(users, options \\ %{}) do 55 | params = options |> Map.merge(%{users: users}) 56 | Slackex.request("mpim.open", params) 57 | end 58 | end 59 | -------------------------------------------------------------------------------- /lib/slackex.ex: -------------------------------------------------------------------------------- 1 | defmodule Slackex do 2 | @moduledoc """ 3 | An HTTP client for Slack. 4 | """ 5 | 6 | # Let's build on top of HTTPoison 7 | use Application 8 | use HTTPoison.Base 9 | 10 | def start(_type, _args) do 11 | Slackex.Supervisor.start_link 12 | end 13 | 14 | @doc """ 15 | Creates the URL for our endpoint. 16 | Args: 17 | * endpoint - part of the API we're hitting 18 | Returns string 19 | """ 20 | def process_url(endpoint) do 21 | "https://slack.com/api/" <> endpoint 22 | end 23 | 24 | @doc """ 25 | Converts the binary keys in our response to atoms. 26 | Args: 27 | * body - string binary response 28 | Returns Record or ArgumentError 29 | """ 30 | def process_response_body(body) do 31 | JSX.decode!(body, [{:labels, :atom}]) 32 | end 33 | 34 | @doc """ 35 | Boilerplate code to make requests. 36 | Args: 37 | * endpoint - string requested API endpoint 38 | * body - request body 39 | Uses token if provided, otherwise uses the one from the env / config 40 | Returns dict 41 | """ 42 | 43 | def request(endpoint, body \\ %{}) 44 | 45 | def request(endpoint, %{token: _} = body) do 46 | Slackex.get!( 47 | endpoint, 48 | headers, 49 | params: body 50 | ).body 51 | end 52 | 53 | def request(endpoint, body) do 54 | request(endpoint, Dict.put(body, :token, Slackex.token)) 55 | end 56 | 57 | 58 | @doc """ 59 | Includes user Slack token with params 60 | """ 61 | def params_with_auth(body) do 62 | Dict.put(body, :token, Slackex.token) 63 | end 64 | 65 | @doc """ 66 | Default json headers 67 | """ 68 | def headers do 69 | %{ 70 | "Content-Type" => "application/json", 71 | "Accept" => "application/json" 72 | } 73 | end 74 | 75 | @doc """ 76 | Gets the token from :slackex, :token application env or 77 | SLACK_TOKEN from system ENV 78 | Returns binary 79 | """ 80 | def token do 81 | Application.get_env(:slackex, :token) || 82 | System.get_env("SLACK_TOKEN") 83 | end 84 | end 85 | -------------------------------------------------------------------------------- /doc/404.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 404 – slackex v0.0.1 9 | 10 | 11 | 12 | 13 | 14 |
15 | 18 | 56 | 57 |
58 |
59 | 60 | 61 |

Page not found

62 | 63 |

Sorry, but the page you were trying to get to, does not exist. You 64 | may want to try searching this site using the sidebar or using our 65 | API Reference page to find what 66 | you were looking for.

67 | 68 | 81 |
82 |
83 |
84 | 85 | 86 | 87 | 88 | -------------------------------------------------------------------------------- /doc/Slackex.Emoji.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Slackex.Emoji – slackex v0.0.1 9 | 10 | 11 | 12 | 13 | 14 |
15 | 18 | 56 | 57 |
58 |
59 | 60 | 61 |

62 | slackex v0.0.1 63 | Slackex.Emoji 64 | 65 | 66 |

67 | 68 | 69 |
70 |

Gets custom Emojis for a team.

71 | 72 |
73 | 74 | 75 | 76 |
77 |

78 | 79 | 80 | 81 | Summary 82 |

83 | 84 | 85 | 86 |
87 |

88 | Functions 89 |

90 |
91 |
92 | list() 93 |
94 | 95 |

This method lists the custom emoji for a team

96 |
97 | 98 |
99 | 100 |
101 | 102 | 103 | 104 | 105 | 106 | 107 |
108 | 109 | 110 | 111 | 112 | 113 |
114 |

115 | 116 | 117 | 118 | Functions 119 |

120 |
121 |
122 | 123 | 124 | 125 | list() 126 | 127 |
128 | 129 |
130 |

This method lists the custom emoji for a team.

131 | 132 |
133 |
134 | 135 |
136 | 137 | 138 | 139 | 140 | 141 | 154 |
155 |
156 |
157 | 158 | 159 | 160 | 161 | -------------------------------------------------------------------------------- /doc/fonts/icomoon.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Generated by IcoMoon 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /doc/Slackex.Auth.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Slackex.Auth – slackex v0.0.1 9 | 10 | 11 | 12 | 13 | 14 |
15 | 18 | 56 | 57 |
58 |
59 | 60 | 61 |

62 | slackex v0.0.1 63 | Slackex.Auth 64 | 65 | 66 |

67 | 68 | 69 |
70 |

Authentication Calls for Slack

71 | 72 |
73 | 74 | 75 | 76 |
77 |

78 | 79 | 80 | 81 | Summary 82 |

83 | 84 | 85 | 86 |
87 |

88 | Functions 89 |

90 |
91 |
92 | test() 93 |
94 | 95 |

Checks Slack Authentication and tells 96 | the user who they are

97 |
98 | 99 |
100 | 101 |
102 | 103 | 104 | 105 | 106 | 107 | 108 |
109 | 110 | 111 | 112 | 113 | 114 |
115 |

116 | 117 | 118 | 119 | Functions 120 |

121 |
122 |
123 | 124 | 125 | 126 | test() 127 | 128 |
129 | 130 |
131 |

Checks Slack Authentication and tells 132 | the user who they are.

133 | 134 |
135 |
136 | 137 |
138 | 139 | 140 | 141 | 142 | 143 | 156 |
157 |
158 |
159 | 160 | 161 | 162 | 163 | -------------------------------------------------------------------------------- /doc/Slackex.Api.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Slackex.Api – slackex v0.0.1 9 | 10 | 11 | 12 | 13 | 14 |
15 | 18 | 56 | 57 |
58 |
59 | 60 | 61 |

62 | slackex v0.0.1 63 | Slackex.Api 64 | 65 | 66 |

67 | 68 | 69 |
70 |

API Test Calls for Slack

71 | 72 |
73 | 74 | 75 | 76 |
77 |

78 | 79 | 80 | 81 | Summary 82 |

83 | 84 | 85 | 86 |
87 |

88 | Functions 89 |

90 |
91 |
92 | test() 93 |
94 | 95 |

Returns an “ok” message when a 96 | successfull connection to the Slack 97 | API is made

98 |
99 | 100 |
101 | 102 |
103 | 104 | 105 | 106 | 107 | 108 | 109 |
110 | 111 | 112 | 113 | 114 | 115 |
116 |

117 | 118 | 119 | 120 | Functions 121 |

122 |
123 |
124 | 125 | 126 | 127 | test() 128 | 129 |
130 | 131 |
132 |

Returns an “ok” message when a 133 | successfull connection to the Slack 134 | API is made

135 | 136 |
137 |
138 | 139 |
140 | 141 | 142 | 143 | 144 | 145 | 158 |
159 |
160 |
161 | 162 | 163 | 164 | 165 | -------------------------------------------------------------------------------- /doc/Slackex.RTM.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Slackex.RTM – slackex v0.0.1 9 | 10 | 11 | 12 | 13 | 14 |
15 | 18 | 56 | 57 |
58 |
59 | 60 | 61 |

62 | slackex v0.0.1 63 | Slackex.RTM 64 | 65 | 66 |

67 | 68 | 69 |
70 |

Manage Slack Real Time Messaging Session

71 | 72 |
73 | 74 | 75 | 76 |
77 |

78 | 79 | 80 | 81 | Summary 82 |

83 | 84 | 85 | 86 |
87 |

88 | Functions 89 |

90 |
91 | 94 | 95 |

This method starts a Real Time Messaging API session. 96 | Refer to the RTM API documentation for full details on 97 | how to use the RTM API

98 |
99 | 100 |
101 | 102 |
103 | 104 | 105 | 106 | 107 | 108 | 109 |
110 | 111 | 112 | 113 | 114 | 115 |
116 |

117 | 118 | 119 | 120 | Functions 121 |

122 |
123 |
124 | 125 | 126 | 127 | start(options \\ %{}) 128 | 129 |
130 | 131 |
132 |

This method starts a Real Time Messaging API session. 133 | Refer to the RTM API documentation for full details on 134 | how to use the RTM API.

135 | 136 |
137 |
138 | 139 |
140 | 141 | 142 | 143 | 144 | 145 | 158 |
159 |
160 |
161 | 162 | 163 | 164 | 165 | -------------------------------------------------------------------------------- /lib/slackex/channels.ex: -------------------------------------------------------------------------------- 1 | defmodule Slackex.Channels do 2 | @moduledoc """ 3 | Get info on your team's Slack channels, 4 | create or archive channels, invite users, 5 | set the topic and purpose, and mark a 6 | channel as read. 7 | """ 8 | 9 | @doc """ 10 | This method archives a channel. 11 | """ 12 | def archive(channel, options \\ %{}) do 13 | params = options |> Map.merge(%{channel: channel}) 14 | Slackex.request("channels.archive", params) 15 | end 16 | 17 | @doc """ 18 | This method is used to create a channel. 19 | """ 20 | def create(name, options \\ %{}) do 21 | params = options |> Map.merge(%{name: name}) 22 | Slackex.request("channels.create", params) 23 | end 24 | 25 | @doc """ 26 | This method returns a portion of messages/events 27 | from the specified channel. To read the entire 28 | history for a channel, call the method with no 29 | latest or oldest arguments, and then continue paging 30 | using the instructions below. 31 | """ 32 | def history(channel, options \\ %{}) do 33 | params = options |> Map.merge(%{channel: channel}) 34 | Slackex.request("channels.history", params) 35 | end 36 | 37 | @doc """ 38 | """ 39 | def info(channel, options \\ %{}) do 40 | params = options |> Map.merge(%{channel: channel}) 41 | Slackex.request("channels.info", params) 42 | end 43 | @doc """ 44 | This method is used to invite a user to a channel. 45 | The calling user must be a member of the channel. 46 | """ 47 | def invite(channel, user, options \\ %{}) do 48 | params = options |> Map.merge(%{channel: channel, user: user}) 49 | Slackex.request("channels.invite", params) 50 | end 51 | 52 | @doc """ 53 | This method is used to join a channel. If the 54 | channel does not exist, it is created. 55 | """ 56 | def join(name, options \\ %{}) do 57 | params = options |> Map.merge(%{name: name}) 58 | Slackex.request("channels.join", params) 59 | end 60 | 61 | @doc """ 62 | This method allows a user to remove another member 63 | from a team channel. 64 | """ 65 | def kick(channel, user, options \\ %{}) do 66 | params = options |> Map.merge(%{channel: channel, user: user}) 67 | Slackex.request("channels.kick", params) 68 | end 69 | 70 | @doc """ 71 | This method is used to leave a channel. 72 | """ 73 | def leave(channel, options \\ %{}) do 74 | params = options |> Map.merge(%{channel: channel}) 75 | Slackex.request("channels.leave", params) 76 | end 77 | 78 | @doc """ 79 | This method returns a list of all channels 80 | in the team. This includes channels the 81 | caller is in, channels they are not currently 82 | in, and archived channels but does not include 83 | private channels. The number of (non-deactivated) 84 | members in each channel is also returned. 85 | 86 | To retrieve a list of private channels, use groups.list 87 | """ 88 | def list(options \\ %{}) do 89 | Slackex.request("channels.list", options) 90 | end 91 | 92 | @doc """ 93 | This method moves the read cursor in a channel. 94 | """ 95 | def mark(channel, timestamp, options \\ %{}) do 96 | params = options |> Map.merge(%{channel: channel, ts: timestamp}) 97 | Slackex.request("channels.mark", params) 98 | end 99 | 100 | @doc """ 101 | This method renames a team channel. 102 | 103 | The only people who can rename a channel are team 104 | admins, or the person that originally created the 105 | channel. Others will receive a "not_authorized" 106 | error. 107 | """ 108 | def rename(channel, new_name, options \\ %{}) do 109 | params = options |> Map.merge(%{channel: channel, name: new_name}) 110 | Slackex.request("channels.rename", params) 111 | end 112 | 113 | @doc """ 114 | This method is used to change the purpose of a 115 | channel. The calling user must be a member of 116 | the channel. 117 | """ 118 | def set_purpose(channel, purpose, options \\ %{}) do 119 | params = options |> Map.merge(%{channel: channel, purpose: purpose}) 120 | Slackex.request("channels.setPurpose", params) 121 | end 122 | 123 | @doc """ 124 | This method is used to change the topic of a 125 | channel. The calling user must be a member of 126 | the channel. 127 | """ 128 | def set_topic(channel, topic, options \\ %{}) do 129 | params = options |> Map.merge(%{channel: channel, topic: topic}) 130 | Slackex.request("channels.setTopic", params) 131 | end 132 | 133 | @doc """ 134 | This method unarchives a channel. The calling 135 | user is added to the channel. 136 | """ 137 | def unarchive(channel, options \\ %{}) do 138 | params = options |> Map.merge(%{channel: channel}) 139 | Slackex.request("channels.unarchive", params) 140 | end 141 | end 142 | -------------------------------------------------------------------------------- /doc/Slackex.Supervisor.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Slackex.Supervisor – slackex v0.0.1 9 | 10 | 11 | 12 | 13 | 14 |
15 | 18 | 56 | 57 |
58 |
59 | 60 | 61 |

62 | slackex v0.0.1 63 | Slackex.Supervisor 64 | 65 | 66 |

67 | 68 | 69 | 70 | 71 |
72 |

73 | 74 | 75 | 76 | Summary 77 |

78 | 79 | 80 | 81 |
82 |

83 | Functions 84 |

85 |
86 |
87 | init(list) 88 |
89 | 90 |

Callback implementation for c::supervisor.init/1

91 |
92 | 93 |
94 |
95 |
96 | start_link() 97 |
98 | 99 |
100 | 101 |
102 | 103 | 104 | 105 | 106 | 107 | 108 |
109 | 110 | 111 | 112 | 113 | 114 |
115 |

116 | 117 | 118 | 119 | Functions 120 |

121 |
122 |
123 | 124 | 125 | 126 | init(list) 127 | 128 |
129 | 130 |
131 |

Callback implementation for c::supervisor.init/1.

132 | 133 |
134 |
135 |
136 |
137 | 138 | 139 | 140 | start_link() 141 | 142 |
143 | 144 |
145 | 146 |
147 |
148 | 149 |
150 | 151 | 152 | 153 | 154 | 155 | 168 |
169 |
170 |
171 | 172 | 173 | 174 | 175 | -------------------------------------------------------------------------------- /doc/Slackex.OAuth.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Slackex.OAuth – slackex v0.0.1 9 | 10 | 11 | 12 | 13 | 14 |
15 | 18 | 56 | 57 |
58 |
59 | 60 | 61 |

62 | slackex v0.0.1 63 | Slackex.OAuth 64 | 65 | 66 |

67 | 68 | 69 |
70 |

Exchanges a temporary OAuth code for an API token.

71 | 72 |
73 | 74 | 75 | 76 |
77 |

78 | 79 | 80 | 81 | Summary 82 |

83 | 84 | 85 | 86 |
87 |

88 | Functions 89 |

90 |
91 | 94 | 95 |

This method allows you to exchange a temporary OAuth 96 | code for an API access token. This is used as part of 97 | the OAuth authentication flow

98 |
99 | 100 |
101 | 102 |
103 | 104 | 105 | 106 | 107 | 108 | 109 |
110 | 111 | 112 | 113 | 114 | 115 |
116 |

117 | 118 | 119 | 120 | Functions 121 |

122 |
123 |
124 | 125 | 126 | 127 | access(client_id, client_secret, code, options \\ %{}) 128 | 129 |
130 | 131 |
132 |

This method allows you to exchange a temporary OAuth 133 | code for an API access token. This is used as part of 134 | the OAuth authentication flow.

135 |

As discussed in RFC 6749 it is possible to supply the 136 | Client ID and Client Secret using the HTTP Basic 137 | authentication scheme. If HTTP Basic authentication is 138 | used you do not need to supply the client_id and 139 | client_secret parameters as part of the request.

140 | 141 |
142 |
143 | 144 |
145 | 146 | 147 | 148 | 149 | 150 | 163 |
164 |
165 |
166 | 167 | 168 | 169 | 170 | -------------------------------------------------------------------------------- /doc/Slackex.UserGroups.Users.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Slackex.UserGroups.Users – slackex v0.0.1 9 | 10 | 11 | 12 | 13 | 14 |
15 | 18 | 56 | 57 |
58 |
59 | 60 | 61 |

62 | slackex v0.0.1 63 | Slackex.UserGroups.Users 64 | 65 | 66 |

67 | 68 | 69 |
70 |

Get information on users in usergroups

71 | 72 |
73 | 74 | 75 | 76 |
77 |

78 | 79 | 80 | 81 | Summary 82 |

83 | 84 | 85 | 86 |
87 |

88 | Functions 89 |

90 |
91 | 94 | 95 |

This method returns a list of all users within 96 | a user group

97 |
98 | 99 |
100 |
101 | 104 | 105 |

This method updates the list of users that belong to 106 | a user group. This method replaces all users in a user 107 | group with the list of users provided in the users 108 | parameter

109 |
110 | 111 |
112 | 113 |
114 | 115 | 116 | 117 | 118 | 119 | 120 |
121 | 122 | 123 | 124 | 125 | 126 |
127 |

128 | 129 | 130 | 131 | Functions 132 |

133 |
134 |
135 | 136 | 137 | 138 | list(usergroup, options \\ %{}) 139 | 140 |
141 | 142 |
143 |

This method returns a list of all users within 144 | a user group.

145 | 146 |
147 |
148 |
149 |
150 | 151 | 152 | 153 | update(usergroup, users, options \\ %{}) 154 | 155 |
156 | 157 |
158 |

This method updates the list of users that belong to 159 | a user group. This method replaces all users in a user 160 | group with the list of users provided in the users 161 | parameter.

162 | 163 |
164 |
165 | 166 |
167 | 168 | 169 | 170 | 171 | 172 | 185 |
186 |
187 |
188 | 189 | 190 | 191 | 192 | -------------------------------------------------------------------------------- /doc/dist/sidebar_items.js: -------------------------------------------------------------------------------- 1 | sidebarNodes={"exceptions":[],"extras":[{"id":"api-reference","title":"API Reference","headers":[]}],"modules":[{"id":"Slackex","title":"Slackex","functions":[{"id":"delete/3","anchor":"delete/3"},{"id":"delete!/3","anchor":"delete!/3"},{"id":"get/3","anchor":"get/3"},{"id":"get!/3","anchor":"get!/3"},{"id":"head/3","anchor":"head/3"},{"id":"head!/3","anchor":"head!/3"},{"id":"headers/0","anchor":"headers/0"},{"id":"options/3","anchor":"options/3"},{"id":"options!/3","anchor":"options!/3"},{"id":"params_with_auth/1","anchor":"params_with_auth/1"},{"id":"patch/4","anchor":"patch/4"},{"id":"patch!/4","anchor":"patch!/4"},{"id":"post/4","anchor":"post/4"},{"id":"post!/4","anchor":"post!/4"},{"id":"process_response_body/1","anchor":"process_response_body/1"},{"id":"process_url/1","anchor":"process_url/1"},{"id":"put/4","anchor":"put/4"},{"id":"put!/4","anchor":"put!/4"},{"id":"request/2","anchor":"request/2"},{"id":"request/5","anchor":"request/5"},{"id":"request!/5","anchor":"request!/5"},{"id":"start/0","anchor":"start/0"},{"id":"start/2","anchor":"start/2"},{"id":"token/0","anchor":"token/0"}],"types":[{"id":"headers/0","anchor":"t:headers/0"}]},{"id":"Slackex.Api","title":"Slackex.Api","functions":[{"id":"test/0","anchor":"test/0"}]},{"id":"Slackex.Auth","title":"Slackex.Auth","functions":[{"id":"test/0","anchor":"test/0"}]},{"id":"Slackex.Channels","title":"Slackex.Channels","functions":[{"id":"archive/1","anchor":"archive/1"},{"id":"create/1","anchor":"create/1"},{"id":"history/2","anchor":"history/2"},{"id":"info/1","anchor":"info/1"},{"id":"invite/2","anchor":"invite/2"},{"id":"join/1","anchor":"join/1"},{"id":"kick/2","anchor":"kick/2"},{"id":"leave/1","anchor":"leave/1"},{"id":"list/0","anchor":"list/0"},{"id":"mark/2","anchor":"mark/2"},{"id":"rename/2","anchor":"rename/2"},{"id":"set_purpose/2","anchor":"set_purpose/2"},{"id":"set_topic/2","anchor":"set_topic/2"},{"id":"unarchive/1","anchor":"unarchive/1"}]},{"id":"Slackex.Chat","title":"Slackex.Chat","functions":[{"id":"delete/2","anchor":"delete/2"},{"id":"post_message/3","anchor":"post_message/3"},{"id":"update/4","anchor":"update/4"}]},{"id":"Slackex.DoNotDisturb","title":"Slackex.DoNotDisturb","functions":[{"id":"end_dnd/0","anchor":"end_dnd/0"},{"id":"end_snooze/0","anchor":"end_snooze/0"},{"id":"info/1","anchor":"info/1"},{"id":"set_snooze/1","anchor":"set_snooze/1"},{"id":"team_info/1","anchor":"team_info/1"}]},{"id":"Slackex.Emoji","title":"Slackex.Emoji","functions":[{"id":"list/0","anchor":"list/0"}]},{"id":"Slackex.Files","title":"Slackex.Files","functions":[{"id":"delete/1","anchor":"delete/1"},{"id":"info/2","anchor":"info/2"},{"id":"list/1","anchor":"list/1"},{"id":"upload/2","anchor":"upload/2"}]},{"id":"Slackex.Files.Comments","title":"Slackex.Files.Comments","functions":[{"id":"add/2","anchor":"add/2"},{"id":"delete/2","anchor":"delete/2"},{"id":"edit/3","anchor":"edit/3"}]},{"id":"Slackex.Groups","title":"Slackex.Groups","functions":[{"id":"archive/1","anchor":"archive/1"},{"id":"close/1","anchor":"close/1"},{"id":"create/1","anchor":"create/1"},{"id":"create_child/1","anchor":"create_child/1"},{"id":"history/2","anchor":"history/2"},{"id":"info/1","anchor":"info/1"},{"id":"invite/2","anchor":"invite/2"},{"id":"kick/2","anchor":"kick/2"},{"id":"leave/1","anchor":"leave/1"},{"id":"list/1","anchor":"list/1"},{"id":"mark/2","anchor":"mark/2"},{"id":"open/1","anchor":"open/1"},{"id":"rename/2","anchor":"rename/2"},{"id":"set_purpose/2","anchor":"set_purpose/2"},{"id":"set_topic/2","anchor":"set_topic/2"},{"id":"unarchive/1","anchor":"unarchive/1"}]},{"id":"Slackex.IM","title":"Slackex.IM","functions":[{"id":"close/1","anchor":"close/1"},{"id":"history/2","anchor":"history/2"},{"id":"list/0","anchor":"list/0"},{"id":"mark/2","anchor":"mark/2"},{"id":"open/1","anchor":"open/1"}]},{"id":"Slackex.MPIM","title":"Slackex.MPIM","functions":[{"id":"close/1","anchor":"close/1"},{"id":"history/2","anchor":"history/2"},{"id":"list/0","anchor":"list/0"},{"id":"mark/2","anchor":"mark/2"},{"id":"open/1","anchor":"open/1"}]},{"id":"Slackex.OAuth","title":"Slackex.OAuth","functions":[{"id":"access/4","anchor":"access/4"}]},{"id":"Slackex.Pins","title":"Slackex.Pins","functions":[{"id":"add/2","anchor":"add/2"},{"id":"list/1","anchor":"list/1"},{"id":"remove/2","anchor":"remove/2"}]},{"id":"Slackex.RTM","title":"Slackex.RTM","functions":[{"id":"start/1","anchor":"start/1"}]},{"id":"Slackex.Reactions","title":"Slackex.Reactions","functions":[{"id":"add/2","anchor":"add/2"},{"id":"get/1","anchor":"get/1"},{"id":"list/1","anchor":"list/1"},{"id":"remove/2","anchor":"remove/2"}]},{"id":"Slackex.Search","title":"Slackex.Search","functions":[{"id":"all/2","anchor":"all/2"},{"id":"files/2","anchor":"files/2"},{"id":"messages/2","anchor":"messages/2"}]},{"id":"Slackex.Stars","title":"Slackex.Stars","functions":[{"id":"add/1","anchor":"add/1"},{"id":"list/1","anchor":"list/1"},{"id":"remove/1","anchor":"remove/1"}]},{"id":"Slackex.Supervisor","title":"Slackex.Supervisor","functions":[{"id":"init/1","anchor":"init/1"},{"id":"start_link/0","anchor":"start_link/0"}]},{"id":"Slackex.Team","title":"Slackex.Team","functions":[{"id":"access_logs/1","anchor":"access_logs/1"},{"id":"info/0","anchor":"info/0"},{"id":"integration_logs/1","anchor":"integration_logs/1"}]},{"id":"Slackex.UserGroups","title":"Slackex.UserGroups","functions":[{"id":"create/2","anchor":"create/2"},{"id":"disable/2","anchor":"disable/2"},{"id":"enable/2","anchor":"enable/2"},{"id":"list/1","anchor":"list/1"},{"id":"update/2","anchor":"update/2"}]},{"id":"Slackex.UserGroups.Users","title":"Slackex.UserGroups.Users","functions":[{"id":"list/2","anchor":"list/2"},{"id":"update/3","anchor":"update/3"}]},{"id":"Slackex.Users","title":"Slackex.Users","functions":[{"id":"get_presence/1","anchor":"get_presence/1"},{"id":"info/1","anchor":"info/1"},{"id":"list/1","anchor":"list/1"},{"id":"set_active/0","anchor":"set_active/0"},{"id":"set_presence/1","anchor":"set_presence/1"}]}],"protocols":[]} -------------------------------------------------------------------------------- /lib/slackex/groups.ex: -------------------------------------------------------------------------------- 1 | defmodule Slackex.Groups do 2 | @moduledoc """ 3 | Get info on your team's private channels. 4 | """ 5 | 6 | @doc """ 7 | This method archives a private channel. 8 | """ 9 | def archive(channel, options \\ %{}) do 10 | params = options |> Map.merge(%{channel: channel}) 11 | Slackex.request("groups.archive", params) 12 | end 13 | 14 | @doc """ 15 | This method closes a private channel. 16 | """ 17 | def close(channel, options \\ %{}) do 18 | params = options |> Map.merge(%{channel: channel}) 19 | Slackex.request("groups.close", params) 20 | end 21 | 22 | @doc """ 23 | This method creates a private channel. 24 | """ 25 | def create(name, options \\ %{}) do 26 | params = options |> Map.merge(%{name: name}) 27 | Slackex.request("groups.create", params) 28 | end 29 | 30 | @doc """ 31 | This method takes an existing private channel and 32 | performs the following steps: 33 | 34 | - Renames the existing private channel (from "example" 35 | to "example-archived"). 36 | - Archives the existing private channel. 37 | - Creates a new private channel with the name of the 38 | existing private channel. 39 | - Adds all members of the existing private channel to 40 | the new private channel. 41 | 42 | This is useful when inviting a new member to an existing 43 | private channel while hiding all previous chat history from 44 | them. In this scenario you can call groups.createChild 45 | followed by groups.invite. 46 | 47 | The new private channel will have a special parent_group 48 | property pointing to the original archived private channel. 49 | This will only be returned for members of both private channels, 50 | so will not be visible to any newly invited members. 51 | """ 52 | def create_child(channel, options \\ %{}) do 53 | params = options |> Map.merge(%{channel: channel}) 54 | Slackex.request("groups.createChild", params) 55 | end 56 | 57 | @doc """ 58 | This method returns a portion of messages/events from the 59 | specified private channel. To read the entire history for 60 | a private channel, call the method with no latest or oldest 61 | arguments, and then continue paging using the instructions 62 | below. 63 | """ 64 | def history(channel, options \\ %{}) do 65 | params = options |> Map.merge(%{channel: channel}) 66 | Slackex.request("groups.history", params) 67 | end 68 | 69 | @doc """ 70 | This method returns information about a private channel. 71 | """ 72 | def info(channel, options \\ %{}) do 73 | params = options |> Map.merge(%{channel: channel}) 74 | Slackex.request("groups.info", params) 75 | end 76 | 77 | @doc """ 78 | This method is used to invite a user to a private channel. 79 | The calling user must be a member of the private channel. 80 | 81 | To invite a new member to a private channel without giving 82 | them access to the archives of the private channel, call 83 | the groups.createChild method before inviting. 84 | """ 85 | def invite(channel, user, options \\ %{}) do 86 | params = options |> Map.merge(%{channel: channel, user: user}) 87 | Slackex.request("groups.invite", params) 88 | end 89 | 90 | @doc """ 91 | This method allows a user to remove another member from a 92 | private channel. 93 | """ 94 | def kick(channel, user, options \\ %{}) do 95 | params = options |> Map.merge( %{channel: channel, user: user}) 96 | Slackex.request("groups.kick", params) 97 | end 98 | 99 | @doc """ 100 | This method is used to leave a private channel. 101 | """ 102 | def leave(channel, options \\ %{}) do 103 | params = options |> Map.merge(%{channel: channel}) 104 | Slackex.request("groups.leave", params) 105 | end 106 | 107 | @doc """ 108 | This method returns a list of private channels in 109 | the team that the caller is in and archived groups 110 | that the caller was in. The list of (non-deactivated) 111 | members in each private channel is also returned. 112 | """ 113 | def list(options \\ %{}) do 114 | Slackex.request("groups.list", options) 115 | end 116 | 117 | @doc """ 118 | This method moves the read cursor in a private channel. 119 | """ 120 | def mark(channel, timestamp, options \\ %{}) do 121 | params = options |> Map.merge(%{channel: channel, ts: timestamp}) 122 | Slackex.request("groups.mark", params) 123 | end 124 | 125 | @doc """ 126 | This method opens a private channel. 127 | """ 128 | def open(channel, options \\ %{}) do 129 | params = options |> Map.merge(%{channel: channel}) 130 | Slackex.request("groups.open", params) 131 | end 132 | 133 | @doc """ 134 | This method renames a private channel. 135 | """ 136 | def rename(channel, name, options \\ %{}) do 137 | params = options |> Map.merge(%{channel: channel, name: name}) 138 | Slackex.request("groups.rename", params) 139 | end 140 | 141 | @doc """ 142 | This method is used to change the purpose of a 143 | private channel. The calling user must be a member 144 | of the private channel. 145 | """ 146 | def set_purpose(channel, purpose, options \\ %{}) do 147 | params = options |> Map.merge(%{channel: channel, purpose: purpose}) 148 | Slackex.request("groups.setPurpose", params) 149 | end 150 | 151 | @doc """ 152 | This method is used to change the topic of a private 153 | channel. The calling user must be a member of the 154 | private channel. 155 | """ 156 | def set_topic(channel, topic, options \\ %{}) do 157 | params = options |> Map.merge(%{channel: channel, topic: topic}) 158 | Slackex.request("groups.setTopic", params) 159 | end 160 | 161 | @doc """ 162 | This method unarchives a private channel. 163 | """ 164 | def unarchive(channel, options \\ %{}) do 165 | params = options |> Map.merge(%{channel: channel}) 166 | Slackex.request("groups.unarchive", params) 167 | end 168 | end 169 | -------------------------------------------------------------------------------- /doc/Slackex.Search.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Slackex.Search – slackex v0.0.1 9 | 10 | 11 | 12 | 13 | 14 |
15 | 18 | 56 | 57 |
58 |
59 | 60 | 61 |

62 | slackex v0.0.1 63 | Slackex.Search 64 | 65 | 66 |

67 | 68 | 69 |
70 |

Search your team’s files and messages.

71 | 72 |
73 | 74 | 75 | 76 |
77 |

78 | 79 | 80 | 81 | Summary 82 |

83 | 84 | 85 | 86 |
87 |

88 | Functions 89 |

90 |
91 | 94 | 95 |

This method allows to to search both messages 96 | and files in a single call

97 |
98 | 99 |
100 |
101 | 104 | 105 |

This method returns files matching a search query

106 |
107 | 108 |
109 |
110 | 113 | 114 |

This method returns messages matching a search query

115 |
116 | 117 |
118 | 119 |
120 | 121 | 122 | 123 | 124 | 125 | 126 |
127 | 128 | 129 | 130 | 131 | 132 |
133 |

134 | 135 | 136 | 137 | Functions 138 |

139 |
140 |
141 | 142 | 143 | 144 | all(query, options \\ %{}) 145 | 146 |
147 | 148 |
149 |

This method allows to to search both messages 150 | and files in a single call.

151 | 152 |
153 |
154 |
155 |
156 | 157 | 158 | 159 | files(query, options \\ %{}) 160 | 161 |
162 | 163 |
164 |

This method returns files matching a search query.

165 | 166 |
167 |
168 |
169 |
170 | 171 | 172 | 173 | messages(query, options \\ %{}) 174 | 175 |
176 | 177 |
178 |

This method returns messages matching a search query.

179 | 180 |
181 |
182 | 183 |
184 | 185 | 186 | 187 | 188 | 189 | 202 |
203 |
204 |
205 | 206 | 207 | 208 | 209 | -------------------------------------------------------------------------------- /doc/Slackex.Chat.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Slackex.Chat – slackex v0.0.1 9 | 10 | 11 | 12 | 13 | 14 |
15 | 18 | 56 | 57 |
58 |
59 | 60 | 61 |

62 | slackex v0.0.1 63 | Slackex.Chat 64 | 65 | 66 |

67 | 68 | 69 |
70 |

Post chat messages to Slack.

71 | 72 |
73 | 74 | 75 | 76 |
77 |

78 | 79 | 80 | 81 | Summary 82 |

83 | 84 | 85 | 86 |
87 |

88 | Functions 89 |

90 |
91 | 94 | 95 |

This method deletes a message from a channel

96 |
97 | 98 |
99 |
100 | 103 | 104 |

This method posts a message to a public channel, 105 | private group, or IM channel

106 |
107 | 108 |
109 |
110 | 113 | 114 |

This method updates a message in a channel

115 |
116 | 117 |
118 | 119 |
120 | 121 | 122 | 123 | 124 | 125 | 126 |
127 | 128 | 129 | 130 | 131 | 132 |
133 |

134 | 135 | 136 | 137 | Functions 138 |

139 |
140 |
141 | 142 | 143 | 144 | delete(channel, timestamp) 145 | 146 |
147 | 148 |
149 |

This method deletes a message from a channel.

150 | 151 |
152 |
153 |
154 |
155 | 156 | 157 | 158 | post_message(channel, text, options \\ %{}) 159 | 160 |
161 | 162 |
163 |

This method posts a message to a public channel, 164 | private group, or IM channel.

165 | 166 |
167 |
168 |
169 |
170 | 171 | 172 | 173 | update(channel, timestamp, text, options \\ %{}) 174 | 175 |
176 | 177 |
178 |

This method updates a message in a channel.

179 | 180 |
181 |
182 | 183 |
184 | 185 | 186 | 187 | 188 | 189 | 202 |
203 |
204 |
205 | 206 | 207 | 208 | 209 | -------------------------------------------------------------------------------- /doc/Slackex.Team.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Slackex.Team – slackex v0.0.1 9 | 10 | 11 | 12 | 13 | 14 |
15 | 18 | 56 | 57 |
58 |
59 | 60 | 61 |

62 | slackex v0.0.1 63 | Slackex.Team 64 | 65 | 66 |

67 | 68 | 69 |
70 |

Get info on your team

71 | 72 |
73 | 74 | 75 | 76 |
77 |

78 | 79 | 80 | 81 | Summary 82 |

83 | 84 | 85 | 86 |
87 |

88 | Functions 89 |

90 |
91 | 94 | 95 |

This method is used to get the access logs for 96 | users on a team

97 |
98 | 99 |
100 |
101 |
102 | info() 103 |
104 | 105 |

This method provides information about your team

106 |
107 | 108 |
109 |
110 | 113 | 114 |

This method lists the integration activity logs for 115 | a team, including when integrations are added, modified 116 | and removed. This method can only be called by Admins

117 |
118 | 119 |
120 | 121 |
122 | 123 | 124 | 125 | 126 | 127 | 128 |
129 | 130 | 131 | 132 | 133 | 134 |
135 |

136 | 137 | 138 | 139 | Functions 140 |

141 |
142 |
143 | 144 | 145 | 146 | access_logs(options \\ %{}) 147 | 148 |
149 | 150 |
151 |

This method is used to get the access logs for 152 | users on a team.

153 | 154 |
155 |
156 |
157 |
158 | 159 | 160 | 161 | info() 162 | 163 |
164 | 165 |
166 |

This method provides information about your team.

167 | 168 |
169 |
170 |
171 |
172 | 173 | 174 | 175 | integration_logs(options \\ %{}) 176 | 177 |
178 | 179 |
180 |

This method lists the integration activity logs for 181 | a team, including when integrations are added, modified 182 | and removed. This method can only be called by Admins.

183 | 184 |
185 |
186 | 187 |
188 | 189 | 190 | 191 | 192 | 193 | 206 |
207 |
208 |
209 | 210 | 211 | 212 | 213 | -------------------------------------------------------------------------------- /doc/Slackex.Files.Comments.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Slackex.Files.Comments – slackex v0.0.1 9 | 10 | 11 | 12 | 13 | 14 |
15 | 18 | 56 | 57 |
58 |
59 | 60 | 61 |

62 | slackex v0.0.1 63 | Slackex.Files.Comments 64 | 65 | 66 |

67 | 68 | 69 |
70 |

Handles comments on files

71 | 72 |
73 | 74 | 75 | 76 |
77 |

78 | 79 | 80 | 81 | Summary 82 |

83 | 84 | 85 | 86 |
87 |

88 | Functions 89 |

90 |
91 |
92 | add(file, comment) 93 |
94 | 95 |

Add a comment to an existing file

96 |
97 | 98 |
99 |
100 |
101 | delete(file, id) 102 |
103 | 104 |

Delete an existing comment on a file. Only the 105 | original author of the comment or a team 106 | administrator may delete a file comment

107 |
108 | 109 |
110 |
111 | 114 | 115 |

Edit an existing comment on a file. Only the user who 116 | created a comment may make edits. Teams may configure 117 | a limited time window during which file comment edits 118 | are allowed

119 |
120 | 121 |
122 | 123 |
124 | 125 | 126 | 127 | 128 | 129 | 130 |
131 | 132 | 133 | 134 | 135 | 136 |
137 |

138 | 139 | 140 | 141 | Functions 142 |

143 |
144 |
145 | 146 | 147 | 148 | add(file, comment) 149 | 150 |
151 | 152 |
153 |

Add a comment to an existing file.

154 | 155 |
156 |
157 |
158 |
159 | 160 | 161 | 162 | delete(file, id) 163 | 164 |
165 | 166 |
167 |

Delete an existing comment on a file. Only the 168 | original author of the comment or a team 169 | administrator may delete a file comment.

170 | 171 |
172 |
173 |
174 |
175 | 176 | 177 | 178 | edit(file, id, comment) 179 | 180 |
181 | 182 |
183 |

Edit an existing comment on a file. Only the user who 184 | created a comment may make edits. Teams may configure 185 | a limited time window during which file comment edits 186 | are allowed.

187 | 188 |
189 |
190 | 191 |
192 | 193 | 194 | 195 | 196 | 197 | 210 |
211 |
212 |
213 | 214 | 215 | 216 | 217 | -------------------------------------------------------------------------------- /doc/Slackex.Pins.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Slackex.Pins – slackex v0.0.1 9 | 10 | 11 | 12 | 13 | 14 |
15 | 18 | 56 | 57 |
58 |
59 | 60 | 61 |

62 | slackex v0.0.1 63 | Slackex.Pins 64 | 65 | 66 |

67 | 68 | 69 |
70 |

Manage Slack Pins

71 | 72 |
73 | 74 | 75 | 76 |
77 |

78 | 79 | 80 | 81 | Summary 82 |

83 | 84 | 85 | 86 |
87 |

88 | Functions 89 |

90 |
91 | 94 | 95 |

This method pins an item (file, file comment, channel 96 | message, or group message) to a particular channel. 97 | The channel argument is required and one of file, 98 | file_comment, or timestamp must also be specified

99 |
100 | 101 |
102 |
103 |
104 | list(channel) 105 |
106 | 107 |

This method lists the items pinned to a channel

108 |
109 | 110 |
111 |
112 | 115 | 116 |

This method un-pins an item (file, file comment, 117 | channel message, or group message) from a channel. 118 | The channel argument is required and one of file, 119 | file_comment, or timestamp must also be specified

120 |
121 | 122 |
123 | 124 |
125 | 126 | 127 | 128 | 129 | 130 | 131 |
132 | 133 | 134 | 135 | 136 | 137 |
138 |

139 | 140 | 141 | 142 | Functions 143 |

144 |
145 |
146 | 147 | 148 | 149 | add(channel, options \\ %{}) 150 | 151 |
152 | 153 |
154 |

This method pins an item (file, file comment, channel 155 | message, or group message) to a particular channel. 156 | The channel argument is required and one of file, 157 | file_comment, or timestamp must also be specified.

158 | 159 |
160 |
161 |
162 |
163 | 164 | 165 | 166 | list(channel) 167 | 168 |
169 | 170 |
171 |

This method lists the items pinned to a channel.

172 | 173 |
174 |
175 |
176 |
177 | 178 | 179 | 180 | remove(channel, options \\ %{}) 181 | 182 |
183 | 184 |
185 |

This method un-pins an item (file, file comment, 186 | channel message, or group message) from a channel. 187 | The channel argument is required and one of file, 188 | file_comment, or timestamp must also be specified.

189 | 190 |
191 |
192 | 193 |
194 | 195 | 196 | 197 | 198 | 199 | 212 |
213 |
214 |
215 | 216 | 217 | 218 | 219 | -------------------------------------------------------------------------------- /doc/Slackex.Stars.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Slackex.Stars – slackex v0.0.1 9 | 10 | 11 | 12 | 13 | 14 |
15 | 18 | 56 | 57 |
58 |
59 | 60 | 61 |

62 | slackex v0.0.1 63 | Slackex.Stars 64 | 65 | 66 |

67 | 68 | 69 |
70 |

Manage Slack Stars

71 | 72 |
73 | 74 | 75 | 76 |
77 |

78 | 79 | 80 | 81 | Summary 82 |

83 | 84 | 85 | 86 |
87 |

88 | Functions 89 |

90 |
91 | 94 | 95 |

This method adds a star to an item (message, file, 96 | file comment, channel, private group, or DM) on behalf 97 | of the authenticated user. One of file, file_comment, 98 | channel, or the combination of channel and timestamp 99 | must be specified

100 |
101 | 102 |
103 |
104 |
105 | list(options \\ %{}) 106 |
107 | 108 |

This method lists the items starred by a user

109 |
110 | 111 |
112 |
113 | 116 | 117 |

This method removes a star from an item (message, 118 | file, file comment, channel, private group, or DM) 119 | on behalf of the authenticated user. One of file, 120 | file_comment, channel, or the combination of channel 121 | and timestamp must be specified

122 |
123 | 124 |
125 | 126 |
127 | 128 | 129 | 130 | 131 | 132 | 133 |
134 | 135 | 136 | 137 | 138 | 139 |
140 |

141 | 142 | 143 | 144 | Functions 145 |

146 |
147 |
148 | 149 | 150 | 151 | add(options \\ %{}) 152 | 153 |
154 | 155 |
156 |

This method adds a star to an item (message, file, 157 | file comment, channel, private group, or DM) on behalf 158 | of the authenticated user. One of file, file_comment, 159 | channel, or the combination of channel and timestamp 160 | must be specified.

161 | 162 |
163 |
164 |
165 |
166 | 167 | 168 | 169 | list(options \\ %{}) 170 | 171 |
172 | 173 |
174 |

This method lists the items starred by a user.

175 | 176 |
177 |
178 |
179 |
180 | 181 | 182 | 183 | remove(options \\ %{}) 184 | 185 |
186 | 187 |
188 |

This method removes a star from an item (message, 189 | file, file comment, channel, private group, or DM) 190 | on behalf of the authenticated user. One of file, 191 | file_comment, channel, or the combination of channel 192 | and timestamp must be specified.

193 | 194 |
195 |
196 | 197 |
198 | 199 | 200 | 201 | 202 | 203 | 216 |
217 |
218 |
219 | 220 | 221 | 222 | 223 | -------------------------------------------------------------------------------- /doc/Slackex.Files.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Slackex.Files – slackex v0.0.1 9 | 10 | 11 | 12 | 13 | 14 |
15 | 18 | 56 | 57 |
58 |
59 | 60 | 61 |

62 | slackex v0.0.1 63 | Slackex.Files 64 | 65 | 66 |

67 | 68 | 69 |
70 |

Get info on files uploaded to Slack, upload 71 | new files to Slack.

72 | 73 |
74 | 75 | 76 | 77 |
78 |

79 | 80 | 81 | 82 | Summary 83 |

84 | 85 | 86 | 87 |
88 |

89 | Functions 90 |

91 |
92 |
93 | delete(file) 94 |
95 | 96 |

This method deletes a file from your team

97 |
98 | 99 |
100 |
101 | 104 | 105 |

This method returns information about a file in 106 | your team

107 |
108 | 109 |
110 |
111 |
112 | list(options \\ %{}) 113 |
114 | 115 |

This method returns a list of files within the team. 116 | It can be filtered and sliced in various ways

117 |
118 | 119 |
120 |
121 | 124 | 125 |

This method allows you to create or upload an existing file

126 |
127 | 128 |
129 | 130 |
131 | 132 | 133 | 134 | 135 | 136 | 137 |
138 | 139 | 140 | 141 | 142 | 143 |
144 |

145 | 146 | 147 | 148 | Functions 149 |

150 |
151 |
152 | 153 | 154 | 155 | delete(file) 156 | 157 |
158 | 159 |
160 |

This method deletes a file from your team.

161 | 162 |
163 |
164 |
165 |
166 | 167 | 168 | 169 | info(file, options \\ %{}) 170 | 171 |
172 | 173 |
174 |

This method returns information about a file in 175 | your team.

176 | 177 |
178 |
179 |
180 |
181 | 182 | 183 | 184 | list(options \\ %{}) 185 | 186 |
187 | 188 |
189 |

This method returns a list of files within the team. 190 | It can be filtered and sliced in various ways.

191 | 192 |
193 |
194 |
195 |
196 | 197 | 198 | 199 | upload(file, options \\ %{}) 200 | 201 |
202 | 203 |
204 |

This method allows you to create or upload an existing file.

205 | 206 |
207 |
208 | 209 |
210 | 211 | 212 | 213 | 214 | 215 | 228 |
229 |
230 |
231 | 232 | 233 | 234 | 235 | -------------------------------------------------------------------------------- /doc/Slackex.UserGroups.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Slackex.UserGroups – slackex v0.0.1 9 | 10 | 11 | 12 | 13 | 14 |
15 | 18 | 56 | 57 |
58 |
59 | 60 | 61 |

62 | slackex v0.0.1 63 | Slackex.UserGroups 64 | 65 | 66 |

67 | 68 | 69 |
70 |

Get info on your team’s user groups.

71 | 72 |
73 | 74 | 75 | 76 |
77 |

78 | 79 | 80 | 81 | Summary 82 |

83 | 84 | 85 | 86 |
87 |

88 | Functions 89 |

90 |
91 | 94 | 95 |

This method is used to create a user group

96 |
97 | 98 |
99 |
100 | 103 | 104 |

This method disables an existing user group

105 |
106 | 107 |
108 |
109 | 112 | 113 |

This method enables a user group which was 114 | previously disabled

115 |
116 | 117 |
118 |
119 |
120 | list(options \\ %{}) 121 |
122 | 123 |

This method returns a list of all user groups in the 124 | team. This can optionally include disabled user groups

125 |
126 | 127 |
128 |
129 | 132 | 133 |

This method updates the properties of an existing 134 | user group

135 |
136 | 137 |
138 | 139 |
140 | 141 | 142 | 143 | 144 | 145 | 146 |
147 | 148 | 149 | 150 | 151 | 152 |
153 |

154 | 155 | 156 | 157 | Functions 158 |

159 |
160 |
161 | 162 | 163 | 164 | create(name, options) 165 | 166 |
167 | 168 |
169 |

This method is used to create a user group.

170 | 171 |
172 |
173 |
174 |
175 | 176 | 177 | 178 | disable(usergroup, options \\ %{}) 179 | 180 |
181 | 182 |
183 |

This method disables an existing user group.

184 | 185 |
186 |
187 |
188 |
189 | 190 | 191 | 192 | enable(usergroup, options \\ %{}) 193 | 194 |
195 | 196 |
197 |

This method enables a user group which was 198 | previously disabled.

199 | 200 |
201 |
202 |
203 |
204 | 205 | 206 | 207 | list(options \\ %{}) 208 | 209 |
210 | 211 |
212 |

This method returns a list of all user groups in the 213 | team. This can optionally include disabled user groups.

214 | 215 |
216 |
217 |
218 |
219 | 220 | 221 | 222 | update(usergroup, options \\ %{}) 223 | 224 |
225 | 226 |
227 |

This method updates the properties of an existing 228 | user group.

229 | 230 |
231 |
232 | 233 |
234 | 235 | 236 | 237 | 238 | 239 | 252 |
253 |
254 |
255 | 256 | 257 | 258 | 259 | -------------------------------------------------------------------------------- /doc/Slackex.Reactions.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Slackex.Reactions – slackex v0.0.1 9 | 10 | 11 | 12 | 13 | 14 |
15 | 18 | 56 | 57 |
58 |
59 | 60 | 61 |

62 | slackex v0.0.1 63 | Slackex.Reactions 64 | 65 | 66 |

67 | 68 | 69 |
70 |

Manage Slack Reactions

71 | 72 |
73 | 74 | 75 | 76 |
77 |

78 | 79 | 80 | 81 | Summary 82 |

83 | 84 | 85 | 86 |
87 |

88 | Functions 89 |

90 |
91 | 94 | 95 |

This method adds a reaction (emoji) to an item 96 | (file, file comment, channel message, group message, 97 | or direct message). One of file, file_comment, or 98 | the combination of channel and timestamp must be 99 | specified

100 |
101 | 102 |
103 |
104 |
105 | get(options \\ %{}) 106 |
107 | 108 |

This method returns a list of all reactions for a single 109 | item (file, file comment, channel message, group message, 110 | or direct message)

111 |
112 | 113 |
114 |
115 |
116 | list(options \\ %{}) 117 |
118 | 119 |

This method returns a list of all items (file, file comment, 120 | channel message, group message, or direct message) reacted 121 | to by a user

122 |
123 | 124 |
125 |
126 | 129 | 130 |

This method removes a reaction (emoji) from an item (file, 131 | file comment, channel message, group message, or direct 132 | message). One of file, file_comment, or the combination of 133 | channel and timestamp must be specified

134 |
135 | 136 |
137 | 138 |
139 | 140 | 141 | 142 | 143 | 144 | 145 |
146 | 147 | 148 | 149 | 150 | 151 |
152 |

153 | 154 | 155 | 156 | Functions 157 |

158 |
159 |
160 | 161 | 162 | 163 | add(name, options \\ %{}) 164 | 165 |
166 | 167 |
168 |

This method adds a reaction (emoji) to an item 169 | (file, file comment, channel message, group message, 170 | or direct message). One of file, file_comment, or 171 | the combination of channel and timestamp must be 172 | specified.

173 | 174 |
175 |
176 |
177 |
178 | 179 | 180 | 181 | get(options \\ %{}) 182 | 183 |
184 | 185 |
186 |

This method returns a list of all reactions for a single 187 | item (file, file comment, channel message, group message, 188 | or direct message).

189 | 190 |
191 |
192 |
193 |
194 | 195 | 196 | 197 | list(options \\ %{}) 198 | 199 |
200 | 201 |
202 |

This method returns a list of all items (file, file comment, 203 | channel message, group message, or direct message) reacted 204 | to by a user.

205 | 206 |
207 |
208 |
209 |
210 | 211 | 212 | 213 | remove(name, options \\ %{}) 214 | 215 |
216 | 217 |
218 |

This method removes a reaction (emoji) from an item (file, 219 | file comment, channel message, group message, or direct 220 | message). One of file, file_comment, or the combination of 221 | channel and timestamp must be specified.

222 | 223 |
224 |
225 | 226 |
227 | 228 | 229 | 230 | 231 | 232 | 245 |
246 |
247 |
248 | 249 | 250 | 251 | 252 | -------------------------------------------------------------------------------- /doc/Slackex.DoNotDisturb.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Slackex.DoNotDisturb – slackex v0.0.1 9 | 10 | 11 | 12 | 13 | 14 |
15 | 18 | 56 | 57 |
58 |
59 | 60 | 61 |

62 | slackex v0.0.1 63 | Slackex.DoNotDisturb 64 | 65 | 66 |

67 | 68 | 69 |
70 |

Adjust and view Do Not Disturb settings for 71 | team members

72 | 73 |
74 | 75 | 76 | 77 |
78 |

79 | 80 | 81 | 82 | Summary 83 |

84 | 85 | 86 | 87 |
88 |

89 | Functions 90 |

91 |
92 |
93 | end_dnd() 94 |
95 | 96 |

Ends the user’s currently scheduled Do Not Disturb session immediately

97 |
98 | 99 |
100 |
101 |
102 | end_snooze() 103 |
104 | 105 |

Ends the current user’s snooze mode immediately

106 |
107 | 108 |
109 |
110 |
111 | info(options \\ %{}) 112 |
113 | 114 |

Provides information about a user’s current 115 | Do Not Disturb settings

116 |
117 | 118 |
119 |
120 | 123 | 124 |

Adjusts the snooze duration for a user’s Do Not 125 | Disturb settings. If a snooze session is not 126 | already active for the user, invoking this method 127 | will begin one for the specified duration

128 |
129 | 130 |
131 |
132 | 135 | 136 |

Provides information about the current Do Not Disturb 137 | settings for users of a Slack team

138 |
139 | 140 |
141 | 142 |
143 | 144 | 145 | 146 | 147 | 148 | 149 |
150 | 151 | 152 | 153 | 154 | 155 |
156 |

157 | 158 | 159 | 160 | Functions 161 |

162 |
163 |
164 | 165 | 166 | 167 | end_dnd() 168 | 169 |
170 | 171 |
172 |

Ends the user’s currently scheduled Do Not Disturb session immediately.

173 | 174 |
175 |
176 |
177 |
178 | 179 | 180 | 181 | end_snooze() 182 | 183 |
184 | 185 |
186 |

Ends the current user’s snooze mode immediately.

187 | 188 |
189 |
190 |
191 |
192 | 193 | 194 | 195 | info(options \\ %{}) 196 | 197 |
198 | 199 |
200 |

Provides information about a user’s current 201 | Do Not Disturb settings.

202 | 203 |
204 |
205 |
206 |
207 | 208 | 209 | 210 | set_snooze(num_minutes) 211 | 212 |
213 | 214 |
215 |

Adjusts the snooze duration for a user’s Do Not 216 | Disturb settings. If a snooze session is not 217 | already active for the user, invoking this method 218 | will begin one for the specified duration.

219 | 220 |
221 |
222 |
223 |
224 | 225 | 226 | 227 | team_info(options \\ %{}) 228 | 229 |
230 | 231 |
232 |

Provides information about the current Do Not Disturb 233 | settings for users of a Slack team.

234 | 235 |
236 |
237 | 238 |
239 | 240 | 241 | 242 | 243 | 244 | 257 |
258 |
259 |
260 | 261 | 262 | 263 | 264 | -------------------------------------------------------------------------------- /doc/Slackex.IM.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Slackex.IM – slackex v0.0.1 9 | 10 | 11 | 12 | 13 | 14 |
15 | 18 | 56 | 57 |
58 |
59 | 60 | 61 |

62 | slackex v0.0.1 63 | Slackex.IM 64 | 65 | 66 |

67 | 68 | 69 |
70 |

Get info on your direct messages.

71 | 72 |
73 | 74 | 75 | 76 |
77 |

78 | 79 | 80 | 81 | Summary 82 |

83 | 84 | 85 | 86 |
87 |

88 | Functions 89 |

90 |
91 |
92 | close(channel) 93 |
94 | 95 |

This method closes a direct message channel

96 |
97 | 98 |
99 |
100 | 103 | 104 |

This method returns a portion of messages/events 105 | from the specified direct message channel. To read 106 | the entire history for a direct message channel, call 107 | the method with no latest or oldest arguments, and 108 | then continue paging using the instructions below

109 |
110 | 111 |
112 |
113 |
114 | list() 115 |
116 | 117 |

This method returns a list of all im channels that 118 | the user has

119 |
120 | 121 |
122 |
123 | 126 | 127 |

This method moves the read cursor in a direct message 128 | channel

129 |
130 | 131 |
132 |
133 |
134 | open(user) 135 |
136 | 137 |

This method opens a direct message channel with 138 | another member of your Slack team

139 |
140 | 141 |
142 | 143 |
144 | 145 | 146 | 147 | 148 | 149 | 150 |
151 | 152 | 153 | 154 | 155 | 156 |
157 |

158 | 159 | 160 | 161 | Functions 162 |

163 |
164 |
165 | 166 | 167 | 168 | close(channel) 169 | 170 |
171 | 172 |
173 |

This method closes a direct message channel.

174 | 175 |
176 |
177 |
178 |
179 | 180 | 181 | 182 | history(channel, options \\ %{}) 183 | 184 |
185 | 186 |
187 |

This method returns a portion of messages/events 188 | from the specified direct message channel. To read 189 | the entire history for a direct message channel, call 190 | the method with no latest or oldest arguments, and 191 | then continue paging using the instructions below.

192 | 193 |
194 |
195 |
196 |
197 | 198 | 199 | 200 | list() 201 | 202 |
203 | 204 |
205 |

This method returns a list of all im channels that 206 | the user has.

207 | 208 |
209 |
210 |
211 |
212 | 213 | 214 | 215 | mark(channel, timestamp) 216 | 217 |
218 | 219 |
220 |

This method moves the read cursor in a direct message 221 | channel.

222 | 223 |
224 |
225 |
226 |
227 | 228 | 229 | 230 | open(user) 231 | 232 |
233 | 234 |
235 |

This method opens a direct message channel with 236 | another member of your Slack team.

237 | 238 |
239 |
240 | 241 |
242 | 243 | 244 | 245 | 246 | 247 | 260 |
261 |
262 |
263 | 264 | 265 | 266 | 267 | -------------------------------------------------------------------------------- /doc/Slackex.Users.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Slackex.Users – slackex v0.0.1 9 | 10 | 11 | 12 | 13 | 14 |
15 | 18 | 56 | 57 |
58 |
59 | 60 | 61 |

62 | slackex v0.0.1 63 | Slackex.Users 64 | 65 | 66 |

67 | 68 | 69 |
70 |

Get info on members of your Slack team.

71 | 72 |
73 | 74 | 75 | 76 |
77 |

78 | 79 | 80 | 81 | Summary 82 |

83 | 84 | 85 | 86 |
87 |

88 | Functions 89 |

90 |
91 |
92 | get_presence(user) 93 |
94 | 95 |

This method lets you find out information about 96 | a user’s presence. Consult the presence documentation 97 | for more details

98 |
99 | 100 |
101 |
102 |
103 | info(user) 104 |
105 | 106 |

This method returns information about a team member

107 |
108 | 109 |
110 |
111 |
112 | list(options \\ %{}) 113 |
114 | 115 |

This method returns a list of all users in the team. This 116 | includes deleted/deactivated users

117 |
118 | 119 |
120 |
121 |
122 | set_active() 123 |
124 | 125 |

This method lets the slack messaging server know that the 126 | authenticated user is currently active. Consult the 127 | presence documentation for more details

128 |
129 | 130 |
131 |
132 | 135 | 136 |

This method lets you set the calling user’s manual presence. 137 | Consult the presence documentation for more details

138 |
139 | 140 |
141 | 142 |
143 | 144 | 145 | 146 | 147 | 148 | 149 |
150 | 151 | 152 | 153 | 154 | 155 |
156 |

157 | 158 | 159 | 160 | Functions 161 |

162 |
163 |
164 | 165 | 166 | 167 | get_presence(user) 168 | 169 |
170 | 171 |
172 |

This method lets you find out information about 173 | a user’s presence. Consult the presence documentation 174 | for more details.

175 | 176 |
177 |
178 |
179 |
180 | 181 | 182 | 183 | info(user) 184 | 185 |
186 | 187 |
188 |

This method returns information about a team member.

189 | 190 |
191 |
192 |
193 |
194 | 195 | 196 | 197 | list(options \\ %{}) 198 | 199 |
200 | 201 |
202 |

This method returns a list of all users in the team. This 203 | includes deleted/deactivated users.

204 | 205 |
206 |
207 |
208 |
209 | 210 | 211 | 212 | set_active() 213 | 214 |
215 | 216 |
217 |

This method lets the slack messaging server know that the 218 | authenticated user is currently active. Consult the 219 | presence documentation for more details.

220 | 221 |
222 |
223 |
224 |
225 | 226 | 227 | 228 | set_presence(presence) 229 | 230 |
231 | 232 |
233 |

This method lets you set the calling user’s manual presence. 234 | Consult the presence documentation for more details.

235 | 236 |
237 |
238 | 239 |
240 | 241 | 242 | 243 | 244 | 245 | 258 |
259 |
260 |
261 | 262 | 263 | 264 | 265 | -------------------------------------------------------------------------------- /doc/Slackex.MPIM.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Slackex.MPIM – slackex v0.0.1 9 | 10 | 11 | 12 | 13 | 14 |
15 | 18 | 56 | 57 |
58 |
59 | 60 | 61 |

62 | slackex v0.0.1 63 | Slackex.MPIM 64 | 65 | 66 |

67 | 68 | 69 |
70 |

Get info on your multiparty direct messages.

71 | 72 |
73 | 74 | 75 | 76 |
77 |

78 | 79 | 80 | 81 | Summary 82 |

83 | 84 | 85 | 86 |
87 |

88 | Functions 89 |

90 |
91 |
92 | close(channel) 93 |
94 | 95 |

Get info on your multiparty direct messages

96 |
97 | 98 |
99 |
100 | 103 | 104 |

This method returns a portion of messages/events 105 | from the specified multiparty direct message channel. 106 | To read the entire history for a multiparty direct 107 | message, call the method with no latest or oldest 108 | arguments, and then continue paging using the 109 | instructions below

110 |
111 | 112 |
113 |
114 |
115 | list() 116 |
117 | 118 |

This method returns a list of all multiparty direct 119 | message channels that the user has

120 |
121 | 122 |
123 |
124 | 127 | 128 |

This method moves the read cursor in a multiparty 129 | direct message channel

130 |
131 | 132 |
133 |
134 |
135 | open(users) 136 |
137 | 138 |

This method opens a multiparty direct message

139 |
140 | 141 |
142 | 143 |
144 | 145 | 146 | 147 | 148 | 149 | 150 |
151 | 152 | 153 | 154 | 155 | 156 |
157 |

158 | 159 | 160 | 161 | Functions 162 |

163 |
164 |
165 | 166 | 167 | 168 | close(channel) 169 | 170 |
171 | 172 |
173 |

Get info on your multiparty direct messages.

174 | 175 |
176 |
177 |
178 |
179 | 180 | 181 | 182 | history(channel, options \\ %{}) 183 | 184 |
185 | 186 |
187 |

This method returns a portion of messages/events 188 | from the specified multiparty direct message channel. 189 | To read the entire history for a multiparty direct 190 | message, call the method with no latest or oldest 191 | arguments, and then continue paging using the 192 | instructions below.

193 | 194 |
195 |
196 |
197 |
198 | 199 | 200 | 201 | list() 202 | 203 |
204 | 205 |
206 |

This method returns a list of all multiparty direct 207 | message channels that the user has.

208 | 209 |
210 |
211 |
212 |
213 | 214 | 215 | 216 | mark(channel, timestamp) 217 | 218 |
219 | 220 |
221 |

This method moves the read cursor in a multiparty 222 | direct message channel.

223 | 224 |
225 |
226 |
227 |
228 | 229 | 230 | 231 | open(users) 232 | 233 |
234 | 235 |
236 |

This method opens a multiparty direct message.

237 |

Opening a multiparty direct message takes a list of 238 | up-to 8 encoded user ids. If there is no MPIM already 239 | created that includes that exact set of members, a 240 | new MPIM will be created. Subsequent calls to mpim.open 241 | with the same set of users will return the already 242 | existing MPIM conversation.

243 | 244 |
245 |
246 | 247 |
248 | 249 | 250 | 251 | 252 | 253 | 266 |
267 |
268 |
269 | 270 | 271 | 272 | 273 | -------------------------------------------------------------------------------- /doc/api-reference.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | API Reference – slackex v0.0.1 9 | 10 | 11 | 12 | 13 | 14 |
15 | 18 | 56 | 57 |
58 |
59 | 60 |

61 | slackex v0.0.1 62 | API Reference 63 |

64 | 65 | 72 | 73 | 74 |
75 |

Modules

76 |
77 |
78 | 79 | 80 |

An HTTP client for Slack

81 |
82 | 83 |
84 |
85 | 86 | 87 |

API Test Calls for Slack

88 |
89 | 90 |
91 |
92 | 93 | 94 |

Authentication Calls for Slack

95 |
96 | 97 |
98 |
99 | 100 | 101 |

Get info on your team’s Slack channels, 102 | create or archive channels, invite users, 103 | set the topic and purpose, and mark a 104 | channel as read

105 |
106 | 107 |
108 |
109 | 110 | 111 |

Post chat messages to Slack

112 |
113 | 114 |
115 |
116 | 117 | 118 |

Adjust and view Do Not Disturb settings for 119 | team members

120 |
121 | 122 |
123 |
124 | 125 | 126 |

Gets custom Emojis for a team

127 |
128 | 129 |
130 |
131 | 132 | 133 |

Get info on files uploaded to Slack, upload 134 | new files to Slack

135 |
136 | 137 |
138 |
139 | 140 | 141 |

Handles comments on files

142 |
143 | 144 |
145 |
146 | 147 | 148 |

Get info on your team’s private channels

149 |
150 | 151 |
152 |
153 | 154 | 155 |

Get info on your direct messages

156 |
157 | 158 |
159 |
160 | 161 | 162 |

Get info on your multiparty direct messages

163 |
164 | 165 |
166 |
167 | 168 | 169 |

Exchanges a temporary OAuth code for an API token

170 |
171 | 172 |
173 |
174 | 175 | 176 |

Manage Slack Pins

177 |
178 | 179 |
180 |
181 | 182 | 183 |

Manage Slack Real Time Messaging Session

184 |
185 | 186 |
187 |
188 | 189 | 190 |

Manage Slack Reactions

191 |
192 | 193 |
194 |
195 | 196 | 197 |

Search your team’s files and messages

198 |
199 | 200 |
201 |
202 | 203 | 204 |

Manage Slack Stars

205 |
206 | 207 |
208 |
209 | 210 | 211 |
212 |
213 | 214 | 215 |

Get info on your team

216 |
217 | 218 |
219 |
220 | 221 | 222 |

Get info on your team’s user groups

223 |
224 | 225 |
226 |
227 | 228 | 229 |

Get information on users in usergroups

230 |
231 | 232 |
233 |
234 | 235 | 236 |

Get info on members of your Slack team

237 |
238 | 239 |
240 | 241 |
242 |
243 | 244 | 245 | 246 | 247 | 248 | 261 |
262 |
263 |
264 | 265 | 266 | 267 | 268 | -------------------------------------------------------------------------------- /doc/Slackex.Channels.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Slackex.Channels – slackex v0.0.1 9 | 10 | 11 | 12 | 13 | 14 |
15 | 18 | 56 | 57 |
58 |
59 | 60 | 61 |

62 | slackex v0.0.1 63 | Slackex.Channels 64 | 65 | 66 |

67 | 68 | 69 |
70 |

Get info on your team’s Slack channels, 71 | create or archive channels, invite users, 72 | set the topic and purpose, and mark a 73 | channel as read.

74 | 75 |
76 | 77 | 78 | 79 |
80 |

81 | 82 | 83 | 84 | Summary 85 |

86 | 87 | 88 | 89 |
90 |

91 | Functions 92 |

93 |
94 |
95 | archive(channel) 96 |
97 | 98 |

This method archives a channel

99 |
100 | 101 |
102 |
103 |
104 | create(name) 105 |
106 | 107 |

This method is used to create a channel

108 |
109 | 110 |
111 |
112 | 115 | 116 |

This method returns a portion of messages/events 117 | from the specified channel. To read the entire 118 | history for a channel, call the method with no 119 | latest or oldest arguments, and then continue paging 120 | using the instructions below

121 |
122 | 123 |
124 |
125 |
126 | info(channel) 127 |
128 | 129 |
130 | 131 |
132 |
133 |
134 | invite(channel, user) 135 |
136 | 137 |

This method is used to invite a user to a channel. 138 | The calling user must be a member of the channel

139 |
140 | 141 |
142 |
143 |
144 | join(name) 145 |
146 | 147 |

This method is used to join a channel. If the 148 | channel does not exist, it is created

149 |
150 | 151 |
152 |
153 |
154 | kick(channel, user) 155 |
156 | 157 |

This method allows a user to remove another member 158 | from a team channel

159 |
160 | 161 |
162 |
163 |
164 | leave(channel) 165 |
166 | 167 |

This method is used to leave a channel

168 |
169 | 170 |
171 |
172 |
173 | list() 174 |
175 | 176 |

This method returns a list of all channels 177 | in the team. This includes channels the 178 | caller is in, channels they are not currently 179 | in, and archived channels but does not include 180 | private channels. The number of (non-deactivated) 181 | members in each channel is also returned

182 |
183 | 184 |
185 |
186 | 189 | 190 |

This method moves the read cursor in a channel

191 |
192 | 193 |
194 |
195 | 198 | 199 |

This method renames a team channel

200 |
201 | 202 |
203 |
204 | 207 | 208 |

This method is used to change the purpose of a 209 | channel. The calling user must be a member of 210 | the channel

211 |
212 | 213 |
214 |
215 | 218 | 219 |

This method is used to change the topic of a 220 | channel. The calling user must be a member of 221 | the channel

222 |
223 | 224 |
225 |
226 |
227 | unarchive(channel) 228 |
229 | 230 |

This method unarchives a channel. The calling 231 | user is added to the channel

232 |
233 | 234 |
235 | 236 |
237 | 238 | 239 | 240 | 241 | 242 | 243 |
244 | 245 | 246 | 247 | 248 | 249 |
250 |

251 | 252 | 253 | 254 | Functions 255 |

256 |
257 |
258 | 259 | 260 | 261 | archive(channel) 262 | 263 |
264 | 265 |
266 |

This method archives a channel.

267 | 268 |
269 |
270 |
271 |
272 | 273 | 274 | 275 | create(name) 276 | 277 |
278 | 279 |
280 |

This method is used to create a channel.

281 | 282 |
283 |
284 |
285 |
286 | 287 | 288 | 289 | history(channel, options \\ %{}) 290 | 291 |
292 | 293 |
294 |

This method returns a portion of messages/events 295 | from the specified channel. To read the entire 296 | history for a channel, call the method with no 297 | latest or oldest arguments, and then continue paging 298 | using the instructions below.

299 | 300 |
301 |
302 |
303 |
304 | 305 | 306 | 307 | info(channel) 308 | 309 |
310 | 311 |
312 | 313 |
314 |
315 |
316 |
317 | 318 | 319 | 320 | invite(channel, user) 321 | 322 |
323 | 324 |
325 |

This method is used to invite a user to a channel. 326 | The calling user must be a member of the channel.

327 | 328 |
329 |
330 |
331 |
332 | 333 | 334 | 335 | join(name) 336 | 337 |
338 | 339 |
340 |

This method is used to join a channel. If the 341 | channel does not exist, it is created.

342 | 343 |
344 |
345 |
346 |
347 | 348 | 349 | 350 | kick(channel, user) 351 | 352 |
353 | 354 |
355 |

This method allows a user to remove another member 356 | from a team channel.

357 | 358 |
359 |
360 |
361 |
362 | 363 | 364 | 365 | leave(channel) 366 | 367 |
368 | 369 |
370 |

This method is used to leave a channel.

371 | 372 |
373 |
374 |
375 |
376 | 377 | 378 | 379 | list() 380 | 381 |
382 | 383 |
384 |

This method returns a list of all channels 385 | in the team. This includes channels the 386 | caller is in, channels they are not currently 387 | in, and archived channels but does not include 388 | private channels. The number of (non-deactivated) 389 | members in each channel is also returned.

390 |

To retrieve a list of private channels, use groups.list

391 | 392 |
393 |
394 |
395 |
396 | 397 | 398 | 399 | mark(channel, timestamp) 400 | 401 |
402 | 403 |
404 |

This method moves the read cursor in a channel.

405 | 406 |
407 |
408 |
409 |
410 | 411 | 412 | 413 | rename(channel, new_name) 414 | 415 |
416 | 417 |
418 |

This method renames a team channel.

419 |

The only people who can rename a channel are team 420 | admins, or the person that originally created the 421 | channel. Others will receive a “not_authorized” 422 | error.

423 | 424 |
425 |
426 |
427 |
428 | 429 | 430 | 431 | set_purpose(channel, purpose) 432 | 433 |
434 | 435 |
436 |

This method is used to change the purpose of a 437 | channel. The calling user must be a member of 438 | the channel.

439 | 440 |
441 |
442 |
443 |
444 | 445 | 446 | 447 | set_topic(channel, topic) 448 | 449 |
450 | 451 |
452 |

This method is used to change the topic of a 453 | channel. The calling user must be a member of 454 | the channel.

455 | 456 |
457 |
458 |
459 |
460 | 461 | 462 | 463 | unarchive(channel) 464 | 465 |
466 | 467 |
468 |

This method unarchives a channel. The calling 469 | user is added to the channel.

470 | 471 |
472 |
473 | 474 |
475 | 476 | 477 | 478 | 479 | 480 | 493 |
494 |
495 |
496 | 497 | 498 | 499 | 500 | -------------------------------------------------------------------------------- /doc/Slackex.Groups.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Slackex.Groups – slackex v0.0.1 9 | 10 | 11 | 12 | 13 | 14 |
15 | 18 | 56 | 57 |
58 |
59 | 60 | 61 |

62 | slackex v0.0.1 63 | Slackex.Groups 64 | 65 | 66 |

67 | 68 | 69 |
70 |

Get info on your team’s private channels.

71 | 72 |
73 | 74 | 75 | 76 |
77 |

78 | 79 | 80 | 81 | Summary 82 |

83 | 84 | 85 | 86 |
87 |

88 | Functions 89 |

90 |
91 |
92 | archive(channel) 93 |
94 | 95 |

This method archives a private channel

96 |
97 | 98 |
99 |
100 |
101 | close(channel) 102 |
103 | 104 |

This method closes a private channel

105 |
106 | 107 |
108 |
109 |
110 | create(name) 111 |
112 | 113 |

This method creates a private channel

114 |
115 | 116 |
117 |
118 |
119 | create_child(channel) 120 |
121 | 122 |

This method takes an existing private channel and 123 | performs the following steps

124 |
125 | 126 |
127 |
128 | 131 | 132 |

This method returns a portion of messages/events from the 133 | specified private channel. To read the entire history for 134 | a private channel, call the method with no latest or oldest 135 | arguments, and then continue paging using the instructions 136 | below

137 |
138 | 139 |
140 |
141 |
142 | info(channel) 143 |
144 | 145 |

This method returns information about a private channel

146 |
147 | 148 |
149 |
150 |
151 | invite(channel, user) 152 |
153 | 154 |

This method is used to invite a user to a private channel. 155 | The calling user must be a member of the private channel

156 |
157 | 158 |
159 |
160 |
161 | kick(channel, user) 162 |
163 | 164 |

This method allows a user to remove another member from a 165 | private channel

166 |
167 | 168 |
169 |
170 |
171 | leave(channel) 172 |
173 | 174 |

This method is used to leave a private channel

175 |
176 | 177 |
178 |
179 |
180 | list(options \\ %{}) 181 |
182 | 183 |

This method returns a list of private channels in 184 | the team that the caller is in and archived groups 185 | that the caller was in. The list of (non-deactivated) 186 | members in each private channel is also returned

187 |
188 | 189 |
190 |
191 | 194 | 195 |

This method moves the read cursor in a private channel

196 |
197 | 198 |
199 |
200 |
201 | open(channel) 202 |
203 | 204 |

This method opens a private channel

205 |
206 | 207 |
208 |
209 |
210 | rename(channel, name) 211 |
212 | 213 |

This method renames a private channel

214 |
215 | 216 |
217 |
218 | 221 | 222 |

This method is used to change the purpose of a 223 | private channel. The calling user must be a member 224 | of the private channel

225 |
226 | 227 |
228 |
229 | 232 | 233 |

This method is used to change the topic of a private 234 | channel. The calling user must be a member of the 235 | private channel

236 |
237 | 238 |
239 |
240 |
241 | unarchive(channel) 242 |
243 | 244 |

This method unarchives a private channel

245 |
246 | 247 |
248 | 249 |
250 | 251 | 252 | 253 | 254 | 255 | 256 |
257 | 258 | 259 | 260 | 261 | 262 |
263 |

264 | 265 | 266 | 267 | Functions 268 |

269 |
270 |
271 | 272 | 273 | 274 | archive(channel) 275 | 276 |
277 | 278 |
279 |

This method archives a private channel.

280 | 281 |
282 |
283 |
284 |
285 | 286 | 287 | 288 | close(channel) 289 | 290 |
291 | 292 |
293 |

This method closes a private channel.

294 | 295 |
296 |
297 |
298 |
299 | 300 | 301 | 302 | create(name) 303 | 304 |
305 | 306 |
307 |

This method creates a private channel.

308 | 309 |
310 |
311 |
312 |
313 | 314 | 315 | 316 | create_child(channel) 317 | 318 |
319 | 320 |
321 |

This method takes an existing private channel and 322 | performs the following steps:

323 |
    324 |
  • Renames the existing private channel (from “example” 325 | to “example-archived”). 326 |
  • 327 |
  • Archives the existing private channel. 328 |
  • 329 |
  • Creates a new private channel with the name of the 330 | existing private channel. 331 |
  • 332 |
  • Adds all members of the existing private channel to 333 | the new private channel. 334 |
  • 335 |
336 |

This is useful when inviting a new member to an existing 337 | private channel while hiding all previous chat history from 338 | them. In this scenario you can call groups.createChild 339 | followed by groups.invite.

340 |

The new private channel will have a special parent_group 341 | property pointing to the original archived private channel. 342 | This will only be returned for members of both private channels, 343 | so will not be visible to any newly invited members.

344 | 345 |
346 |
347 |
348 |
349 | 350 | 351 | 352 | history(channel, options \\ %{}) 353 | 354 |
355 | 356 |
357 |

This method returns a portion of messages/events from the 358 | specified private channel. To read the entire history for 359 | a private channel, call the method with no latest or oldest 360 | arguments, and then continue paging using the instructions 361 | below.

362 | 363 |
364 |
365 |
366 |
367 | 368 | 369 | 370 | info(channel) 371 | 372 |
373 | 374 |
375 |

This method returns information about a private channel.

376 | 377 |
378 |
379 |
380 |
381 | 382 | 383 | 384 | invite(channel, user) 385 | 386 |
387 | 388 |
389 |

This method is used to invite a user to a private channel. 390 | The calling user must be a member of the private channel.

391 |

To invite a new member to a private channel without giving 392 | them access to the archives of the private channel, call 393 | the groups.createChild method before inviting.

394 | 395 |
396 |
397 |
398 |
399 | 400 | 401 | 402 | kick(channel, user) 403 | 404 |
405 | 406 |
407 |

This method allows a user to remove another member from a 408 | private channel.

409 | 410 |
411 |
412 |
413 |
414 | 415 | 416 | 417 | leave(channel) 418 | 419 |
420 | 421 |
422 |

This method is used to leave a private channel.

423 | 424 |
425 |
426 |
427 |
428 | 429 | 430 | 431 | list(options \\ %{}) 432 | 433 |
434 | 435 |
436 |

This method returns a list of private channels in 437 | the team that the caller is in and archived groups 438 | that the caller was in. The list of (non-deactivated) 439 | members in each private channel is also returned.

440 | 441 |
442 |
443 |
444 |
445 | 446 | 447 | 448 | mark(channel, timestamp) 449 | 450 |
451 | 452 |
453 |

This method moves the read cursor in a private channel.

454 | 455 |
456 |
457 |
458 |
459 | 460 | 461 | 462 | open(channel) 463 | 464 |
465 | 466 |
467 |

This method opens a private channel.

468 | 469 |
470 |
471 |
472 |
473 | 474 | 475 | 476 | rename(channel, name) 477 | 478 |
479 | 480 |
481 |

This method renames a private channel.

482 | 483 |
484 |
485 |
486 |
487 | 488 | 489 | 490 | set_purpose(channel, purpose) 491 | 492 |
493 | 494 |
495 |

This method is used to change the purpose of a 496 | private channel. The calling user must be a member 497 | of the private channel.

498 | 499 |
500 |
501 |
502 |
503 | 504 | 505 | 506 | set_topic(channel, topic) 507 | 508 |
509 | 510 |
511 |

This method is used to change the topic of a private 512 | channel. The calling user must be a member of the 513 | private channel.

514 | 515 |
516 |
517 |
518 |
519 | 520 | 521 | 522 | unarchive(channel) 523 | 524 |
525 | 526 |
527 |

This method unarchives a private channel.

528 | 529 |
530 |
531 | 532 |
533 | 534 | 535 | 536 | 537 | 538 | 551 |
552 |
553 |
554 | 555 | 556 | 557 | 558 | --------------------------------------------------------------------------------