REST API GET /repos/{owner}/{repo}/pages 404s #24604
-
I’m trying a basic GET to the pages API and am getting 404s. For example:
Gives me a 404. This is straight from the docs. I also tried this with some of my repos, which I know have pages configured, and I’m getting the same thing. Other endpoints (like |
Beta Was this translation helpful? Give feedback.
Replies: 14 comments 8 replies
-
Hi @adriangb I was able GET with a Token scoped “repo” (Full control of private repositories) for one of my own Pages. Your “gh-pages-docs” is retrievable, when I tried |
Beta Was this translation helpful? Give feedback.
-
Thanks for testing @byrneh I can confirm that using a repo-scoped token I am able to get a response. That begs the question: why is auth required to hit this GET endpoint for public repos, when one can hit many other GET endpoints on public repos (e.g. Regardless, it seems that |
Beta Was this translation helpful? Give feedback.
-
@adriangb, I guess it could equally be argued why would authorization not be required, I am not defending one position or the other on this matter… If you are happy your original question is now solved, you can mark as resolved. |
Beta Was this translation helpful? Give feedback.
-
Thank you for the answer. I’ll mark your answer as a solution, although I still think that the following should be done
|
Beta Was this translation helpful? Give feedback.
-
I would agree in some cases the documentation does do not detail a lot of extra information other than the fields and whether it needs to be authenticated or not, so the addition of minimum scope permissions is useful to avoid users having to work out for themselves and also not get confused that a 404 Not Found may be the result of incorrectly scoped permissions. |
Beta Was this translation helpful? Give feedback.
-
Hi, Byrneh Second, I am also able to add collaborators use the same token https://api.github.com/repos/apertureqa/new_repo/collaborators/apertureatf1 however, when I try to upload a file to the same repo. I got not found error error code 404. I guess it is related with privilege? what should I do manually to change the file test priviliage to allow additional content can be add to test. I manuall created the following file in the repo. what kinds of permission I need to manually update on this file to allow the API call PUT go though to add content to the file? thank you very much I have been blocked, it will be |
Beta Was this translation helpful? Give feedback.
-
Hi @apertureatf1, Your question is not altogether clear, but if I was to guess it sounds like you are trying to use the REST api incorrectly, user will work with git client/GUI’s for updating content. I also tried the REST API method for create-or-update-file-contents if that is what you were attempting
Good luck |
Beta Was this translation helpful? Give feedback.
-
I have a token that has all “repo” entries, but I’m still getting 404. Any idea what could be this issue in this case
|
Beta Was this translation helpful? Give feedback.
-
I was facing the same issue and updated my personal access token to include all of the scopes selected under "repo", which did the trick for me. I previously only had selected:
but it seems that the other repo scope selections were needed. I would highly suggest clarifying this scope need in the docs. |
Beta Was this translation helpful? Give feedback.
-
I'm facing 404 Not Found messages while creating a repo using postman. I have an PAT and the same I am using for GET request, and it is giving me 200 OK but same is failing while POST method. Why so? |
Beta Was this translation helpful? Give feedback.
This comment was marked as off-topic.
This comment was marked as off-topic.
-
This is still a problem. Docs say "no additional permissions". New BETA token creator set to 'All repositories' and 'Repository permissions = issues = read only access'... Generated token. Still get 404 on GET repos/USER/REPO/issues. (The repo is a private repo) Its clear, if I'm doing something wrong, its because its not covered in the documentation. |
Beta Was this translation helpful? Give feedback.
-
Same problem here in 2024 with different kind of tokens. |
Beta Was this translation helpful? Give feedback.
-
Thank you. It's working for me.
Best Regards,
Monika Sahu
DevOps Engineer
c. +91 8827305731
e. ***@***.***
Cloudphysician Healthcare Private Limited
7, Bellary Road, Ganganagar
Bengaluru, 560032, KA, India.
cloudphysician.net <http://www.cloudphysician.net>
…On Thu, Apr 4, 2024 at 11:27 PM guenan01 ***@***.***> wrote:
This was my solution. I was trying to use fine grained tokens at first but
failing. I had to use classic tokens, include ALL repo checkboxes, and then
Configure SSO once the token was generated. I don't see an obvious way to
configure SSO authorization with fine grained tokens.
—
Reply to this email directly, view it on GitHub
<#24604 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/A2VQPDBAHAOOKXVO5WHI7GLY3WIBJAVCNFSM545WWM52U5DIOJSWCZC7NNSXTOKENFZWG5LTONUW63SDN5WW2ZLOOQ5TSMBRGI4TMNA>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
Hi @adriangb
A 404 Not Found from a REST API is often returned due to insufficient permissions (there are security reasons why its a 404, but the explanation is outside the scope of this question)
I was able GET with a Token scoped “repo” (Full control of private repositories) for one of my own Pages.
https://api.github.com/repos/octocat/hello-world/pages returns a 404 Not Found for me also.
Your “gh-pages-docs” is retrievable, when I tried