Integrating Slack. via OAuth

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-16-2020 07:23 PM
Hey everyone,
I'm trying to configure the Slack Spoke in IntegrationHub via OAuth but I'm running in to a problem. I can get the OAuth token and everything, but the "Send Message" action is posting as me, instead of the Bot I've created.
I followed the docs: https://docs.servicenow.com/bundle/orlando-servicenow-platform/page/administer/integrationhub-store-... but ran in to the following problems:
- There are now two sections for OAuth Scopes in the "New" apps, and neither of them have "chat:write:bot"
- When I tried to get a token, it gave me an error about the "chat:write" scope, and when I removed it, it proceeded fine.
- I had to create a custom Script to get an OAuth token for longer than half an hour. This wokred but wasn't mentioned in the docs anywhere.
Has anyone else configured this, and got the messages being sent as the bot? Are webhooks the only way to do it?
Thanks,
Andrew
- Labels:
-
Integrations

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-25-2021 03:42 AM
Hello Andrew,
Don't know if this was answered but this is solved by using the correct Authorization and Token URL for the bot:
1. Check that the Bot has the correct scopes under the OAuth section in the Slack API
2. In ServiceNow navigate to "System OAuth" > Application Registry
3. Set the Authorization URL to https://slack.com/oauth/v2/authorize
4. Set the Token URL to https://slack.com/api/oauth.v2.access
I ran into the same issue, the multiple "Set up Slack Spoke" documentation was very vague.
As for the scopes within ServiceNow I found the "Chat:Write" issue resolved itself once I had switched the links.
Kind regards
Phil