Skip to content

Commit

Permalink
Merge pull request #577 from stevengill/issue-575
Browse files Browse the repository at this point in the history
Added oAuth.v2.access API
  • Loading branch information
stevengill committed Dec 9, 2019
2 parents 33ef376 + 8b296e0 commit 5411500
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions slack/web/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -1267,6 +1267,23 @@ def mpim_replies(
kwargs.update({"channel": channel, "thread_ts": thread_ts})
return self.api_call("mpim.replies", http_verb="GET", params=kwargs)

def oauth_v2_access(
self, *, client_id: str, client_secret: str, code: str, **kwargs
) -> Union[Future, SlackResponse]:
"""Exchanges a temporary OAuth verifier code for an access token.
Args:
client_id (str): Issued when you created your application. e.g. '4b39e9-752c4'
client_secret (str): Issued when you created your application. e.g. '33fea0113f5b1'
code (str): The code param returned via the OAuth callback. e.g. 'ccdaa72ad'
"""
kwargs.update({"code": code})
return self.api_call(
"oauth.v2.access",
data=kwargs,
auth={"client_id": client_id, "client_secret": client_secret},
)

def oauth_access(
self, *, client_id: str, client_secret: str, code: str, **kwargs
) -> Union[Future, SlackResponse]:
Expand Down

0 comments on commit 5411500

Please sign in to comment.