Skip to content
This repository was archived by the owner on Jun 17, 2024. It is now read-only.

Commit b2af7ad

Browse files
committed
all routes issues fixed for o365
1 parent 454de92 commit b2af7ad

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

OneNoteServiceSamplesWinUniversal.Shared/OneNoteApi/O365Auth.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ internal static async Task<AuthenticationResult> GetAuthenticationResult()
9595
//we would have gotten this when we authenticated previously
9696
var allCachedItems = AuthContext.TokenCache.ReadItems();
9797
var validCachedItems = allCachedItems
98-
.Where(i=> i.ExpiresOn > DateTimeOffset.UtcNow && IsO365Token(i.IdentityProvider))
98+
.Where(i => i.ExpiresOn > DateTimeOffset.UtcNow.UtcDateTime && IsO365Token(i.IdentityProvider))
9999
.OrderByDescending(e=>e.ExpiresOn);
100100
var cachedItem = validCachedItems.First();
101101
if (cachedItem != null)

OneNoteServiceSamplesWinUniversal.Shared/OneNoteApi/SectionGroups/GetSectionGroupsExample.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ public static async Task<List<ApiBaseResponse>> GetAllSectionGroups(bool debug,
8484
await Auth.GetAuthToken(provider));
8585

8686
// Prepare an HTTP GET request to the sectionGroups endpoint
87-
var createMessage = new HttpRequestMessage(HttpMethod.Get, @"https://www.onenote.com/api/v1.0/sectionGroups");
87+
var createMessage = new HttpRequestMessage(HttpMethod.Get, apiRoute + "sectionGroups");
8888

8989
HttpResponseMessage response = await client.SendAsync(createMessage);
9090

OneNoteServiceSamplesWinUniversal.Shared/OneNoteApi/Sections/PostSectionsExample.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ public static async Task<ApiBaseResponse> CreateSimpleSection(bool debug, string
8686

8787
// Prepare an HTTP POST request to the Sections endpoint
8888
// The request body content type is application/json and require a name property
89-
var createMessage = new HttpRequestMessage(HttpMethod.Post, @"https://www.onenote.com/api/v1.0/notebooks/" + notebookId + "/sections")
89+
var createMessage = new HttpRequestMessage(HttpMethod.Post, apiRoute + @"notebooks/" + notebookId + "/sections")
9090
{
9191
Content = new StringContent("{ name : '" + WebUtility.UrlEncode(sectionName) + "' }", Encoding.UTF8, "application/json")
9292
};

0 commit comments

Comments
 (0)