Git Product home page Git Product logo

csharp-sdk's Introduction

csharp-sdk

Prerequisites

  • .NET Framework 4.5
  • Visual Studio 2012 or higher
  • An mdmauthkey (set via Settings-->Organization Settings-->MDM Authorization Key).
  • A Client Key and a Client Secret, which your Breezy contact will provide.

Third-party dependencies

Notes

  • This SDK is designed to be used as part of the backend of an application that requires user authentication.
  • The sample code assumes that you want to offer a frictionless authentication experience to your end user, and therefore do not want to prompt them for Breezy login credentials.
  • Because no user interaction is required to authenticate the user, you should be aware that any user on whose behalf your application submits a document will be automatically added to your organization. In other words, you do not need to invite users or manually provision them via the Dashboard. Instead, your application will be treated as a trusted provider of user authentication for your organization's Breezy account, and Breezy will assume that any users you have allowed to access the print functionality in your application are in fact authorized by you to print to your organization's printers via the Breezy infrastructure.

Usage

The libraries in the SDK allow your application, on behalf of the user, to obtain a list of printers available to that user, and to submit a job for printing to any of those printers. For access to more advanced functionality such as print job characteristics, job tracking, auditing etc., just ask your Breezy contact.

Sample Code

  • Breezy.Sdk.Console/Program.cs provides a simple demo.
  • You will need to provide the appropriate values for apiClientKey, apiClientSecret, mdmAuthKey, userEmail, printerName, and filePath, but no other changes are required to run the simple console application.
  • You can get a list of printerNames via the breezyApiClient.GetPrinters(userAccessToken) call. The call returns an array of Breezy.Sdk.Printer objects, which you can inspect to find the names of the printers available to the user.

Relevant function calls in the sample code:

var breezyApiClient = new BreezyApiClient(apiClientKey, apiClientSecret);

// authorize a user via SSO with an mdmAuthKey
var userAccessToken = breezyApiClient.Authorize(mdmAuthKey, userEmail);

// get available printers
var printers = breezyApiClient.GetPrinters(userAccessToken);

// print a file
var documentId = breezyApiClient.Print(Path.GetFileName(filePath), filePath, printerId, userAccessToken);

Usage from PowerShell

[System.Reflection.Assembly]::LoadFile("..\Breezy.Sdk.dll")

$apiClientKey = "..."
$apiClientSecret = "..."
$apiURL = "https://api.breezy.com/"
$apiClient = New-Object Breezy.Sdk.BreezyApiClient -argumentlist $apiClientKey, $apiClientSecret, $apiURL

$mdmAuthKey = "..."
$userEmail = "[email protected]"
$userAccessToken = $apiClient.Authorize($mdmAuthKey, $userEmail)

$endpoint = "..."
$method = "GET"
$response = $apiClient.MakeApiRequest($userAccessToken, $endpoint, $method)

csharp-sdk's People

Contributors

yvanin avatar jaredhansen avatar

Watchers

James Cloos avatar Nilanjana Lodh 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.