I am a member of an organization which has a lot of private repositories on GitHub. I need to use the GitHub API to get data from the private repositories. I am using the following python code:
url = "https://api.github.com/orgs/myorg/repos?access_token=[mytokenhere]"
headers = {"Authorization": "token [myPATHhere]"}
session = requests.Session()
response = session.get(url, headers = headers)
content = response.text
my_json = json.loads(response.text)
for item in my_json:
print(item['html_url'])
Where PAT = my access token. This still only returns the public repositories. I've seen the related question but the listed solutions do not solve my problem. Note that I've authorized my access token to get into the private repository. I've also tried api.github.com/users/repos and api.github.com/users/[myorghere] and still no private repos are returned. Am I not submitted the token correctly?