Convert File Format
LAST UPDATED: AUG 07, 2024
Convert files (txt, xml, json, csv) from database to a different format and save them to the database
Implementation | System |
Command Category | Basic Utility |
Tags | FILE |
Inputs
Parameter Name | Required/Optional | Description | Sample Data |
---|---|---|---|
File IDs | Required | The array of file IDs for conversion. |
CODE
|
Source Table | Required | The name of the table in which the files are stored. | IR_ATCHMNT |
Format | Required | The file format to which the files will be converted. | JSON |
Output
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
https:/{base_url}/{api_namespace}/api/Command/FileFormatConvert
Headers
Please refer to the page Webhook Configuration Guide - Authentication Method: API Keys for more details.
Request Body
{
"Username": <Username here>,
"Site": <Site here>,
"CommandParams": {
"File IDs": <The array of file IDs for conversion.>,
"Source Table": <The name of the table in which the files are stored.>,
"Format": <The file format to which the files will be converted>
}
}
Body Parameters
Parameter Name | Type | Required/Optional | Description |
---|---|---|---|
Username |
| Required | The username of your D3 SOAR account. |
Site |
| Required | The D3 SOAR site to run the remote command. |
File IDs |
| Required | The array of IDs of files for conversion |
Source Table |
| Required | The table name in which the files are |
Format |
| Required | The file format to which the files will be converted |
Sample Request
SAMPLE DATA
{
"Username": "Admin",
"Site": "Security Operations",
"CommandParams": {
"File IDs": [
1044,
1050,
1051
],
"Source Table": "IR_ATCHMNT",
"Format": "JSON"
}
}
Response
Response Fields
Field Name | Type | Description |
---|---|---|
error |
| The error message if the API request has failed. |
returnData |
| The return data from the API request. |
contextData |
| The context data from the API request. |
Sample Response
{
"error": "",
"returnData": "Successful",
"contextData": [
{
"FileID": "370",
"FileName": "73841_2101132325140000---Test.json",
"MD5": "b0778a411c26f7b9b9ef5db8ed99566e",
"SHA1": "62678242ac69a2fb5cfa6a2cc3256fd8229fd7f4",
"SHA256": "2afa7715181f03b6fe5acd7c82b8e818303a5de567af1a83d8c283010af2db44",
"originalFileID": "1044"
},
{
"FileID": "377",
"FileName": "84403_2103252109470000---Test.json",
"MD5": "638c10c0494fbefdef861e702b737a52",
"SHA1": "b1e4daeef920ae36a374619dc19db6d8e43ea2a0",
"SHA256": "8e11ef2a631ca5d0fc00753431ffb3511bff32d65816e98a66d298f0e2f2189b",
"originalFileID": "1050"
},
{
"FileID": "388",
"FileName": "84403_2103252116120000---Test.json",
"MD5": "d0073ab01e38cd4ded6b37fe8bcd9b74",
"SHA1": "146ae75107cd7927870c35ea149ce9ca770d2aa6",
"SHA256": "8078f2d8556e8c0d00429589fa75298544f96776cac63d99f2be1a8aa4cac00a",
"originalFileID": "1051"
}
]
}