次の方法で共有


Announcing C# Support in the API Sandbox for Office 365 APIs

Today we bring you a guest post from Xiaoying Guo, a Senior Program Manager in our Cloud Platform Tools group. Enjoy!

We're pleased to announce that C# is now supported in the API Sandbox for Office 365 APIs! After our initial release with JavaScript in October, the team has been hard at work to deliver a C# language experience as well. I'd love to take this chance to tell you more about API Sandbox: what it is, and how it can help you to get started with the Office 365 APIs.

Figure 1: The home page of API Sandbox

Just one click to try the code with Office 365 APIs

Last October, the Office Team announced the general availability of the Office 365 APIs, including Mail, Calendar, Contacts, and Files. These robust, REST-based APIs enable all developers to integrate their custom experiences with the information in Office 365, regardless of platform or device preferences. To make your programming more productive, we provide multiple client libraries and SDKs for apps that run on different platforms using different programming languages. In order to build an app that uses the Office 365 APIs, you would need to sign up for an Office 365 tenant, register your app in Azure AD, and perhaps install the tools to build the apps. However, if you simply want to explore Office 365 APIs, no sign-up is required when you use API Sandbox. This is our goal for API Sandbox: a quick getting-started experience to try Office 365 APIs without any sign-up or environment setup. No matter whether you simply want to know what these APIs are capable of, or you want to learn more about how to use them by tinkering with code, the only thing you need to do is to open your favorite web browser using your favorite OS, then launch API Sandbox at https://apisandbox.msdn.com.

As its name implies, API Sandbox can run your code in a "sandbox" environment (i.e. a sample Office 365 tenant) we set up for you. By simply clicking the "Run" button above the code snippets, you will see right away the result printed in the "Console" panel underneath the code snippets.

Of course, if you have already have an Office 365 account, and want to try APIs against your real data, API Sandbox also enables an option for you to sign in your own Office 365 tenant for the API calls.

Figure 2: Select "My Office 365" to call the APIs using your own Office 365 tenant

Interactive learning experience for Office 365 APIs

API Sandbox provides an interactive code editing experience for you to learn Office 365 APIs. The code editor of API Sandbox supports syntax highlighting and IntelliSense in both C# and JavaScript, which makes it easy for you to discover the APIs using client libraries.

Figure 3: Get the IntelliSense for outlookClient object

No idea where to start? No problem! You can find multiple code samples in API Sandbox to start with. Those code samples cover both of the scenarios of using Office 365 client libraries and the REST APIs.

Figure 4: Expand "Code Samples" to get sample code snippets for client libraries and REST

API Sandbox is also integrated with the Office 365 API documentation to provide an interactive experience for you to learn the APIs faster. In the Office 365 REST API documentation, for all
GET requests, you can click the "Try" button in the sample request, and see the live response returned from the sample tenant.

Figure 5: Interactive Office 365 REST API reference at https://api.msdn.com

Similarly, in the client library documentation, the "Open" button under the code snippets will open the selected snippet in API Sandbox, so that you can modify and run it.

Figure 6: Interactive Office 365 client library documentation

Note that API Sandbox has implemented the authentication and the creation of Office 365 client objects, so that you can focus on learning the APIs that can get you information from Office 365 mail, calendars, contacts, and files.

Looking ahead

Currently, API Sandbox is still in Preview. In the current release of the sandbox we support GET requests for Office 365 APIs, and allow you to write code with C# and JavaScript. We are working on more features that can help you to ramp up on the new APIs, including better integration with documentation, clearer guidance for you to export the code snippets into your projects, support for more Microsoft cloud services, etc. We are looking to enhance support over time, and want to deliver the features that are important and useful for you. If you have any thoughts on what you want to see in API Sandbox, please send us your feedback through the API Sandbox. We are looking forward to hearing from you!

Figure 7: Send us feedback!

Happy learning!

Xiaoying Guo

Sr. Program Manager, Microsoft Cloud Platform Tools