Community articleCreating a subfolderSince V5.5
Added by IBM contributorElizabeth Bowling | Edited by IBM contributorElizabeth Bowling on September 17, 2015
Rate this article 1 starsRate this article 2 starsRate this article 3 starsRate this article 4 starsRate this article 5 stars

This API creates a new subfolder within an existing folder.
You can create the subfolder within a folder or in within a folder contained in the user's My File Sync.

This API requires authentication.
Input
Method URI Description
POST /files/{auth}/api/collection/{collection-id}/feed Create a new subfolder within the specified parent folder.
POST /files/{auth}/api/myfilesync/collection/{collection-id}/feed Create a subfolder within the specified folder in the user's My File Sync.
Content Type: application/atom+xml
Name Type Optional Description
auth
enumerated No The authorization protocol which is being used.
Authorized values:
  • basic
  • oauth
collection-id
string No The UUID of the parent folder to which the new subfolder will be added.
Name Type Optional Description
label
string No A string that uniquely identifies the folder and is valid across platforms.
title
string No
summary
string Yes
makeUnique
enumerated Yes Automatically append a number to the Label (the folder name) to prevent a conflict with an existing folder of the same name. For example, if you create folder called "Resumes" and a folder with that name already exists, the makeUnique parameter causes "_1" to be added to the folder name (Resumes_1) to prevent a collision.
Authorized values:
  • true
  • false
modified
int Yes The date you want posted as the 'changed' date on the new folder. Specify the date as the number of milliseconds since January 1, 1970, 00:00:00 GMT time. If you do not specify a date, the current time on the server will be used.
created
int Yes The date you want posted as the 'created' date on the new folder. Specify the date as the number of milliseconds since January 1, 1970, 00:00:00 GMT time. If you do not specify a date, the current time on the server will be used.
includeAncestors
enumerated Yes String. Indicates whether the response should list the ancestors of the new folder, so that you can confirm the path.
Authorized values:
  • true
  • false
Name Type Optional Description
Authorization
enumerated No The authentication mechanism selected by your application to access the API.
Basic is the Base64 encoding of the IBM Connections Cloud username and password: Base64(username:password). For example, Base64(twatson@us.ibm.com:password).
Bearer is the oauth 2.0 access token that is generated when the user grants your application access to IBM Connections Cloud services.
See the reference topic "OAuth 2.0 APIs for web server flow" for more information.
Authorized values:
  • bearer
  • basic
Output
Code Description
500
Internal server error. The server encountered an unexpected condition that prevented it from fulfilling the request. Returned when the cause of the error is unknown.
=============
Response body
=============
<td:error xmlns:td="urn:ibm.com/td">
<td:errorCode>Unknown</td:errorCode>
<td:errorMessage>Error: TimedOut</td:errorMessage>
</td:error>
401
Unauthorized. Returned when no authenticated user or no userid, email, or key parameter are provided on the request.
201
The folder was successfully created.
404
The specified parent folder was not found, so the subfolder could not be created.
=============
Response body
=============
<td:error xmlns:td="urn:ibm.com/td">
<td:errorCode>ItemNotFound</td:errorCode>
<td:errorMessage>Collection not found with id 727505c1-011e-4165-b675-9d1985a95182-a</td:errorMessage>
</td:error>
409
The folder could not be created due to a conflict with an existing resource. Include the makeUnique parameter in your query to ensure a unique folder name.
=============
Response body
=============
<td:error xmlns:td="urn:ibm.com/td">
<td:errorCode>ItemExists</td:errorCode>
<td:errorMessage>EJPVJ9921E: Unable to add a collection.</td:errorMessage>
</td:error>
400
Bad Request. No label or title parameter was included in the query, so no name was specified for the folder (and a folder cannot be created without a name). If you are adding a folder in File Sync, this error might indicate that the specified parent folder does not exist.
=============
Response body
=============
<td:error xmlns:td="urn:ibm.com/td">
<td:errorCode>ConstraintViolation</td:errorCode>
<td:errorMessage>EJPVJ9921E: Unable to add a collection.</td:errorMessage>
<td:constraintViolation>
<td:field>TITLE</td:field>
<td:issue>VALUE_NOT_WITHIN_RANGE</td:issue>
<td:expected>&gt; 1 &amp;&amp; &lt;= 256</td:expected>
</td:constraintViolation>
<td:constraintViolation>
<td:field>LABEL</td:field>
<td:issue>VALUE_NOT_WITHIN_RANGE</td:issue>
<td:expected>&gt; 1 &amp;&amp; &lt;= 252</td:expected>
</td:constraintViolation>
</td:error>