You can use the Incremental Skill-based Routing API to export data on the creation, update, and deletion of skill types, skills, and instance values. To learn more about the feature, seeUsing skills-based routingin the Support Help Center.

In this API, skill types are namedattributesand skills are namedattribute values.

Skill-based routing is only available on the Enterprise plan and above.

JSON Format

The exported items are represented as JSON objects. The format depends on the exported resource, but all have the following additional common attributes:

Name Type Comment
end_time integer The most recent resource creation time present in this result set in Unix epoch time
next_page string 应该是调用的URL获取下一组of results
count integer The number of results returned for the current request

For complete lists of attributes, see the JSON format sections below.

Pagination

The endpoints of the skill-based routing API return a maximum of 3000 records per page.

When the response exceeds the per-page maximum, you can paginate to the next page via thenext_pageURL in the response body:

             
{"instance_values":[...],"count":1234,"end_time":"1535671451""next_page":"https://{subdomain}.zendesk.com/api/v2/incremental/routing/instance_values.json?cursor=cccf1b69-acab-11e8-9d65-f1b3d4e2d609"}

Stop paging when thecountattribute is 0.

The pagination for skill-based incremental export endpoints works slightly differently from other endpoints. Theper_pageparameter doesn't apply because of the time-based way these endpoints return records. Thelimitparameter doesn't apply because of the way a single record can generate multiple events.

Unlike other endpoints, skill-based incremental export endpoints uses cursor-based pagination. The坏蛋sorparameter is a non-human-readable argument you can use to move forward or backward in time. The cursor is a read-only URL parameter that's only available in API responses.

JSON Format for Routing Attributes

A routing attribute is a skill type. Routing attributes have the following format:

Name Type Comment
id string Automatically assigned when an attribute is created
name string The name of the attribute
time date The time the attribute was created, updated, or deleted
type string One of "create", "update", or "delete"

Example

             
{"id":"7c43bca9-8c7b-11e8-b808-b99aed889f62","name":"Languages","time":"2018-07-21T07:17:42Z","type":"create"}

JSON Format for Routing Attribute Values

A routing attribute value is a skill. Routing attribute values have the following format:

Name Type Comment
id string Automatically assigned when an attribute value is created
attribute_id string Id of the associated attribute
name string The name of the attribute value
time date The time the attribute value was created, updated, or deleted
type string One of "create", "update", or "delete"

Example

             
{"id":"19ed17fb-7326-11e8-b07e-9de44e7e7f20","attribute_id":"7c43bca9-8c7b-11e8-b808-b99aed889f62","name":"English","time":"2018-06-19T01:33:26Z","type":"create"}

JSON Format for Routing Instance Values

Routing instance values have the following format:

Name Type Comment
id string Automatically assigned when an instance value is created
attribute_value_id string 的Id相关联的属性值
instance_id string Id of the associated agent or ticket
time date The time the instance value was created or deleted
type string One of "associate_agent", "unassociate_agent", "associate_ticket", or "unassociate_ticket"

Example

             
{"id":"62055cad-7326-11e8-b07e-73653560136b","attribute_value_id":"19ed17fb-7326-11e8-b07e-9de44e7e7f20","instance_id":"10001","time":"2018-06-19T01:35:27Z","type":"associate_agent"}

Incremental Attributes Export

  • GET /api/v2/incremental/routing/attributes

Returns a stream of changes that occurred on routing attributes.

Allowed For

  • Admins

Parameters

Optional

Name Type Comment
坏蛋sor string The坏蛋sorparameter is a non-human-readable argument you can use to move forward or backward in time. The cursor is a read-only URL parameter that's only available in API responses. SeePagination.

Code Samples

坏蛋l
              
坏蛋lhttps://{subdomain}.zendesk.com/api/v2/incremental/routing/attributes.json\-v -u{email_address}:{password}
Go
              
import("fmt""io""net/http")funcmain(){url:="https://example.zendesk.com/api/v2/incremental/routing/attributes"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/incremental/routing/attributes").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/incremental/routing/attributes',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://example.zendesk.com/api/v2/incremental/routing/attributes"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/incremental/routing/attributes")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{"attributes":[{"id":"15821cba-7326-11e8-b07e-950ba849aa27","name":"Languages","time":"2018-06-19T01:33:19Z","type":"create"}],"count":1200,"end_time":1533266020,"next_page":"https://{subdomain}.zendesk.com/api/v2/incremental/routing/attributes.json?cursor=7d724c71-3911-11e8-9621-836b8c683dc6"}

Incremental Attributes Values Export

  • GET /api/v2/incremental/routing/attribute_values

Returns a stream of changes that occurred on routing attribute values.

Allowed For

  • Admins

Parameters

Optional

Name Type Comment
坏蛋sor string The坏蛋sorparameter is a non-human-readable argument you can use to move forward or backward in time. The cursor is a read-only URL parameter that's only available in API responses. SeePagination.

Code Samples

坏蛋l
              
坏蛋lhttps://{subdomain}.zendesk.com/api/v2/incremental/routing/attribute_values.json\-v -u{email_address}:{password}
Go
              
import("fmt""io""net/http")funcmain(){url:="https://example.zendesk.com/api/v2/incremental/routing/attribute_values"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/incremental/routing/attribute_values").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/incremental/routing/attribute_values',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://example.zendesk.com/api/v2/incremental/routing/attribute_values"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/incremental/routing/attribute_values")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{"attribute_values":[{"attribute_id":"15821cba-7326-11e8-b07e-950ba849aa27","id":"19ed17fb-7326-11e8-b07e-9de44e7e7f20","name":"English","time":"2018-06-19T01:33:26Z","type":"create"}],"count":1200,"end_time":1533266020,"next_page":"https://{subdomain}.zendesk.com/api/v2/incremental/routing/attribute_values.json?cursor=7d724c71-3911-11e8-9621-836b8c683dc6"}

Incremental Instance Values Export

  • GET /api/v2/incremental/routing/instance_values

Returns a stream of changes that occurred on routing instance values. Changes are grouped byattribute_value_id, with unassociate type events listed with associate type events by the associate event’s timestamp.

Allowed For

  • Admins

Parameters

Optional

Name Type Comment
坏蛋sor string The坏蛋sorparameter is a non-human-readable argument you can use to move forward or backward in time. The cursor is a read-only URL parameter that's only available in API responses. SeePagination.

Code Samples

坏蛋l
              
坏蛋lhttps://{subdomain}.zendesk.com/api/v2/incremental/routing/instance_values.json\-v -u{email_address}:{password}
Go
              
import("fmt""io""net/http")funcmain(){url:="https://example.zendesk.com/api/v2/incremental/routing/instance_values"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/incremental/routing/instance_values").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/incremental/routing/instance_values',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://example.zendesk.com/api/v2/incremental/routing/instance_values"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/incremental/routing/instance_values")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":1200,"end_time":1533266020,"instance_values":[{"attribute_value_id":"19ed17fb-7326-11e8-b07e-9ab44e7e7f28","id":"62055cad-7326-11e8-b07e-73653560136b","instance_id":"10001","time":"2019-06-19T01:35:27Z","type":"associate_agent"},{"attribute_value_id":"19ed17fb-7326-11e8-b07e-9ab44e7e7f28","id":"62055cad-7326-11e8-b07e-cf1082b7e6d4","instance_id":"11375","time":"2019-06-19T01:35:27Z","type":"associate_agent"},{"attribute_value_id":"19ed17fb-7326-11e8-b07e-9ab44e7e7f28","id":"62055cad-7326-11e8-b07e-5b8483a47e24","instance_id":"14187","time":"2020-11-14T16:32:22Z","type":"unassociate_agent"}],"next_page":"https://{subdomain}.zendesk.com/api/v2/incremental/routing/instance_values.json?cursor=62055cad-7326-11e8-b07e-73653560136b"}