Legacy Dev Forum Posts

 View Only

Sign Up

How to assign CAll Flow to a DID

  • 1.  How to assign CAll Flow to a DID

    Posted 06-05-2025 18:31

    copost | 2024-06-19 13:14:47 UTC | #1

    I would like to use the API to assign a Call Flow to a DID. The same result as you get by manually: Admin / DID Numbers / Assign DID number

    I found the PUT/api/v2/architect/ivrs/{ivrId}

    { "name": "test1", "version": 3, "dnis": [ "31123456789" ] }

    But running this, the new DID will be added, but all already assigned DIDs are removed, include config of this Call Flow. So can I use this API with some options to keep current config, or os there another API I can use?

    Many thanks!

    regards, Co

    Please, is there someone who cal help me how to just add a DID to a Call Flow without any other changes?


    jacobshaw | 2024-06-20 13:22:55 UTC | #2

    @copost

    I'm guessing what's happening is that the other DNIs and config is getting overwritten because this a PUT and not a PATCH endpoint. You should be able to first call GET /api/v2/architect/ivrs/{ivrId}, then use the response body to fill out the rest of the request to PUT/api/v2/architect/ivrs/{ivrId}


    copost | 2024-06-21 09:40:07 UTC | #3

    @jacobshaw thanks for your solution (workaround) and this worked properly. However, since this is a list of 200+ DNIS numbers for one call flow ( an important one) the impact would be very large if something goes wrong and the DNIS aren't assigned anymore. Do you know if there is another way to assign a DID to a call flow?

    thanks!


    jacobshaw | 2024-06-21 13:02:04 UTC | #4

    That is standard practice for PUT endpoints, which are meant to replace the entire object, versus a PATCH endpoint which is meant for partial updates. An alternative would be to use GET /api/v2/architect/ivrs to get all the IVR configs up front, then stash them somewhere and then lookup and use them as needed.


    copost | 2024-06-24 07:10:30 UTC | #5

    jacobshaw, post:4, topic:26855
    An alternative would be to use GET /api/v2/architect/ivrs to get all the IVR configs up front, then stash the

    Thanks again, and I know how a PUT works and I wish there was a PATCH. So I was hoping there was another API where you assigning a calls flow to a DNIS, in stead of DNIS to a CallFlow like this API. Just like you do at the GUI. But it seems there is not. However, thanks for your time!


    system | 2024-07-24 07:10:33 UTC | #6

    This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.


    This post was migrated from the old Developer Forum.

    ref: 26855