Slack slash commands
Slash commands such as /checker jane.doe@stripe.com run Tomba lookups from Slack. They're served by your own tomba serve instance: you create a Slack app from the manifest on this page and point its commands at your server.
How it works
When someone runs a command, Slack sends the text after the command to the command's request URL. With ?slack=true in the URL, tomba serve uses that text as the input, calls the Tomba API with the account the CLI is signed in to, and answers with a Slack message. Slack shows the reply only to the person who ran the command.
Every command is a Tomba API request billed to that account, as described in Credit costs. The server doesn't verify Slack's request signatures, so anyone who knows the URL can run lookups on your credits.
Prerequisites
- A server with the CLI installed and signed in.
tomba login --api-keysuits a server; see Authentication. - A public HTTPS URL for that server, with a valid certificate. Slack sends slash commands only to HTTPS URLs.
- Permission to create apps in your Slack workspace.
Expose the server
tomba serve has no authentication and exposes routes that return your API secret and manage your keys, so don't publish its port. Run it behind a reverse proxy that terminates HTTPS and forwards only the routes the commands use, and block port 3000 at your firewall.
An nginx server block that does this:
Code
Then start the server on the same host:
Code
Create the Slack app
- Replace
https://tomba-slack.example.comin the manifest below with your server's URL. - Open api.slack.com/apps, choose Create New App, then From a manifest, select your workspace, and paste the manifest.
- Install the app to your workspace.
Code
Commands
| Command | Route | Input | Reply |
|---|---|---|---|
/domain | /search | A domain | The addresses found, with name, position, location, and profiles |
/checker | /verify | An email address | Format, mail server, and deliverability status, with WHOIS details |
/enrich | /enrich | An email address | The person's name, position, company, location, profiles, and sources |
/author | /author | An article URL | The author's email address and profile |
/linkedin | /linkedin | A LinkedIn profile URL | The person's email address and profile |
For example:
Code
Troubleshooting
| Problem | Cause and fix |
|---|---|
| Slack reports that the command failed | The server answered with an error status: the lookup found nothing, the input was invalid, or the API call failed, for example on a rate limit. Slack doesn't show the reason. Check the server's log, and run the same lookup with the CLI, such as tomba verify --target jane.doe@stripe.com, to see the API's status. |
| Slack reports a timeout | Slack waits 3 seconds for a reply, and some lookups take longer. The lookup still runs and uses credits as usual. |
/checker fails for a Gmail or other webmail address | The server answers with an error for addresses at webmail and disposable email domains, after the verification has run. |