cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
513
Views
0
Helpful
0
Comments
cdnadmin
Level 11
Level 11
This document was generated from CDN thread

Created by: Shivinder Singh on 04-10-2012 11:21:35 AM
Help Documentation: http://docwiki.cisco.com/wiki/Cisco_Unity_Connection_Messaging_Interface_(CUMI)_API

I THINK I'm using the CUMI REST service at <VTG Realm>/vmrest endpoint, and getting some error codes for a start - which is good. Next thing would be to figure out what they mean and wait for new ones right? ;)

To check my own unread messages, I type in a web browser (since its a GET) http://<myipaddress>/vmrest/mailbox/folders/inbox/messages?read=false&type=voice&userobjectid=<myuserobjectid>

I get this error:

Object Not Found

The requested URL '/vmrest/mailbox/folders/inbox/messages?read=false&type=voice&userobjectid=<myuserobejctid>' was not found on the RomPager server.

Return to last page

Now, If I replace my personal IP with Cisco VTG realm IP, I get:

<ErrorDetails><errors><code>INVALID_PARAMETER</code><message>unable to create CML session for user: id=<myuserobjectid>, message=CMLException: 0x46401 code in file CsCmlJni/CsCmlJniSessionFactory.cpp at line 116.</message></errors></ErrorDetails>

How do I do some basic testing against this CUMI REST API?

BTW, VS2010/C# sample of broadcast is very strange choice by Cisco for an example because you don't want to mess up a broadcast doing some testing. Just saying...

Subject: RE: CUMI vmrest error Object Not Found, Or, INVALID_PARAMETER 0x46401
Replied by: Anil Verma on 04-10-2012 11:38:01 AM
When using the CUMI with your own credentials, you do not need to pass the objectid parameter.
So if you want to see all your messages you will use -
<pre>GET /vmrest/mailbox/folders/inbox/messages

The query to execute for what you want to do would be -
GET /vmrest/mailbox/folders/inbox/messages?read=false&type=voice

Check here for examples of the usage of the CUMI API -
http://docwiki.cisco.com/wiki/Cisco_Unity_Connection_Messaging_Interface_%28CUMI%29_API_--_Using_the_CUMI_API
</pre>

Subject: RE: CUMI vmrest error Object Not Found, Or, INVALID_PARAMETER 0x46401
Replied by: Shivinder Singh on 04-10-2012 12:10:02 PM
Anil I have already tried these URL's (before using my objectid). And I get the same error with or without objectid. Matter of fact that's how I guessed my object id.
<ErrorDetails><errors><code>INVALID_PARAMETER</code><message>unable
to create CML session for user: id=<myuserobjectid>,
message=CMLException: 0x46401 code in file
CsCmlJni/CsCmlJniSessionFactory.cpp at line
116.</message></errors></ErrorDetails>
Also, how do I find userobjectid of everyone in the directory?

Subject: RE: CUMI vmrest error Object Not Found, Or, INVALID_PARAMETER 0x46401
Replied by: Anil Verma on 04-10-2012 02:19:26 PM
Are you executing the query from a browser or some other tool?
Is teh user you are logging in as able to see all their information when loggin in through the Web Inbox?
To find the list of users and their object IDs you will need to use the CUPI and use an Administrators provileges.

Subject: RE: CUMI vmrest error Object Not Found, Or, INVALID_PARAMETER 0x46401
Replied by: Jeff Lindborg on 04-10-2012 03:47:54 PM
If you are authenticating as a user (yourself) and want to check your own messages you don’t need to provide an ObjectId. To get information about your account (first name, last name etc…) it looks like this
https://192.168.0.196:8443/vmrest/user
 
authenticate with login/PW setup in your Connection account – you do not need admin rights for this, but you only have access to your own account details/resources.
 
Get all messages:
https://192.168.0.196:8443/vmrest/mailbox/folders/inbox/messages?pagenumber=1&rowsperpage=20
 
Get all unread voice messages:
https://192.168.0.196:8443/vmrest/mailbox/folders/inbox/messages?pagenumber=1&rowsperpage=20&read=false&type=voice
 
 
If instead you want to get messages for another user you need to attach to the Connection server for CUPI for admins functionality with an account that has the user administrator role as well as the “Mailbox Access Delegate Account” role.  To fetch the objectId of all users 25 at a time, it looks like this:
 
https://192.168.0.196:8443/vmrest/users?rowsPerPage=25&pageNumber=1
 
Users that have an alias that starts with “j”:
[url=https://192.168.0.196:8443/vmrest/users?query=(alias%20startswith%20j)&rowsPerPage=25&pageNumber=1]https://192.168.0.196:8443/vmrest/users?query=(alias%20startswith%20j)&rowsPerPage=25&pageNumber=1
 
And so on – using the ObjectID from one of the returned elements you can get messages like this:
https://192.168.0.196:8443/vmrest/mailbox/folders/inbox/messages?userobjectid=8d9f00d8-bbd5-437e-812b-029a39608932&pagenumber=1&rowsperpage=10
 
-J

Subject: RE: New Message from Jeff Lindborg in Cisco Unity Connection(CUC) - CUMI Qu
Replied by: Shivinder Singh on 08-10-2012 10:20:13 AM
Jeff that was perfect. Following needed to happen

1.       Add my service user to “Mailbox Access Delegate Account” role on the Unity Server

2.       In the C# code, add this before making web request, because we have self-signed SSL on Unity Server

ServicePointManager.ServerCertificateValidationCallback += delegate(
                object sender,
                X509Certificate certificate,
                X509Chain chain,
                SslPolicyErrors sslPolicyErrors)
            {
                return true;
            };


Now the question remains: I can’t find the additional call center agent numbers from the /vmrest/users endpoint. I can only see the primary number of a person (DtmfAccessId equals the primary IP phone). But I need ALL userobjectids associated with a particular device. How do I do that?
Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Quick Links