Check if user is a member of a group hub
Hi everyone, I'm currently trying to create a component which will check if a user is a member of a group hub and then if they are, display something on a page. I keep using the LiQL from https://developer.khoros.com/khoroscommunitydevdocs/docs/membership-liql-examples, but for almost each one, I get an "invalid query syntax" error. Does anyone what might be the cause?
Here is the code I'm using:
<#assign apiVersion = "2.0"/>
<#assign liql_query = "SELECT join_date, title FROM nodes WHERE user.id = '" + user.id + "' "/>
${liql_query}
<#assign users= rest(apiVersion, "/search?q=" + liql_query?url + "&restapi.response_style=view") />
<br>${users.status}
<br>${users.message}
I've also tried the following queries, but same error (invalid query syntax):
SELECT id,login FROM users WHERE node.id = 'grouphub:EAP'
SELECT login, id, join_date FROM users WHERE node.id = '<node.type>:<node.id>'
<#assign liql_query = "SELECT * FROM roles WHERE users.id = '" + user.id + "' and node.id = 'grouphub:EAP'"/>
I can't for the life of me figure out what is wrong with the queries. I would appreciate the help!
Hey Nconforti ,
It seems the API's mentioned by you were available in 20.3 release notes, the following is the link to the documentation:
Once your Community is upgraded to the 20.3 version, you may be able to use these APIs.
Please Give Kudos if you find this post useful and also mark this as Accepted Solution if this is the required solution.
RegardsTarun Kumar