Skip to main content
Skip table of contents

Get JSON Objects from Global List by Values

LAST UPDATED: AUG 08, 2024

Retrieves JSON objects from a global list based on desired values for a second-level JSON object key.

READER NOTE

The key and values must be directly present in second-level JSON objects, not nested within lists or other objects.

Implementation

System

Command Category

System Utility

Tags

GLOBAL LIST

Inputs

Parameter Name

Required/Optional

Description

Sample Data

Global List Name

Required

The name of the global list.

demoGlobalList

Key

Required

The key in the specified global list to query.

demoKeyA

Values

Required

User-specified string data associated with a specified key within second-level JSON objects.

CODE
[
    "demoValueA",
    "demoValueB"
]

Output

Return Data

The returned result of this command. If some required parameters are not defined, this returned data could be empty. The returned result can be passed down directly to a subsequent command in playbooks.

SAMPLE DATA

JSON
[
    {
        "demoKeyA": "demoValueA"
    },
    {
        "demoKeyA": "demoValueB"
    }
]
Context Data

The response data from the utility command.

SAMPLE DATA

JSON
[
    {
        "demoKeyA": "demoValueA"
    },
    {
        "demoKeyA": "demoValueB"
    }
]

Remote Command API

The D3 command API allows you to send requests to D3 SOAR to execute this utility command via REST API.

Request

POST

CODE
https:/{base_url}/{api_namespace}/api/Command/GetObjectsFromList

Headers

Please refer to the page Webhook Configuration Guide - Authentication Method: API Keys for more details.

Request Body

JSON
{
  "Username": "<Username here>",
  "Site": "<Site here>",
  "CommandParams": {
    "Global List Name": "<Global List Name here>",
    "Key": "<Key here>",
    "Values": "<Values here>"
  }
}

Body Parameters

Parameter Name

Type

Required/Optional

Description

Username

string

Required

The username of your D3 SOAR account.

Site

string

Required

The D3 SOAR site to run the remote command.

Global List Name

string

Required

The name of the global list.

Key

string

Required

The key in the specified global list to query.

Values

array<string>

Required

Values used to compare with the global list values at the specified key.

Sample Request

SAMPLE DATA

JSON
{
  "Username": "Admin",
  "Site": "Security Operations",
  "CommandParams": {
    "Global List Name": "demoGlobalList",
    "Key": "demoKey",
    "Values": [
      "demoValueA",
      "demoValueB"
    ]
  }
}

Response

Response Fields

Field Name

Type

Description

result

string

The HTML table representation for the data from the returnData and contextData fields.

error

string

The error message if the API request has failed.

returnData

array<JSON Object>

The return data from the API request.

contextData

array<JSON Object>

The context data from the API request.

Sample Response

JSON
{
    "result": "<table class='cc-table'><tr><th>demoKey</th></tr><tr><td>demoValueA</td></tr><tr><td>demoValueB</td></tr></table>",
    "error": "",
    "returnData": [
        {
            "demoKey": "demoValueA"
        },
        {
            "demoKey": "demoValueB"
        }
    ],
    "contextData": [
        {
            "demoKey": "demoValueA"
        },
        {
            "demoKey": "demoValueB"
        }
    ]
}
JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.