Zendesk voice provides a number of default greetings. You can either use the default greetings or replace them with custom greetings. SeeManaging outgoing greetingsin Zendesk help.

Greetings are assigned to greeting categories.

JSON format

Greetings are represented as JSON objects with the following properties:

Name Type Read-only 强制性的 Description
active boolean true false The value is true if the greeting is associated with one or more phone numbers
audio_name string false false Greeting audio name provided in greeting .mp3 or .wav format
audio_url string false false The path to the greeting sound file
category_id integer false true The id of the greeting category. *Writeable on create only.
default boolean true false True if the greeting is a system default greeting
default_lang boolean false false Whether or not the greeting has a default language
has_sub_settings boolean false false Sub-settings for categorized greetings
id true false The greeting ID
ivr_ids array false false The IDs of the IVRs associated with the greeting
name string false true The name of the greeting
pending boolean false false Whether or not the greeting is pending
phone_number_ids array false false The IDs of the phone numbers associated with the greeting
upload_id integer false false Upload ID associated with the greeting

Example

             
{"active":true,"audio_url":"/system/voice/uploads/0000/0002/premium-support-greeting.mp3","category_id":1,"default":false,"id":123,"name":"Premium Support"}

List Greeting Categories

  • GET /api/v2/channels/voice/greeting_categories

Allowed For

  • Agents

Greeting categories are represented as JSON objects which have the following keys:

Name Type Read-only 强制性的 Description
id integer true false The greeting category ID
name string true false The name of the greeting category
             
{"id":1,"name":"voicemail"}

代码示例

旋度
              
旋度https://{subdomain}.zendesk.com/api/v2/channels/voice/greeting_categories.json\-v -u{email_address}:{password}-X GET
Go
              
import("fmt""io""net/http")funcmain(){url:="https://support.zendesk.com/api/v2/channels/voice/greeting_categories"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/greeting_categories").newBuilder();Request请求=newRequest.Builder().url(urlBuilder.build()).method("GET",null).addHeader("Content-Type","application/json").addHeader("Authorization",Credentials.基本("your-email","your-password")).build();Responseresponse=client.newCall(请求).execute();
Nodejs
              
varaxios=require('axios');varconfig={method:'GET',url:“https://support.zendesk.com/api/v2/channels/voice/greeting_categories',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
              
import请求surl="https://support.zendesk.com/api/v2/channels/voice/greeting_categories"headers={"Content-Type":"application/json",}response=请求s.请求("GET",url,auth=('',''),headers=headers)print(response.text)
Ruby
              
require"net/http"uri=URI("https://support.zendesk.com/api/v2/channels/voice/greeting_categories")请求=Net::HTTP::Get.new(uri,"Content-Type":"application/json")请求.基本_auth"username","password"response=Net::HTTP.start uri.hostname,uri.port,use_ssl:truedo|http|http.请求(请求)end

Example response(s)

200 OK
              
// Status 200 OK{"greeting_categories":[{"id":1,"name":"voicemail"},{"id":2,"name":"available"}]}

Show Greeting Category

  • GET /api/v2/channels/voice/greeting_categories/{greeting_categories_id}

Allowed For

  • Agents

Parameters

Name Type In Required Description
greeting_categories_id integer Path true ID of the greeting category

代码示例

旋度
              
旋度https://{subdomain}.zendesk.com/api/v2/channels/voice/greeting_categories/{greeting_categories_id}.json\-v -u{email_address}:{password}
Go
              
import("fmt""io""net/http")funcmain(){url:="https://support.zendesk.com/api/v2/channels/voice/greeting_categories/1"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/greeting_categories/1").newBuilder();Request请求=newRequest.Builder().url(urlBuilder.build()).method("GET",null).addHeader("Content-Type","application/json").addHeader("Authorization",Credentials.基本("your-email","your-password")).build();Responseresponse=client.newCall(请求).execute();
Nodejs
              
varaxios=require('axios');varconfig={method:'GET',url:“https://support.zendesk.com/api/v2/channels/voice/greeting_categories/1',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
              
import请求surl="https://support.zendesk.com/api/v2/channels/voice/greeting_categories/1"headers={"Content-Type":"application/json",}response=请求s.请求("GET",url,auth=('',''),headers=headers)print(response.text)
Ruby
              
require"net/http"uri=URI("https://support.zendesk.com/api/v2/channels/voice/greeting_categories/1")请求=Net::HTTP::Get.new(uri,"Content-Type":"application/json")请求.基本_auth"username","password"response=Net::HTTP.start uri.hostname,uri.port,use_ssl:truedo|http|http.请求(请求)end

Example response(s)

200 OK
              
// Status 200 OK{"greeting_category":{"id":1,"name":"voicemail"}}

List Greetings

  • GET /api/v2/channels/voice/greetings

Allowed For

  • Agents

代码示例

旋度
              
旋度https://{subdomain}.zendesk.com/api/v2/channels/voice/greetings.json\-v -u{email_address}:{password}-X GET
Go
              
import("fmt""io""net/http")funcmain(){url:="https://support.zendesk.com/api/v2/channels/voice/greetings"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/greetings").newBuilder();Request请求=newRequest.Builder().url(urlBuilder.build()).method("GET",null).addHeader("Content-Type","application/json").addHeader("Authorization",Credentials.基本("your-email","your-password")).build();Responseresponse=client.newCall(请求).execute();
Nodejs
              
varaxios=require('axios');varconfig={method:'GET',url:“https://support.zendesk.com/api/v2/channels/voice/greetings',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
              
import请求surl="https://support.zendesk.com/api/v2/channels/voice/greetings"headers={"Content-Type":"application/json",}response=请求s.请求("GET",url,auth=('',''),headers=headers)print(response.text)
Ruby
              
require"net/http"uri=URI("https://support.zendesk.com/api/v2/channels/voice/greetings")请求=Net::HTTP::Get.new(uri,"Content-Type":"application/json")请求.基本_auth"username","password"response=Net::HTTP.start uri.hostname,uri.port,use_ssl:truedo|http|http.请求(请求)end

Example response(s)

200 OK
              
// Status 200 OK{"count":2,"greetings":[{"category_id":1,"id":1,"name":"Premium Support 1"},{"category_id":1,"id":2,"name":"Premium Support 2"}],"next_page":null,"previous_page":null}

Show Greeting

  • GET /api/v2/channels/voice/greetings/{greetings_id}

Allowed For

  • Agents

Parameters

Name Type In Required Description
greetings_id integer Path true ID of the greeting

代码示例

旋度
              
旋度https://{subdomain}.zendesk.com/api/v2/channels/voice/greetings/{greetings_id}.json\-v -u{email_address}:{password}
Go
              
import("fmt""io""net/http")funcmain(){url:="https://support.zendesk.com/api/v2/channels/voice/greetings/1"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/greetings/1").newBuilder();Request请求=newRequest.Builder().url(urlBuilder.build()).method("GET",null).addHeader("Content-Type","application/json").addHeader("Authorization",Credentials.基本("your-email","your-password")).build();Responseresponse=client.newCall(请求).execute();
Nodejs
              
varaxios=require('axios');varconfig={method:'GET',url:“https://support.zendesk.com/api/v2/channels/voice/greetings/1',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
              
import请求surl="https://support.zendesk.com/api/v2/channels/voice/greetings/1"headers={"Content-Type":"application/json",}response=请求s.请求("GET",url,auth=('',''),headers=headers)print(response.text)
Ruby
              
require"net/http"uri=URI("https://support.zendesk.com/api/v2/channels/voice/greetings/1")请求=Net::HTTP::Get.new(uri,"Content-Type":"application/json")请求.基本_auth"username","password"response=Net::HTTP.start uri.hostname,uri.port,use_ssl:truedo|http|http.请求(请求)end

Example response(s)

200 OK
              
// Status 200 OK{"greeting":{"category_id":1,"id":1,"name":"Premium Support"}}

Get Greeting Audio File

  • GET /api/v2/channels/voice/greetings/{greetings_id}/upload

Allowed For

  • Agents

Parameters

Name Type In Required Description
greetings_id integer Path true ID of the greeting

代码示例

旋度
              
旋度https://{subdomain}.zendesk.com/api/v2/channels/voice/greetings/{greetings_id}/upload.mp3\-v -u{email_address}:{password}
Go
              
import("fmt""io""net/http")funcmain(){url:="https://support.zendesk.com/api/v2/channels/voice/greetings/1/upload"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/greetings/1/upload").newBuilder();Request请求=newRequest.Builder().url(urlBuilder.build()).method("GET",null).addHeader("Content-Type","application/json").addHeader("Authorization",Credentials.基本("your-email","your-password")).build();Responseresponse=client.newCall(请求).execute();
Nodejs
              
varaxios=require('axios');varconfig={method:'GET',url:“https://support.zendesk.com/api/v2/channels/voice/greetings/1/upload',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
              
import请求surl="https://support.zendesk.com/api/v2/channels/voice/greetings/1/upload"headers={"Content-Type":"application/json",}response=请求s.请求("GET",url,auth=('',''),headers=headers)print(response.text)
Ruby
              
require"net/http"uri=URI("https://support.zendesk.com/api/v2/channels/voice/greetings/1/upload")请求=Net::HTTP::Get.new(uri,"Content-Type":"application/json")请求.基本_auth"username","password"response=Net::HTTP.start uri.hostname,uri.port,use_ssl:truedo|http|http.请求(请求)end

Example response(s)

200 OK
              
// Status 200 OKnull

Create Greeting

  • POST /api/v2/channels/voice/greetings

Allowed For

  • Agents

Example body

             
{"greeting":{"category_id":1,"name":"Hello"}}

代码示例

旋度
              
旋度https://{subdomain}.zendesk.com/api/v2/channels/voice/greetings.json\-H"Content-Type: application/json"-X POST -d'{"greeting": {"name": "Hello", "category_id": 1}}'\-v -u{email_address}:{password}
Go
              
import("fmt""io""net/http""strings")funcmain(){url:="https://support.zendesk.com/api/v2/channels/voice/greetings"method:="POST"payload:=strings.NewReader(`{"greeting": {"category_id": 1,"name": "Hello"}}`)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/greetings").newBuilder();RequestBodybody=RequestBody.create(MediaType.parse("application/json"),"""{\"greeting\":{\"category_id\":1,\"name\":\"Hello\"}}""");Request请求=newRequest.Builder().url(urlBuilder.build()).method("POST",body).addHeader("Content-Type","application/json").addHeader("Authorization",Credentials.基本("your-email","your-password")).build();Responseresponse=client.newCall(请求).execute();
Nodejs
              
varaxios=require('axios');vardata=JSON.stringify({"greeting":{"category_id":1,"name":"Hello"}});varconfig={method:'POST',url:“https://support.zendesk.com/api/v2/channels/voice/greetings',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
              
import请求simportjsonurl="https://support.zendesk.com/api/v2/channels/voice/greetings"payload=json.loads("""{"greeting": {"category_id": 1,"name": "Hello"}}""")headers={"Content-Type":"application/json",}response=请求s.请求("POST",url,auth=('',''),headers=headers,json=payload)print(response.text)
Ruby
              
require"net/http"uri=URI("https://support.zendesk.com/api/v2/channels/voice/greetings")请求=Net::HTTP::Post.new(uri,"Content-Type":"application/json")请求.body=%q({"greeting":{"category_id":1,"name":"Hello"}})请求.基本_auth"username","password"response=Net::HTTP.start uri.hostname,uri.port,use_ssl:truedo|http|http.请求(请求)end

Example response(s)

201 Created
              
// Status 201 Created{"greeting":{"category_id":1,"id":1,"name":"Premium Support"}}

Update Greeting

  • PUT /api/v2/channels/voice/greetings/{greetings_id}

Updates the greeting object or the recording of the greeting file. See theUsing curlsections below for more information.

Allowed For

  • Agents

Content Types

In addition to application/json, this endpoint supports multipart/form-data to upload local mp3 or wav files. If using multipart/form-data, the name of the input form field isgreeting[upload_attributes][uploaded_data]. The following example uses the-Fform option in cURL:

             
-F'greeting[upload_attributes][uploaded_data][email protected]/path/to/file.mp3'

Parameters

Name Type In Required Description
greetings_id integer Path true ID of the greeting

Example body

             
{"greeting":{"name":"Premium Support"}}

代码示例

旋度
              
旋度https://{subdomain}.zendesk.com/api/v2/channels/voice/greetings/{greetings_id}.json\-H"Content-Type: application/json"-d'{"greeting": {"name": "Hello"}}'\-v -u{email_address}:{password}-X PUT
旋度

You can update an audio file for a greeting by uploading a local mp3 or wav file.

              
旋度https://{subdomain}.zendesk.com/api/v2/channels/voice/greetings/{greeting_id}.json\-F'greeting[upload_attributes][uploaded_data][email protected]/path/to/file.mp3'\-v -u{email_address}:{password}-X PUT
Go
              
import("fmt""io""net/http""strings")funcmain(){url:="https://support.zendesk.com/api/v2/channels/voice/greetings/1"method:="PUT"payload:=strings.NewReader(`{"greeting": {"name": "Premium Support"}}`)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/greetings/1").newBuilder();RequestBodybody=RequestBody.create(MediaType.parse("application/json"),"""{\"greeting\":{\"name\":\"溢价Support\"}}""");Request请求=newRequest.Builder().url(urlBuilder.build()).method("PUT",body).addHeader("Content-Type","application/json").addHeader("Authorization",Credentials.基本("your-email","your-password")).build();Responseresponse=client.newCall(请求).execute();
Nodejs
              
varaxios=require('axios');vardata=JSON.stringify({"greeting":{"name":"Premium Support"}});varconfig={method:'PUT',url:“https://support.zendesk.com/api/v2/channels/voice/greetings/1',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
              
import请求simportjsonurl="https://support.zendesk.com/api/v2/channels/voice/greetings/1"payload=json.loads("""{"greeting": {"name": "Premium Support"}}""")headers={"Content-Type":"application/json",}response=请求s.请求("PUT",url,auth=('',''),headers=headers,json=payload)print(response.text)
Ruby
              
require"net/http"uri=URI("https://support.zendesk.com/api/v2/channels/voice/greetings/1")请求=Net::HTTP::Put.new(uri,"Content-Type":"application/json")请求.body=%q({"greeting":{"name":"Premium Support"}})请求.基本_auth"username","password"response=Net::HTTP.start uri.hostname,uri.port,use_ssl:truedo|http|http.请求(请求)end

Example response(s)

200 OK
              
// Status 200 OK{"greeting":{"category_id":1,"id":1,"name":"Premium Support"}}

删除Greeting

  • DELETE /api/v2/channels/voice/greetings/{greetings_id}

Allowed For

  • Agents

Parameters

Name Type In Required Description
greetings_id integer Path true ID of the greeting

代码示例

旋度
              
旋度https://{subdomain}.zendesk.com/api/v2/channels/voice/greetings/{greetings_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/greetings/1"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/greetings/1").newBuilder();Request请求=newRequest.Builder().url(urlBuilder.build()).method("DELETE",null).addHeader("Content-Type","application/json").addHeader("Authorization",Credentials.基本("your-email","your-password")).build();Responseresponse=client.newCall(请求).execute();
Nodejs
              
varaxios=require('axios');varconfig={method:'DELETE',url:“https://support.zendesk.com/api/v2/channels/voice/greetings/1',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
              
import请求surl="https://support.zendesk.com/api/v2/channels/voice/greetings/1"headers={"Content-Type":"application/json",}response=请求s.请求("DELETE",url,auth=('',''),headers=headers)print(response.text)
Ruby
              
require"net/http"uri=URI("https://support.zendesk.com/api/v2/channels/voice/greetings/1")请求=Net::HTTP::删除.new(uri,"Content-Type":"application/json")请求.基本_auth"username","password"response=Net::HTTP.start uri.hostname,uri.port,use_ssl:truedo|http|http.请求(请求)end

Example response(s)

200 OK
              
// Status 200 OK{"greeting":{"category_id":1,"id":1,"name":"Premium Support"}}