Each bot needs its own API key for tracking.
Create a bot to get an API key.
There are three integration points as outlined below.
When you first connect Slack via rtm.start, POST the data that Slack returns to the following endpoint.
https://tracker.dashbot.io/track?platform=slack&v=11.1.0-rest&type=connect&apiKey=<strong>API_KEY_HERE</strong>
Make sure to set the ‘Content-Type’ header to ‘application/json’
{
"self": {
"...": "..."
},
"team": {
"...": "..."
},
"channels": {
"...": "..."
},
"users": {
"...": "..."
}
}
curl -X POST -H "Content-Type: application/json"
-d '{"self":{"...":"..."},"team":{"...":"..."},"channels":{"...":"..."},"users":{"...":"..."}}'
'https://tracker.dashbot.io/track?platform=slack&v=11.1.0-rest&type=connect&apiKey=<strong>API_KEY_HERE</strong>'
When you receive a message on the Slack websocket, POST to Dashbot passing token, botId, teamId, teamName, and message.
https://tracker.dashbot.io/track?platform=slack&v=11.1.0-rest&type=incoming&apiKey=<strong>API_KEY_HERE</strong>
Make sure to set the ‘Content-Type’ header to ‘application/json’
{
"token": "...",
"team": {
"id": "T0RKXFPTP",
"name": "jessetest"
},
"bot": {
"id": "U16R8L1JA"
},
"message": {
"type": "message",
"channel": "D16RSST6W",
"user": "U0RKX8RDM",
"text": "hi, bot",
"ts": "1483257600.000000",
"team": "T0RKXFPTP"
}
}
curl -X POST -H "Content-Type: application/json"
-d '{"token":"...","team":{"id":"T0RKXFPTP","name":"jessetest"},"bot":{"id":"U16R8L1JA"},"message":{"type":"message","channel":"D16RSST6W","user":"U0RKX8RDM","text":"hi, bot","ts":"1483257600.000000","team":"T0RKXFPTP"}}'
'https://tracker.dashbot.io/track?platform=slack&v=11.1.0-rest&type=incoming&apiKey=<strong>API_KEY_HERE</strong>'
Note
This is just an example — we accept any rich media that Slack accepts.
When you send a message to Slack via the websocket or the chat.postMessage endpoint POST it to Dashbot passing token, botId, teamId, teamName, and message.
https://tracker.dashbot.io/track?platform=slack&v=11.1.0-rest&type=outgoing&apiKey=<strong>API_KEY_HERE</strong>
Make sure to set the ‘Content-Type’ header to ‘application/json’
{
"token": "...",
"team": {
"id": "T0RKXFPTP",
"name": "jessetest"
},
"bot": {
"id": "U16R8L1JA"
},
"message": {
"type": "message",
"text": "Hello, my human pet",
"channel": "D16RSST6W"
}
}
curl -X POST -H "Content-Type: application/json"
-d '{"token":"...","team":{"id":"T0RKXFPTP","name":"jessetest"},"bot":{"id":"U16R8L1JA"},"message":{"type":"message","text":"Hello, my human pet","channel":"D16RSST6W"}}'
'https://tracker.dashbot.io/track?platform=slack&v=11.1.0-rest&type=outgoing&apiKey=<strong>API_KEY_HERE</strong>'
Note
This is just an example — we accept any rich media that Slack accepts.
View a complete example.
When you receive a message on Slack webhook, send the payload to Dashbot. Make sure to parse the payload as JSON and do not send a raw string.
https://tracker.dashbot.io/track?platform=slack&v=11.1.0-rest&type=incoming&apiKey=<strong>API_KEY_HERE</strong>
Make sure to set the ‘Content-Type’ header to ‘application/json’
{
"token": "...",
"team": {
"id": "T0RKXFPTP",
"name": "jessetest"
},
"bot": {
"id": "U16R8L1JA"
},
"message": {
"actions": [
{
"name": "name",
"value": "value"
}
],
"callback_id": "foo_1474051104627",
"team": {
"id": "T0RKXFPTP",
"domain": "jessetestteam"
},
"channel": {
"id": "D0S2AS2F4",
"name": "directmessage"
},
"user": {
"id": "U0RKX8RDM",
"name": "jhull"
},
"action_ts": "1483344000000.000000",
"message_ts": "1483344000000.000000",
"attachment_id": "1",
"token": "...",
"original_message": {
"...": "..."
}
},
"response_url": "..."
}
curl -X POST -H "Content-Type: application/json"
-d '{"token":"...","team":{"id":"T0RKXFPTP","name":"jessetest"},"bot":{"id":"U16R8L1JA"},"message":{"actions":[{"name":"name","value":"value"}],"callback_id":"foo_1474051104627","team":{"id":"T0RKXFPTP","domain":"jessetestteam"},"channel":{"id":"D0S2AS2F4","name":"directmessage"},"user":{"id":"U0RKX8RDM","name":"jhull"},"action_ts":"1483344000000.000000","message_ts":"1483344000000.000000","attachment_id":"1","token":"...","original_message":{"...":"..."}},"response_url":"..."}'
'https://tracker.dashbot.io/track?platform=slack&v=11.1.0-rest&type=incoming&apiKey=<strong>API_KEY_HERE</strong>'
Note
This is just an example — we accept any rich media that Slack accepts.
When you send a message in response to a button click, send the message to Dashbot. Be sure to set the channel.
https://tracker.dashbot.io/track?platform=slack&v=11.1.0-rest&type=outgoing&apiKey=<strong>API_KEY_HERE</strong>
Make sure to set the ‘Content-Type’ header to ‘application/json’
The data to POST should pass the following data:
{
"token": "...",
"team": {
"id": "T0RKXFPTP",
"name": "jessetest"
},
"bot": {
"id": "U16R8L1JA"
},
"message": {
"text": "replace button with this",
"channel": "D0S2AS2F4"
}
}
curl -X POST -H "Content-Type: application/json"
-d '{"token":"...","team":{"id":"T0RKXFPTP","name":"jessetest"},"bot":{"id":"U16R8L1JA"},"message":{"text":"replace button with this","channel":"D0S2AS2F4"}}'
'https://tracker.dashbot.io/track?platform=slack&v=11.1.0-rest&type=outgoing&apiKey=<strong>API_KEY_HERE</strong>'
View a complete example.