Create a player photo upload
POST/v1/teams/{teamId}/players/{playerId}/photo/uploads
const url = 'https://api.ligr.live/rest/v1/teams/1/players/1/photo/uploads';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"contentType":"image/png","size":1,"sha256":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.ligr.live/rest/v1/teams/1/players/1/photo/uploads \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "contentType": "image/png", "size": 1, "sha256": "example" }'Opens a signed upload for the photo of a player on the roster of a team. Declare the exact PNG or
JPEG file you will send. The photo must be exactly 300x300 pixels.
Upload the bytes with one PUT to url and send headers with it.
Then send uploadId to PUT /v1/teams/{teamId}/players/{playerId}/photo within one hour.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Entity identifier
The team id
Entity identifier
The player id
Request Bodyrequired
Section titled “Request Bodyrequired”Declare the exact photo file you will upload.
object
The photo must be exactly 300x300 pixels.
Byte count of the file. The limit is 500 KB.
Lowercase hexadecimal SHA-256 of the exact bytes you will PUT.
Responses
Section titled “Responses”Created
object
Send it as uploadId to the PUT route of the same image.
Signed URL for one PUT of the exact bytes.
Time after which url no longer accepts the PUT.
object
Base64 SHA-256 of the file. Send it unchanged with the PUT.
Examplegenerated
{ "uploadId": 1, "url": "example", "expiresAt": "example", "headers": { "x-amz-checksum-sha256": "example" }}