4

I am trying to list all gist from a group of users using the github api. This is working really well but I can't seem to get it to return private gists for myself or any others users.

I know that you can set scope in the request but I don't get how I would set this in my JQuery request and what scope should I use to get private gists?

Some of my code is below:

var the_url = 'https://api.github.com/users/'+ encodeURIComponent(user) +'/gists';

      $.oauth ({
        consumerKey: 'xxxxxxxxxxxxxxxxx', 
        consumerSecret: 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx', 
        type: "GET",
        url: the_url,
        data: {},
        dataType: 'json',
        async: false,
Adam Seabridge
  • 1,909
  • 1
  • 20
  • 27

1 Answers1

2

You'll need a user to grant access via oAuth.

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 gists oAuth scope is required.

http://developer.github.com/v3/oauth/#scopes

Paul Young
  • 1,489
  • 1
  • 15
  • 34