Skip to content

mikuam/egnyte-dotnetcore

Repository files navigation

Egnyte.NET

A .NET SDK for integration with Egnyte API.

Setup

To get started working with Egnyte .NET SDK, we recommend you to add it to your project using NuGet.

To install Egnyte.Core.Api, run the following command in the Package Manager Console:

PM> Install-Package Egnyte.Core.Api

Supported frameworks

  • .Net Standard 2.0

Creating an application

You need to create an account to have a domain and generate a key for your application:

How to use

Obtaining an access token

In Egnyte.Core.Api all 3 authorization flows are implemented. However, Authorization Code Flow is the most common. To create authorize uri, use OAuthHelper class:

var authorizeUrl = OAuthHelper.GetAuthorizeUri(
    OAuthAuthorizationFlow.Code,
    Domain,
    PrivateKey,
    "https://mywebsite.com/redirectEgnyteResponse");

You will need to redirect user to that url, so he can enter he's credentianls. After getting the response, token can be obtained like this:

var token = await EgnyteClientHelper.GetTokenFromCode(
	Domain,
    PrivateKey,
    Secret,
    "https://mywebsite.com/redirectEgnyteResponse",
	code);

API operations using token

To perform Egnyte API operations, please create EgnyteClient:

var client = new EgnyteClient(Token, Domain);

// lists files and folders in Documents directory
var listing = await client.Files.ListFileOrFolder("Shared/Documents");

For more details, read methods descriptions or documentation.

Documentation

You can browse full documentation of Egnyte SDK here: https://developers.egnyte.com/docs.

License

MIT License

https://opensource.org/licenses/MIT

About

Client for Egnyte Api written for .net core

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages