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

CUPI: Add Role to User -- Fails with 404 Error

grektokomus
Level 1
Level 1


Problem: Cisco Unity .NET SDK (CiscoUnityConnectionRestFunctions--C:\dev\KpUtilization\packages\Cisco.UnityConnection.RestSdk.3.0.51) apparently does not expose a method of assigning system users to a Role.  

Based on the documentation here: 
See Adding Roles: http://docwiki.cisco.com/wiki/Cisco_Unity_Connection_Provisioning_Interface_(CUPI)_API_--_User_Roles  it would seem that a simple REST call should work.  

I have verified REST functionality for GET calls (see below), but the PUT call that should assign the Role to the User fails with a 404.

Target system is Cisco Unity Connection version: 8.6.2ES145.25900-145
***

1) Confirm the role’s ObjectId

GET https://10.210.191.74:8443/vmrest/roles
Authorization: Basic UGhvbmVTd2FwVXNlcjplQXJOcjNySnpt

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Roles total="9">
………
<Role>
<URI>/vmrest/roles/9c7af576-c945-479c-a236-147fa05ad27b</URI>
<ObjectId>9c7af576-c945-479c-a236-147fa05ad27b</ObjectId>
<RoleName>System Administrator</RoleName>
<RoleDescription>Top-level Connection administrator - access to all Connection administrative functions, reports, and tools for server and users</RoleDescription>
<IsEnabled>true</IsEnabled>
<ReadOnly>false</ReadOnly>
</Role>
………
</Roles>


2) Confirm the User’s ObjectId:
GET https://10.210.191.74:8443/vmrest/users/16e2fd76-9a0a-4b55-a205-8d305f300559
Authorization: Basic UGhvbmVTd2FwVXNlcjplQXJOcjNySnpt


<User>
<URI>/vmrest/users/16e2fd76-9a0a-4b55-a205-8d305f300559</URI>
<ObjectId>16e2fd76-9a0a-4b55-a205-8d305f300559</ObjectId>
<UseDefaultLanguage>true</UseDefaultLanguage>
<FirstName>David Lee</FirstName>
<LastName>Roth</LastName>
<Alias>David Lee Roth</Alias>
<City></City>
<State></State>
<Country>US</Country>
<PostalCode></PostalCode>
<Department></Department>
<Manager></Manager>
<Building></Building>
<Address></Address>
<DisplayName>David Lee Roth</DisplayName>
<BillingId></BillingId>
<EmailAddress></EmailAddress>
<TimeZone>4</TimeZone>
<CreationTime>2015-05-05T18:07:33Z</CreationTime>
<IsTemplate>false</IsTemplate>
<DtmfNameFirstLast>328435337684</DtmfNameFirstLast>
<DtmfNameLastFirst>768432843533</DtmfNameLastFirst>
<CosObjectId>60a5dcd3-3219-445b-bde8-f1ea4ab31977</CosObjectId>
<CosURI>/vmrest/coses/60a5dcd3-3219-445b-bde8-f1ea4ab31977</CosURI>
…….
</User>

3) Assign the role for the user (attempted this as a JSON call and an XML call):
POST https://10.210.191.74:8443/vmrest/users/16e2fd76-9a0a-4b55-a205-8d305f300559/userroles
Authorization Basic UGhvbmVTd2FwVXNlcjplQXJOcjNySnpt
{"RoleObjectId":"9c7af576-c945-479c-a236-147fa05ad27b"}

RESULT:
HTTP Status 404 - Not Found
type: Status report
message: Not Found
description: The requested resource is not available.

 

1 Accepted Solution

Accepted Solutions

lindborg
Cisco Employee
Cisco Employee

Issue here is that 8.6.2 did not support POST/DELETE for roles, it was read only.  You need to get to Unity Connection 10.0 or later for full CRUD support on role assignments for users.

As a side note, build 3.0.56 of the .NET SDK added support for easy role assignment and removal for users as well: http://www.ciscounitytools.com/CodeSamples/Connection/CUPI/CUPI.html

 

View solution in original post

1 Reply 1

lindborg
Cisco Employee
Cisco Employee

Issue here is that 8.6.2 did not support POST/DELETE for roles, it was read only.  You need to get to Unity Connection 10.0 or later for full CRUD support on role assignments for users.

As a side note, build 3.0.56 of the .NET SDK added support for easy role assignment and removal for users as well: http://www.ciscounitytools.com/CodeSamples/Connection/CUPI/CUPI.html