cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
785
Views
0
Helpful
0
Replies

Error while importing users using Cisco Unity connection API's

JestyDS
Level 1
Level 1

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

0 Replies 0