Omnichannel Routing Queues
You can use the Omnichannel Routing Queues API to create, update and delete a routing queue, which is used for routing ticket.
JSON format
Omnichannel Routing Queues are represented as JSON objects with the following properties:
Name | Type | Read-only | Mandatory | Description |
---|---|---|---|---|
created_at | string | true | false | The time the queue was created |
definition | object | false | false | Conditions when queue could be applied |
description | string | false | false | The description of the queue |
id | string | true | false | Automatically assigned when creating queue |
name | string | false | false | The name of the queue |
order | integer | false | false | The queue-applied order |
primary_groups | object | false | false | Primary group ids linked to the queue |
priority | integer | false | false | The queue-applied priority |
secondary_groups | object | false | false | Secondary group ids linked to the queue |
updated_at | string | true | false | The time of the queue's last update |
url | string | true | false | The API URL of the queue |
Example
{
"created_at": "2023-11-27T09:03:59Z",
"definition": {
"all": [
{
"field": "priority",
"operator": "is",
"value": "urgent"
}
],
"any": []
},
"description": "Queue description",
"id": "01HG80ATNNZK1N7XRFVKX48XD6",
"name": "New queue with valid definition",
"order": 1,
"primary_groups": {
"count": 2,
"groups": [
{
"id": 6784729637757,
"name": "EWR"
},
{
"id": 5399674286077,
"name": "test"
}
]
},
"priority": 1,
"secondary_groups": {
"count": 0,
"groups": []
},
"updated_at": "2023-11-27T09:03:59Z",
"url": "https://company.zendesk.com/api/v2/queues/01HG80ATNNZK1N7XRFVKX48XD6.json"
}
List queues
GET /api/v2/queues
GET /api/v2/queues
Returns all active queues for an account.
Allowed For
- Admins
Details
Rate limit for showing omnichannel routing queues exceeded. Please wait 1 minute and try again
Rate Limits | Scopes | Interval | Sandbox | Trial | Default |
---|---|---|---|---|---|
Standard | 1 minute | N/A | N/A | 30 |
"Default" applies to all Zendesk suite and support plans. Please refer to the general account limits for more information.
Code Samples
curl
curl https://{subdomain}.zendesk.com/api/v2/queues.json \
-v -u {email_address}/token:{api_token}
Go
import (
"fmt"
"io"
"net/http"
)
func main() {
url := "https://example.zendesk.com/api/v2/queues"
method := "GET"
req, err := http.NewRequest(method, url, nil)
if err != nil {
fmt.Println(err)
return
}
req.Header.Add("Content-Type", "application/json")
req.Header.Add("Authorization", "Basic <auth-value>") // Base64 encoded "{email_address}/token:{api_token}"
client := &http.Client {}
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()
body, err := io.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
Java
import com.squareup.okhttp.*;
OkHttpClient client = new OkHttpClient();
HttpUrl.Builder urlBuilder = HttpUrl.parse("https://example.zendesk.com/api/v2/queues")
.newBuilder();
String userCredentials = "your_email_address" + "/token:" + "your_api_token";
String basicAuth = "Basic " + java.util.Base64.getEncoder().encodeToString(userCredentials.getBytes());
Request request = new Request.Builder()
.url(urlBuilder.build())
.method("GET", null)
.addHeader("Content-Type", "application/json")
.addHeader("Authorization", basicAuth)
.build();
Response response = client.newCall(request).execute();
Nodejs
var axios = require('axios');
var config = {
method: 'GET',
url: 'https://example.zendesk.com/api/v2/queues',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Basic <auth-value>', // Base64 encoded "{email_address}/token:{api_token}"
},
};
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data));
})
.catch(function (error) {
console.log(error);
});
Python
import requests
from requests.auth import HTTPBasicAuth
url = "https://example.zendesk.com/api/v2/queues"
headers = {
"Content-Type": "application/json",
}
email_address = 'your_email_address'
api_token = 'your_api_token'
# Use basic authentication
auth = HTTPBasicAuth(f'{email_address}/token', api_token)
response = requests.request(
"GET",
url,
auth=auth,
headers=headers
)
print(response.text)
Ruby
require "net/http"
require "base64"
uri = URI("https://example.zendesk.com/api/v2/queues")
request = Net::HTTP::Get.new(uri, "Content-Type": "application/json")
email = "your_email_address"
api_token = "your_api_token"
credentials = "#{email}/token:#{api_token}"
encoded_credentials = Base64.strict_encode64(credentials)
request["Authorization"] = "Basic #{encoded_credentials}"
response = Net::HTTP.start uri.hostname, uri.port, use_ssl: true do |http|
http.request(request)
end
Example response(s)
200 OK
// Status 200 OK
{
"queues": [
{
"created_at": "2023-11-27T09:03:59Z",
"definition": {
"all": [
{
"field": "priority",
"operator": "is",
"value": "urgent"
}
],
"any": []
},
"description": "Queue description",
"id": "01HG80ATNNZK1N7XRFVKX48XD6",
"name": "New queue with valid definition",
"order": 1,
"primary_groups": {
"count": 2,
"groups": [
{
"id": 6784729637757,
"name": "EW"
},
{
"id": 5399674286077,
"name": "test"
}
]
},
"priority": 1,
"secondary_groups": {
"count": 0,
"groups": []
},
"updated_at": "2023-11-27T09:03:59Z",
"url": "https://company.zendesk.com/api/v2/queues/01HG80ATNNZK1N7XRFVKX48XD6.json"
}
]
}
Show Queue
GET /api/v2/queues/{queue_id}
Returns a queue for the given queue id.
Allowed For
- Agents
Parameters
Name | Type | In | Required | Description |
---|---|---|---|---|
queue_id | string | Path | true | The id of the omnichannel routing queue |
Details
Rate limit for querying an omnichannel routing queue exceeded. Please wait 1 minute and try again
Rate Limits | Scopes | Interval | Sandbox | Trial | Default |
---|---|---|---|---|---|
Standard | 1 minute | N/A | N/A | 50 |
"Default" applies to all Zendesk suite and support plans. Please refer to the general account limits for more information.
Code Samples
curl
curl https://{subdomain}.zendesk.com/api/v2/queues/{queue_id}.json \
-v -u {email_address}/token:{api_token}
Go
import (
"fmt"
"io"
"net/http"
)
func main() {
url := "https://example.zendesk.com/api/v2/queues/01HG80ATNNZK1N7XRFVKX48XD6"
method := "GET"
req, err := http.NewRequest(method, url, nil)
if err != nil {
fmt.Println(err)
return
}
req.Header.Add("Content-Type", "application/json")
req.Header.Add("Authorization", "Basic <auth-value>") // Base64 encoded "{email_address}/token:{api_token}"
client := &http.Client {}
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()
body, err := io.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
Java
import com.squareup.okhttp.*;
OkHttpClient client = new OkHttpClient();
HttpUrl.Builder urlBuilder = HttpUrl.parse("https://example.zendesk.com/api/v2/queues/01HG80ATNNZK1N7XRFVKX48XD6")
.newBuilder();
String userCredentials = "your_email_address" + "/token:" + "your_api_token";
String basicAuth = "Basic " + java.util.Base64.getEncoder().encodeToString(userCredentials.getBytes());
Request request = new Request.Builder()
.url(urlBuilder.build())
.method("GET", null)
.addHeader("Content-Type", "application/json")
.addHeader("Authorization", basicAuth)
.build();
Response response = client.newCall(request).execute();
Nodejs
var axios = require('axios');
var config = {
method: 'GET',
url: 'https://example.zendesk.com/api/v2/queues/01HG80ATNNZK1N7XRFVKX48XD6',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Basic <auth-value>', // Base64 encoded "{email_address}/token:{api_token}"
},
};
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data));
})
.catch(function (error) {
console.log(error);
});
Python
import requests
from requests.auth import HTTPBasicAuth
url = "https://example.zendesk.com/api/v2/queues/01HG80ATNNZK1N7XRFVKX48XD6"
headers = {
"Content-Type": "application/json",
}
email_address = 'your_email_address'
api_token = 'your_api_token'
# Use basic authentication
auth = HTTPBasicAuth(f'{email_address}/token', api_token)
response = requests.request(
"GET",
url,
auth=auth,
headers=headers
)
print(response.text)
Ruby
require "net/http"
require "base64"
uri = URI("https://example.zendesk.com/api/v2/queues/01HG80ATNNZK1N7XRFVKX48XD6")
request = Net::HTTP::Get.new(uri, "Content-Type": "application/json")
email = "your_email_address"
api_token = "your_api_token"
credentials = "#{email}/token:#{api_token}"
encoded_credentials = Base64.strict_encode64(credentials)
request["Authorization"] = "Basic #{encoded_credentials}"
response = Net::HTTP.start uri.hostname, uri.port, use_ssl: true do |http|
http.request(request)
end
Example response(s)
200 OK
// Status 200 OK
{
"queue": {
"created_at": "2023-11-27T09:03:59Z",
"definition": {
"all": [
{
"field": "priority",
"operator": "is",
"value": "urgent"
}
],
"any": []
},
"description": "Queue description",
"id": "01HG80ATNNZK1N7XRFVKX48XD6",
"name": "New queue with valid definition",
"order": 1,
"primary_groups": {
"count": 2,
"groups": [
{
"id": 6784729637757,
"name": "EW"
},
{
"id": 5399674286077,
"name": "test"
}
]
},
"priority": 1,
"secondary_groups": {
"count": 0,
"groups": []
},
"updated_at": "2023-11-27T09:03:59Z",
"url": "https://company.zendesk.com/api/v2/queues/01HG80ATNNZK1N7XRFVKX48XD6.json"
}
}
Create Queue
POST /api/v2/queues
Creates a queue. Accepts a JSON queue definition as the request body.
Allowed For
- Admins
Details
Rate limit for creating omnichannel routing queues exceeded. Please wait 1 minute and try again
Rate Limits | Scopes | Interval | Sandbox | Trial | Default |
---|---|---|---|---|---|
Standard | 1 minute | N/A | N/A | 50 |
"Default" applies to all Zendesk suite and support plans. Please refer to the general account limits for more information.
Code Samples
curl
curl https://{subdomain}.zendesk.com/api/v2/queues.json \
-H "Content-Type: application/json" \
-d '{ "queue": { "name": "New queue", "description": "Queue description", "priority": 10, "definition": { "all": [ { "field": "priority", "operator": "is", "value": "urgent" } ], "any": [ { "field": "priority", "operator": "is", "value": "normal" } ] }, "primary_groups_id": [1100002759994], "secondary_groups_id": [4398063790591] }}' \
-v -u {email_address}/token:{api_token} -X POST
Go
import (
"fmt"
"io"
"net/http"
)
func main() {
url := "https://example.zendesk.com/api/v2/queues"
method := "POST"
req, err := http.NewRequest(method, url, nil)
if err != nil {
fmt.Println(err)
return
}
req.Header.Add("Content-Type", "application/json")
req.Header.Add("Authorization", "Basic <auth-value>") // Base64 encoded "{email_address}/token:{api_token}"
client := &http.Client {}
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()
body, err := io.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
Java
import com.squareup.okhttp.*;
OkHttpClient client = new OkHttpClient();
HttpUrl.Builder urlBuilder = HttpUrl.parse("https://example.zendesk.com/api/v2/queues")
.newBuilder();
RequestBody body = RequestBody.create(MediaType.parse("application/json"),
"""
""");
String userCredentials = "your_email_address" + "/token:" + "your_api_token";
String basicAuth = "Basic " + java.util.Base64.getEncoder().encodeToString(userCredentials.getBytes());
Request request = new Request.Builder()
.url(urlBuilder.build())
.method("POST", body)
.addHeader("Content-Type", "application/json")
.addHeader("Authorization", basicAuth)
.build();
Response response = client.newCall(request).execute();
Nodejs
var axios = require('axios');
var config = {
method: 'POST',
url: 'https://example.zendesk.com/api/v2/queues',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Basic <auth-value>', // Base64 encoded "{email_address}/token:{api_token}"
},
};
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data));
})
.catch(function (error) {
console.log(error);
});
Python
import requests
from requests.auth import HTTPBasicAuth
url = "https://example.zendesk.com/api/v2/queues"
headers = {
"Content-Type": "application/json",
}
email_address = 'your_email_address'
api_token = 'your_api_token'
# Use basic authentication
auth = HTTPBasicAuth(f'{email_address}/token', api_token)
response = requests.request(
"POST",
url,
auth=auth,
headers=headers
)
print(response.text)
Ruby
require "net/http"
require "base64"
uri = URI("https://example.zendesk.com/api/v2/queues")
request = Net::HTTP::Post.new(uri, "Content-Type": "application/json")
email = "your_email_address"
api_token = "your_api_token"
credentials = "#{email}/token:#{api_token}"
encoded_credentials = Base64.strict_encode64(credentials)
request["Authorization"] = "Basic #{encoded_credentials}"
response = Net::HTTP.start uri.hostname, uri.port, use_ssl: true do |http|
http.request(request)
end
Example response(s)
201 Created
// Status 201 Created
{
"queue": {
"created_at": "2023-11-27T09:03:59Z",
"definition": {
"all": [
{
"field": "priority",
"operator": "is",
"value": "urgent"
}
],
"any": []
},
"description": "Queue description",
"id": "01HG80ATNNZK1N7XRFVKX48XD6",
"name": "New queue with valid definition",
"order": 1,
"primary_groups": {
"count": 2,
"groups": [
{
"id": 6784729637757,
"name": "EW"
},
{
"id": 5399674286077,
"name": "test"
}
]
},
"priority": 1,
"secondary_groups": {
"count": 0,
"groups": []
},
"updated_at": "2023-11-27T09:03:59Z",
"url": "https://company.zendesk.com/api/v2/queues/01HG80ATNNZK1N7XRFVKX48XD6.json"
}
}
Update Queue
PUT /api/v2/queues/{queue_id}
Updates the queue definition for a given queue id.
Allowed For
- Admins
Parameters
Name | Type | In | Required | Description |
---|---|---|---|---|
queue_id | string | Path | true | The id of the omnichannel routing queue |
Details
Rate limit for updating omnichannel routing queues exceeded. Please wait 1 minute and try again
Rate Limits | Scopes | Interval | Sandbox | Trial | Default |
---|---|---|---|---|---|
Standard | 1 minute | N/A | N/A | 50 |
"Default" applies to all Zendesk suite and support plans. Please refer to the general account limits for more information.
Code Samples
curl
curl -X PUT https://{subdomain}.zendesk.com/api/v2/queues/{queue_id}.json \
-H "Content-Type: application/json" \
-d '{ "queue": { "name": "New queue 2", "description": "Queue description 2", "priority": 10, "definition": { "all": [ { "field": "priority", "operator": "is", "value": "urgent" } ], "any": [ { "field": "priority", "operator": "is", "value": "normal" } ] }, "primary_groups_id": [1100002759994], "secondary_groups_id": [4398063790591] }}' \
-v -u {email_address}/token:{api_token}
Go
import (
"fmt"
"io"
"net/http"
)
func main() {
url := "https://example.zendesk.com/api/v2/queues/01HG80ATNNZK1N7XRFVKX48XD6"
method := "PUT"
req, err := http.NewRequest(method, url, nil)
if err != nil {
fmt.Println(err)
return
}
req.Header.Add("Content-Type", "application/json")
req.Header.Add("Authorization", "Basic <auth-value>") // Base64 encoded "{email_address}/token:{api_token}"
client := &http.Client {}
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()
body, err := io.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
Java
import com.squareup.okhttp.*;
OkHttpClient client = new OkHttpClient();
HttpUrl.Builder urlBuilder = HttpUrl.parse("https://example.zendesk.com/api/v2/queues/01HG80ATNNZK1N7XRFVKX48XD6")
.newBuilder();
RequestBody body = RequestBody.create(MediaType.parse("application/json"),
"""
""");
String userCredentials = "your_email_address" + "/token:" + "your_api_token";
String basicAuth = "Basic " + java.util.Base64.getEncoder().encodeToString(userCredentials.getBytes());
Request request = new Request.Builder()
.url(urlBuilder.build())
.method("PUT", body)
.addHeader("Content-Type", "application/json")
.addHeader("Authorization", basicAuth)
.build();
Response response = client.newCall(request).execute();
Nodejs
var axios = require('axios');
var config = {
method: 'PUT',
url: 'https://example.zendesk.com/api/v2/queues/01HG80ATNNZK1N7XRFVKX48XD6',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Basic <auth-value>', // Base64 encoded "{email_address}/token:{api_token}"
},
};
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data));
})
.catch(function (error) {
console.log(error);
});
Python
import requests
from requests.auth import HTTPBasicAuth
url = "https://example.zendesk.com/api/v2/queues/01HG80ATNNZK1N7XRFVKX48XD6"
headers = {
"Content-Type": "application/json",
}
email_address = 'your_email_address'
api_token = 'your_api_token'
# Use basic authentication
auth = HTTPBasicAuth(f'{email_address}/token', api_token)
response = requests.request(
"PUT",
url,
auth=auth,
headers=headers
)
print(response.text)
Ruby
require "net/http"
require "base64"
uri = URI("https://example.zendesk.com/api/v2/queues/01HG80ATNNZK1N7XRFVKX48XD6")
request = Net::HTTP::Put.new(uri, "Content-Type": "application/json")
email = "your_email_address"
api_token = "your_api_token"
credentials = "#{email}/token:#{api_token}"
encoded_credentials = Base64.strict_encode64(credentials)
request["Authorization"] = "Basic #{encoded_credentials}"
response = Net::HTTP.start uri.hostname, uri.port, use_ssl: true do |http|
http.request(request)
end
Example response(s)
200 OK
// Status 200 OK
{
"queue": {
"created_at": "2023-09-27T09:06:34Z",
"definition": {
"all": [
{
"field": "priority",
"operator": "is",
"value": "urgent"
}
],
"any": []
},
"description": "Queue description 2",
"id": "01HG80ATNNZK1N7XRFVKX48XD6",
"name": "New queue 2",
"order": 1,
"primary_groups": {
"count": 1,
"groups": [
{
"id": 1100002759994,
"name": "Sales"
}
]
},
"priority": 10,
"secondary_groups": {
"count": 1,
"groups": [
{
"id": 4398063790591,
"name": "Support"
}
]
},
"updated_at": "2023-10-13T10:58:25Z",
"url": "https://{subdomain}.zendesk.com/api/v2/queues/01HG80ATNNZK1N7XRFVKX48XD6.json"
}
}
Delete Queue
DELETE /api/v2/queues/{queue_id}
Deletes the queue and related records.
Allowed For
- Admins
Parameters
Name | Type | In | Required | Description |
---|---|---|---|---|
queue_id | string | Path | true | The id of the omnichannel routing queue |
Details
Rate limit for deleting omnichannel routing queues exceeded. Please wait 1 minute and try again
Rate Limits | Scopes | Interval | Sandbox | Trial | Default |
---|---|---|---|---|---|
Standard | 1 minute | N/A | N/A | 50 |
"Default" applies to all Zendesk suite and support plans. Please refer to the general account limits for more information.
Code Samples
curl
curl https://{subdomain}.zendesk.com/api/v2/queues/{queue_id}.json \
-v -u {email_address}/token:{api_token} -X DELETE
Go
import (
"fmt"
"io"
"net/http"
)
func main() {
url := "https://example.zendesk.com/api/v2/queues/01HG80ATNNZK1N7XRFVKX48XD6"
method := "DELETE"
req, err := http.NewRequest(method, url, nil)
if err != nil {
fmt.Println(err)
return
}
req.Header.Add("Content-Type", "application/json")
req.Header.Add("Authorization", "Basic <auth-value>") // Base64 encoded "{email_address}/token:{api_token}"
client := &http.Client {}
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()
body, err := io.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
Java
import com.squareup.okhttp.*;
OkHttpClient client = new OkHttpClient();
HttpUrl.Builder urlBuilder = HttpUrl.parse("https://example.zendesk.com/api/v2/queues/01HG80ATNNZK1N7XRFVKX48XD6")
.newBuilder();
String userCredentials = "your_email_address" + "/token:" + "your_api_token";
String basicAuth = "Basic " + java.util.Base64.getEncoder().encodeToString(userCredentials.getBytes());
Request request = new Request.Builder()
.url(urlBuilder.build())
.method("DELETE", null)
.addHeader("Content-Type", "application/json")
.addHeader("Authorization", basicAuth)
.build();
Response response = client.newCall(request).execute();
Nodejs
var axios = require('axios');
var config = {
method: 'DELETE',
url: 'https://example.zendesk.com/api/v2/queues/01HG80ATNNZK1N7XRFVKX48XD6',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Basic <auth-value>', // Base64 encoded "{email_address}/token:{api_token}"
},
};
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data));
})
.catch(function (error) {
console.log(error);
});
Python
import requests
from requests.auth import HTTPBasicAuth
url = "https://example.zendesk.com/api/v2/queues/01HG80ATNNZK1N7XRFVKX48XD6"
headers = {
"Content-Type": "application/json",
}
email_address = 'your_email_address'
api_token = 'your_api_token'
# Use basic authentication
auth = HTTPBasicAuth(f'{email_address}/token', api_token)
response = requests.request(
"DELETE",
url,
auth=auth,
headers=headers
)
print(response.text)
Ruby
require "net/http"
require "base64"
uri = URI("https://example.zendesk.com/api/v2/queues/01HG80ATNNZK1N7XRFVKX48XD6")
request = Net::HTTP::Delete.new(uri, "Content-Type": "application/json")
email = "your_email_address"
api_token = "your_api_token"
credentials = "#{email}/token:#{api_token}"
encoded_credentials = Base64.strict_encode64(credentials)
request["Authorization"] = "Basic #{encoded_credentials}"
response = Net::HTTP.start uri.hostname, uri.port, use_ssl: true do |http|
http.request(request)
end
Example response(s)
204 No Content
// Status 204 No Content
null
List Queue Definitions
GET /api/v2/queues/definitions
GET /api/v2/queues/definitions
Returns the definitions of the queues and the definitions of the conditions under which a queue can execute. The definition of the action includes a title ("Status"), a type ("list"), and possible values. The definition of the condition includes the same fields as well as the possible operators.
Allowed For
- Admins
Details
Rate limit for querying queue definitions exceeded. Please wait 1 minute and try again
Rate Limits | Scopes | Interval | Sandbox | Trial | Default |
---|---|---|---|---|---|
Standard | 1 minute | N/A | N/A | 30 |
"Default" applies to all Zendesk suite and support plans. Please refer to the general account limits for more information.
Code Samples
curl
curl https://{subdomain}.zendesk.com/api/v2/queues/definitions.json \
-v -u {email_address}/token:{api_token}
Go
import (
"fmt"
"io"
"net/http"
)
func main() {
url := "https://example.zendesk.com/api/v2/queues/definitions"
method := "GET"
req, err := http.NewRequest(method, url, nil)
if err != nil {
fmt.Println(err)
return
}
req.Header.Add("Content-Type", "application/json")
req.Header.Add("Authorization", "Basic <auth-value>") // Base64 encoded "{email_address}/token:{api_token}"
client := &http.Client {}
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()
body, err := io.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
Java
import com.squareup.okhttp.*;
OkHttpClient client = new OkHttpClient();
HttpUrl.Builder urlBuilder = HttpUrl.parse("https://example.zendesk.com/api/v2/queues/definitions")
.newBuilder();
String userCredentials = "your_email_address" + "/token:" + "your_api_token";
String basicAuth = "Basic " + java.util.Base64.getEncoder().encodeToString(userCredentials.getBytes());
Request request = new Request.Builder()
.url(urlBuilder.build())
.method("GET", null)
.addHeader("Content-Type", "application/json")
.addHeader("Authorization", basicAuth)
.build();
Response response = client.newCall(request).execute();
Nodejs
var axios = require('axios');
var config = {
method: 'GET',
url: 'https://example.zendesk.com/api/v2/queues/definitions',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Basic <auth-value>', // Base64 encoded "{email_address}/token:{api_token}"
},
};
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data));
})
.catch(function (error) {
console.log(error);
});
Python
import requests
from requests.auth import HTTPBasicAuth
url = "https://example.zendesk.com/api/v2/queues/definitions"
headers = {
"Content-Type": "application/json",
}
email_address = 'your_email_address'
api_token = 'your_api_token'
# Use basic authentication
auth = HTTPBasicAuth(f'{email_address}/token', api_token)
response = requests.request(
"GET",
url,
auth=auth,
headers=headers
)
print(response.text)
Ruby
require "net/http"
require "base64"
uri = URI("https://example.zendesk.com/api/v2/queues/definitions")
request = Net::HTTP::Get.new(uri, "Content-Type": "application/json")
email = "your_email_address"
api_token = "your_api_token"
credentials = "#{email}/token:#{api_token}"
encoded_credentials = Base64.strict_encode64(credentials)
request["Authorization"] = "Basic #{encoded_credentials}"
response = Net::HTTP.start uri.hostname, uri.port, use_ssl: true do |http|
http.request(request)
end
Example response(s)
200 OK
// Status 200 OK
{
"definitions": {
"conditions_all": [
{
"group": "ticket",
"nullable": false,
"operators": [
{
"terminal": false,
"title": "Is",
"value": "is"
}
],
"repeatable": false,
"subject": "status",
"title": "Status",
"type": "list",
"values": [
{
"enabled": false,
"title": "Closed",
"value": "closed"
}
]
}
],
"conditions_any": [
{
"group": "ticket",
"nullable": false,
"operators": [
{
"terminal": false,
"title": "Is",
"value": "is"
}
],
"repeatable": false,
"subject": "status",
"title": "Status",
"type": "list",
"values": [
{
"enabled": false,
"title": "Closed",
"value": "closed"
}
]
}
]
}
}
Reorder Queues
PATCH /api/v2/queues/order
Alters the evaluation order of OCR queues in the account.
The evaluation order is set in a queue_ids
array in the request body.
You must include every queue id in your account to reorder the OCR queues. If not, the endpoint will return 400 Bad Request.
Allowed For
- Admins
Code Samples
curl
curl -X PATCH https://{subdomain}.zendesk.com/api/v2/queues/order.json \
-H "Content-Type: application/json" \
-d '{ "queue_ids": ["01HE5HE5RCZMCEVAVV60VTHA2G", "01HE5HHPM1RETPV4N0H3178P0N"] }' \
-v -u {email_address}/token:{api_token}
Go
import (
"fmt"
"io"
"net/http"
)
func main() {
url := "https://example.zendesk.com/api/v2/queues/order"
method := "PATCH"
req, err := http.NewRequest(method, url, nil)
if err != nil {
fmt.Println(err)
return
}
req.Header.Add("Content-Type", "application/json")
req.Header.Add("Authorization", "Basic <auth-value>") // Base64 encoded "{email_address}/token:{api_token}"
client := &http.Client {}
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()
body, err := io.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
Java
import com.squareup.okhttp.*;
OkHttpClient client = new OkHttpClient();
HttpUrl.Builder urlBuilder = HttpUrl.parse("https://example.zendesk.com/api/v2/queues/order")
.newBuilder();
RequestBody body = RequestBody.create(MediaType.parse("application/json"),
"""
""");
String userCredentials = "your_email_address" + "/token:" + "your_api_token";
String basicAuth = "Basic " + java.util.Base64.getEncoder().encodeToString(userCredentials.getBytes());
Request request = new Request.Builder()
.url(urlBuilder.build())
.method("PATCH", body)
.addHeader("Content-Type", "application/json")
.addHeader("Authorization", basicAuth)
.build();
Response response = client.newCall(request).execute();
Nodejs
var axios = require('axios');
var config = {
method: 'PATCH',
url: 'https://example.zendesk.com/api/v2/queues/order',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Basic <auth-value>', // Base64 encoded "{email_address}/token:{api_token}"
},
};
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data));
})
.catch(function (error) {
console.log(error);
});
Python
import requests
from requests.auth import HTTPBasicAuth
url = "https://example.zendesk.com/api/v2/queues/order"
headers = {
"Content-Type": "application/json",
}
email_address = 'your_email_address'
api_token = 'your_api_token'
# Use basic authentication
auth = HTTPBasicAuth(f'{email_address}/token', api_token)
response = requests.request(
"PATCH",
url,
auth=auth,
headers=headers
)
print(response.text)
Ruby
require "net/http"
require "base64"
uri = URI("https://example.zendesk.com/api/v2/queues/order")
request = Net::HTTP::Patch.new(uri, "Content-Type": "application/json")
email = "your_email_address"
api_token = "your_api_token"
credentials = "#{email}/token:#{api_token}"
encoded_credentials = Base64.strict_encode64(credentials)
request["Authorization"] = "Basic #{encoded_credentials}"
response = Net::HTTP.start uri.hostname, uri.port, use_ssl: true do |http|
http.request(request)
end
Example response(s)
204 No Content
// Status 204 No Content
null