Flowdock REST API - 简单的集成
Flowdock REST API - Simple integrations
所以我们使用 Flowdock Push API 已经有一段时间了。我们一直在使用它从我们的持续集成服务器(Electric commander)推送消息,并且它一直运行得非常好。今天它已集成到 powershell 脚本中。
现在我已收到通知,PUSH API 已弃用,将被删除 "some day" 以及对 REST API 消息功能的引用。
根据文档,我已经能够将来自我个人 API 令牌的消息直接添加到聊天中。但是,当我尝试使用流 API 令牌向收件箱添加消息时,我不断收到 404
我正在使用 fiddler 的撰写功能来 fiddle(哈!)以及来自 dox 的示例(我已经对其进行了一些匿名处理):
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"
}
}
}
原始响应是:
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
flow_token 是我的流程的 API 标记吗?还是我必须注册的开发令牌?
这并不意味着作为应用程序工作,我只是不想将构建和部署的状态推送给其他开发人员。
正确的端点是https://api.flowdock.com/flows/ORG/FLOW/messages
。
flow_token 的命名有点混乱,因为它不是流 API 标记,而是 source's flow_token. In order to get a flow_token to a source, you will need to create an application。然后为它创建一个源到某个流。最简单的方法是使用应用程序中的 "Tools for testing" 部分。
最后,您可能只想使用 "external_thread_id"。
所以我们使用 Flowdock Push API 已经有一段时间了。我们一直在使用它从我们的持续集成服务器(Electric commander)推送消息,并且它一直运行得非常好。今天它已集成到 powershell 脚本中。
现在我已收到通知,PUSH API 已弃用,将被删除 "some day" 以及对 REST API 消息功能的引用。
根据文档,我已经能够将来自我个人 API 令牌的消息直接添加到聊天中。但是,当我尝试使用流 API 令牌向收件箱添加消息时,我不断收到 404
我正在使用 fiddler 的撰写功能来 fiddle(哈!)以及来自 dox 的示例(我已经对其进行了一些匿名处理):
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"
}
}
}
原始响应是:
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
flow_token 是我的流程的 API 标记吗?还是我必须注册的开发令牌?
这并不意味着作为应用程序工作,我只是不想将构建和部署的状态推送给其他开发人员。
正确的端点是https://api.flowdock.com/flows/ORG/FLOW/messages
。
flow_token 的命名有点混乱,因为它不是流 API 标记,而是 source's flow_token. In order to get a flow_token to a source, you will need to create an application。然后为它创建一个源到某个流。最简单的方法是使用应用程序中的 "Tools for testing" 部分。
最后,您可能只想使用 "external_thread_id"。