Skip to content

Commit 2cf4978

Browse files
akashaviatortimabbott
authored andcommitted
api: Implement GET users/{id} endpoint.
1 parent 1d1e93d commit 2cf4978

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

zulip/zulip/__init__.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1056,6 +1056,21 @@ def delete_stream(self, stream_id):
10561056
method='DELETE',
10571057
)
10581058

1059+
def get_user_by_id(self, user_id, request=None):
1060+
# type: (int, Optional[Dict[str, Any]]) -> Dict[str, Any]
1061+
1062+
'''
1063+
Example usage:
1064+
1065+
>>> client.get_user_by_id(8, {'include_custom_profile_fields': True})
1066+
{'result': 'success', 'msg': '', 'user': [{...}, {...}]}
1067+
'''
1068+
return self.call_endpoint(
1069+
url='users/{}'.format(user_id),
1070+
method='GET',
1071+
request=request,
1072+
)
1073+
10591074
def get_members(self, request=None):
10601075
# type: (Optional[Dict[str, Any]]) -> Dict[str, Any]
10611076
'''

0 commit comments

Comments
 (0)