Skip to main content

POST Presigned URL to Upload File

Overview


The following table contains important information about the POST method in regards to the upload process with presigned url.

POST Method
MethodPOST
URL or Endpoint/api/projects/projectId/uploads/url
HeadersAuthorization
ParametersprojectId
BodyCheck the request body below.

The description of the URL parameter is as follows:

projectId URL Parameter
URL Parameter NameprojectId
MandatoryYes
Typestring
DescriptionUnique identifier for project

Request Body

{
"fileName": "{fileName}",
"contentLength": 0,
"mimeType": "{mimeType}",
"contentType": "{contentType}",
"enableDuplicateCheck": false,
"fileHash": "{fileHash}"
}

Information about the fields that appear when you request the body of the video are displayed in the table below.

Field NameMandatoryTypeDescription
fileNameYesstringName of the file.
mimeTypeNostringType of the file.
contentTypeNostringContent type of the file.
contentLengthNointegerLength of the file (in bytes).
enableDuplicateCheckNobooleanDetermines whether duplicate upload should be disallowed.
fileHashNostringThe hash of the file to be uploaded.
Required if enableDuplicateCheck is true.
info

If the enableDuplicateCheck field is set to true and fileHash is provided, the system will check for existing files with the same file hash and prevent them from being uploaded again. If set to false or omitted, duplicates will be allowed.

Important: This field should be enabled for both the initial upload and any subsequent uploads. If not enabled initially, the system will not perform the duplicate check, and duplicates will be allowed, even if the file hash is the same.

Response

{
"success": true,
"errors": [],
"messages": [],
"result": {
"uploadFileDetailsId": 0,
"url": "{url}",
"requestKey": "{requestKey}",
"filePath": "{filePath}"
},
"resultInfo": null,
"statusCode": 200
}

Information about the fields that appear when you request the body of the video are displayed in the table below.

Parameter NameTypeDescription
successboolIf the response is successful, it will return true. Otherwise, it will return false.
errorsarray[string]Indicates if there was an error.
messagesarray[string]Returns the response message from the back-end.
resultobjectReturns the response object.
uploadFileDetailsIdinteger($int32)The ID of upload file details.
urlstringThe URL where the resource can be accessed.
requestKeystringA unique key associated with the request.
filePathstringThe file path of the resource.
resultInfostringReturns extra information about the result.
statusCodeinteger($int32)Returns the HTTP Status Code.

If the action is successful, the service sends back an HTTP 200 or 201 response.

Errors

For information about the errors that are common to all actions, see Common Errors:

  • HTTP Status Code 400: Bad Request

  • HTTP Status Code 401: Unauthorized

  • HTTP Status Code 403: Forbidden

  • HTTP Status Code 404: Result Not Found

  • HTTP Status Code 409: Conflict

{
"success": true,
"errors": [],
"messages": [],
"result": {
"uploadFileDetailsId": "{uploadFileDetailsId}",
"requestKey": "{requestKey}"
},
"resultInfo": null,
"statusCode": 409,
}
  • HTTP Status Code 410: Gone

  • HTTP Status Code 500: Internal Server Error

  • HTTP Status Code 503: Backend Fetch Failed