Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Validate that Skype username is in use

Is there a way to validate that a Skype username is valid in a web app? (form validation upon account creation)

By valid, I do not mean by using regular expressions. We can easily check to see if it is 6-22 characters, starts with a letter, etc. I want to verify that either:

  1. the username entered actually calls the user inputting it, similar to when we validate email by sending an email with a link to verify it or
  2. verify that there exists in the Skype database a user with that username.
like image 430
tnichols Avatar asked Jan 21 '12 08:01

tnichols


2 Answers

This may not be very reliable, but the following endpoint will give you different responses based on the availability of a Skype username: https://login.skype.com/json/validator. Here are two examples of (at the time of this writing) an unavailable and available username:

# Request (unavailable):
curl -iX POST -H" Application/json" https://login.skype.com/json/validator?new_username=borist

# Response:
{
  "status": 406,
  "status_text": "valid",
  "data": {
    "markup": "Skype Name not available",
    "alternatives": true,
    "fieldDetails": "<label>Suggestions<\/label><ul><li><label><input class=\"skypeNameSuggestion\" type=\"radio\" name=\"selectSkypeName\" value=\"borist92\"\/>borist92<\/label> <\/li><li><label><input class=\"skypeNameSuggestion\" type=\"radio\" name=\"selectSkypeName\" value=\"borist176\"\/>borist176<\/label> <\/li><li><label><input class=\"skypeNameSuggestion\" type=\"radio\" name=\"selectSkypeName\" value=\"borist417\"\/>borist417<\/label> <\/li><\/ul>"
  }
}

# Request (available)
curl -iX POST -H" Application/json" https://login.skype.com/json/validator?new_username=boris3294a

# Response 
{
  "status":200,
  "status_text":"valid",
  "data":{"markup":"",
  "alternatives":false,
  "fieldDetails":""}
}
like image 78
pho79 Avatar answered Oct 20 '22 07:10

pho79


I guess you'll have to do exactly what you said: “similar to when we validate email by sending an email with a link to verify it”

I'd dig into Skype4py, you'll find an example of searching for someone.

So you can do:

  1. some kind of early validation by searching for that person
  2. sending him/her a txt message with a key/link to verify your user

See: need an python script that uses skype4py to send an instant message

like image 42
greut Avatar answered Oct 20 '22 07:10

greut