Hi,
I am using VMrest method in Cisco Unity connection API's to import users in Cisco unity. I am able to fetch the list of users who could be imported. But when I try to import the user I get the below error. Please assist.
$pwd = ConvertTo-SecureString "Password" -AsPlainText -Force
$cred = New-Object Management.Automation.PSCredential ('UserName',$pwd)
$URL = "https://servername/vmrest/import/users/ldap?templateAlias=voicemailusertemplate HTTP/1.1"
$postParams = @{"@alias"="Aliasname";
"firstName"="Phil";
"lastName"="TEST";
"dtmfAccessId"="12123465";
"pkid"="7a3647c5-8fc5-b483-175e-ffcb4a834e2d"
} | ConvertTo-Json
$response = Invoke-WebRequest -Uri $URL -Credential $cred -Method Post -Body $postParams -ContentType "application/json"
Write-Host $response.xml
I get the below error :
Invoke-WebRequest : DATA_EXCEPTIONObject not found or is not a template: Parameter = [pTemplateObjectId], Table =
[tbl_Alias,tbl_User], Column = [Alias,ObjectId]
At line:15 char:13
+ $response = Invoke-WebRequest -Uri $URL -Credential $cred -Method POS ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-WebRequest], WebException
+ FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeWebRequestCommand