缺少session.info松弛API调用的num_members属性

时间:2018-08-09 12:02:07

标签: slack-api

我正在尝试根据https://api.slack.com/methods/conversations.info上提供的文档来获取Slack对话(频道,组等)中的成员数量。但是,响应中未返回属性num_members。在下面,我添加了API返回公共频道的示例。

我做错了什么还是文档不是最新的?

{
    "channel": {
    "created": 1487814389,
    "creator": "XXXXX",
    "id": "XXXXXX",
    "is_archived": false,
    "is_channel": true,
    "is_ext_shared": false,
    "is_general": false,
    "is_group": false,
    "is_im": false,
    "is_member": true,
    "is_mpim": false,
    "is_org_shared": false,
    "is_pending_ext_shared": false,
    "is_private": false,
    "is_shared": false,
    "last_read": "1508258940.000289",
    "name": "clients",
    "name_normalized": "clients",
    "pending_shared": [],
    "previous_names": [],
    "purpose": {
        "creator": "XXXXXX",
        "last_set": 1487814389,
        "value": "Talk about the XXXX"
    },
    "shared_team_ids": [
        "XXXXX"
    ],
    "topic": {
        "creator": "",
        "last_set": 0,
        "value": ""
    },
    "unlinked": 0
}

1 个答案:

答案 0 :(得分:0)

松弛支持表示文档不正确(num_members响应中未包含属性conversations.info)。

可以使用conversations.members API调用和分页获得成员数。 Python中的示例可在以下位置找到: https://github.com/chaoss/grimoirelab-perceval/blob/master/perceval/backends/core/slack.py#L318