Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update generate-installation-access-token.md #34259

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions data/reusables/apps/generate-installation-access-token.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
1. Generate a JSON web token (JWT) for your app. For more information, see "[AUTOTITLE](/apps/creating-github-apps/authenticating-with-a-github-app/generating-a-json-web-token-jwt-for-a-github-app)".
1. Get the ID of the installation that you want to authenticate as.
1. Get the installation access token (also known as installation ID or installation token) of the app that you want to authenticate as.

If you are responding to a webhook event, the webhook payload will include the installation ID.
The name _installation access token_ is somewhat misleading because the app is already installed, but it is the secret key used to unlock programmatic access as a GitHub App. Generating a GitHub app installation token is an efficient way to unlock the maximum allotted API calls to avoid rate limiting and can be used by multiple members of your organization.

You can also use the REST API to find the ID for an installation of your app. For example, you can get an installation ID with the `GET /users/{username}/installation`, `GET /repos/{owner}/{repo}/installation`, `GET /orgs/{org}/installation`, or `GET /app/installations` endpoints. For more information, see "[AUTOTITLE](/rest/apps/apps)".
If you are responding to a webhook event, the webhook payload will include the installation access token.

You can also find the app ID on the settings page for your app. The app ID is different from the client ID. For more information about navigating to the settings page for your {% data variables.product.prodname_github_app %}, see "[AUTOTITLE](/apps/maintaining-github-apps/modifying-a-github-app-registration#navigating-to-your-github-app-settings)".
You can also use the REST API to find the access token for an installation of your app. For example, you can get an installation access token with the `GET /users/{username}/installation`, `GET /repos/{owner}/{repo}/installation`, `GET /orgs/{org}/installation`, or `GET /app/installations` endpoints. For more information, see "[AUTOTITLE](/rest/apps/apps)".

Alternatively, you can find the installation access token from the top URL of the GitHub App Settings. In this example URL, the installation access token is `33507770`: `https://github.com/organizations/test-organization/settings/installations/33507770`

1. Send a REST API `POST` request to `/app/installations/INSTALLATION_ID/access_tokens`. Include your JSON web token in the `Authorization` header of your request. Replace `INSTALLATION_ID` with the ID of the installation that you want to authenticate as.

Expand Down
Loading