Webhooks

Webhooks enable HeyTaco to send data to your server whenever an event has happened. They're like event listeners of push notifications.

Creating Webhooks

Webhooks can be created by anyone on the Webhooks page. Each webhook consists of an event type and a URL to send data to.


Event Types

taco_given

Sends data when a taco has been given by your team in Slack.

Example

{
    {
        "received_by": {
            "username": "username",
            "uid": "U12345678" 
        },
        "given_by": {
            "username": "username",
            "uid": "U12345678" 
        },    
        "message": "<@U12345678> nice job on the presentation! :taco:",
        "channel": "C12345678",
        "ts": "1525957491.000614",
        "total_team_tacos": "100"
    }
}

new_achievement_level

Sends data when someone on your team reaches a new achievement level.

{
    {
        "receiver_uid": "U12345678",
        "achievement_level": 1,
        "achievement_level_name": "Taco Initiate",
        "new_achievement_image": "https://s3.amazonaws.com/heytaco/taco-levels/initiate.gif",
        "tacos_given": "15",
        "tacos_received": "35"
    }
}

Response Format

A Webhook URL needs to return a response with HTTP status code 200. Any other response code will be treated as a failure. Webhooks also need to return a response within 3 seconds or they'll be treated as a failure.


Error Codes

Code Meaning
400 The server cannot process the request due to an apparent client error.
403 The request was valid, but the server is refusing action.
404 The requested resource could not be found.
405 The server has rejected the request.
408 The server timed out waiting for the request.
500 There was an unexpected condition resulting in internal server error.

Need help or have a question?

Send a message on our support page and we'll get in touch shortly.