diff --git a/content/developers/apps/creating-a-github-app-from-a-manifest.md b/content/developers/apps/creating-a-github-app-from-a-manifest.md index 22c65eacfa..171ab3f848 100644 --- a/content/developers/apps/creating-a-github-app-from-a-manifest.md +++ b/content/developers/apps/creating-a-github-app-from-a-manifest.md @@ -59,7 +59,9 @@ The person creating the app will be redirected to a GitHub page with an input fi `name` | `string` | The name of the GitHub App. `url` | `string` | **Required.** The homepage of your GitHub App. `hook_attributes` | `object` | The configuration of the GitHub App's webhook. -`redirect_url` | `string` | The full URL to redirect to after the person installs the GitHub App. +`redirect_url` | `string` | The full URL to redirect to after a user initiates the creation of a GitHub App from a manifest.{% if currentVersion == "free-pro-team@latest" or currentVersion == "github-ae@next" or currentVersion ver_gt "enterprise-server@3.0" %} +`callback_urls` | `array of strings` | A full URL to redirect to after someone authorizes an installation. You can provide up to 10 callback URLs.{% else %} +`callback_url` | `string` | A full URL to redirect to after someone authorizes an installation.{% endif %} `description` | `string` | A description of the GitHub App. `public` | `boolean` | Set to `true` when your GitHub App is available to the public or `false` when it is only accessible to the owner of the app. `default_events` | `array` | The list of [events](/webhooks/event-payloads) the GitHub App subscribes to. @@ -96,7 +98,10 @@ This example uses a form on a web page with a button that triggers the `POST` re "hook_attributes": { "url": "https://example.com/github/events", }, - "redirect_url": "https://example.com/callback", + "redirect_url": "https://example.com/redirect", + {% if currentVersion == "free-pro-team@latest" or currentVersion == "github-ae@next" or currentVersion ver_gt "enterprise-server@3.0" %}"callback_urls": [ + "https://example.com/callback" + ],{% else %}"callback_url": "https://example.com/callback",{% endif %} "public": true, "default_permissions": { "issues": "write", @@ -111,10 +116,11 @@ This example uses a form on a web page with a button that triggers the `POST` re }) ``` + This example uses a form on a web page with a button that triggers the `POST` request for an organization account. Replace `ORGANIZATION` with the name of the organization account where you want to create the app. ```html -
+ Create a GitHub App Manifest:
@@ -127,7 +133,10 @@ This example uses a form on a web page with a button that triggers the `POST` re "hook_attributes": { "url": "https://example.com/github/events", }, - "redirect_url": "https://example.com/callback", + "redirect_url": "https://example.com/redirect", + {% if currentVersion == "free-pro-team@latest" or currentVersion == "github-ae@next" or currentVersion ver_gt "enterprise-server@3.0" %}"callback_urls": [ + "https://example.com/callback" + ],{% else %}"callback_url": "https://example.com/callback",{% endif %} "public": true, "default_permissions": { "issues": "write", @@ -147,11 +156,11 @@ This example uses a form on a web page with a button that triggers the `POST` re When the person clicks **Create GitHub App**, GitHub redirects back to the `redirect_url` with a temporary `code` in a code parameter. For example: - https://example.com/callback?code=a180b1a3d263c81bc6441d7b990bae27d4c10679 + https://example.com/redirect?code=a180b1a3d263c81bc6441d7b990bae27d4c10679 If you provided a `state` parameter, you will also see that parameter in the `redirect_url`. For example: - https://example.com/callback?code=a180b1a3d263c81bc6441d7b990bae27d4c10679&state=abc123 + https://example.com/redirect?code=a180b1a3d263c81bc6441d7b990bae27d4c10679&state=abc123 #### 3. You exchange the temporary code to retrieve the app configuration diff --git a/content/developers/apps/creating-a-github-app-using-url-parameters.md b/content/developers/apps/creating-a-github-app-using-url-parameters.md index 966f050739..38b510d4bb 100644 --- a/content/developers/apps/creating-a-github-app-using-url-parameters.md +++ b/content/developers/apps/creating-a-github-app-using-url-parameters.md @@ -22,9 +22,15 @@ The person creating the app can edit the preselected values from the {% data var The following URL creates a new public app called `octocat-github-app` with a preconfigured description and callback URL. This URL also selects read and write permissions for `checks`, subscribes to the `check_run` and `check_suite` webhook events, and selects the option to request user authorization (OAuth) during installation: - ``` - {% data variables.product.oauth_host_code %}/settings/apps/new?name=octocat-github-app&description=An%20Octocat%20App&callback_url=https://example.com&request_oauth_on_install=true&public=true&checks=write&events[]=check_run&events[]=check_suite - ``` +{% if currentVersion == "free-pro-team@latest" or currentVersion == "github-ae@next" or currentVersion ver_gt "enterprise-server@3.0" %} +``` +{% data variables.product.oauth_host_code %}/settings/apps/new?name=octocat-github-app&description=An%20Octocat%20App&callback_urls[]=https://example.com&request_oauth_on_install=true&public=true&checks=write&events[]=check_run&events[]=check_suite +``` +{% else %} +``` +{% data variables.product.oauth_host_code %}/settings/apps/new?name=octocat-github-app&description=An%20Octocat%20App&callback_url=https://example.com&request_oauth_on_install=true&public=true&checks=write&events[]=check_run&events[]=check_suite +``` +{% endif %} The complete list of available query parameters, permissions, and events is listed in the sections below. @@ -34,8 +40,9 @@ The complete list of available query parameters, permissions, and events is list -----|------|------------- `name` | `string` | The name of the {% data variables.product.prodname_github_app %}. Give your app a clear and succinct name. Your app cannot have the same name as an existing GitHub user, unless it is your own user or organization name. A slugged version of your app's name will be shown in the user interface when your integration takes an action. `description` | `string` | A description of the {% data variables.product.prodname_github_app %}. -`url` | `string` | The full URL of your {% data variables.product.prodname_github_app %}'s website homepage. -`callback_url` | `string` | The full URL to redirect to after someone authorizes an installation. This URL is used if your app needs to identify and authorize user-to-server requests. +`url` | `string` | The full URL of your {% data variables.product.prodname_github_app %}'s website homepage.{% if currentVersion == "free-pro-team@latest" or currentVersion == "github-ae@next" or currentVersion ver_gt "enterprise-server@3.0" %} +`callback_urls` | `array of strings` | A full URL to redirect to after someone authorizes an installation. You can provide up to 10 callback URLs. These URLs are used if your app needs to identify and authorize user-to-server requests. For example, `callback_urls[]=https://example.com&callback_urls[]=https://example-2.com`.{% else %} +`callback_url` | `string` | The full URL to redirect to after someone authorizes an installation. This URL is used if your app needs to identify and authorize user-to-server requests.{% endif %} `request_oauth_on_install` | `boolean` | If your app authorizes users using the OAuth flow, you can set this option to `true` to allow people to authorize the app when they install it, saving a step. If you select this option, the `setup_url` becomes unavailable and users will be redirected to your `callback_url` after installing the app. `setup_url` | `string` | The full URL to redirect to after someone installs the {% data variables.product.prodname_github_app %} if the app requires additional setup after installation. `setup_on_update` | `boolean` | Set to `true` to redirect people to the setup URL when installations have been updated, for example, after repositories are added or removed.