Code Monkey home page Code Monkey logo

geckoboard-c-sharp's Introduction

geckoboard-c-sharp

C# client library for Geckoboard

Installation

To be confirmed

Usage

Add a reference in your project

To be confirmed

Ping to authenticate

Verify that your API key is valid and that you can reach the Geckoboard API.

var geckoboardClient = new Client("222efc82e7933138077b1c2554439e15");
geckoboardClient.Ping() // returns true

Find or create

Verify an existing dataset or create a new one.

var dataset = geckoboardClient.Datasets().FindOrCreate(
  "sales.gross", // Dataset ID
  new List<Field>(new Field[] { // Dataset Schema
    new MoneyField("cost", "Cost", true, "USD"),
    new DateTimeField("timestamp", "Time"),
    new NumberField("amount", "Amount", true)
  },
  "timestamp" // Unique By
);

Available field types:

  • DateField
  • DateTimeField
  • NumberField
  • PercentageField
  • StringField
  • MoneyField

uniqueBy is an optional array of one or more field names whose values will be unique across all your records.

Delete

Delete a dataset with a given id.

geckoboardClient.Datasets().Delete("sales.gross"); // returns true

Put

Replace all data in the dataset.

dataset.Put(new Dictionary<string, object>[] {
  new Dictionary<string, object> { 
    { "timestamp", new DateTime(2016, 1, 2, 12, 0, 0) },
    { "amount", 40900 }
  },
  new Dictionary<string, object> {
    { "timestamp", new DateTime(2016, 1, 3, 12, 0, 0) },
    { "amount", 16400 }
  }
});

Post

Append data to a dataset.

dataset.Put(
  new Dictionary<string, object>[] {
    new Dictionary<string, object> { 
      { "timestamp", new DateTime(2016, 1, 2, 12, 0, 0) },
      { "amount", 40900 }
    },
    new Dictionary<string, object> {
      { "timestamp", new DateTime(2016, 1, 3, 12, 0, 0) },
      { "amount", 16400 }
    }
  }, 
  "timestamp" // Delete By
);

`deleteBy` is an optional field by which to order the truncation of records once the maximum record count has been reached. By default the oldest records (by insertion time) will be removed.

Development

To be confirmed

geckoboard-c-sharp's People

Contributors

aleksandresukh avatar mortenanders avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.