2017-02-15 10 views

答えて

1

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": "[email protected]", 
        "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": "[email protected]", 
        "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 
    }, 

イベントのペイロードはどれですか。これは、そのペイロードをリスティングイベントから取得する唯一の方法です。

関連する問題