Can't Access to Private Repos with API Call

I’m following the guide in the List repositories for the authenticated user
but I had private repos on the auth user account and I’m still getting empty array why is that happen

I’m listing user private repos throw /user/repos in GET request with the auth token
I send parameter visibility in query with private value and it returns an empty array
so can you help with that?

https://api.github.com/user/repos?visibility=private

@baselrabia,
If your token is valid, in most cases a case of no data being returned or 404 not found from REST APIs is due to insufficient token scope permissions.
You can view and edit you tokens permissions from this URL
https://github.com/settings/tokens
Does you token have repo scope permission when you tried list-repositories-for-the-authenticated-user?

@byrneh it is working when I generate a personal token from setting
but I had GitHub app and I wanna make the user get the list of his private repos so when I enter OAuth token it’s not appearing
and I saw something in setting personal token
“Personal access tokens function like ordinary OAuth access tokens”
so why it’s not working if they are the same

Did you got a solution for this particular problem? i’m trying to create an app that should be able to create branches in any repositories of an user, but after succesfully authorizing the app and obtaining a session token for the user i am being unable to get private repositories, i can only get the public repositories, even worse, when i try to create a new branch for even public repositories i get this message: “Resource not accessible by integration” even though i specifically enabled all the repositories permissions for the app.

I am following this tutorial for authorizing, login and then requesting the repos:

Identifying and authorizing users for GitHub Apps - GitHub Docs