Comment on a game: what you'd add to it
curl --request POST \
--url https://patch.gg/api/v1/projects/{owner}/{slug}/comments \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"body": "A co-op mode, so two of us can carry the lantern in turns.",
"reply_to": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
body: JSON.stringify('A co-op mode, so two of us can carry the lantern in turns.'),
reply_to: '3c90c3cc-0d44-4b50-8888-8dd25736052a'
})
};
fetch('https://patch.gg/api/v1/projects/{owner}/{slug}/comments', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://patch.gg/api/v1/projects/{owner}/{slug}/comments"
payload = {
"body": "A co-op mode, so two of us can carry the lantern in turns.",
"reply_to": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"body": "<string>",
"author": {
"username": "<string>",
"name": "<string>",
"image": "<string>"
},
"created_at": "<string>",
"reply_to": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"likes": 123,
"liked": true
}{
"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>"
}
}Comments
Comment on a game: what you'd add to it
Goes under the game for everyone who can see it, by your username, so you need one first (422 username_required), or under one of its comments with reply_to. A reply to a reply goes under the same comment: replies are one level deep. A key needs the publish scope. Only you or the game’s team can delete it.
POST
/
projects
/
{owner}
/
{slug}
/
comments
Comment on a game: what you'd add to it
curl --request POST \
--url https://patch.gg/api/v1/projects/{owner}/{slug}/comments \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"body": "A co-op mode, so two of us can carry the lantern in turns.",
"reply_to": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
body: JSON.stringify('A co-op mode, so two of us can carry the lantern in turns.'),
reply_to: '3c90c3cc-0d44-4b50-8888-8dd25736052a'
})
};
fetch('https://patch.gg/api/v1/projects/{owner}/{slug}/comments', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://patch.gg/api/v1/projects/{owner}/{slug}/comments"
payload = {
"body": "A co-op mode, so two of us can carry the lantern in turns.",
"reply_to": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"body": "<string>",
"author": {
"username": "<string>",
"name": "<string>",
"image": "<string>"
},
"created_at": "<string>",
"reply_to": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"likes": 123,
"liked": true
}{
"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>"
}
}Body
application/json