2017-11-11 74 views
0

如何从Flowdock上的Hubot获取当前流量/线程的用户列表?我想用当前流程用户名创建显示消息的插件。 我发现这个:robot.brain.data.users 但它返回来自组织的用户的整个列表,而不是从当前流程中返回。Hubo - 如何获得流量/线程用户

回答

0

可以使用Flows资源获取流的用户列表。您需要知道组织名称和流名称。请参阅 '获取流量' 部分在这里:

https://www.flowdock.com/api/flows

格式为:

GET /flows/:organization/:flow 

和回报:

{ 
    "id": "deadbeefdeadbeef", 
    "name": "My flow", 
    "parameterized_name": "my-flow", 
    "organization": { 
    "id": 8, 
    "name": "Acme", 
    "parameterized_name": "acme", 
    "user_limit": 0, 
    "user_count": 5, 
    "active": true, 
    "url": "https://api.flowdock.com/organizations/acme" 
    } 
    "unread_mentions": 0, 
    "open": true, 
    "url": "https://api.flowdock.com/flows/acme/my-flow", 
    "web_url": "https://www.flowdock.com/app/acme/my-flow", 
    "join_url": "https://www.flowdock.com/invitations/eedd2bf0643f75c14be9099272429351c7132a71-my-flow", 
    "access_mode": "link", 
    "users": [ 
    { 
     "id": 9, 
     "nick": "Joe", 
     "name": "Joe Smith", 
     "email": "[email protected]", 
     "avatar": "https://d2cxspbh1aoie1.cloudfront.net/avatars/f5b8fb60c6116331da07c65b96a8a1d1/", 
     "status": "Testing API", 
     "disabled": false, 
     "last_activity": 1328016726423000, 
     "last_ping": 1328017690004000 
    }, 
    { 
     "id": 42, 
     "nick": "Stevie", 
     "name": "Stevie Johnson", 
     "email": "[email protected]", 
     "avatar": "https://d2cxspbh1aoie1.cloudfront.net/5bdd089a099acc56fc7120f6325a5d5c/", 
     "status": null, 
     "disabled": false, 
     "last_activity": 1328016712345000, 
     "last_ping": 1328017612345000 
    } 
    ] 
}