Skip to content

Latest commit

 

History

History
266 lines (253 loc) · 21.9 KB

README.md

File metadata and controls

266 lines (253 loc) · 21.9 KB

Slack API GoReport GoDoc

Slack, the "messaging app for teams" offers an API that has been used to build multiple projects around it, from bots to independent clients as well as integrations with other external services. This project aims to offer a low level experience for advanced users that want to either drop the web client or interact with the API for testing purpose.

Installation CLI

go get -u github.com/cixtor/slackcli

Installation Source

package main

import (
    "fmt"
    "github.com/cixtor/slackapi"
)

func main() {
    client := slackapi.New()
    fmt.Println(client.Version())
}

Features

The client is built on top of the Bot Users documentation. Most if not all the methods available in the API are implemented and can be executed placing a colon character as the suffix of each method.

Note that the client runs with the same chat session of the user that is using the program, but technically speaking the interaction is similar to that of a bot. This offers some advantages, for example, like other APIs and integrations, bot users are free. Unlike regular users, the actions they can perform are somewhat limited. For teams on the Free Plan, each bot user counts as a separate integration.

Implemented API Endpoints

  • 🔵 means the method has been implemented
  • 🔴 means the method is not implemented yet
  • 💀 means the method has been deprecated without a replacement
:shipit: Method Description
🔵 admin.analytics.getChannelsAnalytics Retrieve analytics data for all the workspace channels
🔴 admin.apps.approve Approve an app for installation on a workspace
🔴 admin.apps.restrict Restrict an app for installation on a workspace
🔴 admin.apps.approved.list List approved apps for an org or workspace
🔴 admin.apps.requests.list List app requests for a team/workspace
🔴 admin.apps.restricted.list List restricted apps for an org or workspace
🔴 admin.conversations.restrictAccess.addGroup Add an allowlist of IDP groups for accessing a channel
🔴 admin.conversations.restrictAccess.listGroups List all IDP Groups linked to a channel
🔴 admin.conversations.restrictAccess.removeGroup Remove a linked IDP group linked from a private channel
🔴 admin.conversations.setTeams Set the workspaces in an Enterprise grid org that connect to a channel
🔴 admin.emoji.add Add an emoji
🔴 admin.emoji.addAlias Add an emoji alias
🔴 admin.emoji.list List emoji for an Enterprise Grid organization
🔴 admin.emoji.remove Remove an emoji across an Enterprise Grid organization
🔴 admin.emoji.rename Rename an emoji
🔴 admin.inviteRequests.approve Approve a workspace invite request
🔴 admin.inviteRequests.deny Deny a workspace invite request
🔴 admin.inviteRequests.list List all pending workspace invite requests
🔴 admin.inviteRequests.approved.list List all approved workspace invite requests
🔴 admin.inviteRequests.denied.list List all denied workspace invite requests
🔴 admin.teams.admins.list List all of the admins on a given workspace
🔴 admin.teams.create Create an Enterprise team
🔴 admin.teams.list List all teams on an Enterprise organization
🔴 admin.teams.owners.list List all of the owners on a given workspace
🔴 admin.teams.settings.info Fetch information about settings in a workspace
🔴 admin.teams.settings.setDefaultChannels Set the default channels of a workspace
🔴 admin.teams.settings.setDescription Set the description of a given workspace
🔴 admin.teams.settings.setDiscoverability An API method that allows admins to set the discoverability of a given workspace
🔴 admin.teams.settings.setIcon Sets the icon of a workspace
🔴 admin.teams.settings.setName Set the name of a given workspace
🔴 admin.usergroups.addChannels Add up to one hundred default channels to an IDP group
🔴 admin.usergroups.addTeams Associate one or more default workspaces with an organization-wide IDP group
🔴 admin.usergroups.listChannels List the channels linked to an org-level IDP group (user group)
🔴 admin.usergroups.removeChannels Remove one or more default channels from an org-level IDP group (user group)
🔴 admin.users.assign Add an Enterprise user to a workspace
🔴 admin.users.invite Invite a user to a workspace
🔴 admin.users.list List users on a workspace
🔴 admin.users.remove Remove a user from a workspace
🔵 admin.users.session.clearSettings Clear user-specific session settings—the session duration and what happens when the client closes—for a list of users
🔵 admin.users.session.getSettings Get user-specific session settings—the session duration and what happens when the client closes—given a list of users
🔵 admin.users.session.invalidate Revoke a single session for a user. The user will be forced to login to Slack
🔵 admin.users.session.list List active user sessions for an organization
🔵 admin.users.session.reset Wipes all valid sessions on all devices for a given user
🔵 admin.users.session.resetBulk Enqueues an asynchronous job to wipe all valid sessions on all devices for a given list of users
🔵 admin.users.session.setSettings Configure the user-level session settings—the session duration and what happens when the client closes—for one or more users
🔴 admin.users.setAdmin Set an existing guest, regular user, or owner to be an admin user
🔴 admin.users.setExpiration Set an expiration for a guest user
🔴 admin.users.setOwner Set an existing guest, regular user, or admin user to be a workspace owner
🔴 admin.users.setRegular Set an existing guest user, admin user, or owner to be a regular user
🔵 api.test Checks API calling code
🔵 api.getFlannelHttpUrl Gets the organization's canonical API endpoint
🔵 apps.list Lists associated applications
🔵 apps.connections.open Generate a temporary Socket Mode WebSocket URL that your app can connect to in order to receive events and interactive payloads over
🔵 apps.event.authorizations.list Get a list of authorizations for the given event context. Each authorization represents an app installation that the event is visible to
🔵 apps.manifest.create Create an app from an app manifest
🔵 apps.manifest.delete Permanently deletes an app created through app manifests
🔵 apps.manifest.export Export an app manifest from an existing app
🔵 apps.manifest.update Update an app from an app manifest
🔵 apps.manifest.validate Validate an app manifest
🔵 apps.uninstall Uninstalls your app from a workspace
🔵 auth.revoke Revokes a token
🔵 auth.teams.list List the workspaces a token can access
🔵 auth.test Checks authentication and identity
🔵 bots.info Gets information about a bot user
🔴 calls.add Registers a new Call
🔴 calls.end Ends a Call
🔴 calls.info Returns information about a Call
🔴 calls.update Updates information about a Call
🔴 calls.participants.add Registers new participants added to a Call
🔴 calls.participants.remove Registers participants removed from a Call
🔵 chat.delete Deletes a message
🔵 chat.deleteAttachment Deletes a message attachment
🔴 chat.deleteScheduledMessage Deletes a pending scheduled message from the queue
🔴 chat.getPermalink Retrieve a permalink URL for a specific extant message
🔵 chat.meMessage Share a me message into a channel
🔴 chat.postEphemeral Sends an ephemeral message to a user in a channel
🔵 chat.postMessage Sends a message to a channel
🔴 chat.scheduleMessage Schedules a message to be sent to a channel
🔴 chat.scheduledMessages.list Returns a list of scheduled messages
🔴 chat.unfurl Provide custom unfurl behavior for user-posted URLs
🔵 chat.update Updates a message
🔵 client.counts List mentions in different conversations
🔵 client.shouldReload Determine if the Slack client must reload or not
🔵 conversations.acceptSharedInvite Accepts an invitation to a Slack Connect channel
🔵 conversations.approveSharedInvite Approves an invitation to a Slack Connect channel
🔵 conversations.archive Archives a conversation
🔵 conversations.close Closes a direct message or multi-person direct message
🔵 conversations.create Initiates a public or private channel-based conversation
🔵 conversations.declineSharedInvite Declines a Slack Connect channel invite
🔵 conversations.delete Delete a public or private channel
🔵 conversations.genericInfo Retrieve information about various channels
🔵 conversations.history Fetches a conversation's history of messages and events
🔵 conversations.info Retrieve information about a conversation
🔵 conversations.invite Invites users to a channel
🔵 conversations.inviteShared Sends an invitation to a Slack Connect channel
🔵 conversations.join Joins an existing conversation
🔵 conversations.kick Removes a user from a conversation
🔵 conversations.leave Leaves a conversation
🔵 conversations.list Lists all channels in a Slack team
🔵 conversations.listConnectInvites Lists shared channel invites that have been generated or received but have not been approved by all parties
🔵 conversations.mark Sets the read cursor in a channel
🔵 conversations.members Retrieve members of a conversation
🔵 conversations.open Opens or resumes a direct message or multi-person direct message
🔵 conversations.rename Renames a conversation
🔵 conversations.replies Retrieve a thread of messages posted to a conversation
🔵 conversations.setPurpose Sets the purpose for a conversation
🔵 conversations.setTopic Sets the topic for a conversation
🔵 conversations.suggestions List Slack suggestions to join conversations
🔵 conversations.unarchive Reverses conversation archival
🔴 dialog.open Open a dialog with a user
🔵 dnd.endDnd Ends the current user's "Do Not Disturb" session immediately
🔵 dnd.endSnooze Ends the current user's snooze mode immediately
🔵 dnd.info Retrieves a user's current "Do Not Disturb" status
🔵 dnd.setSnooze Turns on "Do Not Disturb" mode for the current user, or changes its duration
🔵 dnd.teamInfo Retrieves the "Do Not Disturb" status for up to 50 users on a team
🔵 emoji.add Uploads and registers a new custom emoji
🔵 emoji.addAlias Creates an alias for an existing emoji
🔵 emoji.getInfo Retrieves information about a custom emoji
🔵 emoji.list Lists custom emoji for a team
🔵 emoji.remove Remove an emoji from a team
🔵 eventlog.history Lists all the events since the specified time
🔵 files.comments.add Add a comment to an existing file
🔵 files.comments.delete Deletes an existing comment on a file
🔵 files.comments.edit Edit an existing file comment
🔵 files.delete Deletes a file
🔵 files.info Gets information about a team file
🔵 files.list Lists and filters team files
🔵 files.listAfterTime Lists and filters team files after this timestamp (inclusive)
🔵 files.listBeforeTime Lists and filters team files before this timestamp (inclusive)
🔵 files.listByChannel Lists and filters team files in a specific channel
🔵 files.listByType Lists and filters team files by type: all, posts, snippets, images, gdocs, zips, pdfs
🔵 files.listByUser Lists and filters team files created by a single user
🔵 files.revokePublicURL Revokes public/external sharing access for a file
🔵 files.sharedPublicURL Enables a file for public/external sharing
🔵 files.upload Uploads or creates a file
🔴 files.remote.add Adds a file from a remote service
🔴 files.remote.info Retrieve information about a remote file added to Slack
🔴 files.remote.list Retrieve information about a remote file added to Slack
🔴 files.remote.remove Remove a remote file
🔴 files.remote.share Share a remote file into a channel
🔴 files.remote.update Updates an existing remote file
🔵 help.issues.list List issues reported by the current user
🔵 migration.exchange For Enterprise Grid workspaces, map local user IDs to global user IDs
🔴 oauth.access Exchanges a temporary OAuth code for an API token
🔴 oauth.token Exchanges a temporary OAuth verifier code for a workspace token
🔴 oauth.v2.access Exchanges a temporary OAuth verifier code for an access token
🔵 oauth.v2.exchange Exchanges a legacy access token for a new expiring access token and refresh token
🔵 payments.billing.addresses.get Gets the organization billing address
🔵 payments.billing.addresses.validateAndSet Validates and sets the organization billing address
🔵 pins.add Pins an item to a channel
🔵 pins.list Lists items pinned to a channel
🔵 pins.remove Un-pins an item from a channel
🔵 reactions.add Adds a reaction to an item
🔵 reactions.get Gets reactions for an item
🔵 reactions.list Lists reactions made by a user
🔵 reactions.remove Removes a reaction from an item
🔴 reminders.add Creates a reminder
🔴 reminders.complete Marks a reminder as complete
🔴 reminders.delete Deletes a reminder
🔴 reminders.info Gets information about a reminder
🔴 reminders.list Lists all reminders created by or for a given user
🔵 rtm.connect Starts a Real Time Messaging session
🔵 rtm.start Deprecated: Starts a Real Time Messaging session. Use rtm.connect instead
🔵 rtm.events Prints the API events in real time
🔵 search.all Searches for messages and files matching a query
🔵 search.files Searches for files matching a query
🔵 search.messages Searches for messages matching a query
🔵 search.modules Searches for modules matching a query
🔵 search.users Search users by name or email address
🔵 signup.checkEmail Checks if an email address is valid
🔵 signup.confirmEmail Confirm an email address for signup
🔵 slackbot.responses.add Adds a new automatic Slackbot response
🔵 slackbot.responses.edit Edits an existing automatic Slackbot response
🔵 slackbot.responses.delete Deletes an existing automatic Slackbot response
🔵 stars.add Adds a star to an item
🔵 stars.list Lists stars for a user
🔵 stars.remove Removes a star from an item
🔵 team.accessLogs Gets the access logs for the current team
🔵 team.billableInfo Gets billable users information for the current team
🔵 team.billing.info Reads a workspace's billing plan information
🔵 team.channels.info Retrieve a list of channels in a specific team
🔵 team.channels.membership Retrieve membership information about a team
🔵 team.info Gets information about the current team
🔵 team.integrationLogs Gets the integration logs for the current team
🔵 team.listExternal List external teams and their corresponding information
🔵 team.preferences.list Retrieve a list of a workspace's team preferences
🔵 team.profile.get Retrieve a team's profile
🔴 usergroups.create Create a User Group
🔴 usergroups.disable Disable an existing User Group
🔴 usergroups.enable Enable a User Group
🔴 usergroups.list List all User Groups for a team
🔴 usergroups.update Update an existing User Group
🔴 usergroups.users.list List all users in a User Group
🔴 usergroups.users.update Update the list of users for a User Group
🔵 users.admin.fetchInvitesHistory Gets invitations to join your workspace
🔵 users.admin.inviteBulk Invite others to join your workspace
🔵 users.admin.resendInvitation Resend an invitation to join your workspace
🔵 users.admin.revokeInvitation Revoke an invitation to join your workspace
🔵 users.admin.setInactive Deactivates an existing user account
🔵 users.admin.setRegular Activates an account as a regular user
🔴 users.conversations List conversations the calling user may access
🔵 users.deletePhoto Delete the user profile photo
🔵 users.getPresence Gets user presence information
🔵 users.identity Get a user's identity
🔵 users.info Gets information about a user
🔵 users.list Lists all users in a Slack team
🔵 users.lookupByEmail Find a user with an email address
🔵 users.prefs.get Get user account preferences
🔵 users.prefs.set Set user account preferences
🔵 users.preparePhoto Upload a picture to use as the avatar
🔵 users.profile.get Retrieves a user's profile information
🔵 users.profile.set Set the profile information for a user
🔵 users.setAvatar Upload a picture and set it as the avatar
🔵 users.setEmail Changes the email address without confirmation
🔵 users.setPhoto Set the user profile photo
🔵 users.setPresence Manually sets user presence
🔵 users.setStatus Set the status message and emoji
🔵 users.setUsername Changes the username without admin privileges
🔵 version Displays the program version number
🔴 views.open Open a view for a user
🔴 views.publish Publish a static view for a User
🔴 views.push Push a view onto the stack of a root view
🔴 views.update Update an existing view
🔵 workflows.stepCompleted Indicate that an app's step in a workflow completed execution
🔵 workflows.stepFailed Indicate that an app's step in a workflow failed to execute
🔵 workflows.updateStep Update the configuration for a workflow step