Validate that Skype username is in use
Asked Answered
U

3

6

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.
Us answered 21/1, 2012 at 8:19 Comment(0)
M
1

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

Monaghan answered 21/1, 2012 at 8:50 Comment(1)
I created a small ruby gem for searching used/available skype usernames, you can find it here github.com/smnplk/skype-check, but it is still a work in progress..Lemus
J
10

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":""}
}
Jerrylee answered 30/10, 2012 at 20:15 Comment(2)
Sadly, this will not work with accounts that are linked. I.e. [email protected] will have the username live:xyz. The service will call it invalid, because of the :Bierman
I get Access control allow origin error, when i use it in my localhost. Any thoughts to solve it?Supportable
M
1

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

Monaghan answered 21/1, 2012 at 8:50 Comment(1)
I created a small ruby gem for searching used/available skype usernames, you can find it here github.com/smnplk/skype-check, but it is still a work in progress..Lemus
F
1

Building off of pho79's answer, I have made a gist. The code simply checks to see if the message returned says that the name is unavailable meaning that it is in use. There are some other messages it sends back for other errors, so this is what I went with.

import requests

def checkName(name):
    values = { "new_username" : name }
    r = requests.post("https://login.skype.com/json/validator", values)
    return "not available" in r.json()[u'data'][u'markup']
Fr answered 9/8, 2013 at 19:58 Comment(1)
This only works for English. Just be aware of that. The messages returned in "markup" are localized (to Japanese for example: "Skype名は使用できません"). I found it more reliable to test for when this message is empty. If it's empty, the Skype ID was not taken yet, which means it's not a valid Skype ID at the moment.Noteworthy

© 2022 - 2024 — McMap. All rights reserved.