Forum Discussion

cblown's avatar
cblown
Boss
13 years ago

Query Custom Tags

Hey

 

We are looking into quering Custom Tags and we have this call working

 

/restapi/vc/posts/for/metadata/key/modbar.negativecomment/value/true/count

 

However we'd like to query this count between two dates. So we tried using the Search Rest API - as this offers date quering - but we can't get any data. (while logged in with an Admin role)

 

/restapi/vc/search/messages?metadata_search=true&admin_tags=modbar.negativecomment&search_type=thread&filter=adminTags

 

The above query string does work in Moderation Manager > Custom Tags and interestingly the Subscribe to RSS feed function doesn't work either (?)

 

We were hoping to use this as described here

 

date:[1341341612 TO 1341946412]

 

Any suggestions?

4 Replies

  • AdamN's avatar
    AdamN
    Khoros Oracle
    13 years ago

    While you can use the same parameters from the message search in the UI with the message search in the REST API, the same is not necessarily true for the custom tags search since these are two separate searches. 

     

    However, it is possible to include metadata as part of the REST API message search... You can include it as part of the q parameter in the format "key:value". For example:

    /search/messages?q=modbar.negativecomment:true

     

    From there you can add in other search criteria (such as date).

     

     

  • cblown's avatar
    cblown
    Boss
    13 years ago
    Thanks we'll run some tests and get back here with the results
  • cblown's avatar
    cblown
    Boss
    13 years ago

    /search/messages?q=modbar.negativecomment:true

    this one works (for Attribute Tag)

     

    But I have a problem with List Tag (another type of Custom Tag).

    /search/messages?q=modbar.comment:negative

    /search/messages?q=modbar.comment: positive

    These two don't seem to work if I set up Custom Tag as List Tag.

     

     

  • AdamN's avatar
    AdamN
    Khoros Oracle
    13 years ago

    Hmmm... There's an alternate method for specifying metadata criteria when searching that might work better with list tags. You can specify the name of the metadata field as a query string parameter, and the value of the metadata as the value of that parameter. For example:

     

    /restapi/vc/search/messages?q=date:[1341341612 TO 1341946412]&modbar.comment=negative