Code Monkey home page Code Monkey logo

classnotebooktransferapisample's Introduction

OneNote API Class Notebooks Transfer PowerShell Sample README

Created by Microsoft Corporation, 2016. Provided as-is without warranty. Trademarks mentioned here are the property of their owners.

Scenario

When a teacher leaves the school, or changes classes, it is common for the need to transfer one or more class notebooks from the old teacher to the new teacher. This script will allow the IT Admin to copy all of the Class Notebook contents of the old teacher’s OneDrive over to the new teacher’s OneDrive. The script will also re-trigger the provisioning and permissioning apis to ensure that the class notebook in the new location is properly set up, and all of the contents of the Collaboration Space, Content Library and Student Notebooks are properly set up. In addition, an email will be sent to all students in the class with a link to open the notebook in the new teacher’s OneDrive location.

API functionality demonstrated in this sample

The following aspects of the API are covered in this sample.

  • Obtain an access token using Azure PowerShell
  • POST a Class Notebook Transfer

Prerequisites

  • Azure PowerShell - used to obtain an access token to talk to the OneNote Class Notebooks API.
  • Two Office 365 account with OneDrive set up - This sample will transfer a notebook located on a teacher's OneDrive and transfer it to the other teacher's OneDrive. To ensure that your OneDrive is set up, log on to Office 365 and click the blue "OneDrive" icon in the app launcher. If you are taken to your OneDrive, you are all set.
  • OneNote Class Notebook created using our OneNote Class Notebooks API - this is the notebook the sample will transfer between the teachers.

Using the sample

  1. Obtain a client ID as described under Authenticate using Azure AD (enterprise apps). When asked for a redirect URI, "http://localhost" will suffice:

Image of redirect URI

When asked for OneNote delegated permissions, check the following:

Image of permissions

  1. Download this repo as a ZIP file to your local computer, and extract the files. Or, clone the repository into a local copy of Git.

  2. Edit OneNoteClassNotebooksApiSample.ps1. Find and replace the following tokens with real values:

    • <AZURE_AD_TENANT_NAME> - This is your Office 365 tenant, e.g. "contoso.com".
    • <CLIENT_ID> - This is the client ID of your app, e.g. "471afe29-4aee-4bc5-9aaf-468ee5bbe20a".
    • <MY_ADMIN_LOGIN> - This is your IT Admin Office 365 login name.
    • <MY_ADMIN_PASSWORD> - This is your IT Admin Office 365 password.
    • <NOTEBOOK_ID> - This is the Id of the notebook to be transfered.
    • <SOURCE_TEACHER_ID> - This is the login name of the original teacher that owns the notebook.
    • <DESTINATION_TEACHER_ID> - This is the login name of the new teacher that will receive the notebook.
  3. Once all the placeholders above have been replaced with real values (remember to enclose each value in double quotes), simply execute the script.

  4. Once the script has successfully executed, you will receive a string containing the correlation number. Please keep this as it may help us investigate if there is any issue with the transfer.

  5. Go to the destination teacher OneDrive where you will see a folder named "Class Notebooks". In this folder you will find the class notebook the script transfered from the source's teacher. This process may take a few minutes.

Version info

This is the initial public release for this code sample.

Learning more

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.

classnotebooktransferapisample's People

Contributors

dipakboyed avatar nsaul avatar

Watchers

 avatar  avatar

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.