如何通过事件ID获取GitHub事件负载?

如何通过事件ID获取GitHub事件负载?,github,github-api,Github,Github Api,我可以通过以下方式获取组织的公共活动列表: GET/orgs/:org/events 如何获取事件负载(如)知道其ID?GitHub API没有提供通过ID检索特定事件的方法 每个事件都有一个有效负载。比如说 { "actor": { "avatar_url": "https://avatars.githubusercontent.com/u/240830?", "display_login": "sigmavirus24", "gra

我可以通过以下方式获取组织的公共活动列表:

GET/orgs/:org/events


如何获取事件负载(如)知道其ID?

GitHub API没有提供通过ID检索特定事件的方法

每个事件都有一个
有效负载
。比如说

{
    "actor": {
        "avatar_url": "https://avatars.githubusercontent.com/u/240830?",
        "display_login": "sigmavirus24",
        "gravatar_id": "",
        "id": 240830,
        "login": "sigmavirus24",
        "url": "https://api.github.com/users/sigmavirus24"
    },
    "created_at": "2017-01-27T23:50:12Z",
    "id": "5227100855",
    "org": {
        "avatar_url": "https://avatars.githubusercontent.com/u/1782156?",
        "gravatar_id": "",
        "id": 1782156,
        "login": "github3py",
        "url": "https://api.github.com/orgs/github3py"
    },
    "payload": {
        "before": "7d52c200d80d86f70fbda3e9ebf48060867f9f65",
        "commits": [
            {
                "author": {
                    "email": "sigmavirus24@users.noreply.github.com",
                    "name": "Ian Cordasco"
                },
                "distinct": true,
                "message": "Create test.txt",
                "sha": "a623ca5974523ec35fd83909dd99b220e498ef58",
                "url": "https://api.github.com/repos/github3py/delete_contents/commits/a623ca5974523ec35fd83909dd99b220e498ef58"
            }
        ],
        "distinct_size": 1,
        "head": "a623ca5974523ec35fd83909dd99b220e498ef58",
        "push_id": 1525269783,
        "ref": "refs/heads/master",
        "size": 1
    },
    "public": true,
    "repo": {
        "id": 50486230,
        "name": "github3py/delete_contents",
        "url": "https://api.github.com/repos/github3py/delete_contents"
    },
    "type": "PushEvent"
}
是执行
GET/orgs/github3py/events
后列表中的事件。如果你仔细看,你会发现

    "payload": {
        "before": "7d52c200d80d86f70fbda3e9ebf48060867f9f65",
        "commits": [
            {
                "author": {
                    "email": "sigmavirus24@users.noreply.github.com",
                    "name": "Ian Cordasco"
                },
                "distinct": true,
                "message": "Create test.txt",
                "sha": "a623ca5974523ec35fd83909dd99b220e498ef58",
                "url": "https://api.github.com/repos/github3py/delete_contents/commits/a623ca5974523ec35fd83909dd99b220e498ef58"
            }
        ],
        "distinct_size": 1,
        "head": "a623ca5974523ec35fd83909dd99b220e498ef58",
        "push_id": 1525269783,
        "ref": "refs/heads/master",
        "size": 1
    },
这是来自事件的有效负载。这是获取有效负载的唯一方法(通过列出事件)