1
0
mirror of synced 2025-12-19 18:10:59 -05:00

Remove redundant 'pat-v2' versioning (#52362)

This commit is contained in:
Ben Ahmady
2024-09-25 13:58:24 +01:00
committed by GitHub
parent 18e48896e4
commit 272a9a35c6
26 changed files with 43 additions and 100 deletions

View File

@@ -19,18 +19,13 @@ You can authenticate to the GraphQL API using a {% data variables.product.pat_ge
### Authenticating with a {% data variables.product.pat_generic %}
To authenticate with a {% data variables.product.pat_generic %}, follow the steps in "[AUTOTITLE](/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token)." The data that you are requesting will dictate which scopes {% ifversion pat-v2 %}or permissions {% endif %}you will need.
To authenticate with a {% data variables.product.pat_generic %}, follow the steps in "[AUTOTITLE](/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token)." The data that you are requesting will dictate which scopes or permissions you will need.
{% ifversion pat-v2 %}
For example, select the "issues:read" permission to read all of the issues in the repositories your token has access to.
All {% data variables.product.pat_v2 %}s include read access to public repositories. To access public repositories with a {% data variables.product.pat_v1 %}, select the "public_repo" scope.
{% else %}
For example, select the "read:user" scope to request data about users. Select the "public_repo" scope to request data about public repositories.
{% endif %}
If your token does not have the required scopes {% ifversion pat-v2 %}or permissions {% endif %}to access a resource, the API will return an error message that states the scopes {% ifversion pat-v2 %}or permissions {% endif %}your token needs.
If your token does not have the required scopes or permissions to access a resource, the API will return an error message that states the scopes or permissions your token needs.
### Authenticating with a {% data variables.product.prodname_github_app %}

View File

@@ -120,8 +120,7 @@ GraphQL is [introspective](https://graphql.org/learn/introspection/). This means
{% note %}
**Note**: If you get the response `"message": "Bad credentials"` or `401 Unauthorized`, check that you are using a valid token. {% ifversion pat-v2 %}If you receive a `403` error with `Resource not accessible by {% data variables.product.pat_generic %}`, ensure that your {% data variables.product.pat_v2 %} is targeted to the correct resource owner. For example, it must target the organization that owns the repository you are trying to access.{% endif %}
**Note**: If you get the response `"message": "Bad credentials"` or `401 Unauthorized`, check that you are using a valid token. If you receive a `403` error with `Resource not accessible by {% data variables.product.pat_generic %}`, ensure that your {% data variables.product.pat_v2 %} is targeted to the correct resource owner. For example, it must target the organization that owns the repository you are trying to access.
{% endnote %}
The results are in JSON, so we recommend pretty-printing them for easier reading and searching. You can use a command-line tool like [jq](https://stedolan.github.io/jq/) or pipe the results into `python -m json.tool` for this purpose.