I'm working on a WPF application utilizing the Box Windows SDK. I'm looking to use the GetUsers API method (authenticating as an admin user) to get all the enterprise users in our organization and then On-behalf-of calls in order to list the folders and files for particular users (my API key has already been granted on-behalf-of access). It seems like none of this functionality is currently available in the Windows SDK. Is that correct?
I believe that is correct. The Windows SDK supports most of the non-administrative API calls at the moment.
All the SDKs are open-source, so you can contribute if you want. The pattern is fairly simple to add another header. Or to add an additional noun
Note that you should use as-user instead of on-behalf-of.
Related
I need to write a console application to retrieve domain shared contacts (eventually update, add or delete them, too).
What I found so far is "Google Domain Shared Contacts API" should do just that, but I am a bit clueless as where to start.
I don't know how to access this API in .NET and I haven't found any examples of such a code.
As far as I can see in the documentation, Domain Shared Contacts API is not currently included in the list of Supported Google APIs for .NET .
You may, however, check in Release Notes for the Google API Client Library for .NET for announcement or updates regarding this API.
If the time comes that Domain Shared Contacts API becomes supported, you may use the following references to get started:
Easily access Google APIs from .NET
GitHub post - google-api-dotnet-client
GitHub post - google-api-dotnet-client-samples
I managed to come up with an application that sends http requests to the API, however their documentation is terrible as it lacks complete description of how exactly the requests should look like and I had to experiment a bit.
I am attempting to connect to Yammer using their .NET SDK but I am having a hell of a time managing this... The point of this exercise is to create an application in Azure which periodically - and AUTONOMOUSLY - contacts Yammer and fetches the latest messages from a specific Yammer group.
Does anyone know of the correct way to use the Yammer .NET SDK from, let's say, a console application, which does not rely on a browser (a.k.a. direct user interaction) to successfully connect via OAuth authentication?
What I have tried:
Trying to suss out what to do from the example given on .NET SDK page on developer.yammer.com, you can see under "Standard Process" an example which shows the LaunchSignIn() function with an incorrect signature! The example shows the usage as:
var authResponse = await OAuthUtils.LaunchSignIn(_clientConfig.ClientId, _clientConfig.RedirectUri, ssoEnabled);
whereas the actually signature I get from the dll is:
void OAuthUtils.LaunchSignIn(string clientId, string RedirectUri)
I'll forgive the missing ssoEnabled parameter... but the example claims the function receives a response, from which a Code is then extracted. This is, of course, the piece missing from my attempt to call:
(awaitable) Task<AuthEnvelope> AuthClient.AuthenticateAppAsync(string code)
I have scoured Google for information on the use of the Yammer .NET SDK but have come up empty handed. All manner of examples of connecting to Yammer but none are in any way relevant to the .NET API. The only thing in any way relevant that I have seen is the Yammer .NET API example uploaded, apparently, by the person who developed it, who posted the code on GitHub. I have checked this example but the two parts in it - one for Windows Phone and one for Windows "Modern App" - both rely on a Browser object being available, or something to that effect anyway. There are redirects, I'm supposed to have a RedirectUri for Yammer to direct me... So does this other example - which was the ONLY other example of using the .NET SDK that I could find.
I imagine that the reason the signature is different is because this isn't actually the same function at all. The one I am trying to use is in Yammer.Oss.Api.Utils whereas the example application doesn't even have the letters Utils together other than in the name of the class OAuthUtils... which leads me to believe that it is possibly under Yammer.Oss.Core.WinRT which, as luck would have it, I cannot reference at all... Yammer.Oss.Core only contains Collections, Constants, Extensions and Serialization.
By the way, in the announcement of the .NET SDK (see first link above), the link to documentation for the SDK leads to the Yammer Support page.
Skip the .NET SDK and just do the authorization yourself using the server-side flow. Then make the requests with HttpClient and add the Authorization header. The SDK might be helpful with some Modern Apps but it's overkill for most people. When working with the API manually the worst thing you'll have to deal with is deserializing the JSON responses with JSON.NET, or other JSON library.
You don't say what you are trying to build, but AFAIK WebJobs don't have a UI so you'll need to do the authorization from a console app or website. Then store the resulting OAuth token somewhere that the WebJob can access it. If you have need an OAuth token per user you'll need to store those in a database, but make efforts to protect them because each OAuth token provides access to their Yammer account.
I want to create simple WPF desktop or console application which retrieves and shows data from Office 365 Contacts API.
I already have an Azure AD and an Office 365 accounts. I've read the documentation and seen a lot of samples. But they were all about ASP.NET and windows 8.1 and other types of application.
They used OWIN or build-in authentication calls(for windows 8.1).
I think it should look like this:
User presses the button
My application calls a method from "some Microsoft library" and passes as
client_id a parameter. This call will open a new browser window with
suggestion for user to login. User logs in and agrees to provide access to his contacts.
As result of this call I should receive an access token
Be happy and read contacts by using
Microsoft.Ofiice365.OutlookServices.
I'm stuck at the second point of this idea - "some Microsoft library".
Can you suggest which library I should use?
Does something like this exist?
If it would not work in this way, can you suggest any other way to retrieve contacts from office 365 in WPF desktop or console application?
I'm trying to find something that is like this, but works wiht contacts API (not with One Drive) and does not require me to define special BrowserWindow in XAML or C#.
Does this way exist? Or I should implement this functionality by myself?
Additionally I would like to use Office 365 REST API, not EWS.
Yes, you can do this from a Windows app. I'd recommend using ADAL for the authentication. That should provide a browser window for the signin process. You can also use the Visual Studio Office 365 Tools to register your app and get libraries for calling the Contacts API.
As we know that a new feature called virtual machine has been added in windows azure portal. but i want to create a virtual machine in windows azure programmatically with C# or . net. so can any one please help in this... which API shoud i use or yet the API for .net need to be published by azure people? please any one guide me to do this task.
You'll likely want to use Azure's REST Service Management APIs. For example, APIs for creating and managing VMs are here: Create Virtual Machine Deployment.
The overall API is documented here.
Since you're in .NET it seems like there would be service management APIs in the managed SDK, but I didn't see any service management API references there.
I just want to add something after the above answers, certainly you can create the Virtual Machines using Power Shell or C# and here is an example I found it might be interesting using the .Net API
http://code.msdn.microsoft.com/windowsazure/How-to-program-control-838bd90b
Currently there is only a REST API for creating Virtual Machines
This post shows an example of how to call the REST API in C# for creating a VM.
Remember that a Virtual Machine and a VMRole are different.
Apologies for not having seen this question earlier. The Microsoft Azure Management Libraries (MAML, for short) can provide this sort of .NET-based access to the Microsoft Azure management APIs. MAML is available as a series of NuGet packages, which were released officially just this week.
To accompany the release I've put out a blog post linking to a VS Extension I wrote for the //build/ conference. This extension provides a walk-thru via VS Project & Item templates, along with some code snippets, that do exactly what you're after - create a VM in Microsoft Azure from a Console Application.
I've written a few other posts on MAML that offer other pieces of guidance and information. Hope this helps!
Iam writing a Phone App where the end user should be able to access their own personal messages and other personal content.
Does anyone have some good ideas of how to create a service like this, should i use Soap or Rest, should i simply send the username/password with every request or ?
What would be the best choice for a service i would like to access from all three platforms and that only returns information specific to the authenticate user.
As a suggested alternative to WCF that's at least worth taking a look at, ServiceStack, an open source REST Web Services Framework, is well suited for use in a mobile app and it supports the Mono platforms. It also has built-in support for user authentication. At the very least, it offers a JSON serializer that performs very well.
There's a Wiki for ServiceStack here.
I don't know what the support is like for MonoTouch / MonoDroid, but WCF supports secure services without adding username/password to every request manually (it actually does, but it includes it in the headers).
See this blog post for a great starting point for using WPF Custom Username/Password Validator: http://blogs.msdn.com/b/pedram/archive/2007/10/05/wcf-authentication-custom-username-and-password-validator.aspx