Code Monkey home page Code Monkey logo

slackapidoc's Introduction

slackApiDoc

An unofficial documentation of "undocumented" Slack API methods.

GitHub GitHub contributors Badge

Purpose

Slack has a great web API which is documented here. In addition there are a couple of so called "undocumented" methods. These methods provide some additional and very useful functionality that is not available with the official set of API methods. The purpose of this document is to provide an up-to-date documentation to anyone who wants to use these methods.

IMPORTANT UPDATE: Slack has decided to remove legacy tokens from their API. It will no longer be possible to create new legacy tokens as of May 5th, 2020 (Source). If you have a working legacy token you should be able to continue using the undocumented API methods, but new users will not. Please take this into consideration when deciding about using any of the methods from this repo in your apps.

Disclaimer

Please note that Slack explicitely states in its API Terms of Service that all undocumented methods "may change at any time, you should not rely on these behaviors.". So use them at your own risk.

Scope of this repo

This repo contains a documentation of so called "undocumented" API methods for Slack. These methods are not documented in the official API documentation and usually require a legacy token to be used.

API methods that are only available via the web UI and require a runtime token are out of scope of this repo.

How to use undocumented API methods

  • Token type: In general all undocumented API methods require the post scopes and therefore needs to be called with a legacy token.
  • Slack apps: Since the post scope is not available through the standard Oauth process they can not be directly used in a normal Slack app. In order to use them in a Slack app a legacy token for the respective workspace needs to always be manually create and added.
  • Request types: In general these API methods support GET and standard POST requests only. Standard POST requests use bodies encoded as application/x-www-form-urlencoded. The more modern JSON encoded bodies are not supported.

Licence

This documentation is provided as public domain. Any help in keeping this document up-to-date and as complete and accurate as possible is very welcome.

Slack and the Slack API is owned by Slack Technologies, Inc. All rights reserved by Slack.

slackapidoc's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

slackapidoc's Issues

How Send Channels in users.admin.invite?

i dont know how to send the channels parameter in users.admin.invite.
i'm currently sending the channels as a list like this
channels = ["C8687"]
and got this response {'ok': False, 'error': 'channel_not_found'}
How to send this paramter. FYI i'm using slack_client package in python.

unknown_command

I'm trying to use this for posting a /poll comand. '/poll "question" "yes"' doesn't work, but '/poll' works.
For the former i receive the following response {"ok":false,"error":"unknown_command"}. Any help with this?

commands.list to get available slash commands

Just noticed a commands.list request being used by Slack:

:method: POST
:path: /api/commands.list?_x_id=<someid>

As far as I can tell it returns a list of all available slash commands on our team

Is this still working?

We have a new slack account and can't seem to get channels.delete to work. It returns:

{
    "ok": false,
    "error": "missing_scope",
    "needed": "post",
    "provided": "admin,identify,commands,incoming-webhook,channels:history,mpim:history,channels:read,mpim:read,users:read,channels:write,mpim:write,users:write,users.profile:write"
}

files.unshare

The browser seems to be able to send API calls to files.unshare.
You might want to add that info to this repo.

can a bot user use the chat.command method?

I tried chat.command method with Slack bot token, but got an error of "missing_scope".
The token needed "post" scope. However, official documents show that "post" scope is deprecated. How can I make my BOT token have "post" scope?

missing_scope

I created slack app. and send slack app token.
but response is missing_scope.
this api is only use legacy token??
so user legacy token is only use???
how to send message poll using slack app.
please help me.

users.admin.invite - API error

Hi,

I am getting this error while using this API.

Error: {"ok":false,"error":"no_perms"}

I am sending a test token, email and channel name properly.

The error does not list API error log documentation.

I use this WordPress plugin https://www.wpslacksync.com/.

Although I also trying to hit the API with token, email and channel directly in the browser HTTP. Same error encounter Error: {"ok":false,"error":"no_perms"}

Thanks

is users.admin.invite still valid?

Sending requests with a legacy token for my user on a workspace I created, and with an email value i still always receive:

{
  "ok": false
  "error": "invalid_array_arg"
}

`/api/users.admin.invite` no longer accepting resend option

I noticed this today, but when I use the resend: true on the /api/users.admin.invite endpoint, it's no longer allowing me to resend invitations to emails with a pending invitation.

The response I get back from the API is:

{
  "ok": false,
  "error": "already_invited"
}

users.admin.invite optional params don't work

I've tried channels, first_name and last_name params from doc, but they don't work. User still need to enter full name and display name on registration screen and after registration user has only one default channel.
Probably slack team changed something.

Guest Parameter not working

I'm using the following method to invite a new user:

var slackTeam = "test";
var token = 'test'; 

var url = 'https://'+ slackTeam + '.slack.com/api/users.admin.invite';
fetch(url, { 
  method: 'POST',
  headers: {'Content-Type': 'application/x-www-form-urlencoded'},
  body: 
  "token="+ token + 
  "&email=" + inputData.email +
  "&restricted "+ "1" +
  "&channels="+ "C9GJX4DC3,CAK2BTR1C,CAW19EWEN,C4U78KLDT,CAVA80GRE,C4BAV7VK8"+
  "&first_name "+ inputData.name +
  "&last_name "+ inputData.lastName +
  "&expiration_ts  "+ 1543582799 
})

But for some reason, all the invitations I'm sending are Full Members instead of guests. I also tried with "&restricted "+ "true" but still not working. I'm on a Standard plan . Anyone with the same issue?

Thanks!

Cant find user throught API.

Hi there!

It seems when i do a GET to disable a user it get "user not found".
When i export a workspace and i search for the ID (wich is unique) i CAN find the user.

Anyone else also having this issue? I cant seem to find the solution.

Kind regrads,
Graxo

Removal of users.admin.invite

Are you aware of any alternatives to users.admin.invite? With the deprecation of legacy tokens the only endpoint publicly listed is admin.users.invite, which is Pro/Enterprise only.

The Slack web UI uses the users.admin.inviteBulk endpoint, which might be a viable alternative. Example payload:

[{"email":"[email protected]","mode":"manual","type":"regular"}]

I would investigate this endpoint, but you're much more experienced at exploring undocumented Slack APIs than me.

not_allowed_token_type error response

Thank you for documenting these APIs! This is very helpful.

I've been attempting to use the users.admin.invite API but when I use my API token I'm getting a "not_allowed_token_type" error. Have you seen this before? I'm guessing I generated my token in an incorrect way so if you have any thoughts on where I should look to generate a new one I'd appreciate it!

Thanks!

Another missing error in users.admin.invite

I just got a already_in_team_invited_user error from users.admin.invite which sounds really strange, like what does this even mean...?

The user shows up as a "Full Member" on the Slack admin. So I guess it's more similar to already_in_team error.

conversations.convertToPrivate Method

I'm looking into a way to programmatically convert a public channel to private (in order to make something self-service for end users) and it looks like the undocumented conversations.convertToPrivate API method is what the browser calls in order to make a channel private.

It looks like the browser client sends token and channel values through form data in a POST call.

`channel_not_found` error from `users.admin.invite` endpoint

I got a channel_not_found error until I used the channel ID, rather than the channel name, in the list of channels a user should be auto-enrolled. I'm not sure if that's because it was a private channel, so am raising an issue rather than submitting a PR. Others might benefiting from being aware that they may need to use the ID, not the channel name.

use users.admin.setRestricted or setUltraRestricted like users.admin.invite

I tried to use the "users.admin.setRestricted" or "setUltraRestricted" method as you explained with the "users.admin.invite", but I get the error:
Content : {"ok":false,"error":"not_allowed_token_type"}
I use the same token.
I am looking for the ability to change account types while avoiding the Slack Admin Interface.
Do you have any ideas on this?
Thanks!
BR Kostia

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.