Creating a folder
Added by IBM contributorIBM | Edited by IBM contributorElizabeth Bowling on November 9, 2015
Rate this article 1 starsRate this article 2 starsRate this article 3 starsRate this article 4 starsRate this article 5 stars

Create a file folder.
Provide an Atom document representation of a file folder to output an Atom document representation of the new file folder.

Authentication

This method requires authentication. In order to create a folder, the current user must be authenticated.

External users cannot create public folders in Connections.

Input
Method URI Description
POST /files/{auth}/api/collections/feed Creates a file folder.
Content Type: application/atom+xml
Sample Request:
<?xml version="1.0" encoding="UTF-8"?>



<entry 

 xmlns="http://www.w3.org/2005/Atom" 

 xmlns:app="http://www.w3.org/2007/app" 

 xmlns:snx="http://www.ibm.com/xmlns/prod/sn">


<category scheme="tag:ibm.com,2006:td/type" term="collection" label="collection"/>
<title type="text">FolderTest1</title>

</entry>
Name Type Optional Description
auth
enumerated No The authorization protocol being used by your application to access Connections Cloud.
Authorized values:
  • basic
  • oauth
Name Type Optional Description
label
string No String that uniquely identifies the collection. String must be a valid cross platform filename.
NOTE: title and label cases and their respective results are as follows
title = NOT null
label = NOT null
result: title = title and label = label

title = null
label = NOT null
result: title = label

title = NOT null
label = null
result: label = title

title = null
label = null
result: 400 Invalid Request is thrown
title
string No NOTE: title and label cases and their respective results are as follows
title = NOT null
label = NOT null
result: title = title and label = label
title = null
label = NOT null
result: title = label
title = NOT null
label = null
result: label = title
title = null
label = null
result: 400 Invalid Request is thrown
summary
string Yes String.
visibility
enumerated Yes String. Specify the visibility of the folder.
Default value is private.
Authorized values:
  • private
  • public
  • null
makeUnique
enumerated Yes Boolean. If there is a label conflict, and if you specify true, numbers (eg: "_1,_2...") automatically be added to conflicting labels.
Authorized values:
  • true
  • false
filesAddedNotification
enumerated Yes String. Default value is on.
Authorized values:
  • on
  • off
favorite
enumerated Yes String. Flag to indicate if this collection will be added into favorites.
Default value is false.
Authorized values:
  • true
  • false
includeAncestorys
enumerated Yes String. Specify whether to return ancestors of the folder after creation.
Default value is false.
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
Content Type: application/atom+xml
Code Description
201
Created. Indicates that the collection entry was successfully created. If an error occurs, this header will contain one of the error codes below.
400
Bad Request.
401
Unauthorized.
403
Forbidden. Returned when the cause of an error is due to a permission restriction.
404
Not Found. Returned when the cause of an error is unknown.
Examples
POST /files/basic/api/collections/feed?title=testCreateCollectionWithRoles_contributor_1436163654913&label=testCreateCollectionWithRoles_contributor_1436163654913_LABEL&summary=testCreateCollectionWithRoles_contributor_1436163654913_Summary&visibility=public HTTP/1.1

Content-Type: application/atom+xml

Response returned by the server
<entry xmlns:td="urn:ibm.com/td" xmlns="http://www.w3.org/2005/Atom" xmlns:opensearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:snx="http://www.ibm.com/xmlns/prod/sn" xmlns:thr="http://purl.org/syndication/thread/1.0">
   <id>urn:lsid:ibm.com:td:7e46ec9b-75c7-48bc-b54c-b3fdb7f2e79f</id>
   <td:uuid xmlns:td="urn:ibm.com/td">7e46ec9b-75c7-48bc-b54c-b3fdb7f2e79f</td:uuid>
   <td:label xmlns:td="urn:ibm.com/td">testCreateCollectionWithRoles_contributor_1436163654913_LABEL</td:label>
   <snx:rank xmlns:snx="http://www.ibm.com/xmlns/prod/sn" scheme="http://www.ibm.com/xmlns/prod/sn/item">0</snx:rank>
   <snx:rank xmlns:snx="http://www.ibm.com/xmlns/prod/sn" scheme="http://www.ibm.com/xmlns/prod/sn/collections">0</snx:rank>
   <snx:rank xmlns:snx="http://www.ibm.com/xmlns/prod/sn" scheme="http://www.ibm.com/xmlns/prod/sn/user">0</snx:rank>
   <snx:rank xmlns:snx="http://www.ibm.com/xmlns/prod/sn" scheme="http://www.ibm.com/xmlns/prod/sn/group">1</snx:rank>
   <link href="https://filesvm004.cn.ibm.com:9443/files/basic/api/collection/7e46ec9b-75c7-48bc-b54c-b3fdb7f2e79f/entry" rel="self"></link>
   <link href="https://filesvm004.cn.ibm.com:9443/files/app/folder/7e46ec9b-75c7-48bc-b54c-b3fdb7f2e79f/" rel="alternate" type="text/html"></link>
   <link href="https://filesvm004.cn.ibm.com:9443/files/basic/api/collection/7e46ec9b-75c7-48bc-b54c-b3fdb7f2e79f/entry" rel="edit"></link>
   <link href="https://filesvm004.cn.ibm.com:9443/files/basic/api/collection/7e46ec9b-75c7-48bc-b54c-b3fdb7f2e79f/feed" rel="files"></link>
   <category term="collection" scheme="tag:ibm.com,2006:td/type" label="collection"></category>
   <author>
      <name>Liz Schonfeld</name>
      <snx:userid xmlns:snx="http://www.ibm.com/xmlns/prod/sn">lschonfeld</snx:userid>
      <email>lschonfeld@renovations.com</email>
      <snx:userState xmlns:snx="http://www.ibm.com/xmlns/prod/sn">active</snx:userState>
   </author>
   <td:modifier xmlns:td="urn:ibm.com/td">
      <name>Liz Schonfeld</name>
      <snx:userid xmlns:snx="http://www.ibm.com/xmlns/prod/sn">lschonfeld</snx:userid>
      <email>lschonfeld@renovations.com</email>
      <snx:userState xmlns:snx="http://www.ibm.com/xmlns/prod/sn">active</snx:userState>
   </td:modifier>
   <title type="text">testCreateCollectionWithRoles_contributor_1436163654913</title>
   <published>2015-07-06T06:21:01.402Z</published>
   <updated>2015-07-06T06:21:01.418Z</updated>
   <td:created xmlns:td="urn:ibm.com/td">2015-07-06T06:21:01.402Z</td:created>
   <td:modified xmlns:td="urn:ibm.com/td">2015-07-06T06:21:01.402Z</td:modified>
   <summary type="text">testCreateCollectionWithRoles_contributor_1436163654913_Summary</summary>
   <td:visibility xmlns:td="urn:ibm.com/td">public</td:visibility>
   <td:type xmlns:td="urn:ibm.com/td">personal</td:type>
   <content type="application/atom+xml" src="https://filesvm004.cn.ibm.com:9443/files/basic/api/collection/7e46ec9b-75c7-48bc-b54c-b3fdb7f2e79f/feed"></content>
   <snx:isExternal xmlns:snx="http://www.ibm.com/xmlns/prod/sn">false</snx:isExternal>
   <td:allowSetFavorite xmlns:td="urn:ibm.com/td">true</td:allowSetFavorite>
   <td:allowFollowing xmlns:td="urn:ibm.com/td">true</td:allowFollowing>
</entry>