Forum Discussion

Inactive User's avatar
Inactive User
6 years ago

API V1 equivalent for IN(x,y,z) and MATCHES(x y z)

Trying to find it in the documentation; unable.

I'd like to create a V1 query that has multiple IN values, i.e., in V2, it would be:

WHERE id MATCHES ("alpha beta gamma")

or 

WHERE id IN('1','2','3')

I saw something like this but I can't find it again in the documentation, which is frustrating

/restapi/vc/boards/id/discussions/tagging/tags/id/IN=1,2,3

 

Specifically, I want to make an API V1 call for multiple labels or tags

Thanks!

Note: I can't even find the IN and MATCHES in V2 anywhere in the V2 documentation even though I know it exists... 

  • Inactive User - This call might be helpful. 

     

    https://community.com/restapi/vc/search/messages?q=tags:(tag1%20AND%20tag2)%20AND%20is_root:true%20AND%20board_id:baord-id&sort_by=-topicPostDate
    • Inactive User's avatar
      Inactive User

      TariqHussain  and cike thanks, however, this only returns an empty set using tags or labels, and I know there are messages with these tags in there ... https://community-stage.jmp.com/restapi/vc/search/messages?q=tags:("January")%20AND%20is_root:true%AND%20board_id:angular-test&sort_by=-topicPostDate 

      <response status="success">
      <messages/>
      </response>

       I don't see where you're getting :tags or nearly any of this query. Please help me locate it in the documentation. I can't find anything related to :tags or /search/ or ?q ... How do you find that? Thanks!

      I don't see anything labeled "constraints" either, so cike I appreciate your description but it makes no sense to me given the documentation. Can you give me some links that pertain to what you're talking aobut? 

      SuzieH, this documentation needs more examples on each section, and a clearer navigation. I'm confused and as you know I've been working with V2 for 2+years but can't make sense of this V1 API or its documentation. Thanks!

      • SuzieH's avatar
        SuzieH
        Khoros Alumni (Retired)

        Hi Inactive User. Have you seen the WHERE Clause section under  Using LiQL? We have several examples of MATCHES in there. That doc is pretty light with regard to IN(). Let me know if that gets you closer to what you need?

        I've also got this TKB article. It tries to walk through what you can achieve with V1 and V2 search, where they overlap, and where you need to use one or the other. 

        I'm going to ask your question around the office here as well, but hopefully one of the Lithosphere members can help in the meantime.

  • Hi Inactive User,

    the operators "IN" and "MATCHES" are only available in APIv2 and can't be used in APIv1 calls. But as TariqHussain mentioned in his post, you can use the search route of APIv1 and add tags in the query parameter.

    You won't find a specific documentation for the operators which can be used with APIv2 queries. But you can check the single resource documentations and read the constraints section. There you find all available operators  for each property.

     

    Regards,

    Christian