Yay.com loading

Loading

  • My Shopping Cart (0) £0.00

  • Register

SIP Trunks

API Access

Build custom apps using our JSON API

FREE
Get your free API Key

Trunks

Trunk are used to send calls to and from an external PBX

Get your free API Key

Filter:

  • All
  • GET
  • POST
  • PUT
  • DELETE
  • Chargeable *

* You will be charged every time this command is run.

  • GET/voip/trunk

    Gets a list of all of the active trunks on an account

    Back to top

    Request Details

    Response Details

    Request Details

    This command has no URL/Query String parameters

    Response Details

    200 Response

    {
        "result" : [
            {
                "name" : "Pete's Trunk",
                "user" : "%e164",
                "domain" : "example.com",
                "port" : 5060,
                "transport" : "udp",
                "auth" : [
                    {
                        "type" : "ip",
                        "ip" : "255.255.255.255",
                        "username" : "pete_plumber1",
                        "password" : "secret",
                        "uuid" : "31347d42-00bd-44a5-9b5c-20dc4197a2f6",
                        "created_on" : "2017-07-25",
                        "updated_on" : "2017-07-25"
                    }
                ],
                "uuid" : "31347d42-00bd-44a5-9b5c-20dc4197a2f6",
                "created_on" : "2017-07-25",
                "updated_on" : "2017-07-25"
            }
        ],
        "status_code" : 200,
        "status_message" : "OK"
    }
  • GET/voip/trunk/{uuid}

    Gets the details for a specific trunk on an account

    Back to top

    Request Details

    Response Details

    Request Details

    URL and Query String Parameters

    • Name

    • Type

    • Required

      • uuid

      • String

      • True

      The UUID of the Trunk to be queried

    Response Details

    200 Response

    {
        "result" : {
            "name" : "Pete's Trunk",
            "user" : "%e164",
            "domain" : "example.com",
            "port" : 5060,
            "transport" : "udp",
            "auth" : [
                {
                    "type" : "ip",
                    "ip" : "255.255.255.255",
                    "username" : "pete_plumber1",
                    "password" : "secret",
                    "uuid" : "31347d42-00bd-44a5-9b5c-20dc4197a2f6",
                    "created_on" : "2017-07-25",
                    "updated_on" : "2017-07-25"
                }
            ],
            "uuid" : "31347d42-00bd-44a5-9b5c-20dc4197a2f6",
            "created_on" : "2017-07-25",
            "updated_on" : "2017-07-25"
        },
        "status_code" : 200,
        "status_message" : "OK"
    }

    404 Response

    {
        "result" : {},
        "status_code" : 404,
        "status_message" : "Not Found"
    }
  • POST/voip/trunk

    Creates a new trunk on an account

    Back to top

    Request Details

    Response Details

    Request Details

    This command has no URL/Query String parameters

    POST body

    • Name

    • Type

    • Required

      • domain

      • String

      • True

      The domain to which we will send calls to this Trunk

      • name

      • String

      • True

      The name of this Trunk

      • port

      • Integer

      • True

      The port we will use to send calls to this Trunk

      • transport

      • String

      • True

      The transport protocol used for this Trunk. One of 'udp', 'tcp', or 'tls'.

      • user

      • String

      • True

      The username we will use to send calls to this trunk, or '%e164' to have this replaced with the dialled number

    TrunkAuth

      • ip

      • String

      • True

      If type is 'ip', this is the IP Address we will use to authenticate incoming calls.

      • password

      • String

      • True

      If type is 'sipuser', this is the SIP Password we will use to authenticate incoming calls.

      • type

      • String

      • True

      The type of authentication method. Either 'ip' or 'sipuser'.

      • username

      • String

      • True

      If type is 'sipuser', this is the SIP Username we will use to authenticate incoming calls.

    JSON all-fields example:

    {
        "name" : "Pete's Trunk",
        "user" : "%e164",
        "domain" : "example.com",
        "port" : 5060,
        "transport" : "udp"
    }

    Response Details

    201 Response

    {
        "result" : {
            "name" : "Pete's Trunk",
            "user" : "%e164",
            "domain" : "example.com",
            "port" : 5060,
            "transport" : "udp",
            "auth" : [
                {
                    "type" : "ip",
                    "ip" : "255.255.255.255",
                    "username" : "pete_plumber1",
                    "password" : "secret",
                    "uuid" : "31347d42-00bd-44a5-9b5c-20dc4197a2f6",
                    "created_on" : "2017-07-25"
                }
            ],
            "uuid" : "31347d42-00bd-44a5-9b5c-20dc4197a2f6",
            "created_on" : "2017-07-25"
        },
        "status_code" : 201,
        "status_message" : "Created"
    }

    400 Response

    {
        "result" : {},
        "status_code" : 400,
        "status_message" : "Bad Request"
    }
  • PUT/voip/trunk/{uuid}

    Updates the specified trunk

    Back to top

    Request Details

    Response Details

    Request Details

    URL and Query String Parameters

    • Name

    • Type

    • Required

      • uuid

      • String

      • True

      The UUID of the Trunk to be updated

    PUT body

    • Name

    • Type

    • Required

      • domain

      • String

      • True

      The domain to which we will send calls to this Trunk

      • name

      • String

      • True

      The name of this Trunk

      • port

      • Integer

      • True

      The port we will use to send calls to this Trunk

      • transport

      • String

      • True

      The transport protocol used for this Trunk. One of 'udp', 'tcp', or 'tls'.

      • user

      • String

      • True

      The username we will use to send calls to this trunk, or '%e164' to have this replaced with the dialled number

    TrunkAuth

      • ip

      • String

      • True

      If type is 'ip', this is the IP Address we will use to authenticate incoming calls.

      • password

      • String

      • True

      If type is 'sipuser', this is the SIP Password we will use to authenticate incoming calls.

      • type

      • String

      • True

      The type of authentication method. Either 'ip' or 'sipuser'.

      • username

      • String

      • True

      If type is 'sipuser', this is the SIP Username we will use to authenticate incoming calls.

    JSON all-fields example:

    {
        "name" : "Pete's Trunk",
        "user" : "%e164",
        "domain" : "example.com",
        "port" : 5060,
        "transport" : "udp"
    }

    Response Details

    200 Response

    {
        "result" : {
            "name" : "Pete's Trunk",
            "user" : "%e164",
            "domain" : "example.com",
            "port" : 5060,
            "transport" : "udp",
            "auth" : [
                {
                    "type" : "ip",
                    "ip" : "255.255.255.255",
                    "username" : "pete_plumber1",
                    "password" : "secret",
                    "uuid" : "31347d42-00bd-44a5-9b5c-20dc4197a2f6",
                    "created_on" : "2017-07-25",
                    "updated_on" : "2017-07-25"
                }
            ],
            "uuid" : "31347d42-00bd-44a5-9b5c-20dc4197a2f6",
            "created_on" : "2017-07-25",
            "updated_on" : "2017-07-25"
        },
        "status_code" : 200,
        "status_message" : "OK"
    }

    400 Response

    {
        "result" : {},
        "status_code" : 400,
        "status_message" : "Bad Request"
    }

    404 Response

    {
        "result" : {},
        "status_code" : 404,
        "status_message" : "Not Found"
    }
  • DELETE/voip/trunk/{uuid}

    Deletes the specified trunk

    Back to top

    Request Details

    Response Details

    Request Details

    URL and Query String Parameters

    • Name

    • Type

    • Required

      • uuid

      • String

      • True

      The UUID of the Trunk to be deleted

    Response Details

    204 Response

    {
        "result" : {},
        "status_code" : 204,
        "status_message" : "No Content"
    }

    404 Response

    {
        "result" : {},
        "status_code" : 404,
        "status_message" : "Not Found"
    }
  • DELETE/voip/trunk/{uuid}/auth/{auth_uuid}

    Deletes the specified trunk authentication method from the given trunk

    Back to top

    Request Details

    Response Details

    Request Details

    URL and Query String Parameters

    • Name

    • Type

    • Required

      • uuid

      • String

      • True

      The UUID of the Trunk to be updated

      • auth_uuid

      • String

      • True

      The UUID of the Trunk Authentication method to be deleted

    Response Details

    204 Response

    {
        "result" : {},
        "status_code" : 204,
        "status_message" : "No Content"
    }

    404 Response

    {
        "result" : {},
        "status_code" : 404,
        "status_message" : "Not Found"
    }
View Desktop Site