2

So we have been using the Flowdock Push API for quite some time now. We have been using it to push messages from our Continous Integration server (Electric commander) and it has been working pretty great. It's integrated into a powershell script today.

Now i have been notified that the PUSH API is deprecated and will be removed "some day" along with a refference to the REST API's message feature.

Following the documentation i have been able to add messages from my personal API token directly to the chat. However when i try to add a message to the inbox, with the flow API token, i keep getting 404's

I am using fiddler's compose feature to fiddle (ha!) with the examples from the dox (i have anonymized it a bit):

POST https://api.flowdock.com/MYORGANIZATION/MYFLOW/mesages
User-Agent: Fiddler
Host: api.flowdock.com
Content-Length: 593
Content-Type: application/json
Accept: application/json

{
 "flow_token": "MYFLOWS API TOKEN",
  "event": "activity",
  "author": {
    "name": "anttipitkanen",
    "avatar": "https://avatars.githubusercontent.com/u/946511?v=2"
  },
  "title": "Opened pull request",
  "thread_id": "WT5yWsIpdvUPxP07lfgQDmLoGQQ",
  "external_thread_id": "github:component:pr:42",
  "thread": {
    "title": "Fix bug in thread API",
    "body": "Body with <b>HTML<b> formatting",
    "external_url": "https://github.com/flowdock/component/pull/42",
    "status": {
      "color": "green",
      "value": "open"
    }
  }
}

Raw response is:

HTTP/1.1 404 Not Found
Date: Thu, 08 Oct 2015 10:02:34 GMT
Status: 404 Not Found
Content-Type: application/json
X-Request-Id: ab39438c-07b7-48bf-bde8-c3b29478094d
X-Runtime: 0.007442
Strict-Transport-Security: max-age=31557600
X-Server-Id: 3c4883af38147558374983c6d90b2bb9badb86d4
Vary: Accept-Encoding
Transfer-Encoding: chunked

20
{"message":"Resource not found"}
0

Is the flow_token the API token for my flow? Or is it the dev token i have to sign up for?

This is not meant to work as an application, i just wan't to push the status of builds and deploys to the other developers.

https://www.flowdock.com/api/message-types#/activity

mfriis
  • 217
  • 3
  • 17

1 Answers1

3

The correct endpoint is https://api.flowdock.com/flows/ORG/FLOW/messages.

The flow_token is a bit confusingly named since it is not the flow API token, instead it is a source's flow_token. In order to get a flow_token to a source, you will need to create an application. Then create a source for it to a certain flow. Easiest way to do this is using the "Tools for testing" section in the application.

Lastly you probably want to use only the "external_thread_id".

RedBulli
  • 46
  • 1