SLA Policies
A Service Level Agreement is a documented agreement between a support provider and their customers that specifies performance measures for support. SLAs are often expressed as follows:
For urgent incidents, we will respond to tickets in 10 minutes and resolve the ticket within 2 hours.For high priority incidents, we will respond to tickets in 30 minutes and resolved the ticket within 8 hours.
Because there may be different SLAs per customer (or group of customers) that the provider supports, the provider will define an SLA policy to support each unique SLA's requirements.
A SLA policy is the unique (not enforced) combination of criteria along with assigned metric targets for each value of the priority field. There can be multiple SLA policies per Zendesk Support account.
JSON format
SLA Policies are represented as JSON objects with the following properties:
Name | Type | Read-only | Mandatory | Description |
---|---|---|---|---|
created_at | string | true | false | The time the SLA policy was created |
description | string | false | false | The description of the SLA policy |
filter | object | false | true | An object that describes the conditions that a ticket must match in order for an SLA policy to be applied to that ticket. SeeFilter. |
id | integer | true | false | Automatically assigned when created |
policy_metrics | array | false | false | Array ofPolicy Metricobjects |
position | integer | false | false | Position of the SLA policy that determines the order they will be matched. If not specified, the SLA policy is added as the last position |
title | string | false | true | The title of the SLA policy |
updated_at | string | true | false | The time of the last update of the SLA policy |
url | string | true | false | URL of the SLA Policy reacord |
Filter
A filter checks the value of ticket fields and selects the ticket if the conditions are met. Filter is represented as a JSON object with two arrays of one or more conditions.
Example
{
"filter":{
"all":[
{"field":"type","operator":"is","value":"incident"},
{"field":"via_id","operator":"is","value":4}
],
"any":[
]
}
}
The first array lists all the conditions that must be met. The second array lists any condition that must be met.
Name | Type | Description |
---|---|---|
all |
array | Logical AND. Tickets must fulfill all of the conditions to be considered matching |
any |
array | Logical OR. Tickets may satisfy any of the conditions to be considered matching |
Each condition in an array has the following properties:
Name | Type | Description |
---|---|---|
field | string | The name of a ticket field |
operator | string | A comparison operator |
value | string | The value of a ticket field |
Example
{"field":"type","operator":"is","value":"incident"}
SeeConditions referencefor the list of fields, allowed operators, and values of the conditions.
Policy Metric
An object that describes the metric targets for each value of the priority field.
Policy Metrics are represented as simple flat JSON objects which have the following keys:
Name | Type | Comment |
---|---|---|
priority | string | Priority that a ticket must match |
metric | string | The definition of the time that is being measured. SeeMetrics |
target | integer | The time within which the end-state for a metric should be met |
business_hours | boolean | Whether the metric targets are being measured in business hours or calendar hours |
Example
{
"priority":"low",
"metric":"first_reply_time",
"target":60,
"business_hours":false
}
Metrics
Metric | Value |
---|---|
Agent Work Time | agent_work_time |
First Reply Time | first_reply_time |
Next Reply Time | next_reply_time |
Pausable Update Time | pausable_update_time |
Periodic Update Time | periodic_update_time |
Requester Wait Time | requester_wait_time |
Example
{
"created_at":"2015-03-17T22:50:26Z",
"description":"Organizations: Silver Plan",
"filter":{
"all":[
{
"field":"type",
"operator":"is",
"value":"incident"
},
{
"field":"via_id",
"operator":"is",
"value":"4"
},
{
"field":"custom_status_id",
"operator":"includes",
"value":[
"1",
"2"
]
}
],
"any":[]
},
"id":25,
"policy_metrics":[
{
"business_hours":false,
"metric":"first_reply_time",
"priority":"low",
"target":60
}
],
"position":3,
"title":"Silver Plan",
"updated_at":"2015-03-17T22:50:26Z",
"url":"https://company.zendesk.com/api/v2/slas/policies/25.json"
}
List SLA Policies
GET /api/v2/slas/policies
Availability
- Accounts on the Support Professional or Suite Growth plan or above
Allowed For
- Admins
Code Samples
curl
curlhttps://{subdomain}.zendesk.com/api/v2/slas/policies.json\
-H"Content-Type: application/json"\
-v -u{email_address}:{password}
Go
import(
"fmt"
"io"
"net/http"
)
funcmain(){
url:="https://example.zendesk.com/api/v2/slas/policies"
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://example.zendesk.com/api/v2/slas/policies")
.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://example.亚博zendesk.com/api/v2/slas/policies',
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
importrequests
url="https://example.zendesk.com/api/v2/slas/policies"
headers={
"Content-Type":"application/json",
}
response=requests.request(
"GET",
url,
auth=('
' ,'' ),headers=headers
)
print(response.text)
Ruby
require"net/http"
uri=URI("https://example.zendesk.com/api/v2/slas/policies")
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,
"next_page":null,
"previous_page":null,
"sla_policies":[
{
"description":"For urgent incidents, we will respond to tickets in 10 minutes",
"filter":{
"all":[
{
"field":"type",
"operator":"is",
"value":"incident"
},
{
"field":"via_id",
"operator":"is",
"value":"4"
}
],
"any":[]
},
"id":36,
"policy_metrics":[
{
"business_hours":false,
"metric":"first_reply_time",
"priority":"low",
"target":60
}
],
"position":3,
"title":"Incidents",
"url":"https://{subdomain}.zendesk.com/api/v2/slas/policies/36.json"
}
]
}
Show SLA Policy
GET /api/v2/slas/policies/{sla_policy_id}
Availability
- Accounts on the Support Professional or Suite Growth plan or above
Allowed For
- Admins
Parameters
Name | Type | In | Required | Description |
---|---|---|---|---|
sla_policy_id | integer | Path | true | The ID of the SLA Policy |
Code Samples
curl
curlhttps://{subdomain}.zendesk.com/api/v2/slas/policies/{sla_policy_id}\
-H"Content-Type: application/json"\
-v -u{email_address}:{password}
Go
import(
"fmt"
"io"
"net/http"
)
funcmain(){
url:="https://example.zendesk.com/api/v2/slas/policies/36"
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://example.zendesk.com/api/v2/slas/policies/36")
.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://example.亚博zendesk.com/api/v2/slas/policies/36',
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
importrequests
url="https://example.zendesk.com/api/v2/slas/policies/36"
headers={
"Content-Type":"application/json",
}
response=requests.request(
"GET",
url,
auth=('
' ,'' ),headers=headers
)
print(response.text)
Ruby
require"net/http"
uri=URI("https://example.zendesk.com/api/v2/slas/policies/36")
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
{
"sla_policy":{
"description":"For urgent incidents, we will respond to tickets in 10 minutes",
"filter":{
"all":[
{
"field":"type",
"operator":"is",
"value":"incident"
},
{
"field":"via_id",
"operator":"is",
"value":"4"
}
],
"any":[]
},
"id":36,
"policy_metrics":[
{
"business_hours":false,
"metric":"first_reply_time",
"priority":"low",
"target":60
}
],
"position":3,
"title":"Incidents",
"url":"https://{subdomain}.zendesk.com/api/v2/slas/policies/36.json"
}
}
Create SLA Policy
POST /api/v2/slas/policies
Availability
- Accounts on the Support Professional or Suite Growth plan or above
Allowed For
- Admins
Code Samples
curl
curlhttps://{subdomain}.zendesk.com/api/v2/slas/policies\
-H"Content-Type: application/json"\
-d'{
"sla_policy": {
"title": "Incidents",
"description": "For urgent incidents, we will respond to tickets in 10 minutes",
"position": 3,
"filter": {
"all": [
{ "field": "type", "operator": "is", "value": "incident" }
],
"any": []
},
"policy_metrics": [
{ "priority": "normal", "metric": "first_reply_time", "target": 30, "business_hours": false },
{ "priority": "urgent", "metric": "first_reply_time", "target": 10, "business_hours": false },
{ "priority": "low", "metric": "requester_wait_time", "target": 180, "business_hours": false },
{ "priority": "normal", "metric": "requester_wait_time", "target": 160, "business_hours": false },
{ "priority": "high", "metric": "requester_wait_time", "target": 140, "business_hours": false },
{ "priority": "urgent", "metric": "requester_wait_time", "target": 120, "business_hours": false }
]
}
}'\
-v -u{email_address}:{password}-X POST
Go
import(
"fmt"
"io"
"net/http"
)
funcmain(){
url:="https://example.zendesk.com/api/v2/slas/policies"
method:="POST"
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://example.zendesk.com/api/v2/slas/policies")
.newBuilder();
RequestBodybody=RequestBody.create(MediaType.parse("application/json"),
"""
""");
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');
varconfig={
method:'POST',
url:“https://example.亚博zendesk.com/api/v2/slas/policies',
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
importrequests
url="https://example.zendesk.com/api/v2/slas/policies"
headers={
"Content-Type":"application/json",
}
response=requests.request(
"POST",
url,
auth=('
' ,'' ),headers=headers
)
print(response.text)
Ruby
require"net/http"
uri=URI("https://example.zendesk.com/api/v2/slas/policies")
request=Net::HTTP::Post.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)
201 Created
// Status 201 Created
{
"sla_policy":{
"description":"For urgent incidents, we will respond to tickets in 10 minutes",
"filter":{
"all":[
{
"field":"type",
"operator":"is",
"value":"incident"
}
],
"any":[]
},
"id":36,
"policy_metrics":[
{
"business_hours":false,
"metric":"first_reply_time",
"priority":"normal",
"target":30
},
{
"business_hours":false,
"metric":"first_reply_time",
"priority":"urgent",
"target":10
},
{
"business_hours":false,
"metric":"requester_wait_time",
"priority":"low",
"target":180
},
{
"business_hours":false,
"metric":"requester_wait_time",
"priority":"normal",
"target":160
},
{
"business_hours":false,
"metric":"requester_wait_time",
"priority":"high",
"target":140
},
{
"business_hours":false,
"metric":"requester_wait_time",
"priority":"urgent",
"target":120
}
],
"position":3,
"title":"Incidents",
"url":"https://{subdomain}.zendesk.com/api/v2/slas/policies/36.json"
}
}
Update SLA Policy
PUT /api/v2/slas/policies/{sla_policy_id}
Updates the specified policy.
Availability
- Accounts on the Support Professional or Suite Growth plan or above
Allowed For
- Admins
Parameters
Name | Type | In | Required | Description |
---|---|---|---|---|
sla_policy_id | integer | Path | true | The ID of the SLA Policy |
Code Samples
curl
curlhttps://{subdomain}.zendesk.com/api/v2/slas/policies/{sla_policy_id}\
-H"Content-Type: application/json"\
-d'{
"sla_policy": {
"title": "Urgent Incidents",
"description": "For urgent incidents, we will resolve the ticket within 2 hours",
"position": 3,
"filter": {
"all": [
{ "field": "type", "operator": "is", "value": "incident" }
],
"any": []
},
"policy_metrics": [
{ "priority": "normal", "metric": "first_reply_time", "target": 30, "business_hours": false },
{ "priority": "urgent", "metric": "first_reply_time", "target": 10, "business_hours": false },
{ "priority": "low", "metric": "requester_wait_time", "target": 180, "business_hours": false },
{ "priority": "normal", "metric": "requester_wait_time", "target": 160, "business_hours": false },
{ "priority": "high", "metric": "requester_wait_time", "target": 140, "business_hours": false },
{ "priority": "urgent", "metric": "requester_wait_time", "target": 120, "business_hours": false }
]
}
}'\
-v -u{email_address}:{password}-X PUT
Go
import(
"fmt"
"io"
"net/http"
)
funcmain(){
url:="https://example.zendesk.com/api/v2/slas/policies/36"
method:="PUT"
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://example.zendesk.com/api/v2/slas/policies/36")
.newBuilder();
RequestBodybody=RequestBody.create(MediaType.parse("application/json"),
"""
""");
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');
varconfig={
method:'PUT',
url:“https://example.亚博zendesk.com/api/v2/slas/policies/36',
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
importrequests
url="https://example.zendesk.com/api/v2/slas/policies/36"
headers={
"Content-Type":"application/json",
}
response=requests.request(
"PUT",
url,
auth=('
' ,'' ),headers=headers
)
print(response.text)
Ruby
require"net/http"
uri=URI("https://example.zendesk.com/api/v2/slas/policies/36")
request=Net::HTTP::Put.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
{
"sla_policy":{
"description":"For urgent incidents, we will resolve the ticket within 2 hours",
"filter":{
"all":[
{
"field":"type",
"operator":"is",
"value":"incident"
}
],
"any":[]
},
"id":36,
"policy_metrics":[
{
"business_hours":false,
"metric":"first_reply_time",
"priority":"normal",
"target":30
},
{
"business_hours":false,
"metric":"first_reply_time",
"priority":"urgent",
"target":10
},
{
"business_hours":false,
"metric":"requester_wait_time",
"priority":"low",
"target":180
},
{
"business_hours":false,
"metric":"requester_wait_time",
"priority":"normal",
"target":160
},
{
"business_hours":false,
"metric":"requester_wait_time",
"priority":"high",
"target":140
},
{
"business_hours":false,
"metric":"requester_wait_time",
"priority":"urgent",
"target":120
}
],
"position":3,
"title":"Urgent Incidents",
"url":"https://{subdomain}.zendesk.com/api/v2/slas/policies/36.json"
}
}
删除SLA Policy
DELETE /api/v2/slas/policies/{sla_policy_id}
Availability
- Accounts on the Support Professional or Suite Growth plan or above
Allowed For
- Admins
Parameters
Name | Type | In | Required | Description |
---|---|---|---|---|
sla_policy_id | integer | Path | true | The ID of the SLA Policy |
Code Samples
curl
curlhttps://{subdomain}.zendesk.com/api/v2/slas/policies/{sla_policy_id}\
-H"Content-Type: application/json"\
-v -u{email_address}:{password}-X DELETE
Go
import(
"fmt"
"io"
"net/http"
)
funcmain(){
url:="https://example.zendesk.com/api/v2/slas/policies/36"
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://example.zendesk.com/api/v2/slas/policies/36")
.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://example.亚博zendesk.com/api/v2/slas/policies/36',
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
importrequests
url="https://example.zendesk.com/api/v2/slas/policies/36"
headers={
"Content-Type":"application/json",
}
response=requests.request(
"DELETE",
url,
auth=('
' ,'' ),headers=headers
)
print(response.text)
Ruby
require"net/http"
uri=URI("https://example.zendesk.com/api/v2/slas/policies/36")
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)
204 No Content
// Status 204 No Content
null
Reorder SLA Policies
PUT /api/v2/slas/policies/reorder
Availability
- Accounts on the Support Professional or Suite Growth plan or above
Allowed For
- Admins
Parameters
Name | Type | In | Required | Description |
---|---|---|---|---|
sla_policy_ids | array | 查询 | false | The IDs of the SLA Policies to reorder |
Code Samples
curl
curlhttps://{subdomain}.zendesk.com/api/v2/slas/policies/reorder.json\
-H"Content-Type: application/json"-X PUT\
-d'{"sla_policy_ids": [12, 55]}'\
-v -u{email}:{password}
Go
import(
"fmt"
"io"
"net/http"
)
funcmain(){
url:="https://example.zendesk.com/api/v2/slas/policies/reorder?sla_policy_ids="
method:="PUT"
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://example.zendesk.com/api/v2/slas/policies/reorder")
.newBuilder()
.addQueryParameter("sla_policy_ids","");
RequestBodybody=RequestBody.create(MediaType.parse("application/json"),
"""
""");
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');
varconfig={
method:'PUT',
url:“https://example.亚博zendesk.com/api/v2/slas/policies/reorder',
headers:{
'Content-Type':'application/json',
'Authorization':'Basic
' ,// Base64 encoded "username:password"},
params:{
'sla_policy_ids':'',
},
};
axios(config)
.then(function(response){
console.log(JSON.stringify(response.data));
})
.catch(function(error){
console.log(error);
});
Python
importrequests
url="https://example.zendesk.com/api/v2/slas/policies/reorder?sla_policy_ids="
headers={
"Content-Type":"application/json",
}
response=requests.request(
"PUT",
url,
auth=('
' ,'' ),headers=headers
)
print(response.text)
Ruby
require"net/http"
uri=URI("https://example.zendesk.com/api/v2/slas/policies/reorder")
uri.query=URI.encode_www_form("sla_policy_ids":"")
request=Net::HTTP::Put.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
null
Retrieve Supported Filter Definition Items
GET /api/v2/slas/policies/definitions
Availability
- Accounts on the Support Professional or Suite Growth plan or above
Allowed For
- Admins
Code Samples
curl
curlhttps://{subdomain}.zendesk.com/api/v2/slas/policies/definitions.json\
-H"Content-Type: application/json"\
-v -u{email_address}:{password}-X GET
Go
import(
"fmt"
"io"
"net/http"
)
funcmain(){
url:="https://example.zendesk.com/api/v2/slas/policies/definitions"
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://example.zendesk.com/api/v2/slas/policies/definitions")
.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://example.亚博zendesk.com/api/v2/slas/policies/definitions',
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
importrequests
url="https://example.zendesk.com/api/v2/slas/policies/definitions"
headers={
"Content-Type":"application/json",
}
response=requests.request(
"GET",
url,
auth=('
' ,'' ),headers=headers
)
print(response.text)
Ruby
require"net/http"
uri=URI("https://example.zendesk.com/api/v2/slas/policies/definitions")
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
{
"definitions":{
"all":[
{
"group":"ticket",
"operators":[
{
"title":"Is",
"value":"is"
},
{
"title":"Is not",
"value":"is_not"
}
],
"target":null,
"title":"Brand",
"value":"brand_id",
"values":{
"list":[
{
"title":"Support",
"value":"10001"
}
],
"type":"list"
}
}
],
"any":[
{
"group":"ticket",
"operators":[
{
"title":"Is",
"value":"is"
},
{
"title":"Is not",
"value":"is_not"
}
],
"target":null,
"title":"Brand",
"value":"brand_id",
"values":{
"list":[
{
"title":"Support",
"value":"10001"
}
],
"type":"list"
}
}
]
}
}