Update the essence through your API

I am trying to edit an existing Gist via an API call, following the API docs, I make a curl call like this:

curl -X PATCH -d'{"description": "the description for this gist", "files": {"file1.txt": {"content": "updated file contents"}}}' https://api.github.com/gists/5790365

But he continues to return a "Not Found" error.

Did I miss something?

+4
source share
1 answer

Just realized why it is not working.

It looks like you cannot edit anonymous text, and for its authentication you need to create an API for your account and specify what you want to use with gist in the area as shown below: https://help.github.com/ articles / creating-an-oauth-token-for-command-line-use

After that, you can make API calls passing the authorization header with a token, and everything should work as expected.

+8
source

Source: https://habr.com/ru/post/1486443/


All Articles