MCPcopy Index your code
hub / github.com/slackapi/python-slack-sdk / endpoint

Function endpoint

integration_tests/samples/issues/issue_690.py:19–32  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

17
18@app.route("/slack/oauth/callback", methods=["GET"])
19def endpoint():
20 code = request.args.get("code")
21 from slack_sdk.web import WebClient
22 from slack_sdk.errors import SlackApiError
23
24 try:
25 client = WebClient(token="")
26 client_id = os.environ["SLACK_CLIENT_ID"]
27 client_secret = os.environ["SLACK_CLIENT_SECRET"]
28 response = client.oauth_v2_access(client_id=client_id, client_secret=client_secret, code=code)
29 result = response.get("error", "success!")
30 return str(result)
31 except SlackApiError as e:
32 return make_response(str(e), 400)
33
34
35if __name__ == "__main__":

Callers

nothing calls this directly

Calls 3

oauth_v2_accessMethod · 0.95
WebClientClass · 0.90
getMethod · 0.45

Tested by

no test coverage detected