From 6c97c6a8dab71bc9aec7f20cbe8aff95d23c384e Mon Sep 17 00:00:00 2001 From: Ollie Terrance Date: Fri, 12 May 2017 20:40:31 +0100 Subject: [PATCH] Update endpoint for single contact retrieval Fixes #61. See discussion in ocilo/skype-http#20. --- skpy/user.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/skpy/user.py b/skpy/user.py index 9c66b9e..46ae450 100644 --- a/skpy/user.py +++ b/skpy/user.py @@ -391,9 +391,9 @@ def contact(self, id): SkypeContact: resulting contact object """ try: - json = self.skype.conn("GET", "{0}/users/{1}/profile".format(SkypeConnection.API_USER, id), - auth=SkypeConnection.Auth.SkypeToken).json() - contact = SkypeContact.fromRaw(self.skype, json) + json = self.skype.conn("POST", "{0}/users/batch/profiles".format(SkypeConnection.API_USER), + json={"usernames": [id]}, auth=SkypeConnection.Auth.SkypeToken).json() + contact = SkypeContact.fromRaw(self.skype, json[0]) if contact.id not in self.contactIds: self.contactIds.append(contact.id) return self.merge(contact)