Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

github api does not return my post-receive web hook

I have manually added a web hook to my repository, but when I query the repository using the API I get

{
  "message": "Not Found"
}

what is wrong?

the url: https://api.github.com/repos/akonsu/kamyanov-art.com/hooks/

like image 226
akonsu Avatar asked Apr 27 '13 05:04

akonsu


People also ask

What does GitHub API return?

The API would return the login of each follower, along with other data about the followers that you don't need. Then, for each follower, you would need to make a request to GET /users/{username}/followers .

How do Webhooks work GitHub?

Webhooks allow you to build or set up integrations, such as GitHub Apps or OAuth Apps, which subscribe to certain events on GitHub.com. When one of those events is triggered, we'll send a HTTP POST payload to the webhook's configured URL.

What is payload URL in GitHub Webhook?

The payload URL is the URL of the server that will receive the webhook POST requests.


1 Answers

First, don't put the extra '/' at the end.
That will get you an message "Not Found" every time, authenticated or not.

Second, to add to Ivan's answer, you need to authenticate to access that information about a repo (public or private).

As mentioned in the "API Getting Started" page:

HTTP/1.1 404 Not Found

{
    "message": "Not Found"
}

Oh noes! Where did it go?
If you’re a grizzled HTTP user, you might expect a 403 instead.
Since we don’t want to leak information about private repositories, the GitHub API returns a 404 in this case, as if to say “we can neither confirm nor deny the existence of this repository.”

That is why you see a "Not Found" here.

See issue 294

fwiw, I was scratching my head on this same issue trying to debug a hook, and the solution was to pass basic authentication on the request.

like image 53
VonC Avatar answered Sep 23 '22 16:09

VonC