cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
130
Views
0
Helpful
0
Comments
cdnadmin
Level 11
Level 11
This document was generated from CDN thread

Created by: Daniel Nikolov on 14-09-2012 10:54:51 AM
Hello all,
Does anyone know how to add "favorite"/"like"/"share"/"comment" for existing post ?
I tried searching through the rest api but there is no information about this.
Also using hook portlets is not an option because it's too risky. We are trying to implement it using custom html design and javascript code. but I could not find much information how to do it.
Can anyone help ?

Subject: RE: Modifying existing post - add "favorite", "watch", "like"  programmatic
Replied by: Amanda Whaley on 14-09-2012 11:24:10 AM
Hi Daniel -

You can create a favorite relationship with a post by using the following REST api:

POST http://webexsocialserver/api/quad/rest/users/@me/favorite
Accept:application/json
content-type: json
{   "destination": {
"id": "123",
"resource": "http://quad.cisco.com/schema/1.0/post"
}
}

The id in the Request body is the ID of the post you want to favorite.

You can read more about this operation here : http://www.cisco.com/en/US/docs/collaboration/ecp/api/3_0/ref_guide/user_operations.html#wp1884018

You can comment on a post by using this api:
Request

POST http://webexsocialserver/api/quad/rest/posts/400006/comments

Accept:application/json

Content-Type: application/json

{
    "body":"New Comment"

}

You can read more about this here: http://www.cisco.com/en/US/docs/collaboration/ecp/api/3_0/ref_guide/post_operations.html#wp1091378

To share a post, you use the update a post API, and update the permissions on the post.  You can see an example here:
http://developer.cisco.com/webexsocial/webexsocial-api-examples/post.html#sharePost

hope that helps -
Amanda Whaley

Subject: RE: Modifying existing post - add "favorite", "watch", "like"  programmatic
Replied by: Daniel Nikolov on 16-09-2012 02:44:29 PM
Thanks a lot, Amanda.

Subject: RE: Modifying existing post - add "favorite", "watch", "like"  programmatic
Replied by: Daniel Nikolov on 17-09-2012 01:37:33 AM
Hmm, I tried the rest call with Firefox REST client and it raises the following error:

<ns2:response>
<statusCode>500</statusCode>
<startIndex>0</startIndex>
<itemsPerPage>0</itemsPerPage>
<totalResults>0</totalResults>
<filtered>false</filtered>
<sorted>false</sorted>
<serverMessages>
<code>QUAD-500</code>
<description>Internal server error</description>
<message>Error: could not match input</message>
</serverMessages>
</ns2:response>

I'm using it with Basic Authentication and Content-Type: application/json.
My input is:

{ destination:
{
  "id": 500002,
"resource": "http://quad.cisco.com/schema/1.0/post"
}
}

Can you provide any clues ?

Subject: Re: New Message from Daniel Nikolov in WebEx Social Developer - API/SDK: RE
Replied by: Amanda Whaley on 17-09-2012 11:20:00 AM
Can you please post the complete raw request?

thanks
Amanda Whaley
amwhaley@cisco.com<mailto:amwhaley@cisco.com>
Cisco Developer Services


On Sep 17, 2012, at 12:37 AM, Cisco Developer Community Forums wrote:

Daniel Nikolov has created a new message in the forum "API/SDK":

--------------------------------------------------------------
Hmm, I tried the rest call with Firefox REST client and it raises the following error:

<ns2:response>
<statusCode>500</statusCode>
<startIndex>0</startIndex>
<itemsPerPage>0</itemsPerPage>
<totalResults>0</totalResults>
<filtered>false</filtered>
<sorted>false</sorted>
<serverMessages>
<code>QUAD-500</code>
<description>Internal server error</description>
<message>Error: could not match input</message>
</serverMessages>
</ns2:response>

I'm using it with Basic Authentication and Content-Type: application/json.
My input is:

{ destination:
{
"id": 500002,
"resource": "http://quad.cisco.com/schema/1.0/post"
}
}

Can you provide any clues ?
--
To respond to this post, please click the following link:

<http://developer.cisco.com/web/webexsocial-developer/forums/-/message_boards/view_message/6505515>

or simply reply to this email.

Subject: RE: Modifying existing post - add "favorite", "watch", "like"  programmatic
Replied by: Daniel Nikolov on 18-09-2012 01:48:43 AM
Hi Amanda,
My request is:

Request headers:
   Http Basic Authentication with Base64 encoded username:password
   Content-Type: application/json

Data:
{
    destination:  {
                            "id": 500002,
                            "resource": "http://quad.cisco.com/schema/1.0/post"
    }
}

and II got the following response:

<ns2:response>
  <statusCode>500</statusCode>
  <startIndex>0</startIndex>
  <itemsPerPage>0</itemsPerPage>
  <totalResults>0</totalResults>
  <filtered>false</filtered>
  <sorted>false</sorted>
  <serverMessages>
    <code>QUAD-500</code>
    <description>Internal server error</description>
    <message>Error: could not match input</message>
  </serverMessages>
</ns2:response>

Can you help with this ?

PS: I asked similar questions about other operations too - Favorite, Like, Comment, Share. Watch:
Post operations - Like, Favorite, Watch, Comment, Share

Thanks,
Daniel

Subject: RE: Modifying existing post - add "favorite", "watch", "like"  programmatic
Replied by: Amanda Whaley on 26-09-2012 01:22:43 PM
Daniel -
Are you still having trouble with this or did the answer to the login question help resolve this one also?
Thanks -
Amanda Whaley
Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Quick Links