Get list items
client.rules.lists.items.list(stringlistId, ItemListParams { account_id, cursor, per_page, search } params, RequestOptionsoptions?): CursorPaginationAfter<ItemListResponse>
GET/accounts/{account_id}/rules/lists/{list_id}/items
Fetches all the items in the list.
Security
API Token
The preferred authorization scheme for interacting with the Cloudflare API. Create a token.
Example:
API Email + API Key
The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.
Example:
The previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.
Example:
Accepted Permissions (at least one required)
Get list items
import Cloudflare from 'cloudflare';
const client = new Cloudflare({
apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted
});
// Automatically fetches more pages as needed.
for await (const itemListResponse of client.rules.lists.items.list(
'2c0fc9fa937b11eaa1b71c4d701ab86e',
{ account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
)) {
console.log(itemListResponse);
}{
"errors": [
{
"code": 1000,
"message": "message",
"documentation_url": "documentation_url",
"source": {
"pointer": "pointer"
}
}
],
"messages": [
{
"code": 1000,
"message": "message",
"documentation_url": "documentation_url",
"source": {
"pointer": "pointer"
}
}
],
"result": [
{
"id": "34b12448945f11eaa1b71c4d701ab86e",
"created_on": "2020-01-01T08:00:00Z",
"ip": "10.0.0.1",
"modified_on": "2020-01-10T14:00:00Z",
"comment": "Private IP address"
}
],
"success": true,
"result_info": {
"cursors": {
"after": "yyy",
"before": "xxx"
}
}
}Returns Examples
{
"errors": [
{
"code": 1000,
"message": "message",
"documentation_url": "documentation_url",
"source": {
"pointer": "pointer"
}
}
],
"messages": [
{
"code": 1000,
"message": "message",
"documentation_url": "documentation_url",
"source": {
"pointer": "pointer"
}
}
],
"result": [
{
"id": "34b12448945f11eaa1b71c4d701ab86e",
"created_on": "2020-01-01T08:00:00Z",
"ip": "10.0.0.1",
"modified_on": "2020-01-10T14:00:00Z",
"comment": "Private IP address"
}
],
"success": true,
"result_info": {
"cursors": {
"after": "yyy",
"before": "xxx"
}
}
}