Toolkit for the Cord.
It is a Software Development Kit project for the .NET platform where you can interact with Cord. It aims to be able to use REST ends on Cord and execute authentication processes.
To start using it, include it in your project using the .NET CLI or Package Manager.
dotnet add package Cord.SDK
NuGet\Install-Package Cord.SDK
NET project, you can make SDK related configurations as in the example below.
builder.Services.AddCordSdk(opt =>
{
opt.ApplicationId = "ID";
opt.Secret = "SECRET";
});
Property | Type | Description | Required | Default |
---|---|---|---|---|
ApplicationId | string |
Application id for Rest API access | ✅ | |
Secret | string |
Secret key for Rest API access | ✅ | |
ClientTokenExpiration | int |
Specifies the expiration time in minutes of the token required for users to connect to Cord. | ❌ | 60 |
ServerTokenExpiration | int |
Specifies the expiration time in minutes of the token to be used by the server in Rest API communication. | ❌ | 1440 |
To access Cord services, inject the ICord interface into your method or class.
async Task MyMethod([FromServices] ICord cord)
{
cord.Users.V1.*****
}
public class MyClass
{
private readonly ICord _cord;
public MyClass(ICord cord) => _cord = cord;
public async Task MyMethod()
{
_cord.Organizations.V1.*****
}
}
All methods of services for the Rest API have implemented CancellationToken.