0

I have some Web Service (for example, Twitter). This service already has users, so every user has account.

I want to provide ability for user to enter something like that in slack:

/tweet "Amazing tweet sent from Slack"

And this tweet should appear at Twitter's page of this user(say, John D. with id=1).

I read something about Slack apps, so highlevel overview is the following:

  1. I need to create a new Slack app
  2. I need to register slash command in this app and provide backend URL which will handle all requests from slack users (like https://twitter.com/slack-integration)
  3. When user enters /tweet "Some tweet", then the following will be sent to https://twitter.com/slack-integration:

    user_id=U2147483697&user_name=SlackUser&command=/tweet&text=Some tweet

So, user_id is Slack user id. And now I need a way to link it to John D. with id=1.

Any ideas, what should I do for that?

EvilOrange
  • 876
  • 1
  • 9
  • 17
  • You will need to store the Twitter access token for each user - obtained once via Oauth - together with its Slack user ID in a local database. So your users will need to add their Twitter account once - then they will be able to use your app to tweet on twitter. Here is how Twitter access tokens work: https://developer.twitter.com/en/docs/basics/authentication/guides/access-tokens.html – Erik Kalkoken Oct 10 '18 at 17:11
  • Basically you have to build a connector map between tweeter and slack. This explains (https://www.codeproject.com/Articles/1277949/Integrate-any-application-with-Slack) how to achieve it. – Arindam Nayak Feb 22 '19 at 12:16

0 Answers0