You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 6 Next »

Step 1: Setup your callback URL

Your callback URL is an endpoint available over HTTP/HTTPS which accepts JSON payloads, e.g. https://api.yourservice.com/callback

Callback URL

The messages are posted to your endpoint with the HTTP headers Content-Type: application/json; andAccept-Encoding: gzip,deflate with the JSON payload in the body. If you need help setting up your callback URL contact developer support.

Step 2: Configure

  1. Log in to your admin console by going to https://admin.flock.com (or by choosing "Manage your team" in the Flock desktop app). You will see a screen similar to the one below.
  2. Click on the Add button next to Outgoing Webhook, and you will see the outgoing webhooks configuration window.

Step 3: Receive messages to your endpoint

JSON packets of the following format will be posted (with HTTP POST) to the callback URL you've specified.

JSON
{
   "id":"000025c9-0000-002a-0000-000000002fff",
   "from":"cc1ma89nnd4jm9vf@go.to/talk.to_MAC_1.0.0.147_nqKMZE",
   "to":"1937653121826658704@groups.go.to",
   "type":"message",
   "text":"Test"
}

For details about the fields check the Message object. 

Verifying Requests

A ?token=<webhook-token> is appended to the callback URL while making the call so you can verify that the request came from Flock.

Replying to received messages

 You can reply to messages you receive by sending a JSON packet in your HTTP response.

This is similar to sending messages to an incoming webhook.