Port via API -Python examples



Submit BUSINESS PORT to Apeiron using python requests:



import requests
from requests.auth import HTTPBasicAuth

URL = 'https://api.apeiron.io/v2/ordering/orders/ports'
TOKEN = '2TUxwADAkotusmlNK7Mf2439QxJAjLUBBPSaMZQamdM51PZfzkoLxhAl32h8PQ1e'
USERNAME = '[email protected]'

data = {
    'phone_numbers': '2475221156,2475221179,2475221350',
    'billing_tn': '2475221156',
    'trunk_group_id': 104126,

    'current_provider': ' AT&T',
    'authorization_name': 'David Williams',
    'first_name': 'David',
    'last_name': 'Williams',
    'business_name': 'WILLY\'S WINDOWS',
    'business': True,

    'full_port': False,

    'housenumber': 4486,
    'room_type': '',
    'room_number': '',
    'predirectional':'',
    'streetname': 'SUNSET BLVD',
    'city': 'LOS ANGELES',
    'state': 'CA',
    'postal_code': 90017,

    'due_date': '2015-02-28',
    'ticket_id': '',
    'features': [
        {
            'number': '2475221156',
            'cnam': 'WILLY\'S WINDOWS',
            'sms': False,
            'e911': False,
            'directory_publish': False,
            'caller_id_private': False,
        },
        {
            'number': '2475221179',
            'cnam': 'WILLY\'S WINDOWS',
            'sms': False,
            'e911': False,
            'directory_publish': False,
            'caller_id_private': False,
        },
        {
            'number': '2475221350',
            'cnam': 'WILLY\'S WINDOWS',
            'sms': False,
            'e911': False,
            'directory_publish': False,
            'caller_id_private': False,
        },
    ]

}

response = requests.post(URL, json=data, auth=HTTPBasicAuth(USERNAME, TOKEN))
print response.text



Submit RESIDENTIAL PORT to Apeiron using python requests:



import requests
from requests.auth import HTTPBasicAuth

URL = 'https://api.apeiron.io/v2/ordering/orders/ports'
TOKEN = '2TUxwADAkotusmlNK7Mf2439QxJAjLUBBPSaMZQamdM51PZfzkoLxhAl32h8PQ1e'
USERNAME = '[email protected]'

data = {
    'phone_numbers': '2475221156',
    'billing_tn': '2475221156',
    'trunk_group_id': 104126,

    'current_provider': ' AT&T',
    'authorization_name': 'David Williams',
    'first_name': 'David',
    'last_name': 'Williams',
    'business': False,
    'full_port': False,

    'housenumber': 4486,
    'room_type': '',
    'room_number': '',
    'predirectional':'',
    'streetname': 'SUNSET BLVD',
    'city': 'LOS ANGELES',
    'state': 'CA',
    'postal_code': 90017,

    'due_date': '2015-02-28',
    'ticket_id': '',
    'features': [
        {
            'number': '2475221156',
            'cnam': 'DAVID WILLIAMS',
            'sms': False,
            'e911': False,
            'directory_publish': False,
            'caller_id_private': False,
        },
    ]

}

response = requests.post(URL, json=data, auth=HTTPBasicAuth(USERNAME, TOKEN))
print response.text