Replace the existing code in main.cpp with the following code. Make modifications for multiple action buttons as needed.
Add the following files to the project, MinHttpGP.cpp/.h, and OneNoteHelper.cpp/.h,
found on GitHub.
Replace the existing code in your main .ino file with the following code:
Your Windows Live account is secure and protected. In order to access the OneNote capabilities of the Windows Live API, we need to generate an access token that will give your app permissions.
There are a few ways to do this, and the Windows Live APIs can give you more information on generating tokens within the app. For now though, we’re going to generate and insert a token into our program manually.
You may be prompted to log in to your Microsoft account if you are not already logged in.
Select Yes to generate the needed token.
The browser will navigate to a seemingly blank page. This is OK.
Examine the web address in the address bar of your browser, it may be easier to copy the entire address to a text file or other document before completing step 6.
The token is included in the web address. You will see #access_token= near the beginning of the address. Copy everything beginning after the = up to but not including &token_type=. This token will be very long, on the order of 900 characters.
Paste the token value into the const std::wstring oauth_token string at the top of the .ino sketch (copied from above). (Replace the entire current contents: <PASTE YOUR TOKEN HERE>)