Skip to end of metadata
Go to start of metadata

Custom Fields API

The Custom Fields API allows you to retrieve, add and get custom fields of an asset. The following methods are available:

 

Get all custom fields

Method

Method Name

Returns

getall

Record set

Input Parameter

Parameter

Description

Type

Required

Sample Input

api_key

A valid API key

String

yes

54592180-7060-4D4B-BC74-2566F4B2F943

Output Value

Name

Description

Sample Output

id

ID of the field

108

text

Text of the field

my custom field

type

What type the field is (text, textarea, etc.)

text

enabledIf the field is enabled in RazunaT
showFor which asset type the field is enabledall (default)
img = Images
vid = Videos
aud = Audios
doc = Documents
users = Users 

REST: Sample Request

Sample Output

Output format

Remember you can adjust the output dynamically. The API returns JSON by default. For record sets it defaults to a ROW based set, if you need COLUMNS simply append "&__BDQUERYFORMAT=column" to your call. In case, you need JSONP you want to append "&__BDRETURNFORMAT=jsonp&callback=?". In order to retrieve XML (WDDX) you simply need to append "&__BDRETURNFORMAT=wddx".

Add custom field

Method

Method Name

Returns

setfield

String

Input Parameter

Parameter

Description

Type

Required

Sample Input

api_key

A valid API key

String

yes

54592180-7060-4D4B-BC74-2566F4B2F943

field_textThe text of the fieldStringyesmy custom field
field_typeType of the fieldStringyestext
textarea
radio (radio button)
select (select list)
select_multi (select multiple) as of Razuna 1.7.5
field_showTo what asset type should the field be enabledStringno

all (default)
img = Images
vid = Videos
aud = Audios
doc = Documents
users = Users 

field_enabledIs the field enabled within RazunaStringnoT = yes (default)
F = no 
field_select_listIf your field type is a select list, enter its values hereStringnovalue 1,value 2,value 3

Output Value

Name

Description

Sample Output

responsecode

Responsecode

0 (if successful)

message

Status Message

Custom field successfully added

field_id

ID of the new custom field

109

REST: Sample Request

Sample Output

Get custom fields of asset

Returns all custom fields from asset(s).

Method

Method Name

Returns

getfieldsofasset

Record set

Input Parameter

Parameter

Description

Type

Required

Sample Input

api_key

A valid API key

String

yes

54592180-7060-4D4B-BC74-2566F4B2F943

asset_idID of the asset(s)Stringyes108
or a list like 108,109,etc. 
lang_idID of the language for the resultsStringno1 (default)

Output Value

Name

Description

Sample Output

field_id

ID of the custom field

109090

field_textText of the custom fieldlocation
field_valueValue of the custom field for this asset recordDenmark

REST: Sample Request

Sample Output

Output format

Remember you can adjust the output dynamically. The API returns JSON by default. For record sets it defaults to a ROW based set, if you need COLUMNS simply append "&__BDQUERYFORMAT=column" to your call. In case, you need JSONP you want to append "&__BDRETURNFORMAT=jsonp&callback=?". In order to retrieve XML (WDDX) you simply need to append "&__BDRETURNFORMAT=wddx".

Set custom field value in bulk

Method

Method Name

Returns

setfieldvaluebulk

String

Input Parameter

Parameter

Description

Type

Required

Sample Input

api_key

A valid API key

String

yes

54592180-7060-4D4B-BC74-2566F4B2F943

field_values

 JSON Structure

String

yes

JSON structure
See the example below

Output Value

Name

Description

Sample Output

responsecode

Responsecode

0 (if successful)

message

Status Message

Custom field values successfully added

JSON parameter for field_values

You pass the values for the custom fields as a JSON structure. The first parameter is the assetid, followed by a embedded JSON structure of the custom field ID and the custom field value. A example of passing the values would be (you need to serialize your array in order to pass it in a URL):

In a bulk statement for many files you would simple add them to the JSON structure as in:

REST: Sample Request

Sample Output

 

Set custom field value

Bulk adding

You can also use the setfieldvaluebulk() method above in order to set many custom field values for many files at the same time!

Method

Method Name

Returns

setfieldvalue

String

Input Parameter

Parameter

Description

Type

Required

Sample Input

api_key

A valid API key

String

yes

54592180-7060-4D4B-BC74-2566F4B2F943

assetid

The id of the asset or a list of id's (delimited with a ",")

String

yes

108
or a list like 108,109,etc.

field_values

 JSON Structure

String

yes

JSON structure of metadata
See the metadata field list below

To set a value for select (multiple) simply comma separate the values!

Output Value

Name

Description

Sample Output

responsecode

Responsecode

0 (if successful)

message

Status Message

Custom field values successfully added

JSON parameter for field_values

You pass the values for the custom fields as a JSON structure. You also need to know the ID of the custom field. A example of passing the values would be (you need to serialize your array in order to pass it in a URL):

REST: Sample Request

Sample Output

  • No labels