You can extend the power of Flock by integrating it with the apps and services you love. While the Flock App Store has a growing list of third-party apps, you can always create your own integrations.
Webhooks allow you to send and receive messages from external services. You can even use services such as IFTTT and Zapier to set up simple integrations to read RSS feeds, enable web tickers, and so on.
Flock's webhooks work with JSON packets to transmit messages.
To create an incoming webhook:
- Go to your Flock Admin Panel at https://admin.flock.com.
- Click on Webhooks in the sidebar.
- Click on the Add button next to Incoming Webhook.
- Select the Channel where you want incoming messages to be posted.
- Set a name that the webhook will use to post messages in Flock. You can also change the icon for the webhook.
- Click on Save and Generate URL. Copy the URL that is generated.
- This is the webhook endpoint and it accepts JSON packets posted to it. The following command will post a message to your configured channel:
curl -X POST <incoming-webhook-endpoint> -H
"This is a test message"
- You can send more than text messages. For more info, see Flock API Documentation.
To create an outgoing webhook:
- Click on the Add button next to Outgoing Webhook.
- Select the Channel where the webhook should look for messages. These messages will be sent to the external service you need via the webhook.
- Set a name that the webhook will use to post any replies in Flock. You can also change the icon for the webhook.
- Enter the Callback URL that Flock should send your messages to.
- Click on Save Settings and the outgoing webhook is saved.
- The outgoing webhook will post JSON packets to the Callback URL in the following format:
- A ?token=<webhook-token> is appended to the callback URL while making the call so you can verify that the request came from Flock. For more info, see Flock API Documentation.