# Zoom Phone API to Forward Calls During Lunch

**URL:** <https://devforum.zoom.us/t/zoom-phone-api-to-forward-calls-during-lunch/94892>\
**Category:** Phone\
**Created:** [September 12, 2023, 2:51am UTC](https://devforum.zoom.us/t/zoom-phone-api-to-forward-calls-during-lunch/94892 "2023-09-12T02:51:33Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![paloaltoperio](https://avatars.discourse-cdn.com/v4/letter/p/858c86/32.png) [@paloaltoperio](https://devforum.zoom.us/u/paloaltoperio)\
**Post date:** [September 12, 2023, 2:51am UTC](https://devforum.zoom.us/t/zoom-phone-api-to-forward-calls-during-lunch/94892/1 "2023-09-12T02:51:34Z")

</div>

We are coming from a traditional PBX where we could just forward calls to an answering service ad hoc. this seems to not be supported in Zoom, so I thought why not write some python to forward and unforward, but it seems to not be working. What I would like to do is set the Main Auto Receptionist to forward to an external number when run. This is the snippet I have that is returning a 400 response code:

access\_token = response.json()[“access\_token”]  
headers = {‘Host’:‘[api.zoom.us](http://api.zoom.us)’,‘Authorization’: “Bearer {}”.format(access\_token),‘content-type’: ‘application/json’}

data = {“sub\_setting\_type”:“call\_handling”,“settings”:{‘routing’:{‘action’: 10,‘forward\_to’:{‘phone\_number’: ‘+1650xxxxxxx’}}}}

response = requests.patch(“[https://api.zoom.us/v2/phone/extension/{extension\_id}](https://api.zoom.us/v2/phone/extension/%7Bextension_id%7D)}/call\_handling/settings/business\_hours”, headers=headers, data=json.dumps(data))

print(response)

I would think this would work based on the API documention and the changes I observed when changing in the web ui and using the get function.

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![elisa.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/elisa.zoom/32/47836_2.png) [@elisa.zoom](https://devforum.zoom.us/u/elisa.zoom)\
**Post date:** [September 13, 2023, 4:16pm UTC](https://devforum.zoom.us/t/zoom-phone-api-to-forward-calls-during-lunch/94892/2 "2023-09-13T16:16:08Z")

</div>

HI @paloaltoperio  
Thanks for reaching out to us!  
So what response are you getting after sending this patch request?  
Are you just making one API call to patch an extension ID?

---

<div class="post-metadata">

**Author:** ![paloaltoperio](https://avatars.discourse-cdn.com/v4/letter/p/858c86/32.png) [@paloaltoperio](https://devforum.zoom.us/u/paloaltoperio)\
**Post date:** [September 13, 2023, 9:50pm UTC](https://devforum.zoom.us/t/zoom-phone-api-to-forward-calls-during-lunch/94892/3 "2023-09-13T21:50:49Z")

</div>

Yes, just one call. It gives Response 400.

Thanks!

---

<div class="post-metadata">

**Author:** ![elisa.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/elisa.zoom/32/47836_2.png) [@elisa.zoom](https://devforum.zoom.us/u/elisa.zoom)\
**Post date:** [September 14, 2023, 2:34pm UTC](https://devforum.zoom.us/t/zoom-phone-api-to-forward-calls-during-lunch/94892/4 "2023-09-14T14:34:55Z")

</div>

Let me try and replicate this on my end and I will get back to you  
Cheers,  
Elisa

---

<div class="post-metadata">

**Author:** ![elisa.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/elisa.zoom/32/47836_2.png) [@elisa.zoom](https://devforum.zoom.us/u/elisa.zoom)\
**Post date:** [September 15, 2023, 3:54pm UTC](https://devforum.zoom.us/t/zoom-phone-api-to-forward-calls-during-lunch/94892/5 "2023-09-15T15:54:41Z")

</div>

Hi @paloaltoperio  
As I am trying to replicate this issue on my end, I am facing a couple of issues.  
Are you using this endpoint here?

> **[Zoom Phone API](https://developers.zoom.us/docs/api/rest/reference/phone/methods/#operation/updateCallHandling)**
>
> API Reference for /docs/api/rest/reference/phone/methods

If so, please make sure to pass all the query parameters that are indicated, it looks like you are not passing the /call\_handling/settings/{settingType}

If you are not using this endpoint, could you point me to the endpoint you are using?

Also, how are you getting the extensionID? Via API? If so, could you also share that endpoint with me please
