Summary: - Can I use XERO APIs in my Mvc Project ? I am having an issue with the XERO SDK C# ,I have a project setup in ASP. NET MVC 5 where I am adding my XeroAPI Project with in .NET CORE 2.0.It gives reference error which is valid. So I shifted to make this SDK as an API source and its endpoint there to have initial handshake with Xero and then create Contacts,Invoices by sending parameters required. When I hit the API the connection gets lost and give null token sometimes and I am calling ajax from MVC project to Xero SDK project for the API but not getting anything in success of ajax.
Asked
Active
Viewed 423 times
0
-
I used the machine-to-machine connection method (there's a video on the Xero Youtube channel) to get the access token and refresh token, then do HTTP get, put or post to the various endpoints, not using the API at all. I use the Xero models from the .net API, but only because it makes it easy to get the data structures correct. – droopsnoot Aug 27 '20 at 17:27
1 Answers
1
you can use the Xero.NetStandard.Oauth2Client as an interface to Xero OAuth 2.0 and use your own API client for sending APIs.
In every Xero OAuth 2.0 API call you must pass in access token and tenant ID in the header to work. See full documentation here: https://developer.xero.com/documentation/oauth2/auth-flow

Jenks Guo
- 36
- 2