Sarv.com

PYTHON

Choose Language

Get available Did Number

Info! This is Beta version, if you have any problem in using API, please mail us at [email protected]

https://manage.sarv.com/api/telephony/getTelephonyNumber

Get all available Telephonic NUmber

Example Call


try:
    import requests
    result = requests.post("https://manage.sarv.com/api/telephony/getTelephonyNumber", data={'user_id': 01234567, 'token': 'abcXYZ'})    
    print result
    '''
    {
        "msg" : "success",
        "data" : [{
                    "did_number":"9876543210",
                    "country":"IN",
                    "area":"ALL",
                    "did_type":"MOBILE",
                    "vanity_type":"REGULAR",
                    "vanity_cost":"0"
                },  ...]
    }
    '''
except e:
    print 'A error occurred: %s - %s' % (e.__class__, e)

                        

Example Success Response


{
    "msg" : "success",
    "data" : [{
                "did_number":"9876543210",
                "country":"IN",
                "area":"ALL",
                "did_type":"MOBILE",
                "vanity_type":"REGULAR",
                "vanity_cost":"0"
            },  ...]
}

                        

Example Error Response


{
    "msg": "error",
    "msg_text": "Human Readable message"
}

                        
Parameters
user_id* string a valid Sarv User Id
token* string a valid token
* compulsory field
Return Value: Success
struct the results of getting all DID Number
msg string always success
data array [{ "did_number":"9876543210", "country":"IN", "area":"ALL", "did_type":"MOBILE", "vanity_type":"REGULAR", "vanity_cost":"0" }, ...]
Means of Return Value 'country' key
IN India.
Means of Return Value 'area' key
ALL ALL
Means of Return Value 'did_type' key
MOBILE Mobile Number like 9876543210
TOLLFREE Tollfree like 18002000000
Means of Return Value 'vanity_type' key
REGULAR
VIP
SILVER
GOLD
PLATINUM
DIAMOND
Means of Return Value 'vanity_cost' key
1000 Cost of Number
Return Value: Error
struct the error results when attempt to getting DID Number Data
msg string error
msg_text string human readable message
Error types
ValidationError The parameters passed to the API call are invalid or not provided when required.
GeneralError An unexpected errors occurred processing the request. Sarv Developers will be notified.
AuthenticationError Provided owner_id and token was not matched.