<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:Consolas;}
span.hoenzb
        {mso-style-name:hoenzb;}
span.m-9220861855814655433gmail-hoenzb
        {mso-style-name:m_-9220861855814655433gmail-hoenzb;}
span.EmailStyle21
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Thanks to the group for this thread. I’m likely going to have to go down a similar path soon and will be using this as a reference.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">My biggest fear is that we haven’t had a real userID to phone to voicemail mapping over the years. It’s gonna be interesting going forward.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">---<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Lelio Fulgenzi, B.A.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Senior Analyst, Network Infrastructure<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Computing and Communications Services (CCS)<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">University of Guelph<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">519-824-4120 Ext 56354<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">lelio@uoguelph.ca<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">www.uoguelph.ca/ccs<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Room 037, Animal Science and Nutrition Building<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Guelph, Ontario, N1G 2W1<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> cisco-voip [mailto:cisco-voip-bounces@puck.nether.net]
<b>On Behalf Of </b>Nick Barnett<br>
<b>Sent:</b> Friday, October 06, 2017 3:33 PM<br>
<b>To:</b> Nathan Reeves<br>
<b>Cc:</b> Cisco VoIP Group<br>
<b>Subject:</b> Re: [cisco-voip] Changing CUC UM Account with API?<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">I just wanted to send a quick update and another THANK YOU, this worked perfectly for adding office 365 accounts! Thanks so much. I only ran into one real issue, which I'll know more about next time... apparently, one of my POST requests
 actually worked and then added the UM account to the CUC user. I didn't know this happened because I guess I wasn't paying close enough attention. From that point on, I kept getting a "400 Bad Request."  We spun our wheels for an hour or so trying to figure
 out what was wrong with the web request. Turns out, there was nothing wrong and CUC responds with a 400 when you try to add a SECOND UM account. Derp. We deleted the one that was added during testing and were able to successfully put it back on.<o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">FWIW, we used iwr from powershell, and not postman. Going through this exercise has really been eye opening on how this works. I just didn't "get it" before... one step closer to world domination :)<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Thanks,<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">Nick<o:p></o:p></p>
</div>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">On Sun, Oct 1, 2017 at 12:25 AM, Nathan Reeves <<a href="mailto:nathan.a.reeves@gmail.com" target="_blank">nathan.a.reeves@gmail.com</a>> wrote:<o:p></o:p></p>
<div>
<p class="MsoNormal">Taken a quick look and yeah, Anthony is correct in regards to the use of DELETE.<o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"><b>To Delete the existing UM Service account:</b><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">- A GET to <a href="https://%3cconnection-server%3e/vmrest/users/">
https://<connection-server>/vmrest/users/</a> will dump the users on the Connection Server.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">- For each user you'll find an objectId listed. A GET to <a href="https://%3cconnection-server%3e/vmrest/users/%3cuser-objectid%3e/externalserviceaccounts">
https://<connection-server>/vmrest/users/<user-objectid>/externalserviceaccounts</a> will dump any attached external services account for the user.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">- You'll want to then grab the '<URI>' value in the returned data (looking like '/vmrest/users/<user-objectid>/externalserviceaccounts/<ObjectId>' and execute a DELETE against that URI (obv adding 'https://<connection-server>/' to the URI).<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">- Note that you need to use basic auth to login as an appadmin for the request.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">- CURL wise: curl --basic --user <app admin>:<password> -k -X DELETE
<a href="https://%3cconnection-server%3e/vmrest/users/%3cuser-objectid%3e/externalserviceaccounts/%3cobject-id">
https://<connection-server>/vmrest/users/<user-objectid>/externalserviceaccounts/<object-id</a>> <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"><b>To add the new UM Service to the user account:</b><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">- Update the XML below with:<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">   - %umservice-objectid% - The guid of the um service (easiest way is to grab the guid from the CUC Admin pages for the UM service listed under Unified Messaging > Unified Messaging Services).<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">   - %user-objectid% - As per the id you found prev when you did the delete.<o:p></o:p></p>
</div>
<div style="mso-element:para-border-div;border:dashed #2F6FAB 1.0pt;padding:12.0pt 12.0pt 12.0pt 12.0pt;background:#F9F9F9">
<pre style="line-height:13.2pt;background:#F9F9F9;border:none;padding:0in"><span style="color:black"><ExternalServiceAccount><o:p></o:p></span></pre>
<pre style="line-height:13.2pt;background:#F9F9F9;border:none;padding:0in"><span style="color:black">     <ExternalServiceObjectId><b>%umservice-objectid%</b></ExternalServiceObjectId><o:p></o:p></span></pre>
<pre style="line-height:13.2pt;background:#F9F9F9;border:none;padding:0in"><span style="color:black">     <SubscriberObjectId><b>%user-objectid%</b></SubscriberObjectId><o:p></o:p></span></pre>
<pre style="line-height:13.2pt;background:#F9F9F9;border:none;padding:0in"><span style="color:black">     <UserURI>/vmrest/users/<b>%user-objectid%</b></UserURI><o:p></o:p></span></pre>
<pre style="line-height:13.2pt;background:#F9F9F9;border:none;padding:0in"><span style="color:black">     <EnableCalendarCapability>true</EnableCalendarCapability><o:p></o:p></span></pre>
<pre style="line-height:13.2pt;background:#F9F9F9;border:none;padding:0in"><span style="color:black">     <EnableMeetingCapability>false</EnableMeetingCapability><o:p></o:p></span></pre>
<pre style="line-height:13.2pt;background:#F9F9F9;border:none;padding:0in"><span style="color:black">     <EnableTtsOfEmailCapability>true</EnableTtsOfEmailCapability><o:p></o:p></span></pre>
<pre style="line-height:13.2pt;background:#F9F9F9;border:none;padding:0in"><span style="color:black">     <IsPrimaryMeetingService>false</IsPrimaryMeetingService><o:p></o:p></span></pre>
<pre style="line-height:13.2pt;background:#F9F9F9;border:none;padding:0in"><span style="color:black">     <LoginType>0</LoginType><o:p></o:p></span></pre>
<pre style="line-height:13.2pt;background:#F9F9F9;border:none;padding:0in"><span style="color:black">     <UserPassword/><o:p></o:p></span></pre>
<pre style="line-height:13.2pt;background:#F9F9F9;border:none;padding:0in"><span style="color:black">     <EnableMailboxSynchCapability>true</EnableMailboxSynchCapability><o:p></o:p></span></pre>
<pre style="line-height:13.2pt;background:#F9F9F9;border:none;padding:0in"><span style="color:black">     <EmailAddressUseCorp>true</EmailAddressUseCorp><o:p></o:p></span></pre>
<pre style="line-height:13.2pt;background:#F9F9F9;border:none;padding:0in"><span style="color:black"></ExternalServiceAccount><o:p></o:p></span></pre>
</div>
<div>
<p class="MsoNormal">You'll need to then POST this XML to url: 'https://<connection-server>/vmrest/users/<user-objectid>/externalserviceaccounts'.  Note that again you need to provide basic auth.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Note that the XML Above worked for me when adding a UM Service configured to point to Exchange, so ~in theory~ this should work for O365 as well.  Not got a tenancy I can test against at the moment in O365 to confirm.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">If you use Postman to run this stuff, make sure you use the desktop version (not the chrome extension version), and make sure you add the 'Origin' header.  The value should be the url of the CUC Server (eg '<a href="http://172.20.2.25" target="_blank">http://172.20.2.25</a>'). 
 This should stop you receiving the 'domain not allowed' error message'<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Hope this assists.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="color:#888888"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="color:#888888">Nathan<o:p></o:p></span></p>
</div>
<div>
<div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">On Fri, Sep 29, 2017 at 7:56 AM, Nathan Reeves <<a href="mailto:nathan.a.reeves@gmail.com" target="_blank">nathan.a.reeves@gmail.com</a>> wrote:<o:p></o:p></p>
<div>
<p class="MsoNormal">While people are possibly playing around with the CUC Provisioning API, let me know if you ever get the import of CUCM Local users to CUC working correctly.  The last rollout I did I was trying to pull in local users but the api just didn't
 work.  Had to use LDAP imports instead.  Never looked too much deeper as I just needed to get on with things.<o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">But yeah, the API for CUC is really hit and miss.  lol, and the API for UCCX can be a bit the same.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="color:#888888"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="color:#888888">Nathan<o:p></o:p></span></p>
</div>
</div>
<div>
<div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">On Fri, Sep 29, 2017 at 5:07 AM, Anthony Holloway <<a href="mailto:avholloway+cisco-voip@gmail.com" target="_blank">avholloway+cisco-voip@gmail.com</a>> wrote:<o:p></o:p></p>
<div>
<p class="MsoNormal">Wow, the documentation for the CUC API has gone to shit.  There's literally a link on the
<a href="http://developer.cisco.com" target="_blank">developer.cisco.com</a> site that sends you to a wiki site, which itself then sends you to
<a href="http://developer.cisco.com" target="_blank">developer.cisco.com</a>.  Nice.<o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Anyway, I tried to look into this quick for you, but I got stuck with the documentation on POSTing a new UM account for end users.  It literally just says:<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<div>
<p class="MsoNormal">"To create an a new external service account, POST an XML document (<span style="color:red">formatted similar to the one above</span>) to the following URL:<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">POST <a href="https://%3cconnection-server%3e/vmrest/users/%3cuser-objectid%3e/externalserviceaccounts">
https://<connection-server>/vmrest/users/<user-objectid>/externalserviceaccounts</a>"<o:p></o:p></p>
</div>
</div>
<div>
<p class="MsoNormal">Source: <a href="http://docwiki.cisco.com/wiki/Cisco_Unity_Connection_Provisioning_Interface_(CUPI)_API_--_User_Unified_Messaging_Account" target="_blank">http://docwiki.cisco.com/wiki/Cisco_Unity_Connection_Provisioning_Interface_(CUPI)_API_--_User_Unified_Messaging_Account</a><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">The key part being "similar to."  It's beyond my comprehension that anyone would think that this is sufficient documentation to make an API request work.  Suffice it to say, it didn't work for me, and now I'm done troubleshooting it.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Since any good REST API should use CRUD, it would then make sense that you issue an HTTP DELETE to the user object + um account object URI to remove the old one, after you successfully run the POST above to Create the new association.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Good luck.  If I have more time in the next few days, I'll try again.<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<div>
<div>
<p class="MsoNormal">On Wed, Sep 27, 2017 at 10:25 AM Nick Barnett <<a href="mailto:nicksbarnett@gmail.com" target="_blank">nicksbarnett@gmail.com</a>> wrote:<o:p></o:p></p>
</div>
</div>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in">
<div>
<div>
<div>
<p class="MsoNormal">I can handle most things in CUCM with SOAP, but I always get confused when trying to use VMREST in CUC. I cannot find a way to add and remove a UM account via automation. We're stuck using a CSV and it's really putting a cramp in our migration
 to Exchange Online.<o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">The particular change I'm needing is here: Users->EditMenu->Unified messaging accounts<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">1) Need to add an additional one that connects to Exchange Online (this already exists in CUC)<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">2) Need to delete the old one that connects to on prem Exchange. (Not delete the whole UM connector service, but just the account association to a particular user)<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Does anyone have any pointers on this? We have batches of people migrating every week, sometimes multiple times per week... so I can't just make some global change.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">We're on CUC 10.5<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Thanks!<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">Nick<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">P.S.  I hate that MSFT and CSCO both have a product called "Unified Messaging" :)<o:p></o:p></p>
</div>
</div>
</div>
</div>
<p class="MsoNormal">_______________________________________________<br>
cisco-voip mailing list<br>
<a href="mailto:cisco-voip@puck.nether.net" target="_blank">cisco-voip@puck.nether.net</a><br>
<a href="https://puck.nether.net/mailman/listinfo/cisco-voip" target="_blank">https://puck.nether.net/mailman/listinfo/cisco-voip</a><o:p></o:p></p>
</blockquote>
</div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><br>
_______________________________________________<br>
cisco-voip mailing list<br>
<a href="mailto:cisco-voip@puck.nether.net" target="_blank">cisco-voip@puck.nether.net</a><br>
<a href="https://puck.nether.net/mailman/listinfo/cisco-voip" target="_blank">https://puck.nether.net/mailman/listinfo/cisco-voip</a><o:p></o:p></p>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
</div>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
</body>
</html>