This package is designed to consume the Databox Push API functionality via .NET based client.
Supported .NET versions: .NET 6.0 and later.
The package is listed as public in our Databox Github repository. In order to consume it, you must first add a nuget source.
Databox package repository url is: https://nuget.pkg.github.com/databox/index.json
Detail instructions on how to add this to your project is available here.
After this is completed, the package can be installed via IDE (package named "Databox") or via dotnet cli command
dotnet add package Databox --version <version>
In use the Databox Push API functionality, please refer to Databox Developers Page, specifically the Quick Guide section, where you will learn how to create a Databox Push API token which is required for pushing your data.
The basic example of pushing data to Databox is provided below:
usingSystem.Diagnostics;usingDatabox.Api;usingDatabox.Client;usingDatabox.Model;namespaceExample{publicclassExample{publicstaticasyncTaskMain(string[]args){Configurationconfig=newConfiguration();config.BasePath="https://push.databox.com";config.Username="<Your_Databox_API_Token>";config.DefaultHeaders.Add("Accept","application/vnd.databox.v2+json");HttpClienthttpClient=newHttpClient();HttpClientHandlerhttpClientHandler=newHttpClientHandler();varapiInstance=newDefaultApi(httpClient,config,httpClientHandler);vardataPostRequest=newList<PushData>(){newPushData(){Key="<Metric_name>",Value=123,Date="<Date_in_ISO8601>",Unit="<Unit>",// OptionalAttributes=newList<PushDataAttribute>(){// OptionalnewPushDataAttribute(){Key="<Dimension_name>",Value="<Dimension_value>"}}}};try{varresponse=awaitapiInstance.DataPostWithHttpInfoAsync(dataPostRequest);Console.WriteLine(response.Data.ToString());}catch(ApiExceptione){Console.WriteLine("Exception when calling DefaultApi.DataPostWithHttpInfo: "+e.Message);Console.WriteLine("Status Code: "+e.ErrorCode);Console.WriteLine(e.StackTrace);}}}}