OmniDim Logo

    Phone Number API

    The Phone Number API allows you to manage phone numbers for your agents. You can list all phone numbers associated with your account, attach phone numbers to agents, and detach phone numbers from agents.

    List Phone Numbers

    Parameters

    page
    int
    Optional

    Page number for pagination.

    page_size
    int
    Optional

    Number of items per page.

    Example

    1 2 3 4 5 6 7 8 9 10 import os from omnidimension import Client # Initialize the client api_key = os.environ.get('OMNIDIM_API_KEY') client = Client(api_key) # List all phone numbers with pagination response = client.phone_number.list(page=1, page_size=10) print(response)

    Attach Phone Number to Agent

    Parameters

    phone_number_id
    int
    Required

    ID of the phone number to attach.

    agent_id
    int
    Required

    ID of the agent to attach the phone number to.

    Example

    1 2 3 4 5 6 7 8 9 10 11 12 import os from omnidimension import Client # Initialize the client api_key = os.environ.get('OMNIDIM_API_KEY') client = Client(api_key) # Attach a phone number to an agent phone_number_id = 123 # Replace with your phone number ID agent_id = 456 # Replace with your agent ID response = client.phone_number.attach(phone_number_id, agent_id) print(response)

    Detach Phone Number

    Parameters

    phone_number_id
    int
    Required

    ID of the phone number to detach.

    Example

    1 2 3 4 5 6 7 8 9 10 11 import os from omnidimension import Client # Initialize the client api_key = os.environ.get('OMNIDIM_API_KEY') client = Client(api_key) # Detach a phone number from its associated agent phone_number_id = 123 # Replace with your phone number ID response = client.phone_number.detach(phone_number_id) print(response)