Created by: Daniel Nikolov on 06-09-2012 11:51:16 AM Hello guys, I need help with the following problem: Need to retrieve all posts in specific community containing tag = 'XXXX'. I checked the Quad REST API documentation for any clues but I could find only how to retireve posts in specific community (without filtering by tag's name) or how to retrieve posts with specific tag's name (but without filtering by community). Can anyone help ? BR, Daniel
Subject: RE: Need to retrieve posts count with tag = 'XXX' in a specific community Replied by: Adrienne Moherek on 12-09-2012 02:23:22 PM Hi Daniel,
You can use the search API with filterBy and filterValue parameters to get the specific posts you want. Here is an example: http://<quad-server>/api/quad/rest/search?q=tag:idea&filterBy=communities&filterValue=2210355&filterBy=information&filterValue=post
In the above example, the tag we are searching for is idea. We are filtering this search to only look in a community with community id 2210355. We are adding another filter to search for only posts in that community.
Subject: RE: Need to retrieve posts count with tag = 'XXX' in a specific community Replied by: Adrienne Moherek on 18-09-2012 06:00:47 PM Hi Daniel,
You will have to retrieve the like and favorite data in a separate call.
After you have retrieved the data from your GET request, you will have to parse through the data to retrieve the post IDs.
Then you will have to create another request with the post IDs. Here is an example:
STEP 1: GET http://<server>/api/quad/rest/search?q=tag:idea&filterBy=communities&filterValue=2210355&filterBy=information&filterValue=post
STEP 2: Parse the response to get the post IDs
STEP 3: GET http://<server>/api/quad/rest/posts/1400001,1200008?meta=favorite,like where 1400001 and 120008 are post IDs
The response will provide you the information for like and favorite for each post listed.
Thanks, Adrienne
Subject: RE: Need to retrieve posts count with tag = 'XXX' in a specific community Replied by: Adrienne Moherek on 18-09-2012 06:25:48 PM Hi Daniel,
Using this will only show the like and favorites in relation to whichever user you are logged in as in the authentication of the API. http://<server>/api/quad/rest/posts/1400001,1200008?meta=favorite,like This means that if 5 other people like 1400001, you will not know who these 5 other people are. The response will only show your like or favorite status, not anyone else's status.
Subject: RE: Need to retrieve posts count with tag = 'XXX' in a specific community Replied by: Daniel Nikolov on 18-09-2012 06:05:09 PM Hi, Thanks about this info. I thought that only one Post ID was allowed to be provided ?
What is better: use the described approach, or use the following API calls:
Subject: RE: Need to retrieve posts count with tag = 'XXX' in a specific community Replied by: Daniel Nikolov on 19-09-2012 01:02:33 AM Thanks, I will use the second approach because it will provide list of likes/favorites for all users, not only for the authorized one. Just one more question - what is the mechanism to obtain the user's image located on the left side on each post in Streams portlet ? For example we have 4 different post authors and I need to retrieve the image url for each of them. I detected image url like this: /image/user_portrait?img_id=210132&t=1343073520795 but not sure how to obtain these id values and what they mean. Any idea ?
Thanks, Daniel
Subject: RE: Need to retrieve posts count with tag = 'XXX' in a specific community Replied by: Adrienne Moherek on 19-09-2012 06:19:30 PM Hi Daniel,
You will have to parse the response for the URL of the image.
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: