Forum Discussion

RobertT's avatar
6 years ago

API v2 and filtering for registered users

We're build a custom new users component and have hit a bit of a snag with LIQL.

When querying for new users on one of our instances it returns incomplete user profiles (eg no login name is set and profile is not complete). As far as I can see there's no way currently to filter to only get fully registered users that have a login name?

A workaround for this would be to add a condition to the WHERE clause in the query to check users.registration_data.registration_status for one of the possible values but this doesn't appear to be possible currently.

 

  • RobertT  - This is not feasible in API v2. However, You can use REST API V1 to query out registered user only. 

    /restapi/vc/users/registered

     

    • RobertT's avatar
      RobertT
      Boss

      Hi Tariq

      Unfortunately the /restapi/vc/users/registered endpoint has the same issue, it returns users that have not set a login name yet or completed registration which we don't want.

      We're looking to get a list of users that have completed registration and have a login-name for this component.

      • DougS's avatar
        DougS
        Khoros Oracle

        Hi RobertT ,

        While I've confirmed that the REST API V1 /restapi/vc/users/registered call does in fact include partially-registered users (partially-registered users = users who have not completed the full registration on the community when SSO is enabled that asks for login and possibly other fields depending on how it's configured), The following LiQL query should actually exclude those users:

        SELECT id, login FROM users

        It's possible that a migration might have caused some partially registered users to carry over in a way where they would be returned by search. It's also possible that a more complex LiQL query, that has certain constraints (constraints = items in the WHERE clause of the LiQL query) may have caused it to intentionally include partially-registered users.

        Would you mind posting what constraints you used in your LiQL query and if you think a migration might have been done for your community recently and/or when it was launched?

        Thanks,

        -Doug