1
0
mirror of synced 2026-01-05 12:07:35 -05:00

Combine product name variables for REST and GraphQL API base URLs (#50521)

This commit is contained in:
Laura Coursen
2024-05-10 09:20:12 -05:00
committed by GitHub
parent aef6bc2468
commit e977bce6d8
40 changed files with 99 additions and 107 deletions

View File

@@ -13,7 +13,7 @@
```shell
curl --request POST \
--url "{% data variables.product.api_url_pre %}/app/installations/INSTALLATION_ID/access_tokens" \
--url "{% data variables.product.rest_url %}/app/installations/INSTALLATION_ID/access_tokens" \
--header "Accept: application/vnd.github+json" \
--header "Authorization: Bearer JWT" \
--header "X-GitHub-Api-Version: {{ allVersions[currentVersion].latestApiVersion }}"

View File

@@ -2,7 +2,7 @@
```shell
curl --request GET \
--url "{% data variables.product.api_url_pre %}/user" \
--url "{% data variables.product.rest_url %}/user" \
--header "Accept: application/vnd.github+json" \
--header "Authorization: Bearer USER_ACCESS_TOKEN" \
--header "X-GitHub-Api-Version: {{ allVersions[currentVersion].latestApiVersion }}"

View File

@@ -299,9 +299,8 @@ raw_github_com: >-
current-340-version: '11.10.354'
# Developer site product variables
# Use this inside command-line code blocks
api_url_pre: >-
{% ifversion fpt or ghec %}https://api.github.com{% elsif ghes %}http(s)://<em>HOSTNAME</em>/api/v3{% endif %}
rest_url: >-
{% ifversion fpt or ghec %}https://api.github.com{% elsif ghes %}http(s)://HOSTNAME/api/v3{% endif %}
# Use this inside command-line code blocks
# Enterprise OAuth paths that don't include "/graphql" or "/api/v3"
oauth_host_code: >-
@@ -312,12 +311,5 @@ device_authorization_url: >-
{%- elsif ghes %}
`http(s)://HOSTNAME/login/device`
{%- endif %}
# Use this all other code blocks
api_url_code: >-
{% ifversion fpt or ghec %}https://api.github.com{% elsif ghes %}http(s)://HOSTNAME/api/v3{% endif %}
# Use this inside command-line code blocks
graphql_url_pre: >-
{% ifversion fpt or ghec %}https://api.github.com/graphql{% elsif ghes %}http(s)://<em>HOSTNAME</em>/api/graphql{% endif %}
# Use this all other code blocks
graphql_url_code: >-
graphql_url: >-
{% ifversion fpt or ghec %}https://api.github.com/graphql{% elsif ghes %}http(s)://HOSTNAME/api/graphql{% endif %}