Upload

Request: GET

Get the detail about a specific upload

HTTP Request

GET /v1/{sport}/upload/{uploadType}/type/{entityType}/id/{entityId}

Parameters

Parameter Name Value Description
Required Parameters
sport string The sport for which you are making the request
uploadType string The type of upload. Check the parameter matrix for valid options.
entityType string The type of entity the upload is for. eg. team, league. Check the parameter matrix for valid options.
entityId integer The unique identification number for the entity. eg. personId, teamId. Check the parameter matrix for valid options.
Optional Parameters
useExternalForLeague integer If this value is set to the leagueId for the upload, then the URL parameter entityId will instead refer to the externalId field of the entity.

Parameter Matrix

uploadType entityType entityId
logo league leagueId
logo club clubId
jersey club clubId
logo competition competitionId
logo team teamId
jersey team teamId
photo team teamId
photo person personId

Request Body

Do not supply a request body with this method.

Response

If successful this method returns an Upload resource.

Request: POST/PUT

Upload a new file. Only one file can be associated with a particular type at any one moment. Uploading a new file will associate the type with a new file.

WARNING: By using this API call, you assert that you have the legal right and authority to upload and distribute this image.

HTTP Request

POST /v1/{sport}/upload/{uploadType}/type/{entityType}/id/{entityId}

Parameters

Parameter Name Value Description
Required Parameters
sport string The sport for which you are making the request
uploadType string The type of upload. Check the parameter matrix for valid options.
entityType string The type of entity the upload is for. eg. team, league. Check the parameter matrix for valid options.
entityId integer The unique identification number for the entity. eg. personId, teamId. Check the parameter matrix for valid options.
Optional Parameters
fileField string If using the multipart-form method, this parameter specifies the name of the form field containing the file data.
urlLoad integer If set to 1, then upload the image from a URL contained in the body. Cannot be set if fileField is also set.
useExternalForLeague integer If this value is set to the leagueId for the upload, then the URL parameter entityId will instead refer to the externalId field of the entity.

Request Body

The request body can be one of two formats.

  1. Simple Upload

    In the simple upload format the fileField parameter is not used and the request body contains the data of the file being uploaded.

    Example
    
    POST /v1/basketball/upload/logo/type/team/id/123?ak=TESTAUTHKEY HTTP/1.1
    Host: API host
    Content-Type: image/png
    Content-Length: number of bytes in PNG file
    
    PNG data
  2. Multipart

    In the multipart upload format the data is sent as a multipart/form-data request. The parameter name for the file is given by the parameter fileField.

    Example
    
    POST /v1/basketball/upload/logo/type/team/id/123?ak=TESTAUTHKEY&fileField=file HTTP/1.1
    Host: API host
    Content-Length: number of bytes in entire request body
    Content-Type: multipart/related; boundary="xxxboundaryxxx"
    
    --xxxboundary
    Content-Type: image/png
    Content-Disposition: form-data; name="file"; filename="logo.png"
    
    PNG data
    
    --xxxboundaryxxx-- 
  3. Upload from an existing URL

    In the body you must provide a JSON structure containing the following fields.

    Parameter Name Value Description
    Required Parameters
    url string The URL of the image. Must contain the full protocol (http://). eg. http://www.example.com/teams/teamlogo.png.
    Example
    {
      "url":"http://www.example.com/teams/logo.png"
    }
    

Image Format

The system will only accept image uploads of the following types:

It is strongly recommended to upload PNG files with an alpha channel. This ensures the most flexible usage of the images.

File Size

The file being uploaded must be under 200Kb in size.

Image Dimensions

The image file being uploaded should be square in size and not larger than 1024x1024. If the image is not square then it will be automatically padded with tranparent (or white depending on image format) pixels to achieve a square image.

The system will automatically generate images at defined sizes. If the initial image is smaller than one of the defined sizes, then that size will not be generated. eg. An initial image of 400x400 will not generate an image of 600x600.

Response

If successful this method returns an Upload resource.

Request: DELETE

Delete an existing upload

HTTP Request

DELETE /v1/{sport}/upload/{uploadType}/type/{entityType}/id/{entityId}

Parameters

Parameter Name Value Description
Required Parameters
sport string The sport for which you are making the request
uploadType string The type of upload. Check the parameter matrix for valid options.
entityType string The type of entity the upload is for. eg. team, league. Check the parameter matrix for valid options.
entityId integer The unique identification number for the entity. eg. personId, teamId. Check the parameter matrix for valid options.
Optional Parameters
useExternalForLeague integer If this value is set to the leagueId for the upload, then the URL parameter entityId will instead refer to the externalId field of the entity.

Request Body

Do not supply a request body with this method.

Response

On success this method returns SUCCESS.