Forum Discussion

PatoSalazar's avatar
9 years ago

URL QUERY BUILD V2

Hi, 

 

I am trying to build a url that fetches SELECTS everything FROM messages WHERE subject MATCHES the word pay AND depth=0 and language='FR'

 

This is what I have but gives me a 604 error. If you take the last part   +AND+language%3D'FR' it works correctly.

 

 

 $url = "https://api.lithium.com/community/2.0/tenantID/search?q=SELECT+*+FROM+messages+WHERE+subject+MATCHES+'pay'+AND+depth%3D0+AND+language%3D'FR'&api.pretty_print=true";

 

I just can't add a second parameter to the where clause. Also I have not found in the docs and exhaustive tutorial in how to build this https request. If there is a tutorial around that I have not seen that would be great. Thanks!

 

  • Hi PatoSalazar,

     

    Your query below doesn't work because we do not support a filter for language in LiQL.  Most of our customers usually have one community for each language or they have a particular board or category set up for a particular language.

     

    In case where you have a community set up in a particular language, you can just do 

    select * from messages where subject matches 'pay' and depth=0

    In case when you have a board/category set up in a particular language, you can do 

    select * from messages where subject matches 'pay' and depth=0 and board.id ='test'
    
    select * from messages where subject matches 'pay' and depth=0 and category.id = 'test'

    Hope this helps.

     

    Regards,
    Chhama

  • ChhamaJ's avatar
    ChhamaJ
    Khoros Staff

    Hi PatoSalazar,

     

    Your query below doesn't work because we do not support a filter for language in LiQL.  Most of our customers usually have one community for each language or they have a particular board or category set up for a particular language.

     

    In case where you have a community set up in a particular language, you can just do 

    select * from messages where subject matches 'pay' and depth=0

    In case when you have a board/category set up in a particular language, you can do 

    select * from messages where subject matches 'pay' and depth=0 and board.id ='test'
    
    select * from messages where subject matches 'pay' and depth=0 and category.id = 'test'

    Hope this helps.

     

    Regards,
    Chhama

    • Thanks ChhamaJ...

       

      I keep reading the documentation and I imagine it would be something like that.

       

      Thanks for the clarification