Skip to content

Dotnet package

This nuget package contains all the classes needed to integrate Epoch flow into your dotnet Api.

Install the nuget package

dotnet add package epochflow

Configure services

var apiKey = "<api_key>";
var accountId = "<account_id>";
var apiUrl = "<api_url>";
services.AddEpochFlowV1(apiKey, accountId, apiUrl);

Make requests

private readonly IEpochFlowV1 _epochflow;

public async Task Load(){
  var setId = "<set_id>";
  var result = await _epochflow.GetSet(setId);
  if(!result.IsSuccessStatusCode){
    return;
  }

  var set = result.Content;
}

Alternatively, if you don't want to configure DI

var httpClient = new HttpClient();
httpClient.BaseAddress = new Uri(EpochFlowApiUrl);
httpClient.DefaultRequestHeaders.Add("X-API-Key'", EpochFlowApiKey);
httpClient.DefaultRequestHeaders.Add("X-Account-Id", EpochFlowAccountId);

var epochFlowApi = RestService.For<IEpochFlowV1>(httpClient);
var result = await epochFlowApi.PostDataPoints(EpochFlowSetId, measurements);