Import an incident type

Cortex XSOAR 6 API

post /incidenttypes/import

Import an incident type to Cortex XSOAR.

Authentication: api_key Api Key "Authorization"
Form parameters
file oas_any_type_not_mapped

file

CLIENT REQUEST
curl -X 'POST'
-H "Authorization: [[apiKey]]" \
-H 'Accept: application/json'
'https://hostname/incidenttypes/import'
-F 'file='
import http.client conn = http.client.HTTPSConnection("hostname") headers = { 'accept': "multipart/form-data", 'Authorization': "REPLACE_KEY_VALUE" } conn.request("POST", "/incidenttypes/import", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
require 'uri' require 'net/http' require 'openssl' url = URI("https://hostname/incidenttypes/import") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true http.verify_mode = OpenSSL::SSL::VERIFY_NONE request = Net::HTTP::Post.new(url) request["accept"] = 'multipart/form-data' request["Authorization"] = 'REPLACE_KEY_VALUE' response = http.request(request) puts response.read_body
const data = null; const xhr = new XMLHttpRequest(); xhr.withCredentials = true; xhr.addEventListener("readystatechange", function () { if (this.readyState === this.DONE) { console.log(this.responseText); } }); xhr.open("POST", "https://hostname/incidenttypes/import"); xhr.setRequestHeader("accept", "multipart/form-data"); xhr.setRequestHeader("Authorization", "REPLACE_KEY_VALUE"); xhr.send(data);
HttpResponse<String> response = Unirest.post("https://hostname/incidenttypes/import") .header("accept", "multipart/form-data") .header("Authorization", "REPLACE_KEY_VALUE") .asString();
import Foundation let headers = [ "accept": "multipart/form-data", "Authorization": "REPLACE_KEY_VALUE" ] let request = NSMutableURLRequest(url: NSURL(string: "https://hostname/incidenttypes/import")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "POST" request.allHTTPHeaderFields = headers let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume()
<?php $curl = curl_init(); curl_setopt_array($curl, [ CURLOPT_URL => "https://hostname/incidenttypes/import", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "POST", CURLOPT_HTTPHEADER => [ "Authorization: REPLACE_KEY_VALUE", "accept: multipart/form-data" ], ]); $response = curl_exec($curl); $err = curl_error($curl); curl_close($curl); if ($err) { echo "cURL Error #:" . $err; } else { echo $response; }
CURL *hnd = curl_easy_init(); curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST"); curl_easy_setopt(hnd, CURLOPT_URL, "https://hostname/incidenttypes/import"); struct curl_slist *headers = NULL; headers = curl_slist_append(headers, "accept: multipart/form-data"); headers = curl_slist_append(headers, "Authorization: REPLACE_KEY_VALUE"); curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers); CURLcode ret = curl_easy_perform(hnd);
var client = new RestClient("https://hostname/incidenttypes/import"); var request = new RestRequest(Method.POST); request.AddHeader("accept", "multipart/form-data"); request.AddHeader("Authorization", "REPLACE_KEY_VALUE"); IRestResponse response = client.Execute(request);
Responses

The saved incident type

Body
application/json
errorstring
incidentTypesarray
[
autorunboolean
cacheVersnintegerint64
closureScriptstring
colorstring
commitMessagestring
createdstringdate-time
daysintegerint64
daysRintegerint64
defaultboolean
definitionIdstring
detachedboolean
disabledboolean
extractSettingsobject
fieldCliNameToExtractSettingsobject
Additional propertiesobject
extractAsIsIndicatorTypeIdstring
extractIndicatorTypesIDsarray[string]
isExtractingAllIndicatorTypesboolean
modestring
fromServerVersionobject
Digitsarray[integer]

WARNING: when adding new attributes or changing the names of the existing ones, remember to add support in UnmarshalJSON for items that were exported by msgpack.

Labelstring
highlightobject
Additional propertiesarray[string]
hoursintegerint64
hoursRintegerint64
idstring
indexNamestring
itemVersionobject
Digitsarray[integer]

WARNING: when adding new attributes or changing the names of the existing ones, remember to add support in UnmarshalJSON for items that were exported by msgpack.

Labelstring
layoutstring
lockedboolean
modifiedstringdate-time
namestring
numericIdintegerint64
onChangeRepAlgnumberdouble
packIDstring
packNamestring
packPropagationLabelsarray[string]
playbookIdstring
preProcessingScriptstring
prevNamestring
primaryTermintegerint64
propagationLabelsarray[string]
readonlyboolean
remoteboolean
reputationCalcnumberdouble
sequenceNumberintegerint64
shouldCommitboolean
sizeInBytesintegerint64
slaintegerint64
slaReminderintegerint64
sortValuesarray[string]
syncHashstring
systemboolean
toServerVersionobject
Digitsarray[integer]

WARNING: when adding new attributes or changing the names of the existing ones, remember to add support in UnmarshalJSON for items that were exported by msgpack.

Labelstring
vcShouldIgnoreboolean
vcShouldKeepItemLegacyProdMachineboolean
versionintegerint64
weeksintegerint64
weeksRintegerint64
]
RESPONSE
{ "error": "example", "incidentTypes": [ { "autorun": false, "cacheVersn": 0, "closureScript": "example", "color": "example", "commitMessage": "example", "created": "2020-01-01T12:00:00Z", "days": 0, "daysR": 0, "default": false, "definitionId": "example", "detached": false, "disabled": false, "extractSettings": { "fieldCliNameToExtractSettings": { "additionalProperties": { "extractAsIsIndicatorTypeId": "example", "extractIndicatorTypesIDs": [ "example" ], "isExtractingAllIndicatorTypes": false } }, "mode": "example" }, "fromServerVersion": { "Digits": [ 0 ], "Label": "example" }, "highlight": { "additionalProperties": [ "example" ] }, "hours": 0, "hoursR": 0, "id": "example", "indexName": "example", "itemVersion": { "Digits": [ 0 ], "Label": "example" }, "layout": "example", "locked": false, "modified": "2020-01-01T12:00:00Z", "name": "example", "numericId": 0, "onChangeRepAlg": 0.1, "packID": "example", "packName": "example", "packPropagationLabels": [ "example" ], "playbookId": "example", "preProcessingScript": "example", "prevName": "example", "primaryTerm": 0, "propagationLabels": [ "example" ], "readonly": false, "remote": false, "reputationCalc": 0.1, "sequenceNumber": 0, "shouldCommit": false, "sizeInBytes": 0, "sla": 0, "slaReminder": 0, "sortValues": [ "example" ], "syncHash": "example", "system": false, "toServerVersion": { "Digits": [ 0 ], "Label": "example" }, "vcShouldIgnore": false, "vcShouldKeepItemLegacyProdMachine": false, "version": 0, "weeks": 0, "weeksR": 0 } ] }