Provision Numbers

To use the Provision Numbers API:

    Create a request and provision a Fax number:

    #!/bin/bash
    curl -X POST --header 'Content-Type: application/json' 'https://fax.to/api/v2/countries/didgroups/{did_group_id}/provision?api_key=API_KEY'
    
    <?php
    
    $defaults = [
      CURLOPT_URL => 'https://fax.to/api/v2/countries/didgroups/{did_group_id}/provision?api_key=API_KEY',
      CURLOPT_POST => 1
    ];
    
    $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/didgroups/{did_group_id}/provision?' + urllib.urlencode(params)
    response = urllib.urlopen(url)
    print response.read()
    
    require "net/http"
    require "uri"
    
    uri = URI.parse("https://fax.to/api/v2/countries/didgroups/{did_group_id}/provision?api_key=API_KEY")
    
    response = Net::HTTP.get(uri)
    
    puts response
    
    
    // Sample Output.
    {
      "status": "success",
      "message": "Number has been provisioned.",
      "data": 
        {
          "id": 49,
          "didid": 6988136,
          "did_group_id": 5598,
          "country_code": "CAN",
          "city_name": "ST. JOHN'S",
          "area_code": "709",
          "number": "+17097023976",
          "type": "GEOGRAPHIC",
          "trunk_id": 8934
        }
    }