Architect IVR API Clearing Fields

I just noticed some unexpected behavior today with the Architect API. If I send a PUT request to the ivrs endpoint to update the DNIS list on an IVR and don't include any flow properties (openHoursFlow, closedHoursFlow, scheduleGroup) those properties get cleared out. This happens when the flow is set to "Always route to call flow" with no schedule as well. I would think this is a bug since I don't expect the API to clear fields not included in the request. Has anyone else experienced this?

Here's my request:
PUT /api/v2/architect/ivrs/{ivrId}

{
   "name": "Test Inbound",
   "dnis": ["+13175551000", "+13175550000", "+13175551095"]
}

Yes, that's correct and working as intended. The standard use case for HTTP verbs in REST APIs is:

  • PUT - replace the object with the one provided in the body
  • PATCH - update only the properties provided in the body

There isn't a PATCH operation for this resource, so you need to send the full object you wish to have stored.

Ok, so rookie mistake on our part, thanks Tim.

One question/suggestion, I know the PureCloud UI doesn't allow saving an IVR without some call flow associated, would it make sense for the API to throw an error in a situation like this? Based on the docs it seems it already does if a schedule group is provided without an open and close flow, but adding an error if you don't provide an open flow at all might be helpful.

Thanks, I've passed that feedback on to the Architect dev team.

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