Flowdock: REST API - How to reply to a thread

Document ID : KB000105839
Last Modified Date : 10/07/2018
Show Technical Document Details
Question:
How can we use Flowdock's REST API to send a message into a specific thread in a given flow?
Answer:
In order to use Flowdock's REST API, you will need to get your personal API Token. You will use this token to authenticate your API calls with Flowdock. To get your perosnal API Token go to: https://www.flowdock.com/account/tokens and copy the value of the API Token.

The URL you will need to post your message to consists of the following format:
https://<Your API Token>@api.flowdock.com/flows/<Org Name>/<Flow Name>/threads/<Thread ID>/messages

- The <Org Name> and <Flow Name> can easily be known to you simply by going into Flowdock and checking your the flow.
- To find the <Thread ID> you will need to use a preliminary API call for the flow's threads:
User-added image

Search the reply JSON for your thread. The 'title' is the field holding the first message in that thread, which you'll need to examine to make the determination which thread you need to reply to. In this example, we're going to select a thread titled: "My Thread":
The "id" field is the <Thread ID> you'll need to construct your final URL.
User-added image

Now, let's compose our URL and post our message to this thread.
User-added image
User-added image
Our post is successful, see the "201 Created" status. We also received a UUID for our message post.
User-added image

Let's see it in Flowdock. We can see the first message in that thread matches the title of the thread we posted to. The last message below is the message we just posted via the API:
User-added image
Additional Information: