{"action":"opened","issue":{"url":"https://api.github.com/repos/google/go-github/issues/435","repository_url":"https://api.github.com/repos/google/go-github","labels_url":"https://api.github.com/repos/google/go-github/issues/435/labels{/name}","comments_url":"https://api.github.com/repos/google/go-github/issues/435/comments","events_url":"https://api.github.com/repos/google/go-github/issues/435/events","html_url":"https://github.com/google/go-github/issues/435","id":179501011,"number":435,"title":"create issue using a token","user":{"login":"mh-cbon","id":17096799,"avatar_url":"https://avatars.githubusercontent.com/u/17096799?v=3","gravatar_id":"","url":"https://api.github.com/users/mh-cbon","html_url":"https://github.com/mh-cbon","followers_url":"https://api.github.com/users/mh-cbon/followers","following_url":"https://api.github.com/users/mh-cbon/following{/other_user}","gists_url":"https://api.github.com/users/mh-cbon/gists{/gist_id}","starred_url":"https://api.github.com/users/mh-cbon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mh-cbon/subscriptions","organizations_url":"https://api.github.com/users/mh-cbon/orgs","repos_url":"https://api.github.com/users/mh-cbon/repos","events_url":"https://api.github.com/users/mh-cbon/events{/privacy}","received_events_url":"https://api.github.com/users/mh-cbon/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-09-27T13:59:24Z","updated_at":"2016-09-27T13:59:24Z","closed_at":null,"body":"Hi,\r\n\r\nI m not able to create an issue using a token access.\r\n\r\nAPI will answer\r\n\r\n```\r\nPOST https://api.github.com/repos/mh-cbon/demotest/issues: 401 Bad credentials []\r\n```\r\n\r\nMy code is like this,\r\n\r\n```go\r\n    input := &github.IssueRequest{\r\n        Title:    &g.IssueTitle,\r\n        Body:     &body,\r\n  }\r\n\r\n    ts := oauth2.StaticTokenSource(\r\n        &oauth2.Token{AccessToken: g.Token},\r\n    )\r\n  tc := oauth2.NewClient(oauth2.NoContext, ts)\r\n  client := github.NewClient(tc)\r\n\r\n  _, _, err = client.Issues.Create(g.Owner, g.Repo, input)\r\n```\r\n\r\nLater i tried with basic auth,\r\n\r\n```go\r\n  \tinput := &github.IssueRequest{\r\n  \t\tTitle:    github.String(g.IssueTitle),\r\n  \t\tBody:     github.String(body),\r\n    }\r\n\r\n  \t// ts := oauth2.StaticTokenSource(\r\n  \t// \t&oauth2.Token{AccessToken: g.Token},\r\n  \t// )\r\n    // tc := oauth2.NewClient(oauth2.NoContext, ts)\r\n    tc := github.BasicAuthTransport{\r\n      Username: \"xxxx\",\r\n      Password: \"yyy\",\r\n    }\r\n    client := github.NewClient(tc.Client())\r\n    \r\n    _, _, err = client.Issues.Create(g.Owner, g.Repo, input)\r\n```\r\n\r\nIt worked fine.\r\n\r\nI saw somewhere people adds a `login=xxx` query string parameter. \r\nCould this be the problem ? \r\nHow can i add a qs param to this create issue request ?\r\n\r\nAny help appreciated, i really don t want to use a basic auth."}}
{"actor":{"display_login":"mh-cbon"}}