Documentation

GetContentUploadUrl

Retrieves the pre-signed URL for uploading a content file. A subsequent HTTP PUT to the returned URL uploads the content. Also, please be aware that the Content service is specifically PlayFab's CDN offering, for which standard CDN rates apply.

Request Details

GetContentUploadUrlRequest
Request Properties
ContentType String

A standard MIME type describing the format of the contents. The same MIME type has to be set in the header when uploading the content. If not specified, the MIME type is 'binary/octet-stream' by default.

Key (required) String

Key of the content item to upload, usually formatted as a path, e.g. images/a.png

POST https://{{TitleID}}.playfabapi.com/Admin/GetContentUploadUrl
    Content-Type: application/json
    X-SecretKey: <developer_secret_key>
{
  "Key": "images/sword_icon.png",
  "ContentType": "image/png"
}
        

Response Details

GetContentUploadUrlResult
Result Properties
URL String

URL for uploading content via HTTP PUT method. The URL will expire in approximately one hour.

Sample Response

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
  "code": 200,
  "status": "OK",
  "data": {
    "URL": "https://..."
  }
}

Authentication

SecretKey

Possible Error Codes

Name Code
BillingInformationRequired 1266
ContentQuotaExceeded 1137