Interactive voice response (IVR) uses keypad tones to route customers to the right agent or department, provide recorded responses for frequently asked questions, and deflect calls by allowing callers to switch the interaction to text. IVR is available on the Talk Professional and Enterprise plans. For more information, seeRoute incoming calls with IVRin the Zendesk Help Center.

JSON format

IVR Menus are represented as JSON objects with the following properties:

Name Type Read-only Mandatory Description
default boolean true false Whether this is the default menu for the IVR
greeting_id integer false false The ID of the greeting associated with the IVR menu
id integer true false The IVR menu ID
name string false false The name of the IVR menu
routes array true false The list of the IVR menu routes

Example

             
{"default":true,"greeting_id":10001,"id":10001,"name":"Main menu","routes":[{"action":"group","greeting":null,"id":10001,"keypress":"0","option_text":"Support Group","options":{"group_ids":[360001381413]}}]}

List IVR Menus

  • GET /api/v2/channels/voice/ivr/{ivr_id}/menus

Allowed For

  • Agents

Parameters

Name Type In Required Description
ivr_id integer Path true The ID of the IVR

代码示例

旋度
              
旋度https://{subdomain}.zendesk.com/api/v2/channels/voice/ivr/{ivr_id}/menus.json\-v -u{email_address}:{password}-X GET
Go
              
import("fmt""io""net/http")funcmain(){url:="https://support.zendesk.com/api/v2/channels/voice/ivr/10001/menus"method:="GET"req,err:=http.NewRequest(method,url,nil)iferr!=nil{fmt.Println(err)return}req.Header.Add("Content-Type","application/json")req.Header.Add("Authorization","Basic ")// Base64 encoded "username:password"client:=&http.Client{}res,err:=client.Do(req)iferr!=nil{fmt.Println(err)return}deferres.Body.Close()body,err:=io.ReadAll(res.Body)iferr!=nil{fmt.Println(err)return}fmt.Println(string(body))}
Java
              
importcom.squareup.okhttp.*;OkHttpClientclient=newOkHttpClient();HttpUrl.BuilderurlBuilder=HttpUrl.parse("https://support.zendesk.com/api/v2/channels/voice/ivr/10001/menus").newBuilder();Requestrequest=newRequest.Builder().url(urlBuilder.build()).method("GET",null).addHeader("Content-Type","application/json").addHeader("Authorization",Credentials.basic("your-email","your-password")).build();Responseresponse=client.newCall(request).execute();
Nodejs
              
varaxios=require('axios');varconfig={method:'GET',url:'https://support.zendesk.com/api/v2/channels/voice/ivr/10001/menus',headers:{'Content-Type':'application/json','Authorization':'Basic ',// Base64 encoded "username:password"},};axios(config).then(function(response){console.log(JSON.stringify(response.data));}).catch(function(error){console.log(error);});
Python
              
importrequestsurl="https://support.zendesk.com/api/v2/channels/voice/ivr/10001/menus"headers={"Content-Type":"application/json",}response=requests.request("GET",url,auth=('',''),headers=headers)print(response.text)
Ruby
              
require"net/http"uri=URI("https://support.zendesk.com/api/v2/channels/voice/ivr/10001/menus")request=Net::HTTP::Get.new(uri,"Content-Type":"application/json")request.basic_auth"username","password"response=Net::HTTP.start uri.hostname,uri.port,use_ssl:truedo|http|http.request(request)end

Example response(s)

200 OK
              
// Status 200 OK{"count":1,"ivr_menus":[{"default":true,"greeting_id":10001,"id":10001,"name":"Main menu","routes":[{"action":"group","greeting":null,"id":10001,"keypress":"0","option_text":"Support Group","options":{"group_ids":[360001381413]}}]}],"next_page":null,"previous_page":null}

Show IVR Menu

  • GET /api/v2/channels/voice/ivr/{ivr_id}/menus/{menu_id}

Allowed For

  • Agents

Parameters

Name Type In Required Description
ivr_id integer Path true The ID of the IVR
menu_id integer Path true The ID of the IVR Menu

代码示例

旋度
              
旋度https://{subdomain}.zendesk.com/api/v2/channels/voice/ivr/{ivr_id}/menus/{menu_id}.json\-v -u{email_address}:{password}-X GET
Go
              
import("fmt""io""net/http")funcmain(){url:="https://support.zendesk.com/api/v2/channels/voice/ivr/10001/menus/10001"method:="GET"req,err:=http.NewRequest(method,url,nil)iferr!=nil{fmt.Println(err)return}req.Header.Add("Content-Type","application/json")req.Header.Add("Authorization","Basic ")// Base64 encoded "username:password"client:=&http.Client{}res,err:=client.Do(req)iferr!=nil{fmt.Println(err)return}deferres.Body.Close()body,err:=io.ReadAll(res.Body)iferr!=nil{fmt.Println(err)return}fmt.Println(string(body))}
Java
              
importcom.squareup.okhttp.*;OkHttpClientclient=newOkHttpClient();HttpUrl.BuilderurlBuilder=HttpUrl.parse("https://support.zendesk.com/api/v2/channels/voice/ivr/10001/menus/10001").newBuilder();Requestrequest=newRequest.Builder().url(urlBuilder.build()).method("GET",null).addHeader("Content-Type","application/json").addHeader("Authorization",Credentials.basic("your-email","your-password")).build();Responseresponse=client.newCall(request).execute();
Nodejs
              
varaxios=require('axios');varconfig={method:'GET',url:'https://support.zendesk.com/api/v2/channels/voice/ivr/10001/menus/10001',headers:{'Content-Type':'application/json','Authorization':'Basic ',// Base64 encoded "username:password"},};axios(config).then(function(response){console.log(JSON.stringify(response.data));}).catch(function(error){console.log(error);});
Python
              
importrequestsurl="https://support.zendesk.com/api/v2/channels/voice/ivr/10001/menus/10001"headers={"Content-Type":"application/json",}response=requests.request("GET",url,auth=('',''),headers=headers)print(response.text)
Ruby
              
require"net/http"uri=URI("https://support.zendesk.com/api/v2/channels/voice/ivr/10001/menus/10001")request=Net::HTTP::Get.new(uri,"Content-Type":"application/json")request.basic_auth"username","password"response=Net::HTTP.start uri.hostname,uri.port,use_ssl:truedo|http|http.request(request)end

Example response(s)

200 OK
              
// Status 200 OK{"ivr_menu":{"default":false,"greeting_id":null,"id":10001,"name":"Main Menu","routes":[{"action":"group","greeting":null,"id":10001,"keypress":"0","option_text":"Support Group","options":{"group_ids":[360001381413]}}]}}

Create IVR Menu

  • POST /api/v2/channels/voice/ivr/{ivr_id}/menus

Allowed For

  • Agents

Parameters

Name Type In Required Description
ivr_id integer Path true The ID of the IVR

Example body

             
{"ivr_menu":{"name":"Main Menu"}}

代码示例

旋度
              
旋度https://{subdomain}.zendesk.com/api/v2/channels/voice/ivr/{ivr_id}/menus.json\-H"Content-Type: application/json"-d'{"ivr_menu": {"name": "Main Menu"}}'\-v -u{email_address}:{password}-X POST
Go
              
import("fmt""io""net/http""strings")funcmain(){url:="https://support.zendesk.com/api/v2/channels/voice/ivr/10001/menus"method:="POST"payload:=strings.NewReader(`{"ivr_menu": {"name": "Main Menu"}}`)req,err:=http.NewRequest(method,url,payload)iferr!=nil{fmt.Println(err)return}req.Header.Add("Content-Type","application/json")req.Header.Add("Authorization","Basic ")// Base64 encoded "username:password"client:=&http.Client{}res,err:=client.Do(req)iferr!=nil{fmt.Println(err)return}deferres.Body.Close()body,err:=io.ReadAll(res.Body)iferr!=nil{fmt.Println(err)return}fmt.Println(string(body))}
Java
              
importcom.squareup.okhttp.*;OkHttpClientclient=newOkHttpClient();HttpUrl.BuilderurlBuilder=HttpUrl.parse("https://support.zendesk.com/api/v2/channels/voice/ivr/10001/menus").newBuilder();RequestBodybody=RequestBody.create(MediaType.parse("application/json"),"""{\"ivr_menu\":{\"name\":\"MainMenu\"}}""");Requestrequest=newRequest.Builder().url(urlBuilder.build()).method("POST",body).addHeader("Content-Type","application/json").addHeader("Authorization",Credentials.basic("your-email","your-password")).build();Responseresponse=client.newCall(request).execute();
Nodejs
              
varaxios=require('axios');vardata=JSON.stringify({"ivr_menu":{"name":"Main Menu"}});varconfig={method:'POST',url:'https://support.zendesk.com/api/v2/channels/voice/ivr/10001/menus',headers:{'Content-Type':'application/json','Authorization':'Basic ',// Base64 encoded "username:password"},data:data,};axios(config).then(function(response){console.log(JSON.stringify(response.data));}).catch(function(error){console.log(error);});
Python
              
importrequestsimportjsonurl="https://support.zendesk.com/api/v2/channels/voice/ivr/10001/menus"payload=json.loads("""{"ivr_menu": {"name": "Main Menu"}}""")headers={"Content-Type":"application/json",}response=requests.request("POST",url,auth=('',''),headers=headers,json=payload)print(response.text)
Ruby
              
require"net/http"uri=URI("https://support.zendesk.com/api/v2/channels/voice/ivr/10001/menus")request=Net::HTTP::Post.new(uri,"Content-Type":"application/json")request.body=%q({"ivr_menu":{"name":"Main Menu"}})request.basic_auth"username","password"response=Net::HTTP.start uri.hostname,uri.port,use_ssl:truedo|http|http.request(request)end

Example response(s)

201 Created
              
// Status 201 Created{"ivr_menu":{"default":false,"greeting_id":null,"id":10001,"name":"Main Menu","routes":[{"action":"group","greeting":null,"id":10001,"keypress":"0","option_text":"Support Group","options":{"group_ids":[360001381413]}}]}}

Update IVR Menu

  • PUT /api/v2/channels/voice/ivr/{ivr_id}/menus/{menu_id}

Allowed For

  • Agents

Parameters

Name Type In Required Description
ivr_id integer Path true The ID of the IVR
menu_id integer Path true The ID of the IVR Menu

Example body

             
{"ivr_menu":{"name":"Main Menu"}}

代码示例

旋度
              
旋度https://{subdomain}.zendesk.com/api/v2/channels/voice/ivr/{ivr_id}/menus/{menu_id}.json\-H"Content-Type: application/json"-d'{"ivr_menu": {"name": "Secondary Menu"}}'\-v -u{email_address}:{password}-X PUT
Go
              
import("fmt""io""net/http""strings")funcmain(){url:="https://support.zendesk.com/api/v2/channels/voice/ivr/10001/menus/10001"method:="PUT"payload:=strings.NewReader(`{"ivr_menu": {"name": "Main Menu"}}`)req,err:=http.NewRequest(method,url,payload)iferr!=nil{fmt.Println(err)return}req.Header.Add("Content-Type","application/json")req.Header.Add("Authorization","Basic ")// Base64 encoded "username:password"client:=&http.Client{}res,err:=client.Do(req)iferr!=nil{fmt.Println(err)return}deferres.Body.Close()body,err:=io.ReadAll(res.Body)iferr!=nil{fmt.Println(err)return}fmt.Println(string(body))}
Java
              
importcom.squareup.okhttp.*;OkHttpClientclient=newOkHttpClient();HttpUrl.BuilderurlBuilder=HttpUrl.parse("https://support.zendesk.com/api/v2/channels/voice/ivr/10001/menus/10001").newBuilder();RequestBodybody=RequestBody.create(MediaType.parse("application/json"),"""{\"ivr_menu\":{\"name\":\"MainMenu\"}}""");Requestrequest=newRequest.Builder().url(urlBuilder.build()).method("PUT",body).addHeader("Content-Type","application/json").addHeader("Authorization",Credentials.basic("your-email","your-password")).build();Responseresponse=client.newCall(request).execute();
Nodejs
              
varaxios=require('axios');vardata=JSON.stringify({"ivr_menu":{"name":"Main Menu"}});varconfig={method:'PUT',url:'https://support.zendesk.com/api/v2/channels/voice/ivr/10001/menus/10001',headers:{'Content-Type':'application/json','Authorization':'Basic ',// Base64 encoded "username:password"},data:data,};axios(config).then(function(response){console.log(JSON.stringify(response.data));}).catch(function(error){console.log(error);});
Python
              
importrequestsimportjsonurl="https://support.zendesk.com/api/v2/channels/voice/ivr/10001/menus/10001"payload=json.loads("""{"ivr_menu": {"name": "Main Menu"}}""")headers={"Content-Type":"application/json",}response=requests.request("PUT",url,auth=('',''),headers=headers,json=payload)print(response.text)
Ruby
              
require"net/http"uri=URI("https://support.zendesk.com/api/v2/channels/voice/ivr/10001/menus/10001")request=Net::HTTP::Put.new(uri,"Content-Type":"application/json")request.body=%q({"ivr_menu":{"name":"Main Menu"}})request.basic_auth"username","password"response=Net::HTTP.start uri.hostname,uri.port,use_ssl:truedo|http|http.request(request)end

Example response(s)

200 OK
              
// Status 200 OK{"ivr_menu":{"default":false,"greeting_id":null,"id":10001,"name":"Main Menu","routes":[{"action":"group","greeting":null,"id":10001,"keypress":"0","option_text":"Support Group","options":{"group_ids":[360001381413]}}]}}

删除IVR Menu

  • DELETE /api/v2/channels/voice/ivr/{ivr_id}/menus/{menu_id}

Allowed For

  • Agents

Parameters

Name Type In Required Description
ivr_id integer Path true The ID of the IVR
menu_id integer Path true The ID of the IVR Menu

代码示例

旋度
              
旋度https://{subdomain}.zendesk.com/api/v2/channels/voice/ivr/{ivr_id}/menus/{menu_id}.json\-v -u{email_address}:{password}-X DELETE
Go
              
import("fmt""io""net/http")funcmain(){url:="https://support.zendesk.com/api/v2/channels/voice/ivr/10001/menus/10001"method:="DELETE"req,err:=http.NewRequest(method,url,nil)iferr!=nil{fmt.Println(err)return}req.Header.Add("Content-Type","application/json")req.Header.Add("Authorization","Basic ")// Base64 encoded "username:password"client:=&http.Client{}res,err:=client.Do(req)iferr!=nil{fmt.Println(err)return}deferres.Body.Close()body,err:=io.ReadAll(res.Body)iferr!=nil{fmt.Println(err)return}fmt.Println(string(body))}
Java
              
importcom.squareup.okhttp.*;OkHttpClientclient=newOkHttpClient();HttpUrl.BuilderurlBuilder=HttpUrl.parse("https://support.zendesk.com/api/v2/channels/voice/ivr/10001/menus/10001").newBuilder();Requestrequest=newRequest.Builder().url(urlBuilder.build()).method("DELETE",null).addHeader("Content-Type","application/json").addHeader("Authorization",Credentials.basic("your-email","your-password")).build();Responseresponse=client.newCall(request).execute();
Nodejs
              
varaxios=require('axios');varconfig={method:'DELETE',url:'https://support.zendesk.com/api/v2/channels/voice/ivr/10001/menus/10001',headers:{'Content-Type':'application/json','Authorization':'Basic ',// Base64 encoded "username:password"},};axios(config).then(function(response){console.log(JSON.stringify(response.data));}).catch(function(error){console.log(error);});
Python
              
importrequestsurl="https://support.zendesk.com/api/v2/channels/voice/ivr/10001/menus/10001"headers={"Content-Type":"application/json",}response=requests.request("DELETE",url,auth=('',''),headers=headers)print(response.text)
Ruby
              
require"net/http"uri=URI("https://support.zendesk.com/api/v2/channels/voice/ivr/10001/menus/10001")request=Net::HTTP::删除.new(uri,"Content-Type":"application/json")request.basic_auth"username","password"response=Net::HTTP.start uri.hostname,uri.port,use_ssl:truedo|http|http.request(request)end

Example response(s)

200 OK
              
// Status 200 OK{"ivr_menu":{"default":false,"greeting_id":null,"id":10001,"name":"Main Menu","routes":[{"action":"group","greeting":null,"id":10001,"keypress":"0","option_text":"Support Group","options":{"group_ids":[360001381413]}}]}}