octokit.js: Create a webhook, not found response.
I’m trying to create a webhook using the watchEvent and repos.createHook function and I keep getting notFound error.
github.repos.createHook({
user: "reggi",
repo: "stellar-hooks",
name: "watch",
active: true,
events: [
"user"
],
config: {
url: "http://requestb.in/1bcs4pn1",
}
}, function(err, gres) {
});
});
I’m getting a not found error:
{ [Error: {"message":"Not Found","documentation_url":"https://developer.github.com/v3"}]
Also tried something simpler, and it’s not working either.
github.repos.createHook({
user: "reggi",
repo: "stellar-hooks",
name: "push",
active: true,
config: {
url: "http://requestb.in/1bcs4pn1",
}
}, function(err, gres) {
});
Any ideas?
About this issue
- Original URL
- State: closed
- Created 10 years ago
- Comments: 20 (1 by maintainers)
The access token should have admin:repo_hook scope . Otherwise it will throw a 404
The Amazon CodePipeline service currently can not create GitHub web hooks. It also reports the 404 response. In this case I am not calling the API myself, just choosing from drop-down lists in the AWS console.
There’s a big problem and a ton of confusion around hook
namesandevents.Here are the parameters for “Create a hook”.
That /hooks is a list of random services that use hooks. It really doesn’t make any sense why I’d need to use any of those as the
name.Hook Name v.s Events
In the watchEvent doc it specifically says “Hook name”
watch. Then I found a list of actual “events” andwatchis in that as well. This leads me to believe thatwatchis not a Hooknameit’s anevent.I think that the valid Hook name should be
webjust like in every example in the Hooks documentation.The correct request should be:
But it doesn’t work 😢