Forum Discussion

PerBonomi's avatar
7 years ago

API 2 not returning user who got role 25 minutes ago

Hi everyone. Curious about this. I added the role Moderator to a user 25 minutes ago, yet, when I use this query it doesn't return that user..

<#assign query = restadmin("2.0","/search?q=" + "SELECT id FROM users WHERE roles.name IN('Moderator') LIMIT 50"?url)/>
		<#list query.data.items as q>
		${q.id}<br/>
		</#list>

Does anyone know how long it takes for the API to catch up, or how long it should take? I think it shouldn't take this long..?

  • PerBonomi - can you verify there are less user than 50 with moderator role? And also can you try to fetch the roles of users whom u have assigned the moderate role? 

    • PerBonomi's avatar
      PerBonomi
      Boss

      Hey TariqHussain. Yes, only 2 users with this role. Using API 1 to query this user's roles I get Moderator in the list.

      • TariqHussain's avatar
        TariqHussain
        Boss

        PerBonomi - I faced the same issue with roles clause. After assigning a new role to user, API V2 was talking too much time. In my case even it was taking one day to reflect in API v2. Got it fixed from lithium support. Meanwhile you can use API v1 for your code.