Start changing your picture, and get where to upload it
curl --request POST \
--url https://patch.gg/api/v1/me/picture \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"sha256": "<string>",
"size": 123
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({sha256: '<string>', size: 123})
};
fetch('https://patch.gg/api/v1/me/picture', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://patch.gg/api/v1/me/picture"
payload = {
"sha256": "<string>",
"size": 123
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"upload": {
"method": "PUT",
"url": "<string>",
"headers": {},
"expires_at": "<string>"
}
}{
"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>"
}
}Account
Start changing your picture, and get where to upload it
Send the file’s SHA-256 and size (sessions only). Upload the bytes to the returned URL with exactly its headers, then call PUT /me/picture, which checks the file and publishes it. upload is null when Patch already has these bytes.
POST
/
me
/
picture
Start changing your picture, and get where to upload it
curl --request POST \
--url https://patch.gg/api/v1/me/picture \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"sha256": "<string>",
"size": 123
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({sha256: '<string>', size: 123})
};
fetch('https://patch.gg/api/v1/me/picture', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://patch.gg/api/v1/me/picture"
payload = {
"sha256": "<string>",
"size": 123
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"upload": {
"method": "PUT",
"url": "<string>",
"headers": {},
"expires_at": "<string>"
}
}{
"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>"
}
}