WebhookProxy - A webhook proxy

WebhookProxy is a proxy service to map different webhook posts to message platforms such as Glip's inbound webhook service. It formats messages using CommonChat intermediate message format which can then be translated into different chat platform message formats. This is useful because many services with outbound webhooks need to be formatted before they can be consumed by a webhook consuming app such as a chat service. This proxy service does the conversion so you don't have to. Applications already integrated with Slack's inbound webhooks can create messages on Glip simply by using the proxy URL.
Conversion of the following webhook message formats to Glip inbound webhooks include:
Outbound Webhook Formats supported:
- AppSignal
- Apteligent/Crittercism
- Circle CI
- Codeship
- Confluence
- Datadog
- Desk.com
- Enchant
- GoSquared
- Heroku
- Librato
- Magnum CI
- Marketo
- OpsGenie
- Papertrail
- Pingdom
- Raygun
- Runscope
- Semaphore CI, Deploy
- StatusPage
- Travis CI
- Userlike
- VictorOps
Inbound Webhook Format supported:
- Slack (inbound message format) -
text
only
Note: Slack inbound message formatting is for services sending outbound webhooks using Slack's inbound webhook message format, which can be directed to Glip via this proxy.
Example Webhook Message from Travis CI:

Installation
$ go get github.com/grokify/glip-webhook-proxy
Usage
Starting the Service
Start the service with the following.
package main
import (
log "github.com/Sirupsen/logrus"
"github.com/grokify/webhookproxy"
)
func main() {
config := webhookproxy.Configuration{
Port: 8080,
EmojiURLFormat: "https://grokify.github.io/emoji/assets/images/%s.png",
LogLevel: log.DebugLevel}
glipwebhookproxy.StartServer(config)
}
You can run the above by saving it to a file start.go
and then running $ go run start.go
.
Note: The emoji to URL is designed to take a icon_emoji
value and convert it to a URL. EmojiURLFormat
is a fmt
format
string with one %s
verb to represent the emoji string without :
. You can use any emoji image service. The example shows the emoji set from github.com/wpeterson/emoji forked and hosted at grokify.github.io/emoji/.
Creating the Glip Webhook
- create a Glip webhook
- use webhook URL's GUID to create the proxy URL as shown below
- use the proxy URL in your outbound webhook service
Service |
URL |
Glip |
https://hooks.glip.com/webhook/11112222-3333-4444-5555-666677778888 |
Slack Inbound |
https://example.com/webhook/slack/in/glip/11112222-3333-4444-5555-666677778888 |
Travis CI Outbound |
https://example.com/webhook/travisci/out/glip/11112222-3333-4444-5555-666677778888 |
The webhook proxy URLs support both inbound and outbound formats. For example:
- when using Travis CI's webhook format use
travisci/out/glip
to indicate converting a Travis CI outbound webhook format message to Glip.
- when using a service that supports Slack inbound webhook format use
slack/in/glip
to indicate converting a Slack inbound webhook format message to Glip.
To create the Glip webhook and receive a webhook URL do the following:
Add the Webhook Integration
At the top of any conversation page, click the Settings gear icon and then click Add Integration
.

Select the Glip Webhooks
integration.

Get the Webhook URL
Once you get the URL, the proxy URL is created by appending the GUID (e.g. 1112222-3333-4444-5555-666677778888
) to the proxy URL base, /webhook/slack/glip
(e.g. https://glip-proxy.example.com/webhook/slack/glip/1112222-3333-4444-5555-666677778888
). Use the proxy URL in the app that is posting the Slack webhook and the payload will be sent to Glip.

Example Requests
Most of the time you will likely either:
- use the proxy URL in an outbound webhook service that supports the Slack format or
- use a client library
The following examples are provided for reference and testing.
Using application/json
$ curl -X POST \
-H "Content-Type: application/json" \
-d '{"username":"ghost-bot", "icon_emoji": ":ghost:", "text":"BOO!"}' \
"http://localhost:8080/webhook/slack/glip/11112222-3333-4444-5555-666677778888"
$ curl -X POST \
--data-urlencode 'payload={"username":"ghost-bot", "icon_emoji": ":ghost:", text":"BOO!"}' \
"http://localhost:8080/webhook/slack/glip/11112222-3333-4444-5555-666677778888"
$ curl -X POST \
-F 'payload={"username":"ghost-bot", "icon_emoji": ":ghost:", text":"BOO!"}' \
"http://localhost:8080/webhook/slack/glip/11112222-3333-4444-5555-666677778888"
This has been tested using:
require 'slack/poster'
url = 'http://localhost:8080/webhook/slack/glip/11112222-3333-4444-5555-666677778888'
opts = {
username: 'Ghost Bot [Bot]',
icon_emoji: ':ghost:'
}
poster = Slack::Poster.new url, opts
poster.send_message 'BOO!'
Notes
WebhookProxy is built using: