Terrance/SkPy

How to retrive userid by username?

Closed this issue · 3 comments

Hi! I would like to make something like this working:

def find_contact(self, pattern, strict=True):
        # If strict find only one user by id
        result = self.contacts.search(pattern)
        if strict:
            f = [contact for contact in result if contact.id == pattern] or [None]
            result = f[0]
        return result

So, contact.id == pattern sometimes will not work, because pattern of searching of user can be by email for example and I would like to get his userid to compare with userid or result, or get username from result to compare it with username from pattern. How can I do it?

Sorry, I don't understand your question. search(text) returns a list of SkypeUser that match your query, so you have their usernames and public profile to look at. If you're asking how to see their email address or phone number, you can't as that's their private contact information.

Sorry, I don't understand your question. search(text) returns a list of SkypeUser that match your query, so you have their usernames and public profile to look at. If you're asking how to see their email address or phone number, you can't as that's their private contact information.

For example skype_user.find_contact('email@mail.com') there is not any notes about email@mail.com in the search results, but search is appearing successful. How can I retrive this one exact contact from the results? How can I get userId by email to use it for getting exact contact from search by email?

As above, you can't. Users' email addresses aren't exposed to other users except by behind-the-scene matching in the search API.