Skip to content

Commit

Permalink
Update endpoint for single contact retrieval
Browse files Browse the repository at this point in the history
Fixes #61.  See discussion in ocilo/skype-http#20.
  • Loading branch information
Terrance committed May 12, 2017
1 parent aff3a39 commit 6c97c6a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions skpy/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 6c97c6a

Please sign in to comment.