> For a complete documentation index, fetch https://docs.voximplant.ai/llms.txt

# GetACDState

POST https://api.voximplant.com/platform_api/GetACDState

Gets the current ACD queue state.

Allowed roles: `Owner`, `Admin`, `Developer`.

**Example request:** Get the state of the queue 1.

Reference: https://docs.voximplant.ai/api-reference/management-api/reference/queues/get-acd-state

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: management-api
  version: 1.0.0
paths:
  /GetACDState:
    post:
      operationId: get-acd-state
      summary: GetACDState
      description: |-
        Gets the current ACD queue state.

        Allowed roles: `Owner`, `Admin`, `Developer`.

        **Example request:** Get the state of the queue 1.
      tags:
        - subpackage_queues
      parameters:
        - name: acd_queue_id
          in: query
          description: >-
            The ACD queue ID list separated by semicolons (;). Use the 'all'
            value to select all ACD queues
          required: false
          schema:
            type: array
            items:
              type: integer
        - name: Authorization
          in: header
          description: >-
            Voximplant Management API uses signed JWT tokens generated from your
            service-account private key. Pass the token in the `Authorization`
            header as a Bearer value:


            ```

            Authorization: Bearer $VOXIMPLANT_TOKEN

            ```


            See [Authorization](/api-reference/management-api/authorization) for
            ready-to-copy snippets in bash, Python, Node.js and Go that turn
            your `credentials.json` into a token.
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/queues_GetACDState_Response_200'
servers:
  - url: https://api.voximplant.com/platform_api
components:
  schemas:
    ACDReadyOperatorStateType:
      type: object
      properties:
        user_id:
          type: integer
          description: The user ID of the operator
        user_name:
          type: string
          description: The user name of the operator
        user_display_name:
          type: string
          description: The display user name of the operator
        idle_duration:
          type: integer
          description: >-
            The idle duration in seconds. The minimum of the duration after the
            last hangup and the duration after the operator status changing to
            READY
      description: The ready operator state.
      title: ACDReadyOperatorStateType
    ACDLock:
      type: object
      properties:
        id:
          type: string
          description: The ACD lock ID
        created:
          type: string
          description: |-
            Timestamp in YYYY-MM-DD HH:mm:ss format.

            The UTC lock created time in 24-h format: YYYY-MM-DD HH:mm:ss
      description: >-
        The [ACD](/docs/references/voxengine/voxengine/enqueueacdrequest) lock
        type.
      title: ACDLock
    ACDOperatorCall:
      type: object
      properties:
        acd_session_history_id:
          type: integer
          description: The ACD session history ID of the request
        acd_request_id:
          type: string
          description: The internal ACD session history ID
        acd_queue_id:
          type: integer
          description: The ACD queue ID
        acd_queue_name:
          type: string
          description: The ACD queue name
        callerid:
          type: string
          description: The client callerid
        begin_time:
          type: string
          description: |-
            Timestamp in YYYY-MM-DD HH:mm:ss format.

            The begin time of the request in 24-h format: YYYY-MM-DD HH:mm:ss
        submitted:
          type: string
          description: >-
            Timestamp in YYYY-MM-DD HH:mm:ss format.


            The submission time of the request in 24-h format: YYYY-MM-DD
            HH:mm:ss
      description: The ACD operator call type.
      title: ACDOperatorCall
    ACDLockedOperatorStateType:
      type: object
      properties:
        user_id:
          type: integer
          description: The user ID of the operator
        user_name:
          type: string
          description: The user name of the operator
        user_display_name:
          type: string
          description: The display user name of the operator
        unreached:
          type: string
          description: >-
            Timestamp in YYYY-MM-DD HH:mm:ss format.


            The UTC time when the operator becomes unavailable in 24-h format:
            YYYY-MM-DD HH:mm:ss
        locks:
          type: array
          items:
            $ref: '#/components/schemas/ACDLock'
          description: The operator locks
        acd_calls:
          type: array
          items:
            $ref: '#/components/schemas/ACDOperatorCall'
          description: The ACD operator calls
        status:
          type: string
          description: >-
            The operator <a
            href='/docs/references/websdk/voximplant/operatoracdstatuses'>status
            string</a>. 'BANNED' string indicates temporarily <a
            href='/docs/guides/smartqueue/acdv1'>banned operators</a>. The
            following values are possible: READY, BANNED
      description: The locked operator state.
      title: ACDLockedOperatorStateType
    ACDAfterServiceOperatorStateType:
      type: object
      properties:
        user_id:
          type: integer
          description: The user ID of the operator
        user_name:
          type: string
          description: The user name of the operator
        user_display_name:
          type: string
          description: The display user name of the operator
        status:
          type: string
          description: >-
            The operator <a
            href='/docs/references/websdk/voximplant/operatoracdstatuses'>status
            string</a>
      description: The after service operator state.
      title: ACDAfterServiceOperatorStateType
    ACDServicingCallStateType:
      type: object
      properties:
        user_id:
          type: integer
          description: The user ID of the operator
        user_name:
          type: string
          description: The user name of the operator
        user_display_name:
          type: string
          description: The display user name of the operator
        priority:
          type: integer
          description: The request priority
        callerid:
          type: string
          description: The client callerid
        begin_time:
          type: string
          description: |-
            Timestamp in YYYY-MM-DD HH:mm:ss format.

            The begin time of the request in 24-h format: YYYY-MM-DD HH:mm:ss
        waiting_time:
          type: integer
          description: The waiting time before servicing in seconds
        acd_session_history_id:
          type: integer
          description: The ACD session history ID of the request
      description: The servicing call state.
      title: ACDServicingCallStateType
    ACDWaitingCallStateType:
      type: object
      properties:
        user_id:
          type: integer
          description: The user ID of the operator to try to service the request
        user_name:
          type: string
          description: The user name of the operator
        user_display_name:
          type: string
          description: The display user name of the operator
        priority:
          type: integer
          description: The request priority
        callerid:
          type: string
          description: The client callerid
        begin_time:
          type: string
          description: |-
            Timestamp in YYYY-MM-DD HH:mm:ss format.

            The begin time of the request in 24-h format: YYYY-MM-DD HH:mm:ss
        waiting_time:
          type: integer
          description: The waiting time in seconds
        minutes_to_submit:
          type: integer
          description: The predicted minutes left to start servicing
        acd_session_history_id:
          type: integer
          description: The ACD session history ID of the request
      description: The waiting call state.
      title: ACDWaitingCallStateType
    ACDQueueStateType:
      type: object
      properties:
        acd_queue_id:
          type: integer
          description: The ACD queue ID
        ready_operators:
          type: array
          items:
            $ref: '#/components/schemas/ACDReadyOperatorStateType'
          description: >-
            List of operators with the 'READY' state that can accept a call from
            this queue
        ready_operators_count:
          type: integer
          description: Number of ready operators
        locked_operators:
          type: array
          items:
            $ref: '#/components/schemas/ACDLockedOperatorStateType'
          description: >-
            List of operators with the 'READY' state that cannot accept a call
            from this queue. Operator cannot accept a call if they are
            temporarily banned, or they are servicing a call right now
        locked_operators_count:
          type: integer
          description: Number of locked operators
        after_service_operators:
          type: array
          items:
            $ref: '#/components/schemas/ACDAfterServiceOperatorStateType'
          description: >-
            List of operators with the 'AFTER_SERVICE' state. This state is set
            right after a call is ended to indicate a call postprocessing
        after_service_operator_count:
          type: integer
          description: Number of operators with the 'AFTER SERVICE' state
        servicing_calls:
          type: array
          items:
            $ref: '#/components/schemas/ACDServicingCallStateType'
          description: >-
            List of calls enqueued into this queue that are being serviced right
            now by operators
        waiting_calls:
          type: array
          items:
            $ref: '#/components/schemas/ACDWaitingCallStateType'
          description: >-
            List of calls enqueued into this queue that are not yet serviced by
            operators
        acd_queue_name:
          type: string
        ready_operator_count:
          type: integer
        locked_operator_count:
          type: integer
      description: The ACD queue state.
      title: ACDQueueStateType
    ACDStateType:
      type: object
      properties:
        acd_queues:
          type: array
          items:
            $ref: '#/components/schemas/ACDQueueStateType'
          description: The queues' states
      description: The [GetACDState] function result item.
      title: ACDStateType
    queues_GetACDState_Response_200:
      type: object
      properties:
        result:
          $ref: '#/components/schemas/ACDStateType'
      title: queues_GetACDState_Response_200
  securitySchemes:
    JwtAuth:
      type: http
      scheme: bearer
      description: >-
        Voximplant Management API uses signed JWT tokens generated from your
        service-account private key. Pass the token in the `Authorization`
        header as a Bearer value:


        ```

        Authorization: Bearer $VOXIMPLANT_TOKEN

        ```


        See [Authorization](/api-reference/management-api/authorization) for
        ready-to-copy snippets in bash, Python, Node.js and Go that turn your
        `credentials.json` into a token.

```

## SDK Code Examples

```python Example 1
import requests

url = "https://api.voximplant.com/platform_api/GetACDState"

headers = {"Authorization": "Bearer <token>"}

response = requests.post(url, headers=headers)

print(response.json())
```

```javascript Example 1
const url = 'https://api.voximplant.com/platform_api/GetACDState';
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Example 1
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.voximplant.com/platform_api/GetACDState"

	req, _ := http.NewRequest("POST", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Example 1
require 'uri'
require 'net/http'

url = URI("https://api.voximplant.com/platform_api/GetACDState")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
```

```java Example 1
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.voximplant.com/platform_api/GetACDState")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php Example 1
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.voximplant.com/platform_api/GetACDState', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

echo $response->getBody();
```

```csharp Example 1
using RestSharp;

var client = new RestClient("https://api.voximplant.com/platform_api/GetACDState");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift Example 1
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.voximplant.com/platform_api/GetACDState")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

```python Example 2
import requests

url = "https://api.voximplant.com/platform_api/GetACDState"

headers = {"Authorization": "Bearer <token>"}

response = requests.post(url, headers=headers)

print(response.json())
```

```javascript Example 2
const url = 'https://api.voximplant.com/platform_api/GetACDState';
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Example 2
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.voximplant.com/platform_api/GetACDState"

	req, _ := http.NewRequest("POST", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Example 2
require 'uri'
require 'net/http'

url = URI("https://api.voximplant.com/platform_api/GetACDState")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
```

```java Example 2
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.voximplant.com/platform_api/GetACDState")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php Example 2
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.voximplant.com/platform_api/GetACDState', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

echo $response->getBody();
```

```csharp Example 2
using RestSharp;

var client = new RestClient("https://api.voximplant.com/platform_api/GetACDState");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift Example 2
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.voximplant.com/platform_api/GetACDState")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```