Unliking a blog posting
Added by IBM contributorIBM on March 25, 2013
Rate this article 1 starsRate this article 2 starsRate this article 3 starsRate this article 4 starsRate this article 5 stars

No abstract provided.


If you have already liked a blog posting, you can unlike it by sending a request to the web address of the collection categorized by term unrecommend for the blog posting.

See Authenticating requests for information about how to authenticate the request.

Table 1. Atom API request details
Method
Resource
URI
Input representation
DELETE
None
Value of the href attribute of the <app:collection> element that has a child <title> element with a value of Recommendations in the blog entry.
None



To unlike a blog entry, complete the following steps:
  1. You can only unlike an entry you liked before. To find out whether you have already liked an entry, retrieve a list of the people who have liked the entry and see if your name is included. See Getting a list of recommenders for more details. Alternatively, complete the following steps:
    1. Retrieve an entries feed that contains the entry. See Getting a feed of the latest posts added to all blogs or Getting a feed of recent posts for a blog for more information.
    2. Find the collection element categorized by term recommend for the entry, and then look for a <app:accept/> element. If this element is present, you have already liked this entry and cannot do so again. If no <app:accept/> is present, you have liked the entry yet. For example, the collection categorized by recommend for an entry that you have liked would appear as follows:
    3. <app:collection 
       href="https://enterprise.example.com:9444/blogs/amyblog/api/recommend/entries/
       1fa2dae3-f0af-457c-bfe7-eec0f5f01833?lang=en_us"> 
        <title type="text">Likes</title> 
        <category 
         scheme="http://www.ibm.com/xmlns/prod/sn/collection" 
         term="recommend" /> 
        <app:categories fixed="yes" /> 
      	  <app:accept />
      </app:collection> 

  2. To unlike the entry, send an empty DELETE request to the web address listed as the href of the app:collection.

Input

None.

Output

None.

Returned HTTP Header

HTTP/1.1 200 OK
Indicates that the recommendation was successfully deleted. If an error occurs, this header contains one of the error codes.
Error codes
  • HTTP/1.1 401 Unauthorized
  • HTTP/1.1 403 Forbidden: The user haven't liked this entry.
  • HTTP/1.1 404 Not Found: Either the weblog or the entry is not found.

Parent topic: Working with recommendations ic45Create New Article

Related reference
Getting a list of recommenders ic45Create New Article
Getting a feed of the latest posts added to all blogs ic45Create New Article
Getting a feed of recent posts for a blog ic45Create New Article