API Endpoint(s) and/or Zoom API Event(s)
https://api.zoom.us/v2/phone/extension/$($ExtensionID)/call_handling/settings/business_hours
Description
I am trying to use this API endpoint to remotely set a user’s Business Hours Call Handling “When a call is not answered” routing to point to a target Call Queue with PowerShell.
Error?
I’m essentially just getting a (400) Bad Request error from the server. I’m pretty sure my JSON file is not constructed properly, but the API documentation does not have any code examples for changing the Call Handling pieces. There is a discrepancy between the naming conventions in the documentation and what I’m seeing in PowerShell.
- Documentation says to use the call_not_answered_action property, but a GET command of the call handling settings shows the property is called action.
- Documentation says to use forward_to_extension_id, but a GET command of the call handling settings shows the property is called just forward_to.
Needless to say, I’m stuck and seeking some assistance here. I’ve spent several hours trying to reformat the JSON request, both with the details in the documentation, and those pulled directly with a GET command from the API itself, and neither are working.
How To Reproduce
Steps to reproduce the behavior:
1. Body:
# Create the necessary JSON body for the PATCH request
$settingsBody = @{
settings = @{
routing = @{
action = 7
forward_to = @{
extension_type = "callQueue"
id = "$CallQueueID"
}
}
}
} | ConvertTo-Json -Depth 5
2. API Call:
Invoke-WebRequest -Method PATCH -Uri $settingsEndpoint -Headers $apiHeaders -Body $settingsBody -ContentType “application/json”
Any assistance would be greatly appreciated. Thank you!