OneRosterOAuth

OneRoster OAuth Package


Keywords
OneRoster, ClassLink, OAuth
Install
Install-Package OneRosterOAuth -Version 1.0.0

Contributors

Cody Robibero


See all contributors


Documentation

OneRoster OAuth .NET Plugin

NuGet

Usage:

Install using Nuget package manager:
	PM> Install-Package OneRosterOAuth

// include the library
using OneRosterOAuth;

// Initialize new OneRosterConnection, inputting your Key and Secret
var connection = new OneRosterConnection(oneRosterKey, oneRosterSecret);

// Hit users endpoint, requesting only 1 active user
// use OneRosterConnection.urlEncode for OAuth-safe url encoding
var filter = "filter=" + connection.UrlEncode("status='active'");
var url = "https://example.oneroster.com/learningdata/v1/users?limit=1&" + filter;

// Can use either await or Task.WaitAll

	// using await 
	HttpResponseMessage response = await connection.MakeRequest(url);
	
	// using Task.WaitAll
	var task = connection.MakeRequest(url);
	Task.WaitAll(task);
	HttpResponseMessage response = task.Result;

// Get response status code
var statusCode = response.StatusCode;

// Get response content
var content = await response.Content.ReadAsStringAsync();