Forum Discussion

raguv12ps's avatar
6 years ago

Khoros APIv2 configurations

I am new to khoros community and was testing a restadmin call.

Below is the code which i used in community(API V2)

restadmin("2.0","/search?q=" + "SELECT * FROM roles WHERE users.id = '${user.id}' limit 1000"?url)

Below is what the documentation says

https://api.lithium.com/community/2.0/[TENANT ID]/search?q=select * from messages

 

Is there any configuration where the root(https://api.lithium.com/community) of the rest call is setup? where we can change it, since we are migrating from API proxy.

  • Hi Ragu, your FreeMarker calls don’t need any adjustment because they don’t use HTTP to make a query. The API call is routed to the right place on the backend without needing the full URL. You should be all set on those.

     

    However, you might like to switch to use our newer ”liql” and “liqladmin” FreeMarker methods for making LiQL calls, since it is more convenient (no need for URL-escaping and URL concatenation.

  • AndrewF's avatar
    AndrewF
    6 years ago

    None of rest(...), restadmin(...), liql(...), liqladmin(...) use HTTP to make queries. They are server-side calls that don't involve HTTP things like the API proxy, hostnames, IP addresses, etc. As such there is no need to change any of them when switching away from the API Proxy.

     

    Andrew

4 Replies

  • AndrewF's avatar
    AndrewF
    Khoros Oracle
    6 years ago

    Hi Ragu, your FreeMarker calls don’t need any adjustment because they don’t use HTTP to make a query. The API call is routed to the right place on the backend without needing the full URL. You should be all set on those.

     

    However, you might like to switch to use our newer ”liql” and “liqladmin” FreeMarker methods for making LiQL calls, since it is more convenient (no need for URL-escaping and URL concatenation.

  • raguv12ps's avatar
    raguv12ps
    Ace
    6 years ago

    I have tried using liqladmin and I am able to get the results.
    If i use liqladmin instead of restAdmin or rest in community, will it work when they deprecate the API proxy server?

  • AndrewF's avatar
    AndrewF
    Khoros Oracle
    6 years ago

    None of rest(...), restadmin(...), liql(...), liqladmin(...) use HTTP to make queries. They are server-side calls that don't involve HTTP things like the API proxy, hostnames, IP addresses, etc. As such there is no need to change any of them when switching away from the API Proxy.

     

    Andrew