Examples: query, "exact match", wildcard*, wild?ard, wild*rd
Fuzzy search: cake~ (finds cakes, bake)
Term boost: "red velvet"^4, chocolate^2
Field grouping: tags:(+work -"fun-stuff")
Escape special characters +-&|!(){}[]^"~*?:\ - e.g. \+ \* \!
Range search: properties.timestamp:[1587729413488 TO *] (inclusive), properties.title:{A TO Z}(excluding A and Z)
Combinations: chocolate AND vanilla, chocolate OR vanilla, (chocolate OR vanilla) NOT "vanilla pudding"
Field search: properties.title:"The Title" AND text
Answered
Unable to get user details

I'm implementing a UserJoinedRoomContext watcher in my bot. The code gets called

async def on_activity(self, context: UserJoinedRoomContext):
		user = await self._users.get_user_detail(context.affected_user_id)
		message = 'Welcome'
		await self._messages.send_message(context.source_event.stream.stream_id, self.template.render(message=message))

but I receive a permission exception "User does not have the proper privilege to perform this action." in this line:

user = await self._users.get_user_detail(context.affected_user_id)

I'm pretty sure the bot has all the permissions it needs. Is there something special I need to look for?

  
  
Posted 2 years ago
Edited 2 years ago
Votes Newest

Answers


What you should be using is the list_users_by_ids() method instead of get_user_details(), which calls an admin-level endpoint that retrieves complete user details instead of just the public profile that you require.

# Normal user lookup endpoint
# https://developers.symphony.com/restapi/reference#users-lookup-v3
await self._users.list_users_by_ids([context.affected_user_id])

# Admin level user details endpoint
# https://developers.symphony.com/restapi/reference#get-user-v2
await self._users.get_user_detail(context.affected_user_id)
  
  
Posted 2 years ago
Edited 2 years ago
Yong Sheng Tan
39 × 2 Administrator
2K Views
1 Answer
2 years ago
2 years ago
Tags