Table of Contents

Interface IFortnoxConnectionService

Namespace
Tharga.Fortnox
Assembly
Tharga.Fortnox.dll

Handles connections with Fortnox.

public interface IFortnoxConnectionService

Methods

BuildConnectUriAsync(string, FortnoxScope)

Use this method to get a url to initiat connection with fortnox.

ValueTask<Uri> BuildConnectUriAsync(string requestKey, FortnoxScope scopes)

Parameters

requestKey string

A key for the request so that callbacks can be identified. Your application can generate this by using 'Guid.NewGuid()'.

scopes FortnoxScope

Flag enum to specify the access scopes requested.

Returns

ValueTask<Uri>

ConnectAsync(FortnoxAssignment)

Connect the application with Fortnox.

Task<Result<TokenData>> ConnectAsync(FortnoxAssignment assignment)

Parameters

assignment FortnoxAssignment

Returns

Task<Result<TokenData>>

DisconnectAsync(string)

Disconnect the application from Fortnox.

Task<Result> DisconnectAsync(string refreshToken)

Parameters

refreshToken string

Returns

Task<Result>

RefreshTokenAsync(string)

Retrieve a new access token using the refresh token.

Task<Result<TokenData>> RefreshTokenAsync(string refreshToken)

Parameters

refreshToken string

Returns

Task<Result<TokenData>>