JDenais
JDenais

Reputation: 3016

Git gist missing field User

I can't upload a gist to github using their api.

I always get the same error

{ "message": "Validation Failed", "errors": [ { "resource": "Gist", "code": "missing_field", "field": "user" } ], "documentation_url": "https://developer.github.com/v3/gists/#create-a-gist" }

Here is my code:

{
  "description": "the description for this gist",
  "public": true,
  "user": null,
  "files": {
    "file1.txt": {
      "content": "$formattedConfigText"
    },
    "file2.txt": {
      "content": "$formattedGoogleServices"
    }
  }
}
curlResponse=$(curl -H "Content-Type: application/json" -X POST -d "$(generate_post_data)" https://api.github.com/gists)

It used to work but it's been down for a few days now. Thanks for your help

Upvotes: 4

Views: 215

Answers (1)

Mitu
Mitu

Reputation: 78

From 19 march publishing anonymous gists is deprecated, please check deprecation notice from GitHub Blog:

https://blog.github.com/2018-02-18-deprecation-notice-removing-anonymous-gist-creation/

Upvotes: 2

Related Questions