createAssetUploadUrl
Creates a new URL for uploading assets.
Declaration
CancellablePromise createAssetUploadUrl(
CreateAssetUploadUrlParams params
);Parameters
- params:
A dictionary as described in the Discussion section.
Return Value
A CancellablePromise with the following resolutions.
Discussion
If the promise is successful, it will resolve with one of the following dictionaries:
{ statusCode: 201; result: CKDBAssetUploadUrlResponse }
The promise may reject and throw the following:
DocumentedResponseError, if the HTTP status code is 421. The result member will be a dictionary conforming to AuthenticationRequiredError.DocumentedResponseError, if the HTTP status code is none of the above and in the range 400 to 599. The result member will be a dictionary conforming to RequestError.ValidationError, if the parameters to the method are incorrect.A
FetchErrordescendant, if there is a problem with the network request. A reference to the request object can be used to examine the underlying cause.
Discussion
The params dictionary has the following properties:
dictionary CreateAssetUploadUrlParams {
CKDBCreateAssetUploadUrlRequestBody body;
string containerId;
CKEnvironment environment;
string databaseType;
string zoneName;
}body: Details of the request to create an asset upload URL.containerId: The container identifier. SeeContainer.environment: The container environment. For valid values, seeCKEnvironment.databaseType: The database type. For valid values, seeCKDatabaseType.zoneName: The zone name. SeeCKDBZone.
If successful, the result contains the URL to use when uploading an asset, which is valid for 15 minutes. Use this URL to upload your asset and provide the asset fields returned by the upload when creating or updating a record. The following fields are returned if the asset upload is successful: size, receipt, fileChecksum, wrappingKey, referenceChecksum. You can use these values when creating a CKDBRecordFieldAssetValue object for your asset field type.