Tuesday 16 May 2017

can't get bot access token when requesting oauth2 for slack app

I have integrated a bot using the link here and got a bot access token with which I wrote all my code for the bot. Now I want to put the bot in a slack app. So I went ahead and created my app following these tutorials, this tells how to create an app with a bot and this tells how to easily do oauth2.

Now in my JSON response I get everything except the bot node in which the bot access token should be. Any idea where I might be going wrong?

I get

{ "access_token": "xoxp-XXXXXXXX-XXXXXXXX-XXXXX", "scope": "identify,bot,incoming-webhook,channels:history", "team_name": "yyyyyyyy", "team_id": "XXXXXXXXXX", }

whereas I should be getting something similar to this

{ "access_token": "xoxp-XXXXXXXX-XXXXXXXX-XXXXX", "scope": "identify,bot,incoming-webhook,channels:history", "team_name": "yyyyyyyyy", "team_id": "XXXXXXXXXX", "incoming_webhook": { "url": "https://hooks.slack.com/TXXXXX/BXXXXX/XXXXXXXXXX", "channel": "#channel-it-will-post-to", "configuration_url": "https://teamname.slack.com/services/BXXXXX" }, "bot":{ "bot_user_id":"UTTTTTTTTTTR", "bot_access_token":"xoxb-XXXXXXXXXXXX-TTTTTTTTTTTTTT" } }

As a side note, the bot name that I have given in my slack app shows up on my team's user list. So i guess the bot is integrated but the bot access token is not received in the oauth2 response. Please can anyone help me! THanks



via user7278236

No comments:

Post a Comment