This new API is currently in beta and access is limited. Please contact your account manager or sales@netx.net if you are interested in using the NetX API.

Introduction

NetX is a Digital Asset Management application that empowers users to store, manage, and distribute their digital assets. You can use our API to access assets, folders, attribute data, collections, and views.

Getting started

JSON-RPC

Our API adheres to the JSON-RPC 2.0 spec (http://www.jsonrpc.org/specification) with a few exceptions; we do not yet support named parameters or batched calls.

From the spec: An RPC call is represented by sending a request object to a server. The request object has the following members:

  • jsonrpc: A string specifying the version of the JSON-RPC protocol. MUST be exactly "2.0".
  • method: A string containing the name of the method to be invoked. Method names that begin with the word rpc followed by a period character (U+002E or ASCII 46) are reserved for rpc-internal methods and extensions and MUST NOT be used for anything else.
  • params: A structured value that holds the parameter values to be used during the invocation of the method. This member MAY be omitted.
  • id: An identifier established by the client that MUST contain a string, number, or NULL value if included. If it is not included it is assumed to be a notification. The value SHOULD normally not be Null [1] and Numbers SHOULD NOT contain fractional parts [2]

We also require an extra field in the call named dataContext, which must be set to a value of "json". This will be removed in future versions.

Parameters and request options

Many of the methods in the API have an options parameter that allows you to specify pagination, sorting, and a list of data included in the return objects:

For all of the code examples in this documentation, we will use a page size of 1 or 2 to save space. Here is an example of the getAssetsByFolder method illustrating the use of parameters and their options.

{
    "id":"13576991614322",
    "method":"getAssetsByFolder",
    "params":[
        "NVvdBOKjcvm2nIYt6xzN5rKGv",
        12,
        false,
        {
            "page": {
                "startIndex": 0,
                "size": 2
            },
            "data": ["asset.id", "asset.base"]
        }
    ],
    "dataContext":"json",
    "jsonrpc":"2.0"
}

This indicates that we want assets from folder id 8 (the Castles folder), we don't want assets from subfolders (recursive = false, the 3rd parameter), and that we want paging to start with the first object (startindex = 0), and include 2 items. The data option indicates that all we want are the asset id and the name (asset.id and asset.base).

sort

  • field specifies the field you want to sort on.
  • order specifies a descending or ascending sort order.

page

  • size specifies the number of items included in the response.
  • startIndex specifies the first object in the page.

data

  • This option specifies the data you want returned in the response. You can choose any combination of data options, and the API will only return the data you have selected. As we continue to extend the API, additional fields will be added. For each method, we will list the current data options throughout this documentation.

Not all options are available for every method, please see the particular method for documentation on which options you can use.

Endpoint

The endpoint URL for the API on your site is:

https://<netxinstance>.netx.net/external/api/json

API request objects are POSTed to this URL, and response objects are returned. You must use the HTTP POST verb. You cannot use GET to invoke JSON-RPC methods in the NetX API.

Authentication

authenticate

The NetX API uses session-based authentication. The result of the authenticate call, if successful, is an object containing a session key. This key will be the first parameter of every subsequent API call you make.

Parameters

ParameterDescription
usernameUsername to authenticate with
passwordPassword to authenticate with

Data options

None

Returns

A session object containing the sessionKey which needs to be used for subsequent API calls.

Example

Here's an example authenticate call:

{
    "id":"13576991614322",
    "method":"authenticate",
    "params":["username", "password"],
    "dataContext":"json",
    "jsonrpc":"2.0"
}

If successful, the response object looks like this:

{
    "result": {
        "sessionKey": "NVvdBOKjcvm2nIYt6xzN5rKGv"
    },
    "id": "13576991614322",
    "jsonrpc": "2.0"
}

An error response looks like this:


{
    "id": "13576991614322",
    "error": {
        "result": "Invalid Session",
        "code": 3001,
        "data": null,
        "message": "Invalid Session"
    },
    "jsonrpc": "2.0"
}

Assets

getAssetsByFolder

Returns asset objects contained in a specific folder (and its subfolders, optionally).

Parameters

ParameterDescription
sessionKeyA user's active session key
folderIdA folder's unique identifier
recursiveIf true, assets found in descendants of the requested folder are included in the result.
optionspage, data (see Data options below)

Data options

OptionDescription
asset.idAsset ID
asset.baseAsset name
asset.fileInfo about the asset file
asset.proxiesInfo about the asset proxy files (thumbnail, preview, zoom)
asset.viewsInfo about any views attached to the asset
asset.relatedFoldersInfo about assets related to the asset
asset.foldersInfo about the asset's parent folders
asset.attributesAttribute data for each asset

Returns

A page of asset objects.

Example

Example request:

{
    "id":"13576991614322",
    "method":"getAssetsByFolder",
    "params":[
        "NVvdBOKjcvm2nIYt6xzN5rKGv",
        12,
        false,
        {
            "page": {
                "startIndex": 0,
                "size": 2
            },
            "data": ["asset.id", "asset.base"]
        }
    ],
    "dataContext":"json",
    "jsonrpc":"2.0"
}

Example response:

{
    "result": {
        "results": [
            {
                "id": 39,
                "name": "Alcázar de Segovia",
                "file": null,
                "proxies": null,
                "views": null
            },
            {
                "id": 40,
                "name": "Alnwick Castle",
                "file": null,
                "proxies": null,
                "views": null
            }
        ],
        "size": 62
    },
    "id": "13576991614322",
    "jsonrpc": "2.0"
}

Here is the same call, with a different set of options:

{
    "id":"13576991614322",
    "method":"getAssetsByFolder",
    "params":[
        "NVvdBOKjcvm2nIYt6xzN5rKGv",
        12,
        false,
        {
            "page": {
                "startIndex": 2,
                "size": 2
            },
            "data": ["asset.id", "asset.base", "asset.file", "asset.proxies"]
        }
    ],
    "dataContext":"json",
    "jsonrpc":"2.0"
}

And the response:

{
    "result": {
        "results": [
            {
                "id": 41,
                "name": "Château de Chambord",
                "file": {
                    "name": "Architecture-Chambord-Castle-France.jpg",
                    "size": 559423,
                    "width": 1600,
                    "height": 1200,
                    "url": "/file/asset/41/original/attachment"
                },
                "proxies": [
                    {
                        "name": "Thumbnail",
                        "file": {
                            "name": "Château de Chambord-thumbnail.jpg",
                            "size": 5584,
                            "width": null,
                            "height": null,
                            "url": "/view/0000/t_41.jpg"
                        }
                    },
                    {
                        "name": "Preview",
                        "file": {
                            "name": "Château de Chambord-preview.jpg",
                            "size": 59074,
                            "width": 500,
                            "height": 375,
                            "url": "/view/0000/p_41.jpg"
                        }
                    },
                    {
                        "name": "Zoom",
                        "file": {
                            "name": "Château de Chambord-zoom.jpg",
                            "size": 210869,
                            "width": null,
                            "height": null,
                            "url": "/zoom/0000/z_41.jpg"
                        }
                    }
                ],
                "views": null
            },
            {
                "id": 42,
                "name": "Arg-é Bam",
                "file": {
                    "name": "arg-e-bam.jpg",
                    "size": 69922,
                    "width": 550,
                    "height": 372,
                    "url": "/file/asset/42/original/attachment"
                },
                "proxies": [
                    {
                        "name": "Thumbnail",
                        "file": {
                            "name": "Arg-é Bam-thumbnail.jpg",
                            "size": 4443,
                            "width": null,
                            "height": null,
                            "url": "/view/0000/t_42.jpg"
                        }
                    },
                    {
                        "name": "Preview",
                        "file": {
                            "name": "Arg-é Bam-preview.jpg",
                            "size": 41956,
                            "width": 500,
                            "height": 338,
                            "url": "/view/0000/p_42.jpg"
                        }
                    },
                    {
                        "name": "Zoom",
                        "file": {
                            "name": "Arg-é Bam-zoom.jpg",
                            "size": 113834,
                            "width": null,
                            "height": null,
                            "url": "/zoom/0000/z_42.jpg"
                        }
                    }
                ],
                "views": null
            }
        ],
        "size": 62
    },
    "id": "13576991614322",
    "jsonrpc": "2.0"
}

addAssetToFolder

Adds an asset to a specific parent folder.

Parameters

ParameterDescription
sessionKeyA user's active session key
assetIdID of the asset added to the folder
folderIdID of the folder the asset is added to
optionspage, data (see Data options below)

Data options

OptionDescription
asset.idAsset ID
asset.baseAsset name
asset.fileInfo about the asset file
asset.proxiesInfo about the asset proxy files (thumbnail, preview, zoom)
asset.viewsInfo about any views attached to the asset
asset.relatedFoldersInfo about assets related to the asset
asset.foldersInfo about the asset's parent folders
asset.attributesAttribute data for each asset

Returns

An updated asset object.

Example

Example request:

{
  "id": "7444760565671519",
  "method": "addAssetToFolder",
  "params": [
    "XRuSs5eS02WkSFNx70Wo1sGBi",
    71,
    23,
    {
      "data": [
        "asset.id",
        "asset.base",
        "asset.file",
        "asset.folders"
      ]
    }
  ],
  "dataContext": "json",
  "jsonrpc": "2.0"
}

Example response:

{
  "result": {
    "id": 71,
    "name": "logo-image-small",
    "file": {
      "name": "logo-image-small.jpg",
      "size": 3249,
      "width": 155,
      "height": 155,
      "url": "/file/asset/71/original/attachment"
    },
    "proxies": null,
    "views": null,
    "relatedAssets": null,
    "folders": [
      {
        "id": 22,
        "name": "New Category",
        "description": "",
        "path": "API Testing/New Category",
        "children": null
      },
      {
        "id": 23,
        "name": "Folder 1",
        "description": "",
        "path": "API Testing/Folder 1",
        "children": null
      }
    ]
  },
  "id": "7444760565671519",
  "jsonrpc": "2.0"
}

removeAssetFromFolder

Removes an asset from its parent folder.

Parameters

ParameterDescription
sessionKeyA user's active session key
assetIdID of the asset removed from the folder
folderIdID of the folder the asset is removed from
optionspage, data (see Data options below)

Data options

OptionDescription
asset.idAsset ID
asset.baseAsset name
asset.fileInfo about the asset file
asset.proxiesInfo about the asset proxy files (thumbnail, preview, zoom)
asset.viewsInfo about any views attached to the asset
asset.relatedFoldersInfo about assets related to the asset
asset.foldersInfo about the asset's parent folders
asset.attributesAttribute data for each asset

Returns

An updated asset object.

Example

Example request:

{
  "id": "7445197747158073",
  "method": "removeAssetFromFolder",
  "params": [
    "XRuSs5eS02WkSFNx70Wo1sGBi",
    71,
    23,
    {
      "data": [
        "asset.id",
        "asset.base",
        "asset.file",
        "asset.folders"
      ]
    }
  ],
  "dataContext": "json",
  "jsonrpc": "2.0"
}

Example response:

{
  "result": {
    "id": 71,
    "name": "logo-image-small",
    "file": {
      "name": "logo-image-small.jpg",
      "size": 3249,
      "width": 155,
      "height": 155,
      "url": "/file/asset/71/original/attachment"
    },
    "proxies": null,
    "views": null,
    "relatedAssets": null,
    "folders": [
      {
        "id": 22,
        "name": "New Category",
        "description": "",
        "path": "API Testing/New Category",
        "children": null
      }
    ]
  },
  "id": "7445197747158073",
  "jsonrpc": "2.0"
}

versionAsset

Locates a previously uploaded file and checks it in as a new version of the specified asset. The file for the new version MUST have already been uploaded.

Parameters

ParameterDescription
sessionKeyA user's active session key
assetIdID of the asset to version
filenamename of file uploaded
notesnotes about the new version

Data options

None

Returns

An empty object.

deleteAsset

Deletes an existing asset.

Parameters

ParameterDescription
sessionKeyA user's active session key
assetIdID of the asset to delete

Data options

None

Returns

An empty object.

Folders

getFoldersByParent

Lists the folders with a given folder as a parent.

Parameters

ParameterDescription
sessionKeyA user's active session key
parentIdThe parent folder's ID
optionspage, data (see Data options below)

Data options

OptionDescription
folder.idFolder ID
folder.baseFolder name, description, and full path (individual folders are separated with a forward slash)
folder.childrenInfo about the folder's child assets and folders

Returns

A page of folder objects.

Example

Example request:

{
    "id":"13576991614322",
    "method":"getFoldersByParent",
    "params":[
        "NVvdBOKjcvm2nIYt6xzN5rKGv",
        1,
        {
            "page": {
                "startIndex": 0,
                "size": 10
            },
            "data": ["folder.id", "folder.base"]
        }
    ],
    "dataContext":"json",
    "jsonrpc":"2.0"
}

Example response:

{
    "result": {
        "results": [
            {
                "id": 2,
                "name": "Getting Started",
                "description": "",
                "path": "Getting Started"
            },
            {
                "id": 9,
                "name": "Marketing",
                "description": "",
                "path": "Marketing"
            },
            {
                "id": 7,
                "name": "Object Collection",
                "description": "",
                "path": "Object Collection"
            },
            {
                "id": 8,
                "name": "Archives",
                "description": "",
                "path": "Archives"
            },
            {
                "id": 12,
                "name": "Castles",
                "description": "",
                "path": "Castles"
            }
        ],
        "size": 5
    },
    "id": "13576991614322",
    "jsonrpc": "2.0"
}

getFoldersByNameFilter

Lists the folders with names that contain a given filter string.

Parameters

ParameterDescription
sessionKeyA user's active session key
filterA case-insensitive name filter
optionspage, data (see Data options below)

Data options

OptionDescription
folder.idFolder ID
folder.baseFolder name, description, and full path (individual folders are separated with a forward slash)
folder.childrenInfo about the folder's child assets and folders

Returns

A page of folder objects.

Example

Example request:

{
    "id":"13576991614322",
    "method":"getFoldersByNameFilter",
    "params":[
        "NVvdBOKjcvm2nIYt6xzN5rKGv",
        "Cas",
        {
            "page": {
                "startIndex": 0,
                "size": 10
            },
            "data": ["folder.id", "folder.base"]
        }
    ],
    "dataContext":"json",
    "jsonrpc":"2.0"
}

Example response:

{
    "result": {
        "results": [
            {
                "id": 12,
                "name": "Castles",
                "description": "",
                "path": "Castles"
            }
        ],
        "size": 1
    },
    "id": "13576991614322",
    "jsonrpc": "2.0"
}

getFolderByPath

Finds a folder with a given path.

Parameters

ParameterDescription
sessionKeyA user's active session key
pathA forward-slash-separated path.
optionsdata (see Data options below)

Data options

OptionDescription
folder.idFolder ID
folder.baseFolder name, description, and full path (individual folders are separated with a forward slash)
folder.childrenInfo about the folder's child assets and folders

Returns

A folder object.

Example

Example request:

{
  "id": "13576991614322",
  "method": "getFolderByPath",
  "params": [
    "WtwehfQAZJM11lyhl87igurmF",
    "Portraits",
    {
      "data": [
        "folder.id",
        "folder.base",
        "folder.children"
      ]
    }
  ],
  "dataContext": "json",
  "jsonrpc": "2.0"
}

Example response:

{
    "result": {
        "id": 35,
        "name": "Portraits",
        "description": "",
        "path": "Portraits",
        "children": {
            "assetCount": 7,
            "folderCount": 1
        }
    },
    "id": "13576991614322",
    "jsonrpc": "2.0"
}

createFolderFromPath

Creates a new folder with a given path.

Parameters

ParameterDescription
sessionKeyA user's active session key
pathA forward-slash-separated path.
optionsdata (see Data options below)

Data options

OptionDescription
folder.idFolder ID
folder.baseFolder name, description, and full path (individual folders are separated with a forward slash)
folder.childrenInfo about the folder's child assets and folders

Returns

The new folder object.

Example

Example request:

{
  "id": "13576991614322",
  "method": "createFolderFromPath",
  "params": [
    "WtwehfQAZJM11lyhl87igurmF",
    "Portraits/Color/Pets",
    {
      "data": [
        "folder.id",
        "folder.base",
        "folder.children"
      ]
    }
  ],
  "dataContext": "json",
  "jsonrpc": "2.0"
}

Example response:

{
    "result": {
        "id": 79,
        "name": "Pets",
        "description": "",
        "path": "Portraits/Color/Pets",
        "children": {
            "assetCount": 0,
            "folderCount": 0
        }
    },
    "id": "13576991614322",
    "jsonrpc": "2.0"
}

Attributes

getAssetAttributes

Retrieves the specified asset's attribute values.

Parameters

ParameterDescription
sessionKeyA user's active session key
assetIdID of asset to retrieve attributes from

Data options

None

Returns

Attributes for the specified asset.

Example

Example request:

{
    "id":"13576991614322",
    "method":"getAssetAttributes",
    "params":[
        "FCEApNVV4qshgeKFtMGM2Hdoq",
        12
    ],
    "dataContext":"json",
    "jsonrpc":"2.0"
}

Example response

{
    "result": {
        "Year": [
            "1120"
        ],
        "Country": [
            "Spain"
        ]
    },
    "id": "13576991614322",
    "jsonrpc": "2.0"
}

setAssetAttributes

Updates the values of the specified asset's attributes.

Parameters

ParameterDescription
sessionKeyA user's active session key
assetIdID of asset being updated
attributesAttributes to update with

Data options

None

Returns

An empty object.

Example

Example request:

{
    "id":"13576991614322",
    "method":"setAssetAttributes",
    "params":[
        "FCEApNVV4qshgeKFtMGM2Hdoq",
        12,
        {
            "Year": [
                "1200"
            ],
            "Country": [
                "España"
            ]
        }
    ],
    "dataContext":"json",
    "jsonrpc":"2.0"
}

Example response:

{
    "result": {},
    "id": "13576991614322",
    "jsonrpc": "2.0"
}

Search

getAssetsByQuery

The getAssetsByQuery method finds assets that match a complex search query.The SearchQueryDTO object is a container for a list of SearchClauseDTO objects, which consist of an operator and a criterion. Different types of criteria define different types of searches. Additionally, there is a subquery type of criterion which allows more complex searches to be built. First, we'll look at three examples with a single search clause to demonstrate the various types of criteria possible. Then, we'll show a more advanced example on how to combine search clauses.

Parameters

ParameterDescription
sessionKeyA user's active session key
queryA collection of search criteria
optionssort, page, data (see Data options below)

Data options

OptionDescription
asset.idAsset ID
asset.baseAsset name
asset.fileInfo about the asset file
asset.proxiesInfo about the asset proxy files (thumbnail, preview, zoom)
asset.viewsInfo about any views attached to the asset
asset.relatedFoldersInfo about assets related to the asset
asset.foldersInfo about the asset's parent folders
asset.attributesAttribute data for each asset

Returns

A page of asset objects.

Example

Here is an example showing a single clause folder search:

{
    "id" : "aeae4c48-a312-4a75-a9e4-eb3d8621cd3a",
    "method" : "getAssetsByQuery",
    "params":[
        {
            "query": [
                {
                    "operator": "and",
                    "folder": {
                        "folderId": 1,
                        "recursive": true
                    }
                }
            ]
        },
        {
            "sort": {
                "field": "pulldown-single",
                "order": "asc"
            },
            "page": {
                "startIndex": 0,
                "size": 5
            },
            "data": [
                "asset.id"
            ]
        }
    ],
    "dataContext" : "json",
    "jsonrpc" : "2.0"
}

Here is an example with an attribute value search:

{
    "id" : "aeae4c48-a312-4a75-a9e4-eb3d8621cd3a",
    "method" : "getAssetsByQuery",
    "params":[
        {
            "query": [
                {
                    "operator": "and",
                    "exact": {
                        "attribute": "pulldown-single",
                        "value": "orange"
                    }
                }
            ]
        },
        {
            "sort": {
                "field": "pulldown-single",
                "order": "asc"
            },
            "page": {
                "startIndex": 0,
                "size": 5
            },
            "data": [
                "asset.id"
            ]
        }
    ],
    "dataContext" : "json",
    "jsonrpc" : "2.0"
}

Here is an example with a keyword search:

{
    "id" : "aeae4c48-a312-4a75-a9e4-eb3d8621cd3a",
    "method" : "getAssetsByQuery",
    "params":[
        {
            "query": [
                {
                    "operator": "and",
                    "exact": {
                        "field": "keywords",
                        "value": "filename.jpg"
                    }
                }
            ]
        },
        {
            "sort": {
                "field": "importDate",
                "order": "desc"
            },
            "page": {
                "startIndex": 0,
                "size": 1
            },
            "data": [
                "asset.id"
            ]
        }
    ],
    "dataContext" : "json",
    "jsonrpc" : "2.0"
}

Here is an example with a range search:

{
    "id" : "aeae4c48-a312-4a75-a9e4-eb3d8621cd3a",
    "method" : "getAssetsByQuery",
    "params":[
        {
            "query": [
                {
                    "operator": "and",
                    "range": {
                        "attribute": "numeric-field",
                        "min": "50",
                        "max": "100",
                        "includeMin": true,
                        "includeMax": true
                    }
                }
            ]
        },
        {
            "sort": {
                "field": "pulldown-single",
                "order": "asc"
            },
            "page": {
                "startIndex": 0,
                "size": 5
            },
            "data": [
                "asset.id"
            ]
        }
    ],
    "dataContext" : "json",
    "jsonrpc" : "2.0"
}

Finally, here is an example of a more complicated query. This search finds assets which are either in folder id 1 or folder id 7 and where pulldown-single is either “orange” or “blue”.

{
    "id" : "aeae4c48-a312-4a75-a9e4-eb3d8621cd3a",
    "method" : "getAssetsByQuery",
    "params":[
        {
            "query": [
                {
                    "operator": "and",
                    "subquery": {
                        "query": [
                            {
                                "operator": "or",
                                "folder": {
                                    "folderId": 1,
                                    "recursive": true
                                }
                            },
                            {
                                "operator": "or",
                                "folder": {
                                    "folderId": 7,
                                    "recursive": false
                                }
                            }
                        ]
                    }
                },
                {
                    "operator": "and",
                    "subquery": {
                        "query": [
                            {
                                "operator": "or",
                                "exact": {
                                    "attribute": "pulldown-single",
                                    "value": "orange"
                                }
                            },
                            {
                                "operator": "or",
                                "exact": {
                                    "attribute": "pulldown-single",
                                    "value": "blue"
                                }
                            }
                        ]
                    }
                }
            ]
        },
        {
            "sort": {
                "field": "pulldown-single",
                "order": "asc"
            },
            "page": {
                "startIndex": 0,
                "size": 5
            },
            "data": [
                "asset.id"
            ]
        }
    ],
    "dataContext" : "json",
    "jsonrpc" : "2.0"
}

The result objects from any of these would look like the following:

{
    "result": {
        "results": [
            {
                "id": 16
            },
            {
                "id": 24
            },
            {
                "id": 27
            },
            {
                "id": 31
            },
            {
                "id": 32
            }
        ],
        "size": 15
    },
    "id": "aeae4c48-a312-4a75-a9e4-eb3d8621cd3a",
    "jsonrpc": "2.0"
}

The results are the ids of assets that match the search criteria, packaged in an object that also contains the total number of matching assets so that subsequent paged calls can be made.

Upload assets

Importing new assets is a two step process:

  1. Upload the file to NetX
  2. Call the createAssetFromFile method

Step 1: Upload the file

In order to import anything you must first upload your file to the server. This is done by uploading your file to the following URL:

https://<netxinstance>.netx.net/servlet/FileUploader

This system follows the RFC 1867 standard (http://www.ietf.org/rfc/rfc1867.txt). There are many open source implementations of this protocol, including the Apache FileUpload project (http://commons.apache.org/fileupload/).

The only addition to the above standard (RFC 1867) is that the calling user must have already authenticated, or the call must pass a "sessionKey" parameter with the upload with a corresponding valid sessionKey value. Without a valid sessionKey or authenticated session, the file uploaded will be discarded.

In using this scheme, the file name is critically important: the uploaded file name must match the name used in the subsequent import call exactly (and by the same session or sessionKey).

In addition to Filename and sessionKey, you'll need to specify the target category in which to import; this is designated with the "folderId" parameter.

Here is an example upload (POST) payload to the FileUploader endpoint, where the name of the file is logo-image-small.png, and it is being uploaded to a folder with the ID of 22:

------------ae0cH2KM7Ef1gL6KM7Ef1gL6cH2ae0
Content-Disposition: form-data; name="Filename"
 
logo-image-small.png
------------ae0cH2KM7Ef1gL6KM7Ef1gL6cH2ae0
Content-Disposition: form-data; name="sessionKey"
 
qbbqFksgdDVuXONpDqQbX8qBP
------------ae0cH2KM7Ef1gL6KM7Ef1gL6cH2ae0
Content-Disposition: form-data; name="categoryId"
 
22
------------ae0cH2KM7Ef1gL6KM7Ef1gL6cH2ae0
Content-Disposition: form-data; name="Filedata"; filename="logo-image-small.png"
Content-Type: application/octet-stream
 
 
------------ae0cH2KM7Ef1gL6KM7Ef1gL6cH2ae0
Content-Disposition: form-data; name="Upload"
 
Submit Query
------------ae0cH2KM7Ef1gL6KM7Ef1gL6cH2ae0--

Step 2: Call the createAssetFromFile method

Please note that the following parameter values are the same for both step 1 and step 2:

  • sessionKey
  • fileName
  • folderId

This allows NetX to properly associate the uploaded file with the upload call.

Please note the following:

  1. Step 1 MUST be complete before you make the createAssetFromFile call. This means you MUST wait for an HTTP status code of 200 to be returned from step 1 before proceeding to step 2.
  2. If you are using Hydra, you can import to any node you want. However, for each asset imported, step 1 and step 2 MUST be performed on the same node.
  3. The user you are using to make API calls MUST have permission to import assets into the category.

Parameters

ParameterDescription
sessionKeyA user's active session key
fileNameA collection of search criteria
folderIdParent folder ID for the new asset
optionsdata (see Data options below)

Data options

OptionDescription
asset.idAsset ID
asset.baseAsset name
asset.fileInfo about the asset file
asset.proxiesInfo about the asset proxy files (thumbnail, preview, zoom)
asset.viewsInfo about any views attached to the asset
asset.relatedFoldersInfo about assets related to the asset
asset.foldersInfo about the asset's parent folders
asset.attributesAttribute data for each asset

Returns

The new asset object.

Example

Example request:

{
  "id": "7441158495944158",
  "method": "createAssetFromFile",
  "params": [
    "qbbqFksgdDVuXONpDqQbX8qBP",
    "logo-image-small.png",
    22,
    {
      "data": [
        "asset.id",
        "asset.base",
        "asset.file"
      ]
    }
  ],
  "dataContext": "json",
  "jsonrpc": "2.0"
}

Example response:

{
  "result": {
    "id": 71,
    "name": "logo-image-small",
    "file": {
      "name": "logo-image-small.png",
      "size": 3249,
      "width": null,
      "height": null,
      "url": "/file/asset/71/original/attachment"
    },
    "proxies": null,
    "views": null,
    "relatedAssets": null
  },
  "id": "7441158495944158",
  "jsonrpc": "2.0"
}

Views

createViewFromFile

This call is similar to the createAssetFromFile call in that the file must be uploaded to NetX before this call is made, with the same caveats and restrictions. Please see Upload the file for details.

Parameters

ParameterDescription
sessionKeyA user's active session key
fileNameA collection of search criteria
viewThe new view's writable data
optionsdata (see Data options below)

Data options

OptionDescription
view.idThe view's unique ID
view.baseView name
view.fileAn optional description of the view

Returns

The new view object.

Example

Example request:

{
  "id": "7530249697533316",
  "method": "createViewFromFile",
  "params": [
    "bCuhAegEZyJ66sWM7n95EUMbq",
    "view_1.png",
    {
      "id": 0,
      "name": "New View",
      "description": "Test View",
      "assetId": 71
    },
    {
      "data": [
        "view.id",
        "view.base",
        "view.file"
      ]
    }
  ],
  "dataContext": "json",
  "jsonrpc": "2.0"
}

Example response:

{
  "result": {
    "id": 80,
    "name": "New View",
    "description": "Test View",
    "assetId": 71,
    "file": {
      "name": "view_80.png",
      "size": 14576,
      "width": 500,
      "height": 500,
      "url": "/assetViews/0000/71/view_80.png"
    }
  },
  "id": "7530249697533316",
  "jsonrpc": "2.0"
}

getViewById

Finds the view with a given ID.

Parameters

ParameterDescription
sessionKeyA user's active session key
viewIdA view's unique ID
optionsdata (see Data options below)

Data options

OptionDescription
view.idThe view's unique ID
view.baseView name
view.fileAn optional description of the view

Returns

A view object.

Example

Example request:

{
  "id": "7530871356090573",
  "method": "getViewById",
  "params": [
    "bCuhAegEZyJ66sWM7n95EUMbq",
    80,
    {
      "data": [
        "view.id",
        "view.base",
        "view.file"
      ]
    }
  ],
  "dataContext": "json",
  "jsonrpc": "2.0"
}

Example response:

{
  "result": {
    "id": 80,
    "name": "New View",
    "description": "Test View",
    "assetId": 71,
    "file": {
      "name": "view_80.png",
      "size": 14576,
      "width": 500,
      "height": 500,
      "url": "/assetViews\0000/71/view_80.png"
    }
  },
  "id": "7530871356090573",
  "jsonrpc": "2.0"
}

getViewsByAsset

Finds views with a given parent asset.

Parameters

ParameterDescription
sessionKeyA user's active session key
assetIdAn asset's unique ID
optionspage data (see Data options below)

Data options

OptionDescription
view.idThe view's unique ID
view.baseView name
view.fileAn optional description of the view

Returns

A page of view objects.

Example

Example request:

{
  "id": "7531198788138214",
  "method": "getViewsByAsset",
  "params": [
    "bCuhAegEZyJ66sWM7n95EUMbq",
    71,
    {
      "page": {
        "startIndex": 0,
        "size": 10
      },
      "data": [
        "view.id",
        "view.base",
        "view.file"
      ]
    }
  ],
  "dataContext": "json",
  "jsonrpc": "2.0"
}

Example response:

{
  "result": {
    "results": [
      {
        "id": 79,
        "name": "previewXMP",
        "description": "Asset Metadata",
        "assetId": 71,
        "file": {
          "name": "view_79.xmp",
          "size": 1796,
          "width": null,
          "height": null,
          "url": "/assetViews/0000/71/view_79.xmp"
        }
      },
      {
        "id": 80,
        "name": "New View",
        "description": "Test View",
        "assetId": 71,
        "file": {
          "name": "view_80.png",
          "size": 14576,
          "width": 500,
          "height": 500,
          "url": "/assetViews/0000/71/view_80.png"
        }
      },
      {
        "id": 81,
        "name": "New View 2",
        "description": "Test View 2",
        "assetId": 71,
        "file": {
          "name": "view_81.png",
          "size": 91392,
          "width": 2000,
          "height": 2000,
          "url": "/assetViews/0000/71/view_81.png"
        }
      }
    ],
    "size": 3
  },
  "id": "7531198788138214",
  "jsonrpc": "2.0"
}

updateView

Updates a view's writable data.

Parameters

ParameterDescription
sessionKeyA user's active session key
viewA view's writable data
optionsdata (see Data options below)

Data options

OptionDescription
view.idThe view's unique ID
view.baseView name
view.fileAn optional description of the view

Returns

The updated view object.

Example

Example request:

{
  "id": "7531572488802793",
  "method": "updateView",
  "params": [
    "bCuhAegEZyJ66sWM7n95EUMbq",
    {
      "id": 80,
      "name": "New View Name",
      "description": "New View Description",
      "assetId": 71,
      "file": {
        "name": "view_80.png",
        "size": 14576,
        "width": 500,
        "height": 500,
        "url": "/assetViews/0000/71/view_80.png"
      }
    },
    {
      "data": [
        "view.id",
        "view.base",
        "view.file"
      ]
    }
  ],
  "dataContext": "json",
  "jsonrpc": "2.0"
}

Example response:

{
  "result": {
    "id": 80,
    "name": "New View Name",
    "description": "New View Description",
    "assetId": 71,
    "file": {
      "name": "view_80.png",
      "size": 14576,
      "width": 500,
      "height": 500,
      "url": "/assetViews/0000/71/view_80.png"
    }
  },
  "id": "7531572488802793",
  "jsonrpc": "2.0"
}

deleteView

Deletes the view with a given ID.

Parameters

ParameterDescription
sessionKeyA user's active session key
viewIdA view's unique ID

Data options

None

Returns

An empty object.

Example

Example request:

{
  "id": "7531866794686999",
  "method": "deleteView",
  "params": [
    "bCuhAegEZyJ66sWM7n95EUMbq",
    80,
    null
  ],
  "dataContext": "json",
  "jsonrpc": "2.0"
}

Example response:

{
  "result": {
     
  },
  "id": "7531866794686999",
  "jsonrpc": "2.0"
}

Collections

getCollectionsByUser

Retrieves collection objects a user has a minimum of Viewer permissions for.

Parameters

ParameterDescription
sessionKeyA user's active session key
userIdID of the user to retrieve collections for
optionspage data (see Data options below)

Data options

OptionDescription
collection.idThe collections's unique ID
collection.baseCollection name and item count

Returns

A page of collection objects.

getAssetsByCollection

Retrieves assets contained in a specific collection.

Parameters

ParameterDescription
sessionKeyA user's active session key
collectionIdid of the collection to return contents of
optionspage data (see Data options below)

Data options

OptionDescription
asset.idAsset ID
asset.baseAsset name
asset.fileInfo about the asset file
asset.proxiesInfo about the asset proxy files (thumbnail, preview, zoom)
asset.viewsInfo about any views attached to the asset
asset.relatedFoldersInfo about assets related to the asset
asset.foldersInfo about the asset's parent folders
asset.attributesAttribute data for each asset

Returns

A page of asset objects.