API Bulk Add Reference Set Using Powershell


I’m wondering if anyone would happen to know the correct syntax for bulk adding IP addresses to a reference set using the API and PowerShell? I can add individual items no problem, but I can’t seem to get the body correct for bulk additions. I’ve tried many different formats for the body variable/array, but I keep getting the same error:

“Invoke-RestMethod : {“message”:”Request body must be populated for body parameter “data””,”details”:{},”description”:””,”code”:10,”http_response”:{“message”:”The request
was well-formed but was unable to be followed due to semantic errors”,”code”:422}}”

Here’s an example of the code I’m using:

$url = “https://X.X.com”
$URI = “https://X.X.com/api/reference_data/sets/bulk_load/APITest”

Invoke-RestMethod -Method Post -Uri $URI -Body (convertto-json $body) -Header @{“SEC”= $apiKey }

$body = @{“″,”″,”″,””}


Leave a Reply