Genesys Cloud - Main

 View Only

Discussion Thread View
  • 1.  Duplicate / Modify external trunks via API

    Posted 30 days ago

    Hi,

    Is it possible to duplicate or update external trunk via API ?
    I want to create multiple external trunks. I couldn't find APIs for duplicate a trunk. -- I can't understand how to specify the 
     trunkbasesetting id of my original trunks.
    I can duplicate trunk via Genesys Cloud UI, so Is it possible to modify the name of trunk and phone number in it ?
    Regards.
    Yasuto,

    #API/Integrations
    #SIP/VoIP
    #System Administration
    #Telephony

    ------------------------------
    Yasuto Shinmura
    ディレクター
    ------------------------------


  • 2.  RE: Duplicate / Modify external trunks via API

    Posted 30 days ago

    When you use the copy option in the UI, what it's really doing is taking a copy of the data but then creating new objects as opposed to an AI copy command. What you can do is use Developer Tools in your browser and watch the process when you click copy. This is a useful way of seeing the API calls used when you want to replicate a UI process.



    ------------------------------
    Richard Chandler
    Connect
    ------------------------------



  • 3.  RE: Duplicate / Modify external trunks via API

    Posted 29 days ago

    Ok, I understood as I might combine several api calls to duplicate s trunk.



    ------------------------------
    Yasuto Shinmura
    ディレクター
    ------------------------------



  • 4.  RE: Duplicate / Modify external trunks via API

    Posted 29 days ago

    So, does anyone tells me how to modify existing trunk details via APIs?



    ------------------------------
    Yasuto Shinmura
    ディレクター
    ------------------------------



  • 5.  RE: Duplicate / Modify external trunks via API
    Best Answer

    Posted 29 days ago

    Hi Yasuto,

    I'd suggest this is normally better answered in the Developer Forum. However some pointers.

    Use GET /api/v2/telephony/providers/edges/trunks to get a list of trunks that you want to edit or copy. This will include the Trunk ID and BaseSettings ID

    You can then use GET /api/v2/telephony/providers/edges/trunkbasesettings/{tunkBaseSettingsId} to get the Base settings information.

    You can use POST /api/v2/telephont/providers/edges/trunkbasesettings to create a new base

    The payload can be as simple as below but it won't work unless you have all the relevant info which you can get from a sample in the GET commands above.

    {
      "name": "Bob",
      "description": "Bobs Trunk",
      "trunkMetabase": {
        "id": "external_sip_pcv_byoc_carrier.json",
        "name": "Generic BYOC Carrier"
      },
      "trunkType": "EXTERNAL"
    }

    To Update you use the PUT variant of the POST command. However a PUT replaces all data unlike a PATCH so you basically copy almost everything. An important item to note is the PUT command has a version required so you always need to get the latest version via a GET and then update it.



    ------------------------------
    Richard Chandler
    Connect
    ------------------------------



  • 6.  RE: Duplicate / Modify external trunks via API

    Posted 28 days ago

    Hi Richard,

    Thank you for your suggestions.

    I will try that methods.



    ------------------------------
    Yasuto Shinmura
    ディレクター
    ------------------------------



Need Help finding something?

Check out the Genesys Knowledge Network - your all-in-one access point for Genesys resources