View all methods
importFilters.list
Return a connection’s selective import mode, resource counts, and resources.
Facts
| Method | GET https://yourinstance.getdx.net/api/connections/:connection_id/importFilters.list |
Arguments
Required arguments
| Name | Type | Description |
|---|---|---|
token |
Token |
Auth token passed as an HTTP header. |
connection_id |
Integer |
The connection ID. Substitute this value for :connection_id in the URL path.Example: 123 |
Optional arguments
| Name | Type | Description |
|---|---|---|
import_enabled |
Boolean |
Filter resources by import state. Use true for imported resources or false for excluded resources. Omit this argument to return both. |
limit |
Integer |
Maximum number of resources to return. Defaults to 500 and cannot exceed 1000. |
after_id |
Integer |
Return resources with a DX ID after this cursor. Use the previous response’s next_cursor value. |
Usage info
The response contains:
| Field | Type | Description |
|---|---|---|
connection_id |
Integer |
The connection ID. |
type |
String |
The connector type, such as github or jira_cloud. |
mode |
String |
The current mode: allow_all, allowlist, or denylist. |
counts |
Object |
Counts of total, imported, and excluded resources. |
resources |
Array<Object> |
The requested page of resources. |
has_more |
Boolean |
Whether another page of resources is available. |
next_cursor |
Integer or null |
The cursor for the next page, or null when no additional page is available. |
Each object in resources contains:
| Field | Type | Description |
|---|---|---|
dx_id |
Integer |
The resource’s DX ID. |
source_id |
String or Integer |
The resource’s identifier from the source system. |
name |
String |
The connector’s canonical name, such as organization/repository for an SCM repository or a project key for Jira. |
import_enabled |
Boolean |
Whether the resource is currently imported. |
Resources in both import states are returned when import_enabled is omitted, including when the connection is in allow_all mode. Resources are returned in ascending dx_id order.
When has_more is true, pass next_cursor as after_id in the next request.
Example request
curl "https://yourinstance.getdx.net/api/connections/123/importFilters.list?import_enabled=true&limit=500" \
-H "Accept: application/json" \
-H "Authorization: Bearer xxxx-xxxxxxxxx-xxxx"
Success response
{
"ok": true,
"connection_id": 123,
"type": "github",
"mode": "allowlist",
"counts": {
"total": 3,
"imported": 2,
"excluded": 1
},
"resources": [
{
"dx_id": 101,
"source_id": "869749458",
"name": "acme/api",
"import_enabled": true
}
],
"has_more": false,
"next_cursor": null
}
Errors
| Error | Description |
|---|---|
not_authed |
The request did not include a valid API key. |
connection_not_found |
No connection exists for the given connection_id. |
unsupported_connection_type |
The connection does not support selective import filters. |
invalid_import_enabled |
import_enabled was provided without a valid boolean value. |
invalid_limit |
limit is outside the supported range of 1 to 1000. |
invalid_cursor |
after_id is not a non-negative integer. |