Code Monkey home page Code Monkey logo

xeroapi.net's Introduction

XeroApi .Net Library

Project status

Introduction

This is a .Net wrapper library, written in C#, used to comnunicate with the Xero API (http://api.xero.com).

You can use this library to communicate with the Xero API, without needing any prior knowledge of Xml or OAuth. The library can work in public, private or partner mode.

Note: Unless you're looking to debug the library, you don't need to download the source code and compile it yourself. Each release is published to the NuGet package repository (http://nuget.org/List/Packages/XeroAPI.Net).

If you have any questions or problems using this library, have a look at the Xero API Answers site (https://community.xero.com/developer/).

Features

This library contains a linq provider for writing linq queries:

var bankAccounts = from account in repository.Accounts
				   where account.Type == "BANK"
				   select account;

Or, using linq extension methods...

int invoiceCount = repository.Contacts
	.Where(c => c.UpdatedDateUTC >= DateTime.UtcNow.AddMonths(-1))
	.Count();

Entities can be created or updated using the familiar repository pattern:

Contact contact = new Contact
{
	Name = "Joe Bloggs",
	FirstName = "Joe",
	LastName = "Bloggs",
	EmailAddress = "[email protected]"
};

repository.Create(contact);

License

This software is published under the MIT License.

Portions of this software were taken from the DevDefined.OAuth library (https://github.com/bittercoder/DevDefined.OAuth).

Copyright (c) 2011 Xero Limited

Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.

Installation

There are 2 ways to install this library:

  1. Download the source code from github and compile yourself: https://github.com/XeroAPI/XeroAPI.Net

  2. Download directly into Visual Studio using the NuGet powershell command: PM> Install-Package XeroAPI.Net

Usage

There are sample projects in the git repository show how to use the library:

  1. XeroApi.Console - A console app that can run in public, private or partner mode.
  2. XeroApi.MvcWebApp - An ASP.Net MVC2 web app that runs in partner mode.

In fact, here's one I wrote earlier:

    static void Main(string[] args)
    {
        IOAuthSession session = new XeroApi.OAuth.XeroApiPrivateSession(
            "XeroAPI Mini App",
            "YOUR-CONSUMER-KEY",
            new X509Certificate2(@"D:\Your-Certificate.pfx", "your-pfx-password"));

        Repository repository = new Repository(session);
        
        Console.WriteLine("You're connected to " + repository.Organisation.Name);
        Console.ReadLine();
    }

.

xeroapi.net's People

Contributors

matthewsteeples avatar danbarratt avatar bittercoder avatar richard-rowley avatar meboz avatar eddiefletchernz avatar drgrieve avatar l0st3d 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.