curl -X POST\
-H "Accept: application/json"\
-H "Content-Type: text/plain"\
"https://tools.rocks/api/v1/phone/{format}?spaced_area_code=&spaced_country_code="
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.DefaultApi;
import java.io.File;
import java.util.*;
public class DefaultApiExample {
public static void main(String[] args) {
DefaultApi apiInstance = new DefaultApi();
String body = "030 23125 349,(0)221 4710 977,01729091317,invalid"; // String | The phone number(s) to format as text. Numbers can be seperated by comma, semicolon or newline.
String format = format_example; // String | How to format the phone numbers. Possible values are:
"local" - number without country code, e.g. 01784001420
"plus" - country code specified with a leading +, e.g. +491784001420
"zero" - country code specified with leading zeroes, e.g. 00491784001420
Boolean spacedAreaCode = true; // Boolean | If true, adds a space character after the area code
Boolean spacedCountryCode = true; // Boolean | If true, adds a space character after the country code
try {
inline_response_200 result = apiInstance.phoneFormatPost(body, format, spacedAreaCode, spacedCountryCode);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling DefaultApi#phoneFormatPost");
e.printStackTrace();
}
}
}
import io.swagger.client.api.DefaultApi;
public class DefaultApiExample {
public static void main(String[] args) {
DefaultApi apiInstance = new DefaultApi();
String body = "030 23125 349,(0)221 4710 977,01729091317,invalid"; // String | The phone number(s) to format as text. Numbers can be seperated by comma, semicolon or newline.
String format = format_example; // String | How to format the phone numbers. Possible values are:
"local" - number without country code, e.g. 01784001420
"plus" - country code specified with a leading +, e.g. +491784001420
"zero" - country code specified with leading zeroes, e.g. 00491784001420
Boolean spacedAreaCode = true; // Boolean | If true, adds a space character after the area code
Boolean spacedCountryCode = true; // Boolean | If true, adds a space character after the country code
try {
inline_response_200 result = apiInstance.phoneFormatPost(body, format, spacedAreaCode, spacedCountryCode);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling DefaultApi#phoneFormatPost");
e.printStackTrace();
}
}
}
String *body = "030 23125 349,(0)221 4710 977,01729091317,invalid"; // The phone number(s) to format as text. Numbers can be seperated by comma, semicolon or newline.
String *format = format_example; // How to format the phone numbers. Possible values are:
"local" - number without country code, e.g. 01784001420
"plus" - country code specified with a leading +, e.g. +491784001420
"zero" - country code specified with leading zeroes, e.g. 00491784001420
Boolean *spacedAreaCode = true; // If true, adds a space character after the area code (optional) (default to true)
Boolean *spacedCountryCode = true; // If true, adds a space character after the country code (optional) (default to true)
DefaultApi *apiInstance = [[DefaultApi alloc] init];
// Format phone numbers
[apiInstance phoneFormatPostWith:body
format:format
spacedAreaCode:spacedAreaCode
spacedCountryCode:spacedCountryCode
completionHandler: ^(inline_response_200 output, NSError* error) {
if (output) {
NSLog(@"%@", output);
}
if (error) {
NSLog(@"Error: %@", error);
}
}];
var Toolsrocks = require('toolsrocks');
var api = new Toolsrocks.DefaultApi()
var body = "030 23125 349,(0)221 4710 977,01729091317,invalid"; // {{String}} The phone number(s) to format as text. Numbers can be seperated by comma, semicolon or newline.
var format = format_example; // {{String}} How to format the phone numbers. Possible values are:
"local" - number without country code, e.g. 01784001420
"plus" - country code specified with a leading +, e.g. +491784001420
"zero" - country code specified with leading zeroes, e.g. 00491784001420
var opts = {
'spacedAreaCode': true // {{Boolean}} If true, adds a space character after the area code
'spacedCountryCode': true // {{Boolean}} If true, adds a space character after the country code
};
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
api.phoneFormatPost(bodyformat, opts, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;
namespace Example
{
public class phoneFormatPostExample
{
public void main()
{
var apiInstance = new DefaultApi();
var body = new String(); // String | The phone number(s) to format as text. Numbers can be seperated by comma, semicolon or newline.
var format = format_example; // String | How to format the phone numbers. Possible values are:
"local" - number without country code, e.g. 01784001420
"plus" - country code specified with a leading +, e.g. +491784001420
"zero" - country code specified with leading zeroes, e.g. 00491784001420
var spacedAreaCode = true; // Boolean | If true, adds a space character after the area code (optional) (default to true)
var spacedCountryCode = true; // Boolean | If true, adds a space character after the country code (optional) (default to true)
try
{
// Format phone numbers
inline_response_200 result = apiInstance.phoneFormatPost(body, format, spacedAreaCode, spacedCountryCode);
Debug.WriteLine(result);
}
catch (Exception e)
{
Debug.Print("Exception when calling DefaultApi.phoneFormatPost: " + e.Message );
}
}
}
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');
$api_instance = new Swagger\Client\ApiDefaultApi();
$body = "030 23125 349,(0)221 4710 977,01729091317,invalid"; // String | The phone number(s) to format as text. Numbers can be seperated by comma, semicolon or newline.
$format = format_example; // String | How to format the phone numbers. Possible values are:
"local" - number without country code, e.g. 01784001420
"plus" - country code specified with a leading +, e.g. +491784001420
"zero" - country code specified with leading zeroes, e.g. 00491784001420
$spacedAreaCode = true; // Boolean | If true, adds a space character after the area code
$spacedCountryCode = true; // Boolean | If true, adds a space character after the country code
try {
$result = $api_instance->phoneFormatPost($body, $format, $spacedAreaCode, $spacedCountryCode);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling DefaultApi->phoneFormatPost: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::DefaultApi;
my $api_instance = WWW::SwaggerClient::DefaultApi->new();
my $body = WWW::SwaggerClient::Object::String->new(); # String | The phone number(s) to format as text. Numbers can be seperated by comma, semicolon or newline.
my $format = format_example; # String | How to format the phone numbers. Possible values are:
"local" - number without country code, e.g. 01784001420
"plus" - country code specified with a leading +, e.g. +491784001420
"zero" - country code specified with leading zeroes, e.g. 00491784001420
my $spacedAreaCode = true; # Boolean | If true, adds a space character after the area code
my $spacedCountryCode = true; # Boolean | If true, adds a space character after the country code
eval {
my $result = $api_instance->phoneFormatPost(body => $body, format => $format, spacedAreaCode => $spacedAreaCode, spacedCountryCode => $spacedCountryCode);
print Dumper($result);
};
if ($@) {
warn "Exception when calling DefaultApi->phoneFormatPost: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint
# create an instance of the API class
api_instance = swagger_client.DefaultApi()
body = "030 23125 349,(0)221 4710 977,01729091317,invalid" # String | The phone number(s) to format as text. Numbers can be seperated by comma, semicolon or newline.
format = format_example # String | How to format the phone numbers. Possible values are:
"local" - number without country code, e.g. 01784001420
"plus" - country code specified with a leading +, e.g. +491784001420
"zero" - country code specified with leading zeroes, e.g. 00491784001420
spacedAreaCode = true # Boolean | If true, adds a space character after the area code (optional) (default to true)
spacedCountryCode = true # Boolean | If true, adds a space character after the country code (optional) (default to true)
try:
# Format phone numbers
api_response = api_instance.phone_format_post(body, format, spacedAreaCode=spacedAreaCode, spacedCountryCode=spacedCountryCode)
pprint(api_response)
except ApiException as e:
print("Exception when calling DefaultApi->phoneFormatPost: %s\n" % e)