NAV Navbar
curl

Introduction

Welcome to the Weblegit API's. You can use our API's to validate Email Addresses, Links, Phone Numbers and Domain Names.

Authentication

Weblegit uses API keys to allow access to the API. You can register for Weblegit API key here.

The API key should be included in all API requests to the server in a header that looks like the following:

Authorization: Bearer MTAtcDNhRmhpZHdSaWx4OXNQUlBlZ1BZSDVqMkpVTWdXMXphX1drSmhsZHFtNUFtc3dmVWIza2tpM3BKTWZmWE9reA==

Email Validation


curl -X POST 
  'https://app.weblegit.com/api/email/verify?email=weblegit@gmail.com' 
  -H 'Authorization: Bearer MTAtcDNhRmhpZHdSaWx4OXNQUlBlZ1BZSDVqMkpVTWdXMXphX1drSmhsZHFtNUFtc3dmVWIza2tpM3BKTWZmWE9reA==' 

The above command returns JSON structured like this:

{
    "email": "weblegit@gmail.com",
    "score": 5,
    "disposable": false,
    "role": false,
    "validationType": "EMAIL",
    "valid": true,
    "catch_all": false,
    "valid_mx_record": true,
    "smtp_connection": true,
    "valid_format": true,
    "execution_time": 615
}

Email Validation API allows to verify in real time the information about the email such as presence and deliverability.

HTTP Request

POST https://app.weblegit.com/api/email/verify

Query Parameters

Parameter Required Default Description
email Yes None Email Address to be verified

Response

Property Type Description
email String Email Address being validated
score Integer The score ranges from 0 t0 5 and indicates deliverability confidence. Anything less than 2 is non-deliverable.
disposable Boolean Indicates if the email is disposable
role Boolean True if the email is for role like admin, contact etc
valid Boolean Indictes thaat the email has valid syntax
catch_all Boolean True if email belong to catch all mail server
smtp_connection Boolean True if SMTP connection was sucessful
valid_format Boolean True if syntax is valid
execution_time Long Total execution time in milliseconds

Batch Email Validation

Submit Batch Request

Request body :

{
    "emails":"weblegit@gmail.com",
    "callbackUrl": "http://mysite.com"
}

curl -X POST 
  'https://app.weblegit.com/api/email/batch' 
  -H 'Authorization: Bearer MTAtcDNhRmhpZHdSaWx4OXNQUlBlZ1BZSDVqMkpVTWdXMXphX1drSmhsZHFtNUFtc3dmVWIza2tpM3BKTWZmWE9reA==' 

The above command returns JSON structured like this:

{
    "requestId": "9-2-kiLbPDujANFhbpFJYj2wC2rydwfzF2P0mZqKIYJfvuAB29xGqwfWVRmEiVKzSe9p",
    "emailCount": 1,
    "status": "PROCESSING"
}

Validate email addresses in batch. Allows to validate 10000 emails in one request at a time. A callback Url can be provided optionally where the result can be posted back. Alternatively the requestId returned can be used to poll and query the results.

HTTP Request

POST https://app.weblegit.com/api/email/batch

Request Body

Parameter Required Default Description
emails Yes None Email Addresses to be verified separated by ","
callbackUrl No None Callback URL where result could be posted upon sucessful execution

Response

Property Type Description
requestId String Unique identifier for the batch request
emailCount Integer Number of emails submitted for validation
status String Request status, PROCESSING indicates that the request is under process

Query Batch Response


curl -X GET 
  'https://app.weblegit.com/api/email/batch?requestId=9-2-kiLbPDujANFhbpFJYj2wC2rydwfzF2P0mZqKIYJfvuAB29xGqwfWVRmEiVKzSe9p' 
  -H 'Authorization: Bearer MTAtcDNhRmhpZHdSaWx4OXNQUlBlZ1BZSDVqMkpVTWdXMXphX1drSmhsZHFtNUFtc3dmVWIza2tpM3BKTWZmWE9reA==' 

The above command returns JSON structured like this:

{
    "validationResult": [
        {
            "email": "weblegit@gmail.com",
            "score": 5,
            "disposable": false,
            "role": false,
            "validationType": "EMAIL",
            "valid": true,
            "catch_all": false,
            "valid_mx_record": true,
            "smtp_connection": true,
            "valid_format": true,
            "execution_time": 0
        }
    ],
    "status": "COMPLETE",
    "requestId": "9-2-kiLbPDujANFhbpFJYj2wC2rydwfzF2P0mZqKIYJfvuAB29xGqwfWVRmEiVKzSe9p"
}

This API allows to query the result for batch Request. When the batch request is processed then the result contains the validation information for all the emails, otherwise it returns with the current request status.

HTTP Request

GET https://app.weblegit.com/api/email/batch

Query Parameters

Parameter Required Default Description
requestId Yes None RequestId for the batch Request

Response

Property Type Description
validationResult array Array of email validation responses
status String COMPLETE or PROCESSING depending on the status of batch request
requestId String RequestId for the batch Request

Phone Number Validation


curl -X POST 
  'https://app.weblegit.com/api/phone/verify?phone=650-555-3434' 
  -H 'Authorization: Bearer MTAtcDNhRmhpZHdSaWx4OXNQUlBlZ1BZSDVqMkpVTWdXMXphX1drSmhsZHFtNUFtc3dmVWIza2tpM3BKTWZmWE9reA==' 

The above command returns JSON structured like this:

{
    "valid": true,
    "e164Format": "+16505553434",
    "localFormat": "(650) 555-3434",
    "countryCode": "US",
    "location": "SNFC2143T, CA",
    "carrier": "PACIFIC BELL",
    "lineType": "FIXED_LINE_OR_MOBILE",
    "executionTime": 61,
    "validationType": "PHONE"
}

The Phone number validation API validates for the validity of a phone number and also captures additional information about the phone number

HTTP Request

POST https://app.weblegit.com/api/phone/verify

Query Parameters

Parameter Required Default Description
phone Yes None Phone Number to be validated
countryCode No US Country code for the phone number if its not already part of phone number

Response

Property Type Description
e164Format String International format
localFormat String Local format
countryCode String Country code as determined from phone number if not already provided
location String Phone location
carrier String Carrier Name
lineType String Phone type, mobile or fixed (landline)
execution_time Long Total execution time in milliseconds

Url Validation


curl -X POST 
  'https://app.weblegit.com/api/url/verify?url=https://app.weblegit.com/register' 
  -H 'Authorization: Bearer MTAtcDNhRmhpZHdSaWx4OXNQUlBlZ1BZSDVqMkpVTWdXMXphX1drSmhsZHFtNUFtc3dmVWIza2tpM3BKTWZmWE9reA==' 

The above command returns JSON structured like this:

{
    "valid": true,
    "status": 200,
    "executionTime": 320,
    "link": "https://app.weblegit.com/register",
    "validationType": "LINK"
}

Url Validation checks if the provided link is valid and reachable one.

HTTP Request

POST https://app.weblegit.com/api/url/verify

Query Parameters

Parameter Required Default Description
url Yes None Url link to be verified

Response

Property Type Description
domainName String Domain Name being validated
status Integer HTTP status code for the url link
link String Url link being verified
valid Boolean True if the domain exists
execution_time Long Total execution time in milliseconds

Domain Name Validation


curl -X POST 
  'https://app.weblegit.com/api/domain/verify?domain=weblegit.com' 
  -H 'Authorization: Bearer MTAtcDNhRmhpZHdSaWx4OXNQUlBlZ1BZSDVqMkpVTWdXMXphX1drSmhsZHFtNUFtc3dmVWIza2tpM3BKTWZmWE9reA==' 

The above command returns JSON structured like this:

{
    "valid": true,
    "domainName": "weblegit.com",
    "executionTime": 347,
    "registrationDate": "06/30/2017",
    "validationType": "DOMAIN"
}

Domain Name Validation API checks if the given domain is a valid one and exists.

HTTP Request

POST https://app.weblegit.com/api/domain/verify

Query Parameters

Parameter Required Default Description
domain Yes None Domain name to be verified

Response

Property Type Description
domainName String Domain Name being validated
registrationDate Date Domain registeration date
valid Boolean True if the domain exists
execution_time Long Total execution time in milliseconds

Errors

The Weblegit API uses the following error codes:

Error Code Meaning
400 Bad Request -- Your request is invalid.
401 Unauthorized -- Your API key is wrong.
403 Forbidden - Api Plan limit has exceeded
404 Not Found -- The specified request could not be found.
500 Internal Server Error -- We had a problem with our server. Try again later.
503 Service Unavailable -- We're temporarily offline for maintenance. Please try again later.