# GetTaskTableSelection

## General

### URL

https://{host}/attunityenterprisemanager/api/v1/servers/{server}/tasks/{task}/tables?action=selection

### Description

Retrieves the list of tables selected for inclusion (either explicitly or using pattern) in a specific Replicate task.

### Method

GET

### Required user role

See [Required Enterprise Manager permissions](https://help.qlik.com/en-US/enterprise-manager/May2025/Content/EnterpriseManager/EnterpriseManager_APIGuide/Introduction/AEMPermissions.htm).

## Request parameters

Request parameters

| Location | Name | Required | Description |
| --- | --- | --- | --- |
| URL | host [string] | Yes | The host name of the Qlik Enterprise Manager server.<br><br>Example: computer.network.net |
| URL | Server [string] | Yes | The Replicate Server name as defined on Qlik Enterprise Manager.<br><br>Example: myrepsrv1 |
| URL | Task [string] | Yes | The Replicate task for which the tables were selected. |
| Header | EnterpriseManager.APISessionID [string] | Yes | wCo0\_KvjEUFROvfHF5KGrw |

## cURL example

### Request

`curl -i -k --header "EnterpriseManager.APISessionID: eEAt8oWp4TtS3KzV7YlDUw" https://myhostname/attunityenterprisemanager/api/v1/servers/localhost/tasks/sql2sql/tables?action=selection`

### Response

`HTTP/1.1 200 OK` `Cache-Control: no-cache, no-store` `Content-Length: 140` `Content-Type: application/json; charset=utf-8` `Server: Microsoft-HTTPAPI/2.0` `Date: Thu, 14 Mar 2024 10:06:10 GMT` ` ` `{"included_pattern":[],"excluded_pattern":[],"explicit_included_tables":[{"owner":"dbo","name":"employees","load_order":0,"table_type":"TABLE"}]}`

## Response parameters

Response parameters

| Location | Description |
| --- | --- |
| included\_pattern | The include table pattern defined for the Replicate task. |
| excluded\_pattern | The exclude table pattern defined for the Replicate task. |
| explicit\_included\_tables | The specific list of tables and views selected for the Replicate task and the order in which they are loaded to the target. |

## Errors

All of the [general errors](https://help.qlik.com/en-US/enterprise-manager/May2025/Content/EnterpriseManager/EnterpriseManager_APIGuide/PythonAPI/error_handling.htm) as well as the errors listed in the table below.

Error responses

| HTTP Code | Enterprise Manager Code | Text | Description |
| --- | --- | --- | --- |
| 500 | AEM\_TABLE\_LIST\_INNER\_ERR | Failed to retrieve table list for replication task "{task}" on server "{server}". Error: "{message}" | Returned when the table list cannot be retrieved. |
| 500 | AEM\_TASK\_NOT\_FOUND | Replicate task {task} on server {server} could not be found. | The task name is unknown to Enterprise Manager. |