Documentation

InitiateFileUploads

Initiates file uploads to an entity's profile.

Request Details

Returns URLs that may be used to upload the files for a profile 5 minutes. After using the upload calls FinalizeFileUploads must be called to move the file status from pending to live.

InitiateFileUploadsRequest
Request Properties
Entity (required) EntityKey

The entity to perform this action on.

FileNames (required) List<String>

Names of the files to be set. Restricted to a-Z, 0-9, '(', ')', '_', '-' and '.'

ProfileVersion int32

The expected version of the profile, if set and doesn't match the current version of the profile the operation will not be performed.

POST https://{{TitleID}}.playfabapi.com/File/InitiateFileUploads
    Content-Type: application/json
{
  "FileNames": [
    "profile_configuration",
    "game_state"
  ],
  "Entity": {
    "Id": "ID",
    "Type": "title_player_account",
    "TypeString": "title_player_account"
  }
}
        

Response Details

InitiateFileUploadsResponse
Result Properties
Entity EntityKey

The entity id and type.

ProfileVersion (required) int32

The current version of the profile, can be used for concurrency control during updates.

UploadDetails List<InitiateFileUploadMetadata>

Collection of file names and upload urls

Sample Response

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
  "code": 200,
  "status": "OK",
  "data": {
    "ProfileVersion": 5,
    "UploadDetails": [
      {
        "FileName": "game_state",
        "UploadUrl": "https://..."
      },
      {
        "FileName": "profile_configuration",
        "UploadUrl": "https://..."
      }
    ],
    "Entity": {
      "Id": "ID",
      "Type": "title_player_account",
      "TypeString": "title_player_account"
    }
  }
}

Authentication

EntityToken

Possible Error Codes

Name Code
EntityFileOperationPending 1350