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... 

  • 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

  • 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!

      • cike's avatar
        cike
        Champion

        Inactive User it seems you need to specify the "q" and "f" parameter to get label or tag queries to work:

         https://community-stage.jmp.com/restapi/vc/search/messages?q=January&f=tags

        Tested this with the label parameter in one of our environments and it works.

        I think you can concat different filters and search parameter strings, too. Maybe this little piece of the Lihium Docs helps. :)