Skip to content

Commit

Permalink
Update tables for accessibility (API, Apps, and events) (github#35531)
Browse files Browse the repository at this point in the history
Co-authored-by: Laura Coursen <lecoursen@github.com>
Co-authored-by: Sarah Edwards <skedwards88@github.com>
  • Loading branch information
3 people authored Mar 24, 2023
1 parent 422db29 commit e72377f
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 61 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ The following URL creates a new public app called `octocat-github-app` with a pr
{% 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
```

The complete list of available query parameters, permissions, and events is listed in the sections below.

## {% data variables.product.prodname_github_app %} configuration parameters

Name | Type | Description
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ The web application flow to authorize users for your app is:

GET {% data variables.product.oauth_host_code %}/login/oauth/authorize

This endpoint takes the following input parameters:
This endpoint takes the following input parameters.

Name | Type | Description
Parameter name | Type | Description
-----|------|--------------
`client_id`|`string` | **Required**. The client ID you received from GitHub when you {% ifversion fpt or ghec %}[registered](https://github.com/settings/applications/new){% else %}registered{% endif %}.
`redirect_uri`|`string` | The URL in your application where users will be sent after authorization. See details below about [redirect urls](#redirect-urls).
Expand All @@ -64,9 +64,9 @@ Exchange this `code` for an access token:

POST {% data variables.product.oauth_host_code %}/login/oauth/access_token

This endpoint takes the following input parameters:
This endpoint takes the following input parameters.

Name | Type | Description
Parameter name | Type | Description
-----|------|--------------
`client_id` | `string` | **Required.** The client ID you received from {% data variables.product.product_name %} for your {% data variables.product.prodname_oauth_app %}.
`client_secret` | `string` | **Required.** The client secret you received from {% data variables.product.product_name %} for your {% data variables.product.prodname_oauth_app %}.
Expand Down Expand Up @@ -140,9 +140,9 @@ Before you can use the device flow to authorize and identify users, you must fir

Your app must request a user verification code and verification URL that the app will use to prompt the user to authenticate in the next step. This request also returns a device verification code that the app must use to receive an access token and check the status of user authentication.

The endpoint takes the following input parameters:
The endpoint takes the following input parameters.

Name | Type | Description
Parameter name | Type | Description
-----|------|--------------
`client_id` | `string` | **Required.** The client ID you received from {% data variables.product.product_name %} for your app.
`scope` | `string` | The scope that your app is requesting access to.
Expand All @@ -153,7 +153,7 @@ By default, the response takes the following form:
device_code=3584d83530557fdd1f46af8289938c8ef79f9dc5&expires_in=900&interval=5&user_code=WDJB-MJHT&verification_uri=https%3A%2F%{% data variables.product.product_url %}%2Flogin%2Fdevice
```

Name | Type | Description
Parameter name | Type | Description
-----|------|--------------
`device_code` | `string` | The device verification code is 40 characters and used to verify the device.
`user_code` | `string` | The user verification code is displayed on the device so the user can enter the code in a browser. This code is 8 characters with a hyphen in the middle.
Expand Down Expand Up @@ -199,9 +199,9 @@ The user must enter a valid code within 15 minutes (or 900 seconds). After 15 mi

Once the user has authorized, the app will receive an access token that can be used to make requests to the API on behalf of a user.

The endpoint takes the following input parameters:
The endpoint takes the following input parameters.

Name | Type | Description
Parameter name | Type | Description
-----|------|--------------
`client_id` | `string` | **Required.** The client ID you received from {% data variables.product.product_name %} for your {% data variables.product.prodname_oauth_app %}.
`device_code` | `string` | **Required.** The device verification code you received from the `POST {% data variables.product.oauth_host_code %}/login/device/code` request.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,16 @@ topics:
- Marketplace
shortTitle: Webhook events
---
## {% data variables.product.prodname_marketplace %} purchase webhook payload
## About webhooks and {% data variables.product.prodname_marketplace %}

Webhooks `POST` requests have special headers. See "[AUTOTITLE](/webhooks-and-events/webhooks/webhook-events-and-payloads#delivery-headers)" for more details. GitHub doesn't resend failed delivery attempts. Ensure your app can receive all webhook payloads sent by GitHub.

Cancellations and downgrades take effect on the first day of the next billing cycle. Events for downgrades and cancellations are sent when the new plan takes effect at the beginning of the next billing cycle. Events for new purchases and upgrades begin immediately. Use the `effective_date` in the webhook payload to determine when a change will begin.

{% data reusables.marketplace.marketplace-malicious-behavior %}

## About the purchase webhook payload for {% data variables.product.prodname_marketplace %}

Each `marketplace_purchase` webhook payload will have the following information:


Expand Down Expand Up @@ -59,18 +61,3 @@ Key | Type | Description
`bullet` | `array of strings` | The names of the bullets set in the pricing plan.

<br/>

### Example webhook payload for a `purchased` event
This example provides the `purchased` event payload.

{{ webhookPayloadsForCurrentVersion.marketplace_purchase.purchased }}

### Example webhook payload for a `changed` event

Changes in a plan include upgrades and downgrades. This example represents the `changed`,`pending_change`, and `pending_change_cancelled` event payloads. The action identifies which of these three events has occurred.

{{ webhookPayloadsForCurrentVersion.marketplace_purchase.changed }}

### Example webhook payload for a `cancelled` event

{{ webhookPayloadsForCurrentVersion.marketplace_purchase.cancelled }}
48 changes: 24 additions & 24 deletions content/webhooks-and-events/events/github-event-types.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,30 +23,30 @@ The Events API can return different types of events triggered by activity on Git

The event objects returned from the Events API endpoints have the same structure.

| Event API attribute name | Description |
|--------------------------|-------------|
| `id` | Unique identifier for the event. |
| `type` | The type of event. Events uses PascalCase for the name. |
| `actor` | The user that triggered the event. |
| `actor.id` | The unique identifier for the actor. |
| `actor.login` | The username of the actor. |
| `actor.display_login` | The specific display format of the username. |
| `actor.gravatar_id` | The unique identifier of the Gravatar profile for the actor. |
| `actor.url` | The REST API URL used to retrieve the user object, which includes additional user information. |
| `actor.avatar_url` | The URL of the actor's profile image. |
| `repository` | The repository object where the event occurred. |
| `repository.id` | The unique identifier of the repository. |
| `repository.name` | The name of the repository, which includes the owner and repository name. For example, `octocat/hello-world` is the name of the `hello-world` repository owned by the `octocat` personal account. |
| `repository.url` | The REST API URL used to retrieve the repository object, which includes additional repository information. |
| `payload` | The event payload object is unique to the event type. See the event type below for the event API `payload` object. |
| `public` | Whether the event is visible to all users. |
| `created_at` | The date and time when the event was triggered. It is formatted according to ISO 8601. |
| `org` | The organization that was chosen by the actor to perform action that triggers the event.<br />_The property appears in the event object only if it is applicable._ |
| `org.id` | The unique identifier for the organization. |
| `org.login` | The name of the organization. |
| `org.gravatar_id` | The unique identifier of the Gravatar profile for the organization. |
| `org.url` | The REST API URL used to retrieve the organization object, which includes additional organization information. |
| `org.avatar_url` | The URL of the organization's profile image. |
| Event API attribute name | Type | Description |
|--------------------------|-------------|-------------|
| `id` | `string` | Unique identifier for the event. |
| `type` | `string` | The type of event. Events uses PascalCase for the name. |
| `actor` | `object` | The user that triggered the event. |
| `actor.id` | `string` | The unique identifier for the actor. |
| `actor.login` | `string` | The username of the actor. |
| `actor.display_login` | `string` | The specific display format of the username. |
| `actor.gravatar_id` | `string` | The unique identifier of the Gravatar profile for the actor. |
| `actor.url` | `string` | The REST API URL used to retrieve the user object, which includes additional user information. |
| `actor.avatar_url` | `string` | The URL of the actor's profile image. |
| `repository` | `object` | The repository object where the event occurred. |
| `repository.id` | `string` | The unique identifier of the repository. |
| `repository.name` | `string` | The name of the repository, which includes the owner and repository name. For example, `octocat/hello-world` is the name of the `hello-world` repository owned by the `octocat` personal account. |
| `repository.url` | `string` | The REST API URL used to retrieve the repository object, which includes additional repository information. |
| `payload` | `object` | The event payload object is unique to the event type. See the event type below for the event API `payload` object. |
| `public` | `boolean` | Whether the event is visible to all users. |
| `created_at` | `string` | The date and time when the event was triggered. It is formatted according to ISO 8601. |
| `org` | `object` | The organization that was chosen by the actor to perform action that triggers the event.<br />_The property appears in the event object only if it is applicable._ |
| `org.id` | `string` | The unique identifier for the organization. |
| `org.login` | `string` | The name of the organization. |
| `org.gravatar_id` | `string` | The unique identifier of the Gravatar profile for the organization. |
| `org.url` | `string` | The REST API URL used to retrieve the organization object, which includes additional organization information. |
| `org.avatar_url` | `string` | The URL of the organization's profile image. |

### Example WatchEvent event object

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,14 @@ The unique properties for a webhook event are the same properties you'll find in

### Delivery headers

HTTP POST payloads that are delivered to your webhook's configured URL endpoint will contain several special headers:

Header | Description
-------|-------------|
`X-GitHub-Event`| Name of the event that triggered the delivery.
`X-GitHub-Delivery`| A [GUID](http://en.wikipedia.org/wiki/Globally_unique_identifier) to identify the delivery.{% ifversion ghes or ghae %}
`X-GitHub-Enterprise-Version` | The version of the {% data variables.product.prodname_ghe_server %} instance that sent the HTTP POST payload.
`X-GitHub-Enterprise-Host` | The hostname of the {% data variables.product.prodname_ghe_server %} instance that sent the HTTP POST payload.{% endif %}{% ifversion not ghae %}
`X-Hub-Signature`| This header is sent if the webhook is configured with a [`secret`](/rest/repos#create-hook-config-params). This is the HMAC hex digest of the request body, and is generated using the SHA-1 hash function and the `secret` as the HMAC `key`.{% ifversion fpt or ghes or ghec %} `X-Hub-Signature` is provided for compatibility with existing integrations, and we recommend that you use the more secure `X-Hub-Signature-256` instead.{% endif %}{% endif %}
`X-Hub-Signature-256`| This header is sent if the webhook is configured with a [`secret`](/rest/repos#create-hook-config-params). This is the HMAC hex digest of the request body, and is generated using the SHA-256 hash function and the `secret` as the HMAC `key`.
HTTP POST payloads that are delivered to your webhook's configured URL endpoint will contain several special headers.

- `X-GitHub-Event`: Name of the event that triggered the delivery.
- `X-GitHub-Delivery`: A [GUID](http://en.wikipedia.org/wiki/Globally_unique_identifier) to identify the delivery.{% ifversion ghes or ghae %}
- `X-GitHub-Enterprise-Version`: The version of the {% data variables.product.prodname_ghe_server %} instance that sent the HTTP POST payload.
- `X-GitHub-Enterprise-Host`: The hostname of the {% data variables.product.prodname_ghe_server %} instance that sent the HTTP POST payload.{% endif %}{% ifversion not ghae %}
- `X-Hub-Signature`: This header is sent if the webhook is configured with a [`secret`](/rest/repos#create-hook-config-params). This is the HMAC hex digest of the request body, and is generated using the SHA-1 hash function and the `secret` as the HMAC `key`.{% ifversion fpt or ghes or ghec %} `X-Hub-Signature` is provided for compatibility with existing integrations, and we recommend that you use the more secure `X-Hub-Signature-256` instead.{% endif %}{% endif %}
- `X-Hub-Signature-256`: This header is sent if the webhook is configured with a [`secret`](/rest/repos#create-hook-config-params). This is the HMAC hex digest of the request body, and is generated using the SHA-256 hash function and the `secret` as the HMAC `key`.

Also, the `User-Agent` for the requests will have the prefix `GitHub-Hookshot/`.

Expand Down

0 comments on commit e72377f

Please sign in to comment.