Search code examples
skype-for-businessucwaskypedeveloper

Not Able to Get Applications Url for Skype for Business


I'm trying to use the REST API in Skype for Business Online by following the instructions here: https://msdn.microsoft.com/EN-US/library/office/mt590891(v=office.16).aspx.

I make the first call to the discovery service, and then get the discovery URL back for the user; it looks like this for me: https://webdir0b.online.lync.com/Autodiscover/AutodiscoverService.svc/root/oauth/user

I then make the call to Azure and successfully get an access token back for https://webdir0b.online.lync.com. The next step is where things break down - I make a request again to the discovery Url for the user and include the access token. The call returns successfully, but the problem is that it doesn't have the "applications" url in the payload as described in the documentation. Instead it returns the same exact info as I got when I called the general discovery endpoint (https://webdir.online.lync.com/autodiscover/autodiscoverservice.svc/root). I've triple checked that I'm calling the correct endpoint so...any hints as to why I'm not getting the expected payload when calling the discovery Url for the user?


Solution

  • I'll try and answer as short as possible - I got this working. 1st issue - when you don't get "applications" in the result, you should have a "redirect" value instead. Keep following that and doing your GET against it (using the process of getting access tokens and adding the auth header) and eventually you should get the applications Url. 2nd issue - after you get your applications URL, you need to go get another access token and use the host name of the applications URL as the resource ID. Then you can post and create your app. Really hope this helps someone. :-)