Closed attilaTM closed 3 years ago
I created a separate test app here https://github.com/AGenius/XeroAPI2Tests
The connection step should show a browser popup to authenticate to Xero , make sure this is happening
I just noticed the readme is missing something
xeroAPI.InitializeAPI();
Your wrapper seems to be very useful, it makes life easier. I just need to understand exactly how to use it. The code I am trying with, is XeroConfiguration XeroConfig = new XeroConfiguration { ClientID = "EF88A72FCDE941948F74C2D188B83340", CallbackUri = new Uri("http://localhost:8888/callback/"), // Add Scopes this way or see below ////Scopes = new List { Xero.Net.Core.OAuth2.Model.XeroScope.accounting_contacts, Xero.Net.Core.OAuth2.Model.XeroScope.accounting_transactions },
//State = XeroState, // Optional - Not needed for a desktop app
codeVerifier = null // Code verifier will be generated if empty
};
Till this moment everything is great, xeroAPI is created but it is not connected. xeroAPI.isConnected is false, xeroAPI.Tennants is null, xeroAPI.AccountingApi.Configuration.AccessToken is null. It is not clear how to “connect”, but without that a call like var invoices = xeroAPI.AccountingApi.Invoices(); throws a null reference exception. In the code above I did not hide the ClientID, it belongs to a real test app created on the Xero developer platform, it uses PKCE as it was requested in the "getting started" section in the description. Many thanks in advance for your help. By the way, it would be useful to have a sample app showing how to use your wrapper.