Skip to main content

Asset API - Asset Data Format

FileSpin returns Asset data in a standard JSON format as below for all Asset API calls. In addition, data posted to your Webhooks will also be of this format.

Asset Data JSON Format - Example

{
"id": "99d819953914402babbdeb68337ea6a3",
"status": "OK",
"name": "sample.mov",
"size": 8836363,
"checksum": "5f5f26bd7c0f62c6e02e44c73d09734e",
"provider": "local",
"storage_type": "AMAZON_S3",
"bucket": "filespin-labs",
"key": "/99d819953914402babbdeb68337ea6a3/sample.jpg",
"public": false,
"content_type": "video/quicktime",
"creator_id": 272,
"upload_time": "2015-07-02T08:12:56Z",
"update_user_id": 272,
"update_time": "2015-07-02T08:12:56Z",
"upload_source": "upload.example.com",
"data_schema_id": 1,
"metadata": {
"width": 1200,
"height": 800,
"duration": 30
},
"data": {
"foo": "bar"
},
"conversions": {
"720p-video": {
"storage_type": "s3",
"bucket": "filespin-labs",
"key": "/99d819953914402babbdeb68337ea6a3/720p-video.mp4",
"width": 1280,
"height": 720,
"duration": 30,
"size": 716000,
"public": true,
"watermarked": false
},
"hls-video": {
"storage_type": "s3",
"bucket": "filespin-labs",
"key": "/99d819953914402babbdeb68337ea6a3/hls/playlist.m3u8",
"width": 1280,
"height": 720,
"duration": 30,
"size": 716000,
"public": true,
"watermarked": false
}
},
"addons_info": {
"ON_DEMAND_IMAGE": {
"available": true
}
}
}

JSON Parameters

KeyValueDescription
idstringAsset's unique ID, 32 character alphanumeric UUID
statusstringOK if Asset was saved successfully, NOT_READY if file is being saved, ERROR if the asset has any errors (such as , if it is not a image or a video). ARCHIVED if the asset is archived. An archived asset will be available in read-only mode and cannot be updated.
eventstringfile-saved, file-processed or file-data-updated
namestringFile name
sizeintegerSize of file in bytes
checksumstringMD5 checksum
providerstringThe source of the file, local or one of the supported cloud providers
storage_typestringAMAZON_S3 if s3 else FILESPIN if storage is managed by FileSpin
bucketstringS3 Bucket name
keystringS3 Object key for this file
publicbooleantrue if file is publicly accessible, false otherwise
content_typestringMIME type
creator_idintegerUser Id of file owner
update_user_idintegerUser Id of user updating file derivatives or file data
upload_timestringISO 8601 datetime, when the original file was uploaded
update_timestringISO 8601 datetime, when the asset metadata was last updated
upload_sourcestringwhere the file was sourced from
data_schema_idintegerJSON Schema Id for the asset data
metadataJSONDepending on Addons enabled, file metadata is returned. For image/video files, width, height in pixels and duration in seconds are always returned
dataJSONOptional user-data stored along with an asset
conversionsJSONStandard image/video conversions and those generated by addons
addon_infoJSONIndicates which addons were processed for the asset
errorsJSONErrors if any while processing asset. This will be like: {"original": "Original file appears to be invalid!"}. If there are warnings that do not affect processing but have been captured for an asset, they will be like: {"warning": "This may be a PNG file uploaded as JPG!"}
The importance of Asset Status

When an asset is uploaded, the status may be returned as NOT_READY. Client applications must check if the status is OK before trying to access the asset or invoke further asset processing. This can be done by waiting a few seconds for large files (1GB+) and a few hundred milliseconds for small files (less than 50 MB).