Github v3 API - create a REPO

后端 未结 4 1024
心在旅途
心在旅途 2020-12-09 06:46

I’m trying to use the Github v3 API - I already implemented the required OAuth flow and it works well.

Now I’m trying some of the Repos API endpoints (http://develo

4条回答
  •  攒了一身酷
    2020-12-09 07:49

    I had the same issue. The reason why you are getting a 404 with your oauth access token is that when you authorize to github you need to also additionally pass the scopes you want. For example, in the header you should see "X-OAuth-Scopes: repo, user", which means this user has read/write access to his profile and repositories. Once you have set the correct scopes you should be able to do POST/PUT requests just fine.

    To see whether or not you have the correct permissions. You can do something like the following. Substitute the XXXXXXX with your access token.

    curl -I https://api.github.com/user?access_token=XXXXXXXX
    

提交回复
热议问题