putdir (Modify directory information)

The putdir transaction modifies the meta information for a directory (folder).

Query string

The query string in the HTTP header must contain the following parameters:

api
Specify the name of the API transaction.
apiversion
Specify the version of the API that should handle the requested transaction.

For the most up-to-date version, use apiversion=3.

uid
Specify a valid 1010data user name.
pswd
Specify a valid password for the 1010data user name provided to the uid parameter.
Note: The pswd value should be the encrypted password returned from the login transaction.
sid
The session ID for the current API session.

This value is returned by the login transaction and must be provided to every transaction (except login).

kill (optional)
Valid values for kill are as follows:
yes
Terminate the existing session and start a new one.
no
Do not terminate the existing session.

If no session exists, a new one will be created. If a session does exist, an error is returned.

Note: If kill=no and a session is active, the system returns an error.
possess
Log in and possess the existing session.
auth
Authenticate with the system but do not kill, possess, or start any session.

The default is yes.

XML Input to Server

The input specification must contain the following elements:

<dir>
Contains data about parent and/or child objects in a directory.
Include the following attributes with the <dir> element:
Note: Any attributes that are omitted will not be modified.
Note: You must specify both the directory name and the directory ID to modify directory metadata. If either piece of information is omitted an error is returned.
id
The unique identification number for the directory, table, or query. The ID is an integer.
name
The full path to the table, directory, or query to which the metadata belongs.
title
The title, or label, of the directory, table, or query.
sdesc
The short description of the directory, table, or query.
ldesc
The long description of the directory, table, or query.
secure
Returns 1 if the directory, table, or query is marked as "secure" and 0 if it is not marked as "secure".
Note: This metadata element is still returned but has been deprecated.
users
A space-separated list of users and groups whom are allowed to access this directory, table, or query.
owner
The owner of the directory, table, or query.
gif
Returns the location of the gif file to be used to display the directory, table, or query in the UI.
uploaders
Space-separated list of users and groups who have permission to create tables or directories inside the directory.

XML response from server

A successful response from the server contains the following elements:

<rc>
The return code generated by the transaction. For a list of return codes, see Return codes.
<msg>
The message returned by the system. Specific messages correspond to specific return codes.
<dir>
Contains data about parent and/or child objects in a directory.

The directory metadata is returned as a series of attributes contained within the <dir> element. The attributes are as follows:

Query string example

https://www2.1010data.com/gw.k?api=putdir&apiversion=3&uid=$UID&pswd=$PSWD&sid=$SID

XML input example

<in>
  <dir id="3353015" name="certification" sdesc="Data for the 1010data certification program"/>
</in>

XML response example

A successful putdir produces the following result, based on the input example:

<out>
    <rc>0</rc>
    <msg>putdir successful</msg>
    <dir id="3353015" name="certification" title="Certification" 
    sdesc="Data for the 1010data certification program" ldesc="" type="DIR" secure="0" own="1" 
    owner="certification_admin" upload="1" update="2015-09-29 10:15:17" gif="" 
    users="certification_admin rd_kdasika cp_training_users cp_training_trainers interns_2015 brausj 
    abogdan rd_jsigler retaildemo_analian" uploaders="certification_admin" numchild="10"/>
</out>