Upload a member's profile photo
curl --request POST \
--url https://api.gymdesk.com/members/{memberId}/photo \
--header 'Content-Type: multipart/form-data' \
--header 'X-API-Key: <api-key>' \
--form photo='@example-file'import requests
url = "https://api.gymdesk.com/members/{memberId}/photo"
files = { "photo": ("example-file", open("example-file", "rb")) }
headers = {"X-API-Key": "<api-key>"}
response = requests.post(url, files=files, headers=headers)
print(response.text)const form = new FormData();
form.append('photo', '<string>');
const options = {method: 'POST', headers: {'X-API-Key': '<api-key>'}};
options.body = form;
fetch('https://api.gymdesk.com/members/{memberId}/photo', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.gymdesk.com/members/{memberId}/photo",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"photo\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Content-Type: multipart/form-data",
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"data": {
"thumbnail": "https://files.gymdesk.com/3/member123-thumb.jpg",
"large": "https://files.gymdesk.com/3/member123-large.jpg"
}
}{
"message": "Unauthorized",
"correlationId": "01890c1a-9b2d-7c3e-8f12-3456789abcde"
}{
"message": "Resource not found",
"correlationId": "01890c1a-9b2d-7c3e-8f12-3456789abcde"
}{
"message": "Validation failed",
"errors": {
"name": [
"Field is required"
],
"email": [
"Must be a valid email address"
]
},
"correlationId": "01890c1a-9b2d-7c3e-8f12-3456789abcde"
}Members
Upload a member's profile photo
Replace the member’s profile photo. Send the image as a multipart/form-data request with a single photo file part (JPEG, PNG, or GIF, up to 5 MB). Returns the URLs of the stored sizes.
POST
/
members
/
{memberId}
/
photo
Upload a member's profile photo
curl --request POST \
--url https://api.gymdesk.com/members/{memberId}/photo \
--header 'Content-Type: multipart/form-data' \
--header 'X-API-Key: <api-key>' \
--form photo='@example-file'import requests
url = "https://api.gymdesk.com/members/{memberId}/photo"
files = { "photo": ("example-file", open("example-file", "rb")) }
headers = {"X-API-Key": "<api-key>"}
response = requests.post(url, files=files, headers=headers)
print(response.text)const form = new FormData();
form.append('photo', '<string>');
const options = {method: 'POST', headers: {'X-API-Key': '<api-key>'}};
options.body = form;
fetch('https://api.gymdesk.com/members/{memberId}/photo', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.gymdesk.com/members/{memberId}/photo",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"photo\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Content-Type: multipart/form-data",
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"data": {
"thumbnail": "https://files.gymdesk.com/3/member123-thumb.jpg",
"large": "https://files.gymdesk.com/3/member123-large.jpg"
}
}{
"message": "Unauthorized",
"correlationId": "01890c1a-9b2d-7c3e-8f12-3456789abcde"
}{
"message": "Resource not found",
"correlationId": "01890c1a-9b2d-7c3e-8f12-3456789abcde"
}{
"message": "Validation failed",
"errors": {
"name": [
"Field is required"
],
"email": [
"Must be a valid email address"
]
},
"correlationId": "01890c1a-9b2d-7c3e-8f12-3456789abcde"
}⌘I
