/precheck
Description
Using the precheck method allows you to first check if you are creating a new record for an existing file. If the file exists within your project it will create a new record with a new URL that is independent of itself but is linked to the original file saving you storage costs and upload/retrieval times. A file is not required when using this method. If no matching file is found, it will respond back with an upload_required:true
in the response. It is recommended that anyone bulk uploading files that have multiples of the same file run each request through the precheck method first.
Sample Upload Request using Precheck
For the precheck method project_id
, asset_it
, and item_id
are REQUIRED. Server side validation will reject the request for any of the following:
Parameters do not conform to the UUID Spec
asset_id
already exists - Must be entirely uniqueMissing any of the required parameters
API Key is missing or transmitted improperly
Successful Precheck Response
The response will include a data parameter in the response that contains the full url record locater for your file. This url should be stored client side in order to reference your file.
Sample Failed precheck Response
a failed response on a precheck is almost always due the system not being able to find a similar record. The item_id
parameter is what is used to match to a pre-existing file. If you send a request with an item_id
that has already been used within your project, it will always create a new record linked to the file of the previously uploaded record.
Last updated