List Countries

The list Countries operation allows you to search for countries available in the Fax.to coverage.

To use the List Countries API:

    Create a request and get list of countries:

    #!/bin/bash
    curl -X GET --header 'Content-Type: application/json' 'https://fax.to/api/v2/countries?api_key=API_KEY'
    
    <?php
    
    $defaults = [
      CURLOPT_URL => 'https://fax.to/api/v2/countries?api_key=API_KEY'
    ];
    
    $ch = curl_init();
    curl_setopt_array($ch, $defaults);
    
    $response = curl_exec($ch);
    
    // Decode the json object you retrieved when you ran the request.
    $decodedResponse = json_decode($response, true);
    var_dump($decodedResponse);
    
    
    import urllib
    
    params = {
        'api_key': 'API_KEY'
    }
    
    url = 'https://fax.to/api/v2/countries?' + urllib.urlencode(params)
    response = urllib.urlopen(url)
    print response.read()
    
    require "net/http"
    require "uri"
    
    uri = URI.parse("https://fax.to/api/v2/countries?api_key=API_KEY")
    
    response = Net::HTTP.get(uri)
    
    puts response
    
    
    // Sample Output.
    {
      "status": "success",
      "data": [
      {
        "country": "ARGENTINA",
        "slug": "ARGENTINA",
        "a2_code": "ARG",
        "dial_code": 54
      },
      {
        "country": "AUSTRALIA",
        "slug": "AUSTRALIA",
        "a2_code": "AUS",
        "dial_code": 61
      }, 
      ...
    }