Global Database

Our global database will help you to check if a phone number is likely to be wrong

Early Verification

By checking the phone number validity before sending the verification code, you can greatly improve the user registration process and reduce the user’s frustration

Cost Reduction

By filtering the invalid numbers, you can save messaging costs

Free

This service is provided for free to our SMS and voice products customers

Code Samples

All PaaSoo services are accessible using either HTTP or HTTPS. However, for security reasons, we highly recommend all our customers to use the HTTPS protocol.

import org.apache.http.HttpEntity;
import org.apache.http.NameValuePair;
import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.message.BasicNameValuePair;
import org.apache.http.util.EntityUtils;

import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class ValidNumber {
    //Use UTF-8 Encoding to send messages
    private static String ENCODING = "UTF-8";
    //API URL
    private static String URI_GET_VALID_NUMBER = "https://api.paasoo.cn/lookup";

    public static void main(String[] args) throws Exception {
        //Parameters
        String key = "********";
        String secret = "********";
        String countryCode = "********";
        String number = "********";

        System.out.println(ValidNumber.getValidNumber(key, secret, countryCode, number));
    }

    /**
     * Phone Number verification 
     *
     * @param key    account key
     * @param secret account paasword
     * @param countryCode    Country code of mobile phone number to be verified
     * @param number Mobile phone number to be verified, without country code
     * @return
     * @throws Exception
     */
    public static String getValidNumber(String key, String secret, String countryCode, String number) throws Exception {
        Map params = new HashMap();
        params.put("key", key);
        params.put("secret", secret);
        params.put("countryCode", countryCode);
        params.put("number", number);
        return get(URI_GET_VALID_NUMBER, params);
    }


    /**
     *
     * @param url       Submission URL
     * @param paramsMap  parameters Map
     * @return          Response
     */
    public static String get(String url, Map paramsMap) throws Exception {
        CloseableHttpClient httpClient = HttpClients.createDefault();
        CloseableHttpResponse response = null;
        InputStream is = null;
        try {
            List params = new ArrayList();
            for (Map.Entry param : paramsMap.entrySet()) {
                NameValuePair pair = new BasicNameValuePair(param.getKey(), param.getValue());
                params.add(pair);
            }
            String str = EntityUtils.toString(new UrlEncodedFormEntity(params, ENCODING));
            HttpGet httpGet = new HttpGet(url + "?" + str);
            response = httpClient.execute(httpGet);
            HttpEntity entity = response.getEntity();
            String result = EntityUtils.toString(entity);
            return result;
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (is != null) {
                try {
                    is.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            if (response != null) {
                try {
                    response.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            if (httpClient != null) {
                try {
                    httpClient.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
        return null;
    }

}

                                
2222
import requests
from urllib.parse import urlencode

API = "https://api.paasoo.cn/lookup"
params = {
"key": "",
"secret": "",
"number": ""
}

url = API + "?" + urlencode(params)
response = requests.get(url)
print(response.text)
444
More API code samples>>