Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GitHub Gist API patch doesn't work?

I am creating anonymous Gists using Postman. The Gists get created successfully but when I try to patch them, I get:

{
  "message": "Not Found",
  "documentation_url": "https://developer.github.com/v3/gists/#edit-a-gist"
}

The URL I am using is:

https://api.github.com/gists/14694f43065a32ec28ad 

If I do a GET, it works fine. If I do a PATCH, I get an error message.

What's wrong here?

like image 268
An SO User Avatar asked Dec 27 '15 04:12

An SO User


1 Answers

You can read and create anonymous gists, but you cannot edit them. If you want to create, read, update and delete, use authentication.

In the Authentication section, it says:

You can read public gists and create them for anonymous users without a token; however, to read or write gists on a user's behalf the gist OAuth scope is required.

You will get the same 404–Not found error if you just try to git push some commits into an anonymous gist.

$ git push
Username for 'https://gist.github.com': IonicaBizau
Password for 'https://[email protected]': 
remote: Repository not found.
fatal: repository 'https://gist.github.com/anonymous/5801....d2f/' not found

They don't even provide an edit button on the Gist page, for anonymous gists. They do have a Delete button associated with the IP (any user having the anonymous Gist link, being connected on the same network, assuming they get the same public ip, can delete the anonymous gist).

Otherwise you have to contact support for deleting the anonymous gist.

like image 166
Ionică Bizău Avatar answered Sep 22 '22 10:09

Ionică Bizău