Get your Watson Language Translation credentials
To get started with IBM Watson Conversation, youâ€™ll need a Bluemix account. If you donâ€™t have one already, you can sign up here. Once you have signed in, enable the IBM Watson Language Translation service by selecting itÂ here and then clicking on the Create button on the following page.
Once you create it, go to your enabled Watson services list here, select Language Translation and grab its credentials.
Creating the Slack Slash Command
This application is available as a Stamplay Blueprint, a pre-built integration that can be deployed in your Stamplay account with minimum effort. To get started clickÂ here or on the button below:
Youâ€™ll be asked to pick a name for your project and then to provide credentials for IBM Watson translation service. Paste those here, click Connect and then on Next.
Thatâ€™s it the blueprint is now fully configured and youâ€™re ready to move on to the next step. Easy right?
After the configuration is complete, click on Go To App, and then select Webhook from the left-hand sidebar. There youâ€™ll be able to see the API endpoint URL that weâ€™ll need to provide to Slack. Copy it and letâ€™s move to the next step.
Configuring the Slack command
Time to create and configure the Slack command. Open https://slack.com/apps/manage/custom-integrations, it should open on your primary organization but if it doesnâ€™t you can switch that in the upper right corner.
Select Slash Command custom integration (if you donâ€™t see it listed, you can add it. Search it from the App Directory search bar on the top) and create a New configuration.
Here you decide which command your users will have to type (we used /translate) and provide an URL which is the one we copied from the Webhook view and append â€ś?sync=trueâ€ť to it.
So if your webhook URL looks like this https://watsontranslateonslack.stamplayapp.com/api/webhook/v1/translate/catch
Insite the Slack URL field you have to type: https://watsontranslateonslack.stamplayapp.com/api/webhook/v1/translate/catch?sync=true
Other field in this view let you customize the look of the command with a name and an icon. Here is how we did it, the thing you donâ€™t want to miss is the Autocomplete section so you can add the slash command to the autocomplete list and add some usage hints.
Now youâ€™re all set. Go to Slack and type something like â€ś/translate -es this tool works like magic!â€ť and get it translated in a few seconds. Funny uh?
If you have any feedback or questions tweet us at @stamplay. Enjoy!