Skip to content

Instantly share code, notes, and snippets.

@philals
Last active September 10, 2015 19:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save philals/4b8e0a64971f93e4db93 to your computer and use it in GitHub Desktop.
Save philals/4b8e0a64971f93e4db93 to your computer and use it in GitHub Desktop.
using System;
using Xero.Api.Core;
using Xero.Api.Example.TokenStores;
using Xero.Api.Infrastructure.OAuth;
namespace Xero.Api.Example.Counts
{
class Program
{
static void Main(string[] args)
{
var user = new ApiUser { Name = Environment.MachineName };
var tokenStore = new MemoryTokenStore();
var api = new Applications.Public.Core(tokenStore, user)
{
UserAgent = "Xero Api - Listing example"
};
var setUp = api.Contacts.Page(1); // Sets up to GET page 1
var allPage1 = setUp.Find(); // Returns all Contacts from page 1
var singleContact = setUp.Find(new Guid("2b6d2035-ded0-xxxx-b2ad-4b01c788eaef")); // Returns a single Contact with this GUID
new Lister(api).List();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment