I have also defined the scope as “ADMIN” in atlassian-connect.json file but still unable to fetch any result and no users are returned. Is there anything i am missing with the request or permissions?
The first function is the one i am accessing as an app user using the scope [“ADMIN”](tried with “READ” too as specified in docs) but still getting a null set as result.
The second function is on behalf of a user which is working as expected and giving the desired result(scope: [“ACT_AS_USER”])
I also accessed another API using authorization with app user and is working as expected.
The above API is working for me.
In the docs, it is specified “Anonymous calls or calls by users without the required permission return empty search results.” under the API description. Does this relate to my query?
Also, my current “atlassian-connect-express” dependency version is 7.4.7.
Yes, the app user not having the Browse users and groups permission will result in an empty search result. In order to check if you have the right permissions, go to Settings > System > Global permissions (or hit . then type Global Permissions). Verify if permission has been granted to the group that your app is a part of.
To check the group your app user belongs to, you can run https://{yoursite}.atlassian.net/rest/api/3/user?accountId={appUserAccountId}&expand=groups. You can get your app’s account id from the result of your successful Get user search call.
I was able to resolve the issue with the right permission. The Browse users and groups permission was not added for the group atlassian-addons-admins. Thanks for pointing it out.