Recommending a File
Added by IBM contributorPaul Bastide | Edited by Claudia R Elbourn on July 21, 2015
Rate this article 1 starsRate this article 2 starsRate this article 3 starsRate this article 4 starsRate this article 5 stars

You can use the Files API with the POST method to recommend a file.

Recommending a file prompts and acknowledges the file's social value.

Input
Method URI Description
POST /files/{auth}/api/{library}/{library-id}/{document-id}/feed The pattern for managing file recommendations.
Name Type Optional Description
auth
enumerated No The pattern is either basic or oauth, and the pattern should match the authorization protocol that you use.
Authorized values:
  • basic
  • oauth
library
enumerated No The library that you use.
Authorized values:
  • library
  • userlibrary
library-id
string No The ID of your library, or the userid
document-id
string No The ID of the document-id.
Name Type Optional Description
X-Update-Nonce
string No The nonce value.
Output
Code Description
201
The recommendation is created for the file
401
Unauthorized. Returned when no authenticated user or no userid, email, or key parameter are provided on the request.
500
Internal server error. The server encountered an unexpected condition that prevented it from fulfilling the request.
403
Forbidden. The server refuses to fulfill a request, typically because the request was for an object that you don't have permission to access.
400
Bad Request. Returned when the nonce is omitted from the request.
Examples
Demonstrates recommending a file (receives a 201 back)
<!--
Example Curl Call
curl -X POST -u "demo@bluebox.lotus.com:passwordisnotreal" \
     -H "Content-Type: application/atom+xml" \
     -H "X-Update-Nonce: 215398dd-5365-442a-bba8-ed05719395bc" \
     --data "<?xml version=\"1.0\" encoding=\"UTF-8\"?><entry xmlns=\"http://www.w3.org/2005/Atom\"><category term=\"recommendation\" scheme=\"tag:ibm.com,2006:td/type\" label=\"recommendation\"/></entry>" "https://{server}/files/basic/api/userlibrary/20000395/document/aca70bd1-0925-42c1-8196-b1c3042178a6/feed" 
--!>
<?xml version="1.0" encoding="UTF-8"?>
<entry xmlns="http://www.w3.org/2005/Atom">
	<category term="recommendation" scheme="tag:ibm.com,2006:td/type" label="recommendation"/>
</entry>

Response returned by the server
<entry 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:td="urn:ibm.com/td" xmlns:thr="http://purl.org/syndication/thread/1.0">
  <id>urn:lsid:ibm.com:td:1c68f928-6c46-411d-a1c3-454b298aa13c;b71caa0e-15e3-482d-98c0-d95f278dbb7d</id>
  <td:uuid>1c68f928-6c46-411d-a1c3-454b298aa13c;b71caa0e-15e3-482d-98c0-d95f278dbb7d</td:uuid>
  <link
    href="https://filesvm004.cn.ibm.com:9443/files/form/api/library/ee1289fb-c515-48be-b451-d5d6e99c107a/document/1c68f928-6c46-411d-a1c3-454b298aa13c/recommendation/aalain/entry" rel="self"/>
  <link
    href="https://filesvm004.cn.ibm.com:9443/communities/service/html/communityview?communityUuid=c27edb2c-1957-4928-bff6-ce9a3149ec43#fullpageWidgetId=W02f00f8d4c0d_4ff9_abaa_b0c97c58f06d&amp;file=1c68f928-6c46-411d-a1c3-454b298aa13c"
    rel="alternate" type="text/html"/>
  <category label="recommendation" scheme="tag:ibm.com,2006:td/type" term="recommendation"/>
  <author>
    <name>Amadou Alain</name>
    <snx:userid>aalain</snx:userid>
    <email>aalain@renovations.com</email>
    <snx:userState>active</snx:userState>
  </author>
  <title type="text">Amadou Alain recommended CodeFormatting.xml</title>
  <updated>2015-06-29T12:26:09.983Z</updated>
</entry>