API Endpoints
validate
The validate endpoint can be used to check the validity of an email address or username. Both syntax and duplication are checked. This allows the app to verify username and email address before it tries to register a user. The endpoint is quick, therefore it is probably Ok to check as each character is typed.
| Method |
Description |
| /email/validate?value=EMAIL |
checks email for correct syntax and duplication, returns success/error |
| /username/validate?value=USERNAME |
checks username for correct syntax, length(16 characters max), and duplication, returns success/error |
Example1: email/validate?value=EMAIL -- valid email example
GET http://api.hipgeo.com/email/validate?value=john_doe@yahoo.com
Returns:
{
"email":"john_doe@yahoo.com",
"result":"success"
}
| Error Code |
Possible Errors |
| 400 |
- Nothing to validate
- Email address is required
- Not a valid email address
- anything@hipgeo.com is invalid
- Email is too long
- This email is already used
|
Example2: email/validate?value=EMAIL -- invalid email example
GET http://api.hipgeo.com/email/validate?value=john&doe@yahoo.com
Returns:
{
"request":"http:\/\/api.hipgeo.com\/email\/validate?value=john&doe@yahoo.com",
"result":"error",
"details":"Not a valid e-mail address."
}
| Error Code |
Possible Errors |
| 400 |
- Nothing to validate
- Email address is required
- Not a valid email address
- anything@hipgeo.com is invalid
- Email is too long
- This email is already used
|
Example3: username/validate?value=USERNAME -- valid username example
GET http://api.hipgeo.com/username/validate?value=john2000&access_token=TOKENVALUE
Returns:
{
"username":"john2000",
"result":"success"
}
| Error Code |
Possible Errors |
| 400 |
- Nothing to validate
- Sorry, this user name is taken
- HipGeo is not allowed in names
- Spaces are not allowed in names
- Only letters and numbers
- Must contain a letter
|
Example4: username/validate?value=[username] -- duplicate username example
GET http://api.hipgeo.com/username/validate?value=scott&access_token=TOKENVALUE
Returns:
{
"request":"http:\/\/api.hipgeo.com\/username\/validate?value=gerard&access_token=TOKENVALUE",
"result":"error",
"details":"Sorry, this user name is taken"
}
| Error Code |
Possible Errors |
| 400 |
- Nothing to validate
- Sorry, this user name is taken
- HipGeo is not allowed in names
- Spaces are not allowed in names
- Only letters and numbers
- Must contain a letter
|