GithubHelp home page GithubHelp logo

officedev / office-365-rest-api-explorer Goto Github PK

View Code? Open in Web Editor NEW
67.0 49.0 33.0 311 KB

This project is a Windows Store app that uses the Office 365 APIs client libraries to get access tokens. The app then uses the tokens with the REST API in SharePoint to show you how to build HTTP requests that perform CRUD operations on lists, list items, and files.

License: Other

C# 96.23% Smalltalk 3.77%

office-365-rest-api-explorer's Introduction

page_type products languages extensions urlFragment description
sample
office-365
csharp
contentType createdDate
samples
10/7/2014 10:32:11 AM
office-365-rest-api-explorer-for-sites
An example that shows how to perform HTTP requests to some of the REST endpoints in SharePoint sites hosted on Office 365.

Office 365 REST API Explorer for Sites

Overview

This app is an example that shows SharePoint developers how to perform HTTP requests to some of the REST endpoints in SharePoint sites hosted on Office 365.

The key goal of this project is to show SharePoint developers how they can use the tokens obtained with the Office 365 APIs to access the REST API in SharePoint. Specifically, the app shows how to:

  • Request an access token
  • Get a new access token with a refresh token
  • Clear the tokens in the cache
  • Sign out the user
  • Manage exceptions related to tokens

Visualizing and inspecting how the Office 365 APIs behave at the REST protocol level can be really helpful for learning and understanding them. This project uses the Office 365 APIs to get an access token that can be used with the REST endpoints in SharePoint. You can construct basic CRUD operations on lists, list items, and files viewing both the HTTP request and response. You can try out the REST endpoints that you need for your own apps and websites. The app has controls that let you modify the default CRUD operations.

You can perform CRUD operations on the following items in a SharePoint site:

  • Lists
  • List items
  • Files

Prerequisites and Configuration

This sample requires the following:

Configure the sample

Follow these steps to configure the sample.

  1. Open the O365-REST-API-Explorer.sln file using Visual Studio 2013.
  2. Register and configure the app to consume Office 365 services (detailed below).
  3. In the Solution Explorer window, choose Office365RESTAPIforSites project -> Add -> Connected Service. You must install the Office 365 API tools to see this menu option.
  4. In the Services Manager dialog box, choose Office 365 and Register your app.
  5. On the sign-in dialog box, enter the username and password for your Office 365 tenant.
    • We recommend that you use your Office 365 Developer Site. Often, this user name will follow the pattern <username>@<tenant>.onmicrosoft.com. If you do not have a developer site, you can get a free developer site as part of your MSDN benefits or sign up for a free trial. Be aware that the user must be an tenant admin user—but for tenants created as part of an Office 365 developer site, this is likely to be the case already. Also developer accounts are usually limited to one sign-in.
    • After you're signed in, you will see a list of all the services. Initially, no permissions are selected.
  6. To register for the services used in this sample, choose the following permissions: - Sites
    • Create or delete items and lists in all site collections
    • Edit or delete items in all site collections
    • Read items in all site collections
  7. After clicking OK in the Services Manager dialog box, assemblies for connecting to the Office 365 REST API will be added to your project.

Build

  1. Open the solution in Visual Studio and press F5.
  2. In the initial screen, provide the URL of your SharePoint site.
  3. Sign in with your organizational account to Office 365.

Project Components of Interest

Pages

  • ConfigureAppPage
  • ItemsPage
  • SplitPage

Data Access Classes and Files

  • DataSource
  • DataGroup
  • DataItem
  • RequestItem
  • ResponseItem
  • InitialData.json

Troubleshooting

You may run into an authentication error after deploying and running if apps do not have the ability to access account information in the Windows Privacy Settings menu. Set Let my apps access my name, picture, and other account info to On.

Known issues

  • You need to provide a site that is at the root of the web application. For example: the https://<tenant>.sharepoint.com site. The sign in process fails with non-root site collections.

Questions and comments

We'd love to get your feedback on the Office 365 REST API Explorer project. You can send your questions and suggestions to us in the Issues section of this repository.

Questions about Office 365 development in general should be posted to Stack Overflow. Make sure that your questions or comments are tagged with [Office365] and [API].

Additional resources

Copyright

Copyright (c) 2014 Microsoft. All rights reserved.

This project has adopted the Microsoft Open Source Code of Conduct. For more information, see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

office-365-rest-api-explorer's People

Contributors

andrewjmay avatar bmitchell287 avatar davidchesnut avatar o365devx avatar ricalo avatar supernova-eng avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

office-365-rest-api-explorer's Issues

Cannot find a resource with the given key - System.Runtime.InteropServices.COMException

The following error happens with some versions of the Connected Services experience.

An exception of type 'System.Runtime.InteropServices.COMException' occurred in mscorlib.dll but was not handled in user code

WinRT information: Cannot find a resource with the given key.

Additional information: Unspecified error



Cannot find a resource with the given key.

If there is a handler for this exception, the program may be safely continued.

sharepoint

Hi

How to get the sharepoint online of Office 365 details using which rest API and resource and end points of share point online using python script.

SelectedItem is NULL

Opening this bug to address @hernandoz comments on issue #4...

SelectedItem is NULL .. SplitPlage.xaml.cs line 316

var selectedItem = (DataItem)itemsViewSource.View.CurrentItem;
selectedItem.Response = await DataSource.GetResponseAsync(selectedItem.Request);

@hernandoz, while I'm trying to repro, could you provide more details? Maybe repro steps and what version of Visual Studio you are using?

Thank you!

Update: Unfortunately I couldn't repro in a clean machine. Please check that you have all permissions for Sites and Sign you in and read your profile for Users and Groups.

Sorry, but we’re having trouble signing you in....

I now this is know issue but thought I would share my situation to see if it helps resolve the issus

I have tried my .sharepoint.com and got the AADSTS70001 error.
the site is the root sharepoint and I have the correct identity settings on my workstation to show my ID etc.

contacted MSFT and they could not see the correlation ID in the logs

App does get initialized on the SP server and I tried numerous attempts at adding more privileges etc.

then I tried another round on my MSFT MSDN account pointing to the MSFT developer server . Unfortunately the same problem.

I have pasted the error below. Let me know if there is anything else I can so to help.

thx

Additional technical information:
Correlation ID: e96a5fc4-5ca9-4508-9130-99d0f563ef8a
Timestamp: 2015-07-01 09:56:05Z
AADSTS70001: Application with identifier a6fd3d58-e820-4e38-93b4-92743e4a572fa6fd3d58-e820-4e38-93b4-92743e4a572f was not found in the directory MYDOMAIN.onmicrosoft.com

Visual Studio 2019 - Unsupported This version of Visual Studio is unable to open the following projects

Project cannot be opened when using visual studio 2019 preview, hitting below errors:

Unsupported
This version of Visual Studio is unable to open the following projects. The project types may not be installed or this version of Visual Studio may not support them.
For more information on enabling these project types or otherwise migrating your assets, please see the details in the "Migration Report" displayed after clicking OK.
- Office365RESTAPIExplorer, "C:\Users\Chunlong\Source\Repos\Office-365-REST-API-Explorer\Office365RESTAPIExplorer\Office365RESTAPIExplorer.csproj"

Non-functional changes required
Visual Studio will automatically make non-functional changes to the following projects in order to enable them to open in Visual Studio 2015, Visual Studio 2013, Visual Studio 2012, and Visual Studio 2010 SP1. Project behavior will not be impacted.
- O365-REST-API-Explorer, "C:\Users\Chunlong\source\repos\Office-365-REST-API-Explorer\O365-REST-API-Explorer.sln"

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.