Home Page > Integration > REST API > Files


Files - /REST/1/Files

This endpoint is used for manipulating files within the system. Objects are always returned in a JSON format within an array. Empty results return an empty array.


It should be noted that this resource works slightly different to others in that the JSON body is provided in a form-data parameter. Here is an outline of how the form-data should appear:


Field Name Field Value
file An array of physical files to be uploaded to the system.
_jsonBody The JSON Object as described below.


Each Object within the JSON list presented in _jsonBody is matched against the file using the original_filename attribute. Below is an example of a POST using curl:


curl -u admin:admin -X POST http://my.openasset.example.org/REST/1/Files
    -F file=@filename001.jpg
    -F _jsonBody='[
            "category_id": 1,
            "original_filename": "filename001.jpg"



The File object takes/returns the following JSON object.

        ​"access_level": "<int>",
        "alternate_store_id": "<int>",
        "caption": "<text>",
        "category_id": "<int>",
        "click_count": "<int>",
        "contains_audio": "<bool>",
        "contains_video": "<bool>",
        "copyright_holder_id": "<int>",
        "created": "<date>",
        "description": "<text>",
        "download_count": "<int>",
        "duration": "<int>",
        "filename": "<string>",
        "id": "<int>",
        "md5_at_upload": "<hash>",
        "md5_now": "<hash>",
        "original_filename": "<string>",
        "photographer_id": "<int>",
        "processing_failures": "<int>",
        "project_id": "<int>",
        "rank": "<int>",
        "recheck": "<int>",
        "replaced": "<date>",
        "replaced_user_id": "<int>",
        "rotate_degrees": "<int>",
        "rotation_since_upload": "<int>",
        "updated": "<date>",
        "rotation_since_upload": "<bool>",
        "uploaded": "<date>",
        "user_id": "<int>",
        "video_frames_per_second": "<int>"

Last Updated: June 27th, 2018.


As with other resources, this resource is subject to the global parameters mentioned in the REST Overview.



The following JSON parameters are available when updating a resource.


JSON Parameter Allowed Values Notes
access_level int  
caption string  
copyright_holder_id int  
description string  
photographer_id int  
rank int  
rotate_degrees enum:0,90,180,270 Represents a clockwise rotation. Optional



The following JSON parameters are required when creating a resource:


JSON Parameter Allowed Values Notes
category_id int  
original_filename string Must match filename used in file post parameter
project_id int Required if it is a project based category
album_id int Optional
partial_filename string Optional
rotate_degrees enum:0,90,180,270 Represents a clockwise rotation. Optional


The resource can be deleted using this verb and including the id in the endpoint URL.



OpenAsset C# REST Wrapper

Additional general examples using the OpenAsset C-sharp REST Wrapper are found below. The Wrapper itself can be found at the following github location: https://github.com/axomic/openasset-rest-cs

        /// <summary>
        /// Get a collection of Files from the REST API. 
        /// The Rest Library File Noun and JSON Library will serialize the results automatically.
        /// </summary>
        /// <returns></returns>
private static List<File> GetFiles()
            RESTOptions<File> options = new RESTOptions<File>();
            Connection conn = Connection.GetConnection(BASEURL, USERNAME, PASSWORD);
            return conn.GetObjects<File>(options);




Ruby code example with File Noun.

  //Get a collection of Files from the REST API. 
 //The Rest Library will serialize the results automatically.

require 'openasset-rest-client'

client = OpenAsset::RestClient.new("url","username","password")

-- Get files
files = client.get_files

--Create file
client.upload_file('/path/to/file', category_id, project_id)

--Update file(s)
//edit some attribute

--Delete file(s)



Last modified


This page has no custom tags.


This page has no classifications.