From 2cf49788fdda9d9618c55aee994311ca17b95afc Mon Sep 17 00:00:00 2001 From: akashaviator Date: Thu, 12 Mar 2020 01:26:37 +0530 Subject: [PATCH] api: Implement GET users/{id} endpoint. --- zulip/zulip/__init__.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/zulip/zulip/__init__.py b/zulip/zulip/__init__.py index a95b741..4e68e5d 100644 --- a/zulip/zulip/__init__.py +++ b/zulip/zulip/__init__.py @@ -1056,6 +1056,21 @@ class Client(object): method='DELETE', ) + def get_user_by_id(self, user_id, request=None): + # type: (int, Optional[Dict[str, Any]]) -> Dict[str, Any] + + ''' + Example usage: + + >>> client.get_user_by_id(8, {'include_custom_profile_fields': True}) + {'result': 'success', 'msg': '', 'user': [{...}, {...}]} + ''' + return self.call_endpoint( + url='users/{}'.format(user_id), + method='GET', + request=request, + ) + def get_members(self, request=None): # type: (Optional[Dict[str, Any]]) -> Dict[str, Any] '''