Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Github v3 API - create a REPO

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://developer.github.com/v3/repos/).

So far, I’m able to get a List of my repos using: GET /user/repos However, when I try to create a repo using POST /user/repos, I get a 404.

Any thoughts what I might be doing wrong?

Joubert

like image 622
Joubert Nel Avatar asked Dec 01 '22 01:12

Joubert Nel


1 Answers

Can you please tell us how exactly you did the HTTP request? The 404 sounds like you were using a wrong path, probably. But to give a reliable answer instead a wild guess, we need to see your request, including how you are sending your token, just mask it with 'xxx' or something.

I'll show you in the meantime an example request, that is working:

curl -XPOST -H 'Authorization: token S3CR3T' https://api.github.com/user/repos -d '{"name":"my-new-repo","description":"my new repo description"}'

You would need to replace the OAuth token of course: S3CR3T

like image 94
plu Avatar answered Dec 04 '22 04:12

plu