Flight API Version 1.1

Updated: 2016-11-28


Overview

This document covers the methods and techniques required to access, create and modify content (assets, folders and albums) in Flight through our RESTful API. The API assumes you have a user account for Flight by Canto. The document references your http call as https://[your domain].cantoflight.com where your domain is the domain name you currently use (i.e. myaccount). In our sample results, we use https://obj.cantoflight.com for your reference.

Authorization

Flight's API uses the OAuth 2.0 protocol for authorization. Every API request must contain an access_token parameter with the OAuth 2.0 access token. Access tokens may be requested directly with your Flight expert. See the OAuth 2.0 Authentication Process for details below.

Compatibility

Future API versions may add new endpoints or parameters. In order to keep older verisons working, behaviors and return values of APIs with given parameters will not change from the currently documented behavior and return values. That being said, there are two important exceptions:

  • Currently undocumented request parameters (whether they are actually ignored or not) may be given a specific meaning
  • objects returned in responses may contain additional keys in the future

Thus, if you want to be future-proof, you should avoid passing undocumented parameters (as they may cause different behavior in the future), and they should avoid strict checks on the keys of objects found in responses. The current version is v1. So each path will start with /api/v1. Once we want to provide incompatible API in new versions like v2, we will maintain the /api/v1 as it is, and go through “/api/v2” for new the new version.

Security

All requests are done via SSL.

Date formats

All dates in the API are strings in the following format: 20150415063836418 which is translating into: yyyyMMddHHmmssSSS. (Note: Not including the date string importing from the file, it will maintain the format as it is.

Pagination

If the results of a call are a list, there are 2 scenarios:

  • Return the complete set: the following parameters are given: sortBy and sortDirection
  • Return just a subset of the results: for pagination purposes we give two additional parameters: limit and start. The result will give you the total result parameter found and you can define the number of pages you want to display from it. For example the found is 680, and we keep the limit as default 100, there would be a total of 7 pages:
    • Parameters ?start=0&limit=100 1st page contains [0..99]
    • Parameters ?start=100&limit=100 2st page contains [100..199]
    • Parameters ?start=200&limit=100 3st page contains [200..299]
    • Parameters ?start=300&limit=100 4st page contains [300..399]
    • Parameters ?start=400&limit=100 5th page contains [400..499]
    • Parameters ?start=500&limit=100 6th page contains [500..599]
    • Parameters ?start=600&limit=100 7th page contains [600..680]

HTTP Status Codes

The Flight API uses standard HTTP response codes to indicate errors.

Status Code Description
200 Request processed successfully
400
401
403 Access Token is invalid or missing
404 results (or page) not found (will also return this in case of arbitrary content/album/folder ID
500 Unexpected Error
503 Server unaccessible

General Properties

We want to introduce some general properties in advance:

Scheme All Flight files are part of one of our schemes. We also call them content types or smart albums. The themes are: Image, Video, Audio, Document, Presentation, Other. All files are connected to one scheme.
ID The ID is self-evident. Pair it up with the scheme field, and you could locate a resource like folder, album or file.
Created original time created
Time last time modified
Owner user ID of the user who uploaded the content
OwnerName owner's user name (email address)

Authentication Process

Access Token

By default you need to use an access token or the server will reject your request (401 status code). For example to retrieve the current user info, you should retrieve it with the command below:

curl -v -H 'Authorization: Bearer ya29.BwH2aP6rApmqH6eNqylimHjX0_iJ8Wah5S8-OM2U7SZreoLibKn-d3j4AVpC-t4fr7NgOdVNNscQcA' -H 'User-Agent: yourApp' "https://yourdomain.cantoflight.com/api/v1/user"

All OAuth endpoints have basic parameters. Every integrated app needs to use their own specified value.

Parameter Description
{App ID} This is a string Flight assign to you. Represent your App identifier.
{App Secret} This is a string Flight assign to you. Represent your App secret.
{Redirect Uri} Your web site url, which is used for redirect url when Flight finishes some request and send response to you.
{Flight OAuth domain url} https://oauth.cantoflight.com:8443/oauth/
Flight OAuth UI
Method URL (and sample)
GET https://{ Flight OAuth domain url }/api/oauth2/authorize

https://oauth.cantoflight.com:8443/oauth/api/oauth2/authorize?response_type=code&app_id=5909b958eac74764914e9cad927d1523&redirect_uri=https%3A%2F%2Foauth.dmc.objectiva.cn
%3A8443%2Foauth%2Frest%2Ftwitter%2Fback&state=abcd
Parameter Required Description
response_type Yes MUST be set to "code"
app_id Yes Your App identifier, the value is {App Id}
redirect_uri No The redirect url on third party web site. The value is {Redirect Uri}. If this value does not exist, Flight will take the value from your App setting. If the value exists, it must be same as your {Redirect Uri} in App setting.
state No A value which the {Redirect Uri} will receive alongside the access token. This is for security purpose, to ensure where you receive from is just the right site you send to.
Response Description
success Flight will lead user to login and authorization page
failure 400 if parameter is invalid plus json string with more details, i.e.
{
	“error”: “invalid_request”,
	“error_description”:” Wrong app_id value”}
Login and authorize

On the first page, the user will login to Flight:

  • Flight tenant url (i.e.“obj.staging.cantoflight.com”)
  • Username (Email address)
  • Password
Flight will verify the validity of the account. On the second page, Flight will ask for authorization of the App.
  • Deny: you will be redirected to your {Redirect Uri}(i.e. the user will receive {Redirect Uri}?error=access_denied&error_description=The+user+denied+access+to+your+application.
  • Agree: Flight will return you the authorization code to {Redirect Uri}.

    Return Code

    After user agrees the authorization of the App, Flight will return an authorization code to {Redirect Uri}. For example: https//yoursite.com/rest/flight/back?code=y78isjkh4c123u2bcq2&state=abcd

    Response Description
    code A string token you must exchange for your access token. The authorization code has 1 hour expiration time.
    state The state you provided earlier. You must validate that this matches your original state. If the state does not match, you should not attempt to exchange the authorization code.
    Exchange Access Token
    Method URL (and sample)
    POST https://{ Flight OAuth domain url }/api/oauth2/token

    curl -v -d "app_id=5909b958eac74764914e9cad927d1523&redirect_uri=https%3A%2F%2Foauth.dmc.objectiva.cn
    %3A8443%2Foauth%2Frest%2Fyoutube%2Fback&app_secret= bca8d7d4136047fdb58cbdbfd2dc0b5288832db69345434e845418a3a4bd1d00&grant_type=authorization_code&code= f135cd520c074219a5cac1622bd3415e" oauth.cantoflight.com:8443/oauth/api/oauth2/token
    Parameter Required Description
    app_id Yes Your App identifier, the value is {App Id}
    app_secret Yes Your App Secret, the value is {App Secret}
    grant_type Yes To gain access token, the value should be “authorization_code”
    redirect_uri No The redirect url on third party web site. The value is {Redirect Uri}. If not present this value, Flight will take the value from your App setting. If present this value, it must be same as your {Redirect Uri} in App setting.
    code Yes The authorization code you gain in last step.
    Response Description
    success 200 and access token & refresh token, in JSON format:
    {
    	"accessToken":"d0531d8b5247444fa2249f7f575faffe",
    	"expiresIn":"2592000",
    	"tokenType":"Bearer",
    	"refreshToken":"71b8b869e9144c5f9a2000279e55bf8224143a9bbac342648d976bf5650eeffa"
    }
    • expiresIn: Units in seconds
    • accessToken: expires after 1 month
    • refreshToken: expires after 1 year
    failure 400 if some parameters are invalid with json string, i.e.:
    {
    	“error”: “invalid_request”,
    	“error_description”:” Wrong app_id value”
    }

    401 if authorization code has expired (or is incorrect) with json string, i.e.:
    {
    	“error”: “authentication_expired”,
    	“error_description”:” Authentication code expired”
    }

    or 500 for other exceptions
    Refresh with new token
    Method URL (and sample)
    POST https://{ Flight OAuth domain url }/api/oauth2/token

    curl -v -d "app_id=5909b958eac74764914e9cad927d1523&redirect_uri=https%3A%2F%2Foauth.dmc.objectiva.cn
    %3A8443%2Foauth%2Frest%2Fyoutube%2Fback&app_secret= bca8d7d4136047fdb58cbdbfd2dc0b5288832db69345434e845418a3a4bd1d00&grant_type= refresh_token&refresh_token=71b8b869e9144c5f9a2000279e55bf8224143a9bbac342648d976bf5650eeffa" oauth.cantoflight.com:8443/oauth/api/oauth2/token
    POST
    Parameter Required Description
    app_id Yes Your App identifier, the value is {App Id}
    app_secret Yes Your App Secret, the value is {App Secret}
    grant_type Yes To refresh access token, the value should be “refresh_token”
    redirect_uri No The redirect url on third party web site. The value is {Redirect Uri}. If the value exists, Flight will take the value from your App setting. If this value does not exist, it must be same as your {Redirect Uri} in App setting.
    refresh_token Yes The refresh token use to exchange access token.
    Response Description
    success 200 and access token & refresh token, in JSON format:
    {
    	"accessToken":"2d35fd02eafa45b79fd58e48d6b23bcd",
    	"expiresIn":"2592000",
    	"tokenType":"Bearer",
    	"refreshToken":"bb14553feadf45b4917190a8fc8435ad8522750c8ca04470be3e47f556e1bf27"
    }
    • expiresIn: unit is second
    • accessToken: expires after 1 month
    • refreshToken: expires after 1 year
    When refresh an access token, we also publish a new refresh token.
    failure 400 if some parameters are invalid and json string, i.e:
    {
    	“error”: “invalid_request”,
    	“error_description”:”Wrong redirect_uri value”
    }
    401 if the refresh token has expired or is incorrect and json string, i.e:
    {
    	“error”: “authentication_fail”,
    	“error_description”:”Invalid refresh token”
    }
    
    or 500

Methods

 

List all API endpoints

 

View all endpoints as URI templates. In other words you don’t need this document any more.

GET https://{Flight domain url}/api/v1

Parameter

Required

Description

N/A

 

 

 

Below is a sample url:

https://yourdomain.run.cantoflight.com/api/v1

 

Response

Description

Success

Http status code 200 and all API endpoints returned as below:

 

[

    {

        "url": "/api[/p/{pname}]/v1/user",

        "method": "GET",

        "description": "get user info",

        "parameters": [ ],

        "exceptions": [ ],

        "return": {

            "type": "user",

            "description": "user info",

            "sampleResult": {

                "userId": "harveyli@objectivasoftware.com",

                "firstName": "first name",                 "lastName": "last name"

            }

        }

    },

    { ... },

    { ... },

    { ... },

]

 

To be short, only 1 endpoint appeared. Actually there’s a lot.

“url” would be the url path for endpoint.

“method” would be http method including “GET”, “PUT”, “POST”, etc.

“parameter” describe the input parameter.

“return” describe the return json we need. In types it might be “user”, “single_result”, “multiple_result”, “binary”. To be friendly you will get a sample result.

Failure

N/A

 

If other exception occurs, Flight will return you 500 http status code.

 

 

 

Get current user info

Get the current user info, which the access token represent.

GET https://{Flight domain url}/api/v1/user

Parameter

Required

Description

N/A

 

 

 

Below is a sample url:

https://yourdomain.run.cantoflight.com/api/v1/user

 

Response

Description

Success

Http status code 200 and current user info returned as below:

 

{

 "userId": "harveyli@objectivasoftware.com",

 "name": "Harvey li",

}

 

Please refer to general notes above for time format.

Failure

N/A

 

If other exception occurs, Flight will return you 500 http status code.

 

 

 

Get content detail

Get content detail information including general properties, urls, default & additional fields, version history and metadata. Take “detail” url from url array and get a click, you will get tour to flight page, you will get everything there.

 

GET https://{Flight domain url}/api/v1/{scheme}/{content id}

Parameter

Required

Description

Scheme (provided in url path)

YES

One of the image, video, audio, document, presentation, other.

Case sensitive

Content Id (provided in url path)

YES

Id of the content

 

Below is a sample url:

https://yourdomain.run.cantoflight.com/api/v1/image/abcdefghijklmnopqrstuvwxyz

 

Response

Description

Success

Http status code 200 and given content detail returned as below:

 

{

    "scheme": "image",

    "id": "abcdefghijklmnopqrstuvwxyz",

    "name": "sample.png",

    "owner": "noreply@cantoflight.com",

    "ownerName": "first name last name",

    "description": "the description of the content",

    "size": "123",

    "created": "20150415063836418",

    "time": "20150422063836418",

    "lastUploaded": "20150418063836418",

    "url": {

        "detail": "https://obj.run.cantoflight.com/smartalbum/image?column=image&id=abcdefghijklmnopqrstuvwxyz",

        "preview": "https://obj.run.cantoflight.com/api_binary/v1/image/abcdefghijklmnopqrstuvwxyz/preview",

        "PNG": "https://obj.run.cantoflight.com/api_binary/v1/image/abcdefghijklmnopqrstuvwxyz/PNG",

        "HighJPG": "https://obj.run.cantoflight.com/api_binary/v1/image/abcdefghijklmnopqrstuvwxyz/HighJPG",

        "download": "https://obj.run.cantoflight.com/api_binary/v1/image/abcdefghijklmnopqrstuvwxyz",

        "LowJPG": "https://obj.run.cantoflight.com/api_binary/v1/image/abcdefghijklmnopqrstuvwxyz/LowJPG",

        "metadata": "https://obj.run.cantoflight.com/api_binary/v1/image/abcdefghijklmnopqrstuvwxyz/metadata"

    },

    "tag": [

        "the",

        "tag",

        "list"

    ],

    "keyword": [

        "the",

        "keyword",

        "list"

    ],

    "default": {

        "Name": "original.png",

        "Content Type": "image/png",

        "Dimensions": "1024*768 Pixels",

        "Creation Tool": "Adobe Photoshop CS6",

        "Author": "specified author",

        "Copyright": null,

        "Date modified": "20150422063836418",

        "Date uploaded": "20150415063836418",

        "Uploaded by": "noreply@cantoflight.com",

        "Color": "RGB",

        "Size": "123"

    },

    "additional": {

        "Product": "my product",

        "License Expired Date": "20150401234123714",

        "License Used Number": "135"

    },

    "versionHistory": [

        {

            "no": "2",

            "ownerName": "first name last name",

            "created": "20150418063836418",

            "time": "20150418063836418",

            "versionId": "fileversionid2abcdefghighijklmnopqrstuvwxyz",

            "uri": {

                "preview": "https://obj.run.cantoflight.com/api_binary/v1/image/abcdefghijklmnopqrstuvwxyz/smallpreviewversionid2abcdefghighijklmnopqrstuvwxyz/preview",

                "download": "https://obj.run.cantoflight.com/api_binary/v1/image/abcdefghijklmnopqrstuvwxyz/fileversionid2abcdefghighijklmnopqrstuvwxyz"

            }

        },

        {

            "no": "1",

            "ownerName": "first name last name",

            "created": "20150415063836418",

            "time": "20150415063836418",

            "versionId": "fileversionid1abcdefghighijklmnopqrstuvwxyz",

            "uri": {

                "preview": "https://obj.run.cantoflight.com/api_binary/v1/image/abcdefghijklmnopqrstuvwxyz/smallpreviewversionid1abcdefghighijklmnopqrstuvwxyz/preview",

                "download": "https://obj.run.cantoflight.com/api_binary/v1/image/abcdefghijklmnopqrstuvwxyz/fileversionid1abcdefghighijklmnopqrstuvwxyz"

            }

        }

    ],

    "metadata": {

        "File Type": "image",

        "Orientation": "Landscape File",

        "Image Height": "768",

        "File Name": "original.jpg",

        "Asset Data Size (Long)": "123",

        "Finfotool version": "1.1",

        "Color": "RGB",

        "Compression": "Deflate/Inflate",

        "Filter": "Adaptive",

        "MIME Type": "image/png",

        "File Modification Date/Time": "2015-04-20 08:08:28",

        "Bit Depth": "8",

        "Image Size": "1024x768",

        "File Type Detail": "PNG",

        "Interlace": "Noninterlaced",

        "Color Model": "RGB",

        "Image Width": "1024"

},

    "copyright": "copyright",     "termsAndConditions": "www.canto.com"

}

 

“scheme” is a flight concept which including “image”, “video”, “audio”, “document”, “presentation”, “other”, all content should belong to one of them.

At first sight login Flight website, there are 6 huge tabs called smart album. Scheme is terminology of it.

 “id”, “name”, “owner”, “ownerName”, “description” are self-evident.

 

The point is the array list of the url. Each content contain the detail, preview, metadata and download url. Others are scheme special url. The detail url links the canto flight website. We will talk about them separately.

 “size” means file size in bytes here.

“created” means original uploaded time.

“time” means last modified time.

“lastUploaded” means the uploaded time of latest version. From here we could check whether the binary changed.

 

“keyword” & “tag” is the concept in flight.

 

“default” & “additional” fields can be set in flight settings.

 

“versionHistory” tracks the file uploading history.

 

“metadata” extracted from the original file.

“copyright” and “termsAndConditions” values will return if you turn on DRM in flight setting, and set values in detail page.

Failure

Http status code 404 for arbitrary content id.

 

If other exception occurs, Flight will return you 500 http status code.

 

 

Download content

To download the content, firstly retrieve the detail info above (3 Get Content Detail), and then you will get an array named url.  All of them contain “api_binary” means binary files in various format. The detail url connect to flight website if you were able to login with.

 

The “download” url means downloading the original content file. For image content, there are extra 3 urls, “PNG”, “HighJPG”, “LowJPG”. You can download the corresponding image format as you want.

 

The “preview” url means a image view of the content, for example first page view for document content, and a smaller size image for the image content. By default it give you the “240” dimension image (dimension means the longest size of the width and height when zooming out). To specified the dimension, you could provide slash “/” and dimension number under the preview url. For example the preview url is https://yourdomain.run.cantoflight.com/api_binary/v1/image/abc/preview, you could get 500 dimension preview image by “https://yourdomain.run.cantoflight.com/api_binary/v1/image/abc/preview/500”. Of course if the maximum preview size is 400, the url just now can only get 400 dimension preview.

 

The “metadata” url give you the xml file we extracted from the original file. It is more detail than the metadata part returned by detail API. Here we just follow the original data format, not the one in general notes.

 

The “play” url is only for audio and video content. Generally the file would be smaller than original and it could be played and represent the original file.

List the content of specified scheme

List the content of the specified scheme, page by page. Only brief content info supplied.

GET https://{Flight domain url}/api/v1/{scheme}

Parameter

Required

Description

Scheme (provided in url path)

YES

One of the image, video, audio, document, presentation, other

Case sensitive

At first sight login Flight website, there are 6 huge tabs called smart album. Scheme is terminology of it.  

sortBy

NO

One of name, time, scheme, owner, size, and default is time.

sortDirection

NO

“ascending” or “descending”

limit

NO

The maximum number of items to be returned. Default is 100.

start

NO

The offset number of items to be returned. Default is 0.

 

Below is a sample url:

https://yourdomain.run.cantoflight.com/api/v1/{scheme}?sortBy=name&sortDirection=ascending&limit=2&start=10

 

Response

Description

Success

Http status code 200 and content list returned as below:

 

{

    "found": 2902,

    "limit": 100,

    "start": 2900,

    "sortBy": "name",

    "sortDirection": "ascending",

    "results": [

        {

            "scheme": "image",

            "id": "abcdefghijklmnopqrstuvwxyz",

            "name": "sample.jpg",

            "size": "123",

            "owner": "harveyli@objectivasoftware.com",

            "ownerName": "harvey li",

            "time": "20150422070212000",

            "description": "here is the description",

            "url": {

                "detail": "https://obj.run.cantoflight.com/smartalbum/image?column=image&id=abcdefghijklmnopqrstuvwxyz",

                "preview": "https://obj.run.cantoflight.com/api_binary/v1/image/abcdefghijklmnopqrstuvwxyz/preview",

                "PNG": "https://obj.run.cantoflight.com/api_binary/v1/image/abcdefghijklmnopqrstuvwxyz/PNG",

                "HighJPG": "https://obj.run.cantoflight.com/api_binary/v1/image/abcdefghijklmnopqrstuvwxyz/HighJPG",

                "download": "https://obj.run.cantoflight.com/api_binary/v1/image/abcdefghijklmnopqrstuvwxyz",

                "LowJPG": "https://obj.run.cantoflight.com/api_binary/v1/image/abcdefghijklmnopqrstuvwxyz/LowJPG",

                "metadata": "https://obj.run.cantoflight.com/api_binary/v1/image/abcdefghijklmnopqrstuvwxyz/metadata"

            }

        },

        {

            "scheme": "image",

            "id": "ghijklmnopqrstuvwxyzabcdef",

            "name": "another.jpg",

            "size": "123",

            "owner": "harveyli@objectivasoftware.com",

            "ownerName": "harvey li",

            "time": "20150422070212000",

            "description": "here is the description",

            "url": {

                "detail": "https://obj.run.cantoflight.com/smartalbum/image?column=image&id=ghijklmnopqrstuvwxyzabcdef",

                "preview": "https://obj.run.cantoflight.com/api_binary/v1/image/ghijklmnopqrstuvwxyzabcdef/preview",

                "PNG": "https://obj.run.cantoflight.com/api_binary/v1/image/ghijklmnopqrstuvwxyzabcdef/PNG",

                "HighJPG": "https://obj.run.cantoflight.com/api_binary/v1/image/ghijklmnopqrstuvwxyzabcdef/HighJPG",

                "download": "https://obj.run.cantoflight.com/api_binary/v1/image/ghijklmnopqrstuvwxyzabcdef",

                "LowJPG": "https://obj.run.cantoflight.com/api_binary/v1/image/ghijklmnopqrstuvwxyzabcdef/LowJPG",

                "metadata": "https://obj.run.cantoflight.com/api_binary/v1/image/ghijklmnopqrstuvwxyzabcdef/metadata"

            }

        }

    ]

}

 

 

“found” means the total number of the server found.

“results” array maintain all brief info list of the content.

Failure

N/A

 

If other exception occurs, Flight will return you 500 http status code.

 

 

 

Get whole tree view

Get the whole tree. There’s no pagination option, if you don’t specify the layer parameter, you will really get the whole tree info including each folder and each album.

GET https://{Flight domain url}/api/v1/tree

Parameter

Required

Description

sortBy

NO

One of name, time, scheme, owner, size,  default is time.

sortDirection

NO

“ascending” or “descending”

layer

NO

The maximum deep number of the folder or album items to be returned. Default is -1 which means no limit.

 

Below is a sample url:

https://yourdomain.run.cantoflight.com/api/v1/tree?sortBy=name&sortDirection=ascending

 

Response

Description

Success

Http status code 200 and whole tree returned as below:

 

{

    "orderBy": "name",

    "sortDirection": false,

    "results": [

        {

            "scheme": "album",

            "id": "Q32JS",

            "name": "topLevelAlbum",

            "idPath": "Q32JS",

            "namePath": "topLevelAlbum",

            "size": "5",

            "url": {

                "detail": "https://obj.run.cantoflight.com/album/Q32JS"

            },

            "owner": "harveyli@objectivasoftware.com",

            "description": "top level album",

            "created": "20150422092222748",

            "time": "20150422092222748"

        },

        {

            "scheme": "folder",

            "id": "U6H66",

            "name": "dev",

            "idPath": "U6H66",

            "namePath": "dev",

            "url": {

                "detail": "https://obj.run.cantoflight.com/folder/U6H66"

            },

            "owner": "harveyli@objectivasoftware.com",

            "time": "20150422092441072",

            "children": [

                {

                    "scheme": "folder",

                    "id": "LDM3J",

                    "name": "movie",

                    "idPath": "U6H66/LDM3J",

                    "namePath": "dev/movie",

                    "url": {

                        "detail": "https://obj.run.cantoflight.com/folder/LDM3J"

                    },

                    "owner": "harveyli@objectivasoftware.com",

                    "time": "20150422092501097"

                },

                {

                    "scheme": "folder",

                    "id": "H87HD",

                    "name": "book",

                    "idPath": "U6H66/H87HD",

                    "namePath": "dev/book",

                    "url": {

                        "detail": "https://obj.run.cantoflight.com/folder/H87HD"

                    },

                    "owner": "harveyli@objectivasoftware.com",

                    "time": "20150422092451137",

                    "children": [

                        {

                            "scheme": "folder",

                            "id": "OH4MP",

                            "name": "computer",

                            "idPath": "U6H66/H87HD/OH4MP",

                            "namePath": "dev/book/computer",

                            "url": {

                                "detail": "https://obj.run.cantoflight.com/folder/OH4MP"

                            },

                            "size": "3",

                            "owner": "harveyli@objectivasoftware.com",

                            "created": "20150422092542069",

                            "time": "20150422092542069"

                        },

                        {

                            "scheme": "album",

                            "id": "SIR13",

                            "name": "art",

                            "idPath": "U6H66/H87HD/SIR13",

                            "namePath": "dev/book/art",

                            "url": {

                                "detail": "https://obj.run.cantoflight.com/album/SIR13"

                            },

                            "size": "2",

                            "owner": "harveyli@objectivasoftware.com",

                            "created": "20150422092551909",

                            "time": "20150422092551909"

                        }

                    ]

                }

            ]

        }

    ]

}

 

“idPath” means the full id path from the library root.

 

“namePath” means the full name path from the library root.

 

“size” of folder means immediate folder and album count under it.

 

“size” of album means content number assigned with it.

 

“children” array maintain all immediate children list of the parent folder.

Failure

N/A

 

If other exception occurs, Flight will return you 500 http status code.

 

 

 

Get sub tree view

Get the sub tree under specified folder. Folders and albums under the folder will be returned. You know only folder is able to contain folder or album, album can only contain content, so please don’t specified album id or you will get nothing.

GET https://{Flight domain url}/api/v1/tree/{folder id}

Parameter

Required

Description

Folder Id (provided in url path)

YES

Parent folder id

sortBy

NO

One of name, time, scheme, owner, size,  default is time.

sortDirection

NO

“ascending” or “descending”

layer

NO

The maximum deep number of the folder or album items to be returned. Default is -1 which means no limit.

 

Below is a sample url:

https://yourdomain.run.cantoflight.com/api/v1/tree/H87HD?sortBy=name&sortDirection=ascending

 

Response

Description

Success

Http status code 200 and sub tree under the given folder returned as below:

 

{

    "orderBy": "name",

    "sortDirection": false,

    "results": [

        {

            "scheme": "folder",

            "id": "OH4MP",

            "name": "computer",

            "idPath": "U6H66/H87HD/OH4MP",

            "namePath": "dev/book/computer",

            "url": {

                "detail": "https://obj.run.cantoflight.com/folder/OH4MP"

            },

            "size": "3",

            "owner": "harveyli@objectivasoftware.com",

            "created": "20150422092542069",

            "time": "20150422092542069"

        },

        {

            "scheme": "album",

            "id": "SIR13",

            "name": "art",

            "idPath": "U6H66/H87HD/SIR13",

            "namePath": "dev/book/art",

            "url": {

                "detail": "https://obj.run.cantoflight.com/album/SIR13"

            },

            "size": "2",

            "owner": "harveyli@objectivasoftware.com",

            "created": "20150422092551909",

            "time": "20150422092551909"

        }

    ]

}

“idPath” means the full id path from the library root.

 

“namePath” means the full name path from the library root.

 

“size” of folder means immediate folder and album count under it.

 

“size” of album means content number assigned with it.

 

“children” array maintain all immediate children list of the parent folder.

Failure

Http status code 404 for arbitrary folder id.

 

If other exception occurs, Flight will return you 500 http status code.

 

 

 

List content of a specified album

List content of a album, page by page. Only brief content info supplied.

GET https://{Flight domain url}/api/v1/album/{album id}

Parameter

Required

Description

Album Id (provided in url path)

YES

Parent album id

sortBy

NO

One of name, time, scheme, owner, size,  default is time.

sortDirection

NO

“ascending” or “descending”

limit

NO

The maximum number of items to be returned. Default is 100.

start

NO

The offset number of items to be returned. Default is 0.

 

 

 

 

Below is a sample url:

https://yourdomain.run.cantoflight.com/api/v1/album/SIR13?sortBy=name&sortDirection=ascending&limit=2&start=10

 

Response

Description

Success

Http status code 200 and content list under the given album returned as below:

 

{

    "found": 20,

    "limit": 2,

    "start": 10,

    "sortBy": "name",

    "sortDirection": "ascending",

    "results": [

        {

            "scheme": "image",

            "id": "ob3mim4rf13dn2kc56lv1eko2p",

            "name": "China_Shanghai.jpg",

            "url": {

                "detail": "https://obj.run.cantoflight.com/smartalbum/image?column=image&id=ob3mim4rf13dn2kc56lv1eko2p",

                "preview": "https://obj.run.cantoflight.com/api_binary/v1/image/ob3mim4rf13dn2kc56lv1eko2p/preview",

                "PNG": "https://obj.run.cantoflight.com/api_binary/v1/image/ob3mim4rf13dn2kc56lv1eko2p/PNG",

                "HighJPG": "https://obj.run.cantoflight.com/api_binary/v1/image/ob3mim4rf13dn2kc56lv1eko2p/HighJPG",

                "download": "https://obj.run.cantoflight.com/api_binary/v1/image/ob3mim4rf13dn2kc56lv1eko2p",

                "LowJPG": "https://obj.run.cantoflight.com/api_binary/v1/image/ob3mim4rf13dn2kc56lv1eko2p/LowJPG",

                "metadata": "https://obj.run.cantoflight.com/api_binary/v1/image/ob3mim4rf13dn2kc56lv1eko2p/metadata"

            },

            "size": "3549975",

            "owner": "harveyli@objectivasoftware.com",

            "ownerName": "harvey li",

            "time": "20150422150212000",

            "description": "SHANGHAI - November 21"

        },

        {

            "scheme": "image",

            "id": "oers558mq96ov5djl3mc0sl31g",

            "name": "horse.jpg",

            "url": {

                "detail": "https://obj.run.cantoflight.com/smartalbum/image?column=image&id=oers558mq96ov5djl3mc0sl31g",

                "preview": "https://obj.run.cantoflight.com/api_binary/v1/image/oers558mq96ov5djl3mc0sl31g/preview",

                "PNG": "https://obj.run.cantoflight.com/api_binary/v1/image/oers558mq96ov5djl3mc0sl31g/PNG",

                "HighJPG": "https://obj.run.cantoflight.com/api_binary/v1/image/oers558mq96ov5djl3mc0sl31g/HighJPG",

                "download": "https://obj.run.cantoflight.com/api_binary/v1/image/oers558mq96ov5djl3mc0sl31g",

                "LowJPG": "https://obj.run.cantoflight.com/api_binary/v1/image/oers558mq96ov5djl3mc0sl31g/LowJPG",

                "metadata": "https://obj.run.cantoflight.com/api_binary/v1/image/oers558mq96ov5djl3mc0sl31g/metadata"

            },

            "size": "47551",

            "owner": "harveyli@objectivasoftware.com",

            "ownerName": "harvey li",

            "time": "20150422181308000"

        }

    ]

}

 

“found” means the total number of the server found.

“results” array maintain all brief info list of the content.

Failure

Http status code 404 for arbitrary album id.

 

If other exception occurs, Flight will return you 500 http status code.

 

 

Get upload setting

Before actual uploading, firstly you need to retrieve this setting

GET https://{Flight domain url}/api/v1/upload/setting

Parameter

Required

Description

N/A

 

 

 

Response

Description

Success

Http status code 200 and a properties map returned as below:

 

{

    "url": "https://bucket-name.s3-us-west-2.amazonaws.com/",

    "AWSAccessKeyId": "ACCESS KEY ID",

    "Policy": "POLICY STRING",

    "key": "tenant id/harveyli@objectivasoftware.com/${filename}",

"Signature": " Signature "

    "acl": "private",

    "x-amz-meta-tag": "",

    "x-amz-meta-file_name": "${filename}"

    "x-amz-meta-scheme": "",

    "x-amz-meta-id": "",

    "x-amz-meta-album_id": "",

}

 “url” means post form url, action value actually.

 

Others fields are all request by amazon service. Please provide them in post form honestly. A friendly remind it’s case sensitive.

 

 

Failure

N/A

 

If other exception occurs, Flight will return you 500 http status code.

 

Upload file to amazon s3

Construct a form base on the setting retrieved.

The form and policy must be UTF-8 encoded. You can apply UTF-8 encoding to the form by specifying it in the HTML heading or as a request header.

 

The enclosure type (enctype) must be specified and must be set to multipart/form-data for both file uploads and text area uploads. For more information, go to RFC 1867.

 

POST  https://bucket-name.s3-us-west-2.amazonaws.com/ (the url property retrieved from upload setting)

Parameter

Required

Description

Other properties

YES

Provide the value as the setting given.

x-amz-meta-album_id

YES

Which album the content assigned to. Provide empty string if you want none.

x-amz-meta-scheme

YES

Provide the original scheme if you want to upload a new version, otherwise just empty string.

x-amz-meta-id

YES

Provide the original id if you want to upload a new version, otherwise just empty string.

file

YES

The file or content must be the last field in the form. Any fields below it are ignored.

You cannot upload more than one file at a time.

 

A sample form like below:

 

<html>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

<title>Post file directly to s3</title>

</head>

<body>

 

<form action="https://default-public-bucket.s3-us-west-2.amazonaws.com/" method="POST" enctype="multipart/form-data">

Key to upload: <input type="input" name="key" value="bucket-name/harveyli@objectivasoftware.com/${filename}"/><br />

ACL: <input type="input" name="acl" value="private" /><br />

 

AWSAccessKeyId:<input type="input" name="AWSAccessKeyId" value="ACCESS KEY ID" /><br />

Policy:<input type="input" name="Policy" value="Policy String" /><br />

Signature:<input type="input" name="Signature" value="Signature" /><br />

 

File Name: <input type="input" name="x-amz-meta-file_name" value="${filename}" /><br />

Tags for File: <input type="input" name="x-amz-meta-tag" value="" /><br />

scheme for File: <input type="input" name="x-amz-meta-scheme" value="" /><br />

id for File: <input type="input" name="x-amz-meta-id" value="" /><br />

Album for File: <input type="input" name="x-amz-meta-album_id" value="" /><br />

 

File: <input type="file" name="file" /> <br />

<!-- The elements after this will be ignored -->

<input type="submit" name="submit" value="Upload to Amazon S3" />

</form>

 

</body>

</html>

 

 

Response

Description

Success

Http status code 200 nothing returned.

 

 

Failure

N/A

 

 

 

Please refer to Amazon document for details.  http://docs.aws.amazon.com/AmazonS3/latest/dev/HTTPPOSTForms.html

 

 

Query upload status

Query upload status for recently file uploading or uploaded.

 

GET https://{Flight domain url}/api/v1/upload/status

Parameter

Required

Description

hours

No

The pried for last hours. An integer of 1..24, and the default value is 1.

 

Response

Description

Success

Http status code 200 and a list returned as below:

 

{

    "found": 20,

    "results": [

        {

            "id": "ob3mim4rf13dn2kc56lv1eko2p",

            "name": "China_Shanghai.jpg",

            "time": "20150422150212000",

            "status": "processing"

        },

        {

            "id": " oers558mq96ov5djl3mc0sl31g ",

            "name": " horse.jpg ",

            "time": "20150422181308000",

            "status": "done"

        },

    { ... },

    { ... },

    { ... }

    ]

}

 

“id” means identify of the file. At very first period, we don’t have this property.

“name” means file name of the uploading.

“time” means uploading time.

“status” means the status of the uploading file. There are 4 period list below:

 

n   Initial

File just uploads to amazon storage.

n   Queue

Waiting for process

n   Processing

Step by step processing

n   Done

Successfully done. You could find it in system now.

n   Error

Something unfortunately happened. You might try it again.

 

 

Failure

N/A

 

If other exception occurs, Flight will return you 500 http status code.

 

 

 

Attach tag to content

Attach a tag to specify content. A tag is just a plain text.

 

PUT https://{Flight domain url}/api/v1/{scheme}/{content id}/tag/{tag}

Parameter

Required

Description

Scheme (provided in url path)

YES

One of the image, video, audio, document, presentation, other.

Case sensitive

At first sight login Flight website, there are 6 huge tabs called smart album. Scheme is terminology of it.

Content Id (provided in url path)

YES

Id of the content

Tag

Yes

The plain text of tag

 

Response

Description

Success

Http status code 200 and nothing returned.

 

Get same successfully response for the tag already attached.

Failure

Http status code 404 for arbitrary content id.

 

If other exception occurs, Flight will return you 500 http status code.

 

Remove tag from content

Remove a tag from specify content. A tag is just a plain text.

 

DELETE https://{Flight domain url}/api/v1/{scheme}/{content id}/tag/{tag}

Parameter

Required

Description

Scheme (provided in url path)

YES

One of the image, video, audio, document, presentation, other.

Case sensitive

At first sight login Flight website, there are 6 huge tabs called smart album. Scheme is terminology of it.

Content Id (provided in url path)

YES

Id of the content

Tag

Yes

The plain text of tag

 

Response

Description

Success

Http status code 200 and nothing returned.

 

Get same successfully response for the tag already removed.

Failure

Http status code 404 for arbitrary content id.

 

If other exception occurs, Flight will return you 500 http status code.

 

 

Attach keyword to content

Attach a keyword to specify content. A keyword is plain text maintenances by tenant admin.

 

PUT https://{Flight domain url}/api/v1/{scheme}/{content id}/keyword/{keyword}

Parameter

Required

Description

Scheme (provided in url path)

YES

One of the image, video, audio, document, presentation, other.

Case sensitive

At first sight login Flight website, there are 6 huge tabs called smart album. Scheme is terminology of it.

Content Id (provided in url path)

YES

Id of the content

Keyword

Yes

The plain text of keyword

 

Response

Description

Success

Http status code 200 and nothing returned.

 

Get same successfully response for the keyword already attached.

Failure

Http status code 404 for arbitrary content id.

Http status code 404 for arbitrary keyword.

 

If other exception occurs, Flight will return you ‘500’ http status code.

 

Remove keyword from content

Remove a keyword from specify content. A keyword is plain text maintenances by tenant admin.

 

DELETE https://{Flight domain url}/api/v1/{scheme}/{content id}/keyword/{keyword}

Parameter

Required

Description

Scheme (provided in url path)

YES

One of the image, video, audio, document, presentation, other.

Case sensitive

At first sight login Flight website, there are 6 huge tabs called smart album. Scheme is terminology of it.

Content Id (provided in url path)

YES

Id of the content

Keyword

Yes

The plain text of keyword

 

Response

Description

Success

Http status code 200 and nothing returned.

 

Get same successfully response for the keyword already removed.

Failure

Http status code 404 for arbitrary content id.

Http status code 404 for arbitrary keyword.

 

If other exception occurs, Flight will return you ‘500’ http status code.

 

 

Create folder

Create a folder under specified folder or library.

POST https://{Flight domain url}/api/v1/folder/{folder name}

POST https://{Flight domain url}/api/v1/folder/{parent folder id}/{folder name}

Parameter

Required

Description

Parent Folder ID

(provided in url path)

NO

The parent folder id.

Empty for library.

Folder Name

(provided in url path)

YES

Folder Name,

The max length is 80. Avoid using \ / : * ? \" < > or | in name.

Description

NO

The Description of the folder.

The max length is 400.

 

Response

Description

Success

Http status code 200 and created folder info returned as below:

 

{

    scheme: "folder",

    id: "J3V5N",

    name: "newFolderName",

    url: {

        detail: "https://hta.dev.cantoflight.com/folder/J3V5N"

    },

    time: "20151210154909104",

    namePath: "parentFolderName/newFolderName",

    idPath: "SRRP7/J3V5N"

}

 

Failure

Http status code 404 for arbitrary folder id.

Http status code 400 for duplicate folder name.

 

If other exception occurs, Flight will return you ‘500’ http status code.

 

Create album

Create an album under specified folder or library.

POST https://{Flight domain url}/api/v1/album/{album name}

POST https://{Flight domain url}/api/v1/album/{parent folder id}/{album name}

Parameter

Required

Description

Parent Folder ID

(provided in url path)

NO

The parent folder id.

Empty for library.

Album Name

(provided in url path)

YES

Album Name,

The max length is 80. Avoid using \ / : * ? \" < > or | in name.

Description

NO

The Description of the album.

The max length is 400.

 

Response

Description

Success

Http status code 200 and created album info returned as below:

 

{

    scheme: "album",

    id: "J3V5N",

    name: "newAlbumName",

    url: {

        detail: "https://hta.dev.cantoflight.com/album/J3V5N"

    },

    time: "20151210154909104",

    namePath: "parentFolderName/newAlbumName ",

    idPath: "SRRP7/J3V5N"

}

 

Failure

Http status code 404 for arbitrary folder id.

Http status code 400 for duplicate album name.

 

If other exception occurs, Flight will return you ‘500’ http status code.

 

Global search

 

List the results of the specified keyword, page by page.

GET https://{Flight domain url}/api/v1/search

Parameter

Required

Description

keyword

YES

The search term(s)

sortBy

NO

One of name, time, scheme, owner, size, and default is time.

sortDirection

NO

“ascending” or “descending”, default is descending.

limit

NO

The maximum number of items to be returned. Default is 100.

start

NO

The offset number of items to be returned. Default is 0.

 

Below is a sample url:

https://yourdomain.run.cantoflight.com/api/v1/search? sortBy=name&sortDirection=ascending&limit=100&start=0&keyword=tiger

 

 

Response

Description

Success

Http status code 200 and content list returned as below:

 

{

    "found": 2902,

    "limit": 100,

    "start": 2900,

    "sortBy": "name",

    "sortDirection": " descending ",

    "results": [

        {

            "scheme": "image",

            "id": "abcdefghijklmnopqrstuvwxyz",

            "name": "sample.jpg",

            "size": "123",

            "owner": "harveyli@objectivasoftware.com",

            "ownerName": "harvey li",

            "time": "20150422070212000",

            "description": "here is the description",

            "url": {

                "detail": "https://obj.run.cantoflight.com/smartalbum/image?column=image&id=abcdefghijklmnopqrstuvwxyz",

                "preview": "https://obj.run.cantoflight.com/api_binary/v1/image/abcdefghijklmnopqrstuvwxyz/preview",

                "PNG": "https://obj.run.cantoflight.com/api_binary/v1/image/abcdefghijklmnopqrstuvwxyz/PNG",

                "HighJPG": "https://obj.run.cantoflight.com/api_binary/v1/image/abcdefghijklmnopqrstuvwxyz/HighJPG",

                "download": "https://obj.run.cantoflight.com/api_binary/v1/image/abcdefghijklmnopqrstuvwxyz",

                "LowJPG": "https://obj.run.cantoflight.com/api_binary/v1/image/abcdefghijklmnopqrstuvwxyz/LowJPG",

                "metadata": "https://obj.run.cantoflight.com/api_binary/v1/image/abcdefghijklmnopqrstuvwxyz/metadata"

            }

        },

        {

            "scheme": "image",

            "id": "ghijklmnopqrstuvwxyzabcdef",

            "name": "another.jpg",

            "size": "123",

            "owner": "harveyli@objectivasoftware.com",

            "ownerName": "harvey li",

            "time": "20150422070212000",

            "description": "here is the description",

            "url": {

                "detail": "https://obj.run.cantoflight.com/smartalbum/image?column=image&id=ghijklmnopqrstuvwxyzabcdef",

                "preview": "https://obj.run.cantoflight.com/api_binary/v1/image/ghijklmnopqrstuvwxyzabcdef/preview",

                "PNG": "https://obj.run.cantoflight.com/api_binary/v1/image/ghijklmnopqrstuvwxyzabcdef/PNG",

                "HighJPG": "https://obj.run.cantoflight.com/api_binary/v1/image/ghijklmnopqrstuvwxyzabcdef/HighJPG",

                "download": "https://obj.run.cantoflight.com/api_binary/v1/image/ghijklmnopqrstuvwxyzabcdef",

                "LowJPG": "https://obj.run.cantoflight.com/api_binary/v1/image/ghijklmnopqrstuvwxyzabcdef/LowJPG",

                "metadata": "https://obj.run.cantoflight.com/api_binary/v1/image/ghijklmnopqrstuvwxyzabcdef/metadata"

            }

        }

    ]

"facets": 

[{"name": "approval","value": ["Approved","Pending","Restricted"]},

{"name": "scheme","value": ["image","video"]},

{"name": "created","max": 1452021772,"mix": 1445901667},

{"name": "dimension","max": 2448,"mix": 202},

{"name": "duration","max": 10,"mix": 10},

{"name": "keywords","value": ["doristest","Unkeyworded"]},

{"name": "orientation","value": ["Portrait","Landscape"]},

{"name": "owner","value": ["dzuo@objectivasoftware.com"]},

{"name": "pageNumber"},

{"name": "resolution","max": 72,"mix": 1},

{"name": "fileSize","max": 4294967293,"mix": 4},

{"name": "storageClass","value": ["standard"]},

{"name": "tags","value": ["doris","test","baby","tree","Untagged"]}],

}

 

“found” means the total number of the server found.

“results” array maintain all brief info list of the content.

“facets” means it returns the search range value from cloud search.

“name” means the facet name.

“value” means the value from cloud search. The facet type is String.

“mix” means the value from cloud search. The facet type is int.

“max” means the value from cloud search. The facet type is int.

Failure

N/A

 

If other exception occurs, Flight will return you 500 http status code.

 

Filter

To filter the results, firstly retrieve the detail info above (1 global search), and then you will get the data using for filter.

 

General rules: if the filter type is String, you can search one value or multi value. Multi value can only is the relationship of OR.  Example for: standard|freeze.

If the filter type is int, you can search using a data range. Example for: 0..1233

Parameter

Required

Description                      

Example format

keyword

NO

The search term(s)

 

scheme

NO

One of the image, video, audio, document, presentation, other

At first sight login Flight website, there are 6 huge tabs called smart album. Scheme is terminology of it. 

 

One value: image

Multi value:

image|video|audio

keywords

NO

File keywords

One value: business

Multi value: business|animal

tags

NO

File tags

One value: sunset

Multi value: sunset|1227

storageClass

NO

Storage type, standard, freeze

One value: standard

Multi value: standard|freeze

owner

NO

The user ID

One value: midiclear@163.com

Multi value: midiclear@163.com|jhuo@objectivasoftware.com

fileSize

NO

File size

95073..26893954

created

NO

Created time 

1444662143..1452182400

approval

NO

It works when the approval process is checked in setting page.

Approval status: Approved, Pending, Restricted,Expired

One value: approved

Multi value: approved|pending

 

If you select Expired, you cannot select other status.

e.g. cannot use Expired |pending, only use Expired

dimension

NO

Only for image, e.g.202px

77..3840

resolution

NO

Only for image, e.g. 15dpi

5..350

orientation

NO

Only for image, landscape, portrait, square

One value: landscape

Multi value: landscape|portrait

duration

NO

Only for video, audio

9..1205

pageNumber

NO

Only for document,presentation

6..482

 

 

Below is a sample url:

https://yourdomain.run.cantoflight.com/api/v1/search? sortBy=name&sortDirection=ascending&limit=100&start=0&keyword=tiger& tags=sunset|1227& storageClass=freeze& pageNumber=6..482

 

Response

Description

Success

Http status code 200 and content list returned as below:

 

{

    "found": 2902,

    "limit": 100,

    "start": 2900,

    "sortBy": "name",

    "sortDirection": " descending ",

    "results": [

        {

            "scheme": "image",

            "id": "abcdefghijklmnopqrstuvwxyz",

            "name": "sample.jpg",

            "size": "123",

            "owner": "harveyli@objectivasoftware.com",

            "ownerName": "harvey li",

            "time": "20150422070212000",

            "description": "here is the description",

            "url": {

                "detail": "https://obj.run.cantoflight.com/smartalbum/image?column=image&id=abcdefghijklmnopqrstuvwxyz",

                "preview": "https://obj.run.cantoflight.com/api_binary/v1/image/abcdefghijklmnopqrstuvwxyz/preview",

                "PNG": "https://obj.run.cantoflight.com/api_binary/v1/image/abcdefghijklmnopqrstuvwxyz/PNG",

                "HighJPG": "https://obj.run.cantoflight.com/api_binary/v1/image/abcdefghijklmnopqrstuvwxyz/HighJPG",

                "download": "https://obj.run.cantoflight.com/api_binary/v1/image/abcdefghijklmnopqrstuvwxyz",

                "LowJPG": "https://obj.run.cantoflight.com/api_binary/v1/image/abcdefghijklmnopqrstuvwxyz/LowJPG",

                "metadata": "https://obj.run.cantoflight.com/api_binary/v1/image/abcdefghijklmnopqrstuvwxyz/metadata"

            }

        },

        {

            "scheme": "image",

            "id": "ghijklmnopqrstuvwxyzabcdef",

            "name": "another.jpg",

            "size": "123",

            "owner": "harveyli@objectivasoftware.com",

            "ownerName": "harvey li",

            "time": "20150422070212000",

            "description": "here is the description",

            "url": {

                "detail": "https://obj.run.cantoflight.com/smartalbum/image?column=image&id=ghijklmnopqrstuvwxyzabcdef",

                "preview": "https://obj.run.cantoflight.com/api_binary/v1/image/ghijklmnopqrstuvwxyzabcdef/preview",

                "PNG": "https://obj.run.cantoflight.com/api_binary/v1/image/ghijklmnopqrstuvwxyzabcdef/PNG",

                "HighJPG": "https://obj.run.cantoflight.com/api_binary/v1/image/ghijklmnopqrstuvwxyzabcdef/HighJPG",

                "download": "https://obj.run.cantoflight.com/api_binary/v1/image/ghijklmnopqrstuvwxyzabcdef",

                "LowJPG": "https://obj.run.cantoflight.com/api_binary/v1/image/ghijklmnopqrstuvwxyzabcdef/LowJPG",

                "metadata": "https://obj.run.cantoflight.com/api_binary/v1/image/ghijklmnopqrstuvwxyzabcdef/metadata"

            }

        }

    ]

"facets": 

[{"name": "approval","value": ["Approved","Pending","Restricted"]},

{"name": "scheme","value": ["image","video"]},

{"name": "created","max": 1452021772,"mix": 1445901667},

{"name": "dimension","max": 2448,"mix": 202},

{"name": "duration","max": 10,"mix": 10},

{"name": "keywords","value": ["doristest","Unkeyworded"]},

{"name": "orientation","value": ["Portrait","Landscape"]},

{"name": "owner","value": ["dzuo@objectivasoftware.com"]},

{"name": "pageNumber"},

{"name": "resolution","max": 72,"mix": 1},

{"name": "fileSize","max": 4294967293,"mix": 4},

{"name": "storageClass","value": ["standard"]},

{"name": "tags","value": ["doris","test","baby","tree","Untagged"]}],

}

 

 

“found” means the total number of the server found.

“results” array maintain all brief info list of the content.

“facets” means it returns the search range value from cloud search.

“name” means the facet name.

“value” means the value from cloud search. The facet type is String.

“mix” means the value from cloud search. The facet type is int.

“max” means the value from cloud search. The facet type is int.

 

Failure

N/A

 

If other exception occurs, Flight will return you 500 http status code.

 

Advanced search

List the results of searching from combination of any 6 fields which include filename, description, comment, keywords, author, and tags using operator “and” “or”.

Parameter

Required

Description                      

keyword

YES

The search term(s)

searchInField

YES

You can search from fields which include filename, description, comment, keywords, author, and tags.  If you input other field name, the results will ignore it.

operator

YES

Operator, and, or. Default is and.

 

Below is a sample url:

https://yourdomain.run.cantoflight.com/api/v1/search? sortBy=name&sortDirection=ascending&limit=100&start=0&keyword=tiger& searchInField = filename& searchInField = tags

 

Response

Description

Success

Http status code 200 and content list returned as below:

 

{

    "found": 2902,

    "limit": 100,

    "start": 2900,

    "sortBy": "name",

    "sortDirection": " descending ",

    "results": [

        {

            "scheme": "image",

            "id": "abcdefghijklmnopqrstuvwxyz",

            "name": "sample.jpg",

            "size": "123",

            "owner": "harveyli@objectivasoftware.com",

            "ownerName": "harvey li",

            "time": "20150422070212000",

            "description": "here is the description",

            "url": {

                "detail": "https://obj.run.cantoflight.com/smartalbum/image?column=image&id=abcdefghijklmnopqrstuvwxyz",

                "preview": "https://obj.run.cantoflight.com/api_binary/v1/image/abcdefghijklmnopqrstuvwxyz/preview",

                "PNG": "https://obj.run.cantoflight.com/api_binary/v1/image/abcdefghijklmnopqrstuvwxyz/PNG",

                "HighJPG": "https://obj.run.cantoflight.com/api_binary/v1/image/abcdefghijklmnopqrstuvwxyz/HighJPG",

                "download": "https://obj.run.cantoflight.com/api_binary/v1/image/abcdefghijklmnopqrstuvwxyz",

                "LowJPG": "https://obj.run.cantoflight.com/api_binary/v1/image/abcdefghijklmnopqrstuvwxyz/LowJPG",

                "metadata": "https://obj.run.cantoflight.com/api_binary/v1/image/abcdefghijklmnopqrstuvwxyz/metadata"

            }

        },

        {

            "scheme": "image",

            "id": "ghijklmnopqrstuvwxyzabcdef",

            "name": "another.jpg",

            "size": "123",

            "owner": "harveyli@objectivasoftware.com",

            "ownerName": "harvey li",

            "time": "20150422070212000",

            "description": "here is the description",

            "url": {

                "detail": "https://obj.run.cantoflight.com/smartalbum/image?column=image&id=ghijklmnopqrstuvwxyzabcdef",

                "preview": "https://obj.run.cantoflight.com/api_binary/v1/image/ghijklmnopqrstuvwxyzabcdef/preview",

                "PNG": "https://obj.run.cantoflight.com/api_binary/v1/image/ghijklmnopqrstuvwxyzabcdef/PNG",

                "HighJPG": "https://obj.run.cantoflight.com/api_binary/v1/image/ghijklmnopqrstuvwxyzabcdef/HighJPG",

                "download": "https://obj.run.cantoflight.com/api_binary/v1/image/ghijklmnopqrstuvwxyzabcdef",

                "LowJPG": "https://obj.run.cantoflight.com/api_binary/v1/image/ghijklmnopqrstuvwxyzabcdef/LowJPG",

                "metadata": "https://obj.run.cantoflight.com/api_binary/v1/image/ghijklmnopqrstuvwxyzabcdef/metadata"

            }

        }

    ]

"facets": 

[{"name": "approval","value": ["Approved","Pending","Restricted"]},

{"name": "scheme","value": ["image","video"]},

{"name": "created","max": 1452021772,"mix": 1445901667},

{"name": "dimension","max": 2448,"mix": 202},

{"name": "duration","max": 10,"mix": 10},

{"name": "keywords","value": ["doristest","Unkeyworded"]},

{"name": "orientation","value": ["Portrait","Landscape"]},

{"name": "owner","value": ["dzuo@objectivasoftware.com"]},

{"name": "pageNumber"},

{"name": "resolution","max": 72,"mix": 1},

{"name": "fileSize","max": 4294967293,"mix": 4},

{"name": "storageClass","value": ["standard"]},

{"name": "tags","value": ["doris","test","baby","tree","Untagged"]}],

}

 

 

“found” means the total number of the server found.

“results” array maintain all brief info list of the content.

“facets” means it returns the search range value from cloud search.

“name” means the facet name.

“value” means the value from cloud search. The facet type is String.

“mix” means the value from cloud search. The facet type is int.

“max” means the value from cloud search. The facet type is int.

 

 

Failure

N/A

 

If other exception occurs, Flight will return you 500 http status code.

 

Batch Edit Content Get

 

Get Information Field Values of Multi-Content Being Edited

POST https://{Flight domain url}/api/v1/batch/edit

Parameter

Required

Description

scheme

YES

One of the image, video, audio, document, presentation, other

id

YES

Id of the content 

 

Below is a sample of request parameters:

[{"id":"iim463p68p59t11cijqfchd066","scheme":"presentation"},{"id":"jshc6m631l41n758lj3525tl1i","scheme":"document"},{"id":"dafmf4ma291bf7243s9tg35s2j","scheme":"image"}]

 

Response

Description

Success

Http status code 200 and content list returned as below:

{             

                " availableKeywords ": ["ASKW_1","Animal","AveryKey","HectorKeyword","Search test keyword","hector test keyword","test keyword"],

              "approvalStatus": ["Approved"],

                "expirationDate": ["2016-05-29"],

              "tag": ["ASKW_1"],         

                "keyword": ["ASKW_1"] ,

              "description": ["000"]

}

 

availableKeywords: available keywords for select.

approvalStatus, expirationDate, description:if mutli select document have the same value,return this value,else return null.

tag, keyword: return the same tag or keyword from mutli select document.if all different return null.

Failure

N/A

 

If other exception occurs, Flight will return you 500 http status code.

 

Batch Edit Content Apply

 

Save  the information fields of the batch edit content.

PUT https://{Flight domain url}/api/v1/batch/edit

Parameter

Required

Description

contents

YES

Mutli select document

scheme

YES

One of the image, video, audio, document, presentation, other

id

YES

Id of the content 

properties

YES

Set properties

propertyId

YES

 Properties name. You can edit from properties name which include description, approvalStatus, expirationDate, keyword and tag.

propertyValue

YES

Properties value, permit an empty string.

When property name is expirationDate ,value format by YYYY-MM-DD.

When property  name is keyword or tag,the  mutli value separator by comma.

action

NO

permit an empty string.

When property  name is description,action is one of the append or cover. empty string default cover.

When property name is keyword or tag,action is one of the add or remove.  empty string default add.

 

Below is a sample of request paramter:

{"contents":[{"id":"iim463p68p59t11cijqfchd066","scheme":"presentation"},{"id":"jshc6m631l41n758lj3525tl1i","scheme":"document"},{"id":"dafmf4ma291bf7243s9tg35s2j","scheme":"image"}],"properties":[{"propertyId":"description","propertyValue":"909090","action":"append"},{"propertyId":"approvalStatus","propertyValue":"Approved"},{"propertyId":"expirationDate","propertyValue":"2020-01-01"},{"propertyId":"keyword","propertyValue":"test keyword","action":"add"},{"propertyId":"keyword","propertyValue":"ASKW_1","action":"remove"},{"propertyId":"tag","propertyValue":"ASKW_1","action":"add"}]}

 

Response

Description

Success

Http status code 200 and content list returned as below:

success

 

Failure

N/A

 

If other exception occurs, Flight will return you 500 http status code.