Documentation

Support

Multiplay Hosting

Multiplay Hosting

Build upload workflow

Follow this workflow to upload and manage builds using the API.
Read time 4 minutesLast updated 3 days ago

The build workflow includes building the binary, getting (or creating) a build, creating a list of build files, upload the build files, creating a build version, and waiting for the build to sync. Before using the Build workflow, you must have a CCD API key and a UGS service account with the following roles:
  • Multiplay API Viewer
  • Multiplay API Editor
Refer to Project roles and Service account authentication. The following diagram shows a simplified version of the workflow:
build workflow diagram

build workflow diagram

Build the binary

Before continuing with the rest of the build workflow, you must build your game binary if you plan to create a build. If you already have a build you want to use, you can skip this step and continue to get an existing build. The process for building a game binary depends on the game engine and tech stack your game uses. If you’re using the Unity Engine, refer to Publishing builds and Create a build.

Get a build

The process for getting a build varies depending on whether you want to use an existing build or create a new build.

Get an existing build by name

You can retrieve an existing build ID by name using the List Builds API. If you already know the build ID, continue to Create a list of files in the build. The Build List API response body includes the CCD Bucket ID of each build in the
ccd.bucketID
field for each build. Make note of the
buildID 
and
ccd.bucketID
field values of the build you want to use.
The following code sample shows how to get an existing build by name using curl:
curl -X GET -H "Authorization: Basic <SERVICE_ACCOUNT_CREDENTIALS>" https://services.api.unity.com/multiplay/builds/v1/projects/{projectId}/environments/{environmentId}/builds
Refer to the API documentation for example response bodies and parameter documentation.

Create a new build

You can create a new build using the Create build API. The Create Build API response body includes the CCD Bucket ID of the build you created in the
ccd.bucketID
field. Make note of the
buildID 
and
ccd.bucketID
field values.
The following code sample shows how to create a new build using curl:
curl -X POST -H "Authorization: Basic <SERVICE_ACCOUNT_CREDENTIALS>" -H "Content-Type: application/json" \-d '{"buildName":"Dev Build A", "ccd": {}, "osFamily": "LINUX"}' \https://services.api.unity.com/multiplay/builds/v1/projects/{projectId}/environments/{environmentId}/builds
Refer to the Create build API documentation for example response bodies and parameter documentation.

Create a list of files in the build

Upload the files in the build

You can upload the files in a build using the CCD create or update entry by path API for each file in your list
  1. Create an entry. The following code sample shows how to create an entry using curl:
curl -X POST -H "Authorization: Basic <SERVICE_ACCOUNT_CREDENTIALS>" -H "Content-Type: application/json" \-d '{"content_type": "<FILE_CONTENT_TYPE>", "signed_url": true}' \https://content-api.cloud.unity.com/api/v1/environments/{environmentid}/buckets/{bucketid}/entry_by_path/?path=path/to/file
  1. Capture the
    signed_url
    from the response. You can then upload the file contents to this URL The following code sample shows how to upload a file using curl:
curl -X PUT -H "Content-Type: <FILE_CONTENT_TYPE>" --upload-file path/to/file \<signed_url>
Refer to the CCD create or update entry by path API documentation for example response bodies and parameter documentation.

Create a build version

You can create a build version with the Create a new build version API. Be sure to set the
ccd.bucketID
field to the ID of the CCD bucket you noted earlier.
The following code sample shows how to create a build version using curl:
curl -X POST -H "Authorization: Basic <SERVICE_ACCOUNT_CREDENTIALS>" -H "Content-Type: application/json" \-d '{"ccd": { "bucketID": "<CCD_BUCKET_ID>" }, "forceRollout": false}' \https://services.api.unity.com/multiplay/builds/v1/projects/{projectId}/environments/{environmentId}/builds/{buildId}/versions
Refer to the Create a new build version API documentation for example response bodies and parameter documentation.

Wait for the build to sync

You can find out when the build synchronization completes by retying the Get a single build API until the
syncStatus
field is
SYNCED
.
The following code sample shows how to know when the build has synced using curl:
curl -X GET -H "Authorization: Basic <SERVICE_ACCOUNT_CREDENTIALS>" https://services.api.unity.com/multiplay/builds/v1/projects/{projectId}/environments/{environmentId}/builds/{buildId}
Refer to the Get a single build API documentation for example response bodies and parameter documentation.