Skip to end of metadata
Go to start of metadata

Folder API

Get a list of folders

This method will return a list of folders on ONE level. To iterate for subfolders you will need to call this method each time.

Method

Method Name

Returns

getfolders

record set

Input Parameter

Parameter

Description

Type

Required

Sample Input

api_key

A valid api key

String

yes

54592180-7060-4D4B-BC74-2566F4B2F943

folderid

The ID of the folder you want to retrieve assets from.

Numeric

no

0 = all folders on the root level

collectionfolderIf this is a collection folderStringnotrue | false

Output Value

Name

Description

Sample Output

Note

folder_id

ID of folder

2

 

folder_name

Name of folder

Demo Folder

 

folder_ownerID of user that owns the folder0CA09066-05AA-4B22-B33C1CC6EED10F3E 
usernameName of user that owns the folderJohn 

hassubfolders

Folder contains sub-folder

true or false

 

folder_descriptionFolder descriptionUpload folderRazuna 1.5.5 (hosted edition 12.11.2012)

totalassets

Total of all assets in this folder. Only populated if not a collection folder.

8

Razuna 1.3.5

totalimg

Total of all images in this folder. Only populated if not a collection folder.

5

Razuna 1.3.5

totalvid

Total of all videos in this folder. Only populated if not a collection folder.

2

Razuna 1.3.5

totaldoc

Total of all documents in this folder. Only populated if not a collection folder.

1

Razuna 1.3.5

totalaud

Total of all audios in this folder. Only populated if not a collection folder.

3

Razuna 1.3.5

howmanycollectionsNumber of collections in collection folder. Only populated if this is a collection folder.1 

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".

 

Retrieving all assets in a folder

Method

Method Name

Returns

getassets

Record set

Input Parameter

Parameter

Description

Type

Required

Sample Input

api_key

A valid api key

String

yes

54592180-7060-4D4B-BC74-2566F4B2F943

folderid

The ID of the folder you want to retrieve assets from.

String

yes

1

showsubfolders

To include assets from subfolders as well.

String

no

true
false (default)

show

What kind of assets to show

String

no

all = All assets (default)
img = Images only
vid = Videos only
doc = Documents only
aud = Audios only

Output Value

Name

Description

Sample Output

totalassetscount

How many assets are in this folder

8

calledwith

The folderid you passed to this method

1

listassets

The body node of the returned list of assets

 

assets

For each asset an asset node is returned with information of the asset

see sample output

Updates

As of Razuna 1.5.5 (hosted edition since 16.12.2012) the search also returns the collection id(s) the file might be in in the column "colid"

REST: Sample Request

Sample Output

Error rendering macro 'excerpt-include' : null

Get Folder Information

Method

Method Name

Returns

getfolder

Record set

Input Parameter

Parameter

Description

Type

Required

Sample Input

Note

api_key

A valid api_key

String

yes

54592180-7060-4D4B-BC74-2566F4B2F943

 

folderid

The ID of the folder you want to retrieve information for

String

yes*

1

Either folderid and/or foldername must be provided.
Available from Razuna version 1.6.6 onwards. 
foldername

Full or partial name of the folder(s) you wish to retrieve information for.
All folders matching the folder name criterion will be returned.

Stringyes*picturesEither folderid and/or foldername must be provided.
Available from Razuna version 1.6.6 onwards. 

Output Value

Name

Description

Sample Output

Note

folder_id

The folderid you passed to this method

1

 

folder_related_to

To which folder this folder is related to

if this is the root folder it will be the same ID as the folder id

 

folder_name

Name of this folder

Renderings

 
folder_descriptionFolder descriptionUpload folderRazuna 1.5.5 (hosted edition 12.11.2012)
folder_sharedDepicts whether folder is shared or nottrueAvailable from Razuna version 1.6.6 onwards. 
group_permission

An array of groups and related permissions for folder. Groupid '0' is the 'Everybody' group.

[["73CCC1DB-C9A2-445A-B0F3CE28F8780B02","X"],["FDE74B74-D5F5-40F3-A9731BC28D14BB1D","W"],["0","R"]]Available from Razuna version 1.6.6 onwards. 

totalassets

Total of all assets in this folder

8

 

totalimg

Total of all images in this folder

5

 

totalvid

Total of all videos in this folder

2

 

totaldoc

Total of all documents in this folder

1

 

totalaud

Total of all audios in this folder

3

 

REST: Sample Request

Sample Output

Error rendering macro 'excerpt-include' : null

Create Folder

Method

Method Name

Returns

setfolder

String

Input Parameter

Parameter

Description

Type

Required

Sample Input

api_key

A valid api_key

String

yes

54592180-7060-4D4B-BC74-2566F4B2F943

folder_name

Name of folder

String

yes

Test Folder

folder_owner

The user id that this folder belongs to. If left blank then the current user is the owner.

String

no

(if not passed uses the current user id)

folder_related

The ID of the related folder. Important if you create a folder in a sublevel.

String

no

1

folder_collection

Is this folder a collection folder

String

no

true
false (default)

folder_description

Description of folder

String

no

This folder is created with the API

Output Value

Name

Description

Sample Output

Response

A result code with the status of the login. If the result is 0 the method was successful.

0

folder_id

The ID of the created folder

1

REST: Sample Request

Sample Output

Delete Folder

This method will remove the folder, any sub-folders and content within! There is no way to redo this action !

Method

Method Name

Result

removefolder

String

Input Parameter

Parameter

Description

Type

Required

Sample Input

api_key

A valid api key

String

yes

54592180-7060-4D4B-BC74-2566F4B2F943

folder_id

Name of folder

String

yes

454329579845097425097

Output Value

Name

Description

Sample Output

Response

A result code with the status of the login. If the result is 0 the method was successful.

0

Message

Message

Folder and content has been successfully removed!

REST: Sample Request

Sample Output

Set folder permissions

Method

Method Name

Returns

setFolderPermissions

String

Input Parameter

Parameter

Description

Type

Required

Sample Input

api_key

A valid API key

String

yes

54592180-7060-4D4B-BC74-2566F4B2F943

permissions

 JSON Structure

String

yes

JSON structure
See example below

Output Value

Name

Description

Sample Output

responsecode

Responsecode

0 (if successful)

message

Status Message

Folder permissions successfully updated

JSON structure

You pass the values for the permissions as a JSON structure. The order is:

Name

Description

 

folderid

ID of the folder

 

groupid

ID of the group

The "EVERYBODY" group has the ID of "0" (zero)!
permissionR = read only
W = read/write
X = full add 
 

A example of passing the values would be (you need to serialize your array in order to pass it in a URL):

With CFML you can use the following code snippet to create the JSON (The below code will create a 2 dimensional array and using 2 groups).

REST: Sample Request

Sample Output

  • No labels

7 Comments

  1. Anonymous

    Hello Nitai,

    setfolder method is returning below error however folder is getting created under razuna DAM.

    string

     '
    
    {"message":"The value returned from function setfolder() is not of type string","errorcode":"errorCode.runtimeError","detail":"Function: setfolder"}
    ' (length=151)

    Please suggest.

    Regards

    Tapan Thapa

     

  2. Anonymous

    Hello Nitai,

    removefolder method is also returning below error however folder gets deleted from razuna dam.

    {"message":"The value returned from function removefolder() is not of type string","errorcode":"errorCode.runtimeError","detail":"Function: removefolder"}

    Please suggest.

    Regards

    Tapan Thapa

  3. It pays out to have early access to builds (smile) Sorry about that, must have been the late night codings... All fixed and available in Github.

  4. Anonymous

    setfolder method of folder api2 is now throwing below error on test server:

    API Called:

    http://192.168.71.132:8080/razuna/global/api2/folder.cfc?method=setfolder&api_key=82B39A73A1C14B9A859FD265EC45BCED&folder_name=test

    Error:

    {"message":"application.razuna.api.userid[82B39A73A1C14B9A859FD265EC45BCED] doesn't exist.","errorcode":"","detail":"Error at line 1, column 31"}

    Please suggest.

    Regards

    Tapan Thapa

     

    1. hmhmhmh..... I changed it quickly. Do a update (you don't need to flush cache)

  5. Anonymous

    Hi, method removefolder send me this error:

    {"message":"application.razuna.setid doesn't exist.","errorcode":"","detail":"Error at line 1, column 1"}

    can you help me ??

    1. Strange... nevertheless, I set the variable now. If you are on github do an update. The hosted platform has also been updated.

      Thank you for reporting this and making Razuna better.