Sharing a file with a community or communities
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

Share a file with a community or multiple communities.
{document-id} is the value of the <td:uuid> or <td:label> elements in the file's Atom entry document.


Provide one of the following input types:

  • Community Atom entry document that defines the community with which you want to share the file.
  • Communities feed in which each entry identifies one of the communities with which you want to share the file.

Authentication 

This method requires authentication. In order to add an Item to a community, the currently authenticated user must be the owner or a member of the community, or an administrator.

Input
Method URI Description
POST /files/{auth}/api/myuserlibrary/document/{document-id}/feed Adds a file to the specified community.
POST /files/{auth}/api/library/{library-id}/document/{document-id}/feed Share the document with the communities specified by Atom entry or feed.
POST /files/{auth}/api/userlibrary/{user-id}/document/{document-id}/feed Share the document with the communities specified by Atom entry or feed.
POST /files/{auth}/api/document/{document-id}/feed Share the document with the communities specified by Atom entry or feed.
Content Type: application/atom+xml
Sample Request:
<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<entry>
<category term="community" label="community" scheme="tag:ibm.com,2006:td/type"/>
<itemId xmlns="urn:ibm.com/td"> -COMMUNITY ID HERE- </itemId>
</entry>
</feed>
Name Type Optional Description
document-id
string No {document-id} is the value of the <td:uuid> or <td:label> elements in the file's Atom entry document.
auth
enumerated No The authorization protocol being used by your application to access Connections Cloud.
Authorized values:
  • basic
  • oauth
Name Type Optional Description
identifier
string Yes Indicates how the document is identified in the {document-id} variable segment of the web address. By default, look up is performed with the expectation that the URL contains the value from the <td:uuid> element of a file Atom entry. Options are uuid and label . Specify label if the URL instead contains the value from the <td:label> element of a file Atom entry.
Name Type Optional Description
Content-Type
string Yes Used to specify the mime type for the content being sent to the server.
Content-Language
string Yes Specifies the language of the content being sent to the server. All contents are handled using UTF-8 encoding on the server.
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
204
Indicates that the file was successfully shared. If an error occurs, this header contains one of the error codes.
401
Unauthorized.
403
Forbidden.
404
Not Found.
409
Conflict.