Below is inelegant but working PowerShell script (I'm using version 5.0, lower versions would probably work, how low I'm not sure). Variable $depts holds multiple JSON body strings, foreach iterates over each using RESTful API (v1) to create department. Illustrative example only, scaling this up to hundreds/thousands of departments would be a pain, but $depts could be read from an external file of almost any type with appropriate changes to rest of script.
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
$thekey = [convert]::ToBase64String([text.encoding]::ASCII.getbytes('yourApiKey'))
$depts = '{"itil_department":{"name":"SuperNova1","description":"Spaceship Mfg Company1", "head_id":"500001"}}','{"itil_department":{"name":"SuperNova2","description":"Spaceship Mfg Company2", "head_id":"500002"}}','{"itil_department":{"name":"SuperNova3","description":"Spaceship Mfg Company3", "head_id":"500003"}}'
$headers = @{}
$headers.Add('authorization', ("Basic {0}" -f $thekey))
$headers.Add('content-type', 'application/json')
$url = 'https://yourCompany.freshservice.com/itil/departments.json'
foreach ($d in $depts) {
Invoke-RestMethod -Method post $url -Headers $headers -Body $d
}
What is VIA problem? any way.