Start linking your GitHub account with a code: for pch and agents
curl --request POST \
--url https://patch.gg/api/v1/me/github/device \
--header 'Authorization: Bearer <token>'const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://patch.gg/api/v1/me/github/device', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://patch.gg/api/v1/me/github/device"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text){
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"user_code": "WDJB-MJHT",
"verification_uri": "https://github.com/login/device",
"interval": 123,
"expires_in": 123
}{
"error": {
"code": "version_exists",
"message": "<string>",
"details": "<unknown>"
}
}{
"error": {
"code": "version_exists",
"message": "<string>",
"details": "<unknown>"
}
}{
"error": {
"code": "version_exists",
"message": "<string>",
"details": "<unknown>"
}
}{
"error": {
"code": "version_exists",
"message": "<string>",
"details": "<unknown>"
}
}{
"error": {
"code": "version_exists",
"message": "<string>",
"details": "<unknown>"
}
}GitHub
Start linking your GitHub account with a code: for pch and agents
GitHub’s device flow: show the person user_code and verification_uri, where they enter it, then ask GET /me/github/device/{id} no more often than every interval seconds. Once they have, Patch keeps their GitHub user token, as from GitHub’s sign-in in a browser. Needs the publish scope.
POST
/
me
/
github
/
device
Start linking your GitHub account with a code: for pch and agents
curl --request POST \
--url https://patch.gg/api/v1/me/github/device \
--header 'Authorization: Bearer <token>'const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://patch.gg/api/v1/me/github/device', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://patch.gg/api/v1/me/github/device"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text){
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"user_code": "WDJB-MJHT",
"verification_uri": "https://github.com/login/device",
"interval": 123,
"expires_in": 123
}{
"error": {
"code": "version_exists",
"message": "<string>",
"details": "<unknown>"
}
}{
"error": {
"code": "version_exists",
"message": "<string>",
"details": "<unknown>"
}
}{
"error": {
"code": "version_exists",
"message": "<string>",
"details": "<unknown>"
}
}{
"error": {
"code": "version_exists",
"message": "<string>",
"details": "<unknown>"
}
}{
"error": {
"code": "version_exists",
"message": "<string>",
"details": "<unknown>"
}
}Authorizations
An API key (pch_...) or the token from pch login.
Response
The code for the person to enter