Skip to main content
Version: 5.7.0

GetGlobalCDNUrl

tip

This method was added to support clients (like very old versions of Unity - i.e. circa 2016) that cannot handle HTTP Redirects. This method allows clients to pre-resolve the CDN endpoint for the file to download.


This call is not required in the great majority of cases. Just use the regular file download URL and the platform will automatically re-direct the client to the appropriate CDN URL.

Returns the CDN URL for the specified file.

ServiceOperation
globalFileV3GET_GLOBAL_CDN_URL

Method Parameters

ParameterDescription
fileIdFile ID

Usage

http://localhost:3000
string fileId = "hjvfsghguhuhrtghgh";
SuccessCallback successCallback = (response, cbObject) =>
{
Debug.Log(string.Format("Success | {0}", response));
};
FailureCallback failureCallback = (status, code, error, cbObject) =>
{
Debug.Log(string.Format("Failed | {0} {1} {2}", status, code, error));
};

_bc.GlobalFileService.GetGlobalCDNUrl(fileId, successCallback, failureCallback);
JSON Response
{
"status": 200,
"data": {
"appServerUrl": "https://api.braincloudservers.com/...f434b1db538b/f/uploadsimplefile.txt",
"cdnUrl": "https://d2b6zwnvr1nyug.cloudfront.net/bc/g/20001/u/107b3aa9-0d9f-4e90-af..."
}
}