Facts
application/x-www-form-urlencoded application/json Arguments
Optional arguments
client_idstringOptionalIssued when you created your application. If possible, avoid sending client_id and client_secret as parameters in your request and instead supply the Client ID and Client Secret using the HTTP Basic authentication scheme.
2141029472.691202649728client_secretstringOptionalIssued when you created your application. If possible, avoid sending client_id and client_secret as parameters in your request and instead supply the Client ID and Client Secret using the HTTP Basic authentication scheme.
e1b9e11dfcd19c1982d5de12921e17e8ccodestringOptionalThe code param returned via the OAuth callback.
4724469134.4644010092847.232b4e6d82c333b475fc30f5f5a341d294feb1a94392c2fd791f7ab7731a443d1aredirect_uristringOptionalThis must match the originally submitted URI (if one was sent).
http://example.comsingle_channelbooleanOptionalRequest the user to add your app only to a single channel. Only valid with a legacy workspace app.
falsetrueUsage info
This method allows you to exchange a temporary OAuth code for an API access token.
This is the third step of the OAuth authentication flow.
We strongly recommend supplying the Client ID and Client Secret using the HTTP Basic authentication scheme, as discussed in RFC 6749.
If at all possible, avoid sending client_id and client_secret as parameters in your request.
Keep your tokens secure. Do not share tokens with users or anyone else.
When used with a legacy workspace app, this method's response differs significantly.
A potential gotcha: while redirect_uri is optional, it is required if your app passed it as a parameter to oauth/authorization in the first step of the OAuth flow.
Response
Successful user token negotiation for a single scope
{
"access_token": "xoxp-XXXXXXXX-XXXXXXXX-XXXXX",
"scope": "groups:write",
"team_name": "Wyld Stallyns LLC",
"team_id": "TXXXXXXXXX",
"enterprise_id": null
}
Success example when asking for multiple scopes, a bot user token, and an incoming webhook
{
"access_token": "xoxp-XXXXXXXX-XXXXXXXX-XXXXX",
