I'm trying to create a github repository form a notebook, using this simple code

token = "bftoken";
url = "https://api.github.com/user/repos";

data = URLFetch[url, 
 "Parameters" -> {"access_token" -> token, "name" -> "test"}, 
 "Method" -> "POST"]

but I get this result

{"message":"Requires \

My token has "full access", so I guess that's not the problem. Could you give me some pointers on how to login(and create this repo)

  • $\begingroup$ That is not what I get. I get a prompt asking me to login. !Mathematica graphics only when you hit the CANCEL button, do I get the message you show. So, you need to actually sign in. $\endgroup$ – Nasser Jun 25 '14 at 6:36
  • $\begingroup$ So "access_token" and "name" are your login and password parameters? $\endgroup$ – Mike Honeychurch Jun 25 '14 at 6:41
  • $\begingroup$ @Nasser, yes, I get the prompt too, and then I enter my credentials, but still can't create a repo $\endgroup$ – Marco Aviles Jun 25 '14 at 13:10

This did the trick

 "Headers" -> {"Authorization" -> "token " <> token}, 
  "BodyData" -> "{\"name\":\"test012\"}", "Method" -> "POST"]
|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.