Xero - beautiful accounting software

Xero Developer Help Center

Xero Developer Community

Community > Getting Started >

Webforms example

Started by richard latimer -   in Getting Started

Hello All,

Im trying to integrate my webforms webapp with Xero in such a way that the user is able to select items to create an invoice.
Basicly, everything seems to work locally, but as soon as I publish to Azure Webapp , nothing works.
I seem to be unable to create a httplistener in Azure and create await statements resulting in response is nothing.

I know that my explanation seems a bit complicated, but I tried to find some good working examples for Xero.NetStandard for webforms, but all I can find is MVC and the explaination is very limited thus im unable to get it working.

Can someone help me out or point me in the right direction for Xero.NetStandard in Webforms ?

Thank you very much!


Hi Richard. Assuming you got it working locally with OAuth2.0 locally, this sounds like an Azure Devops issue.

If you can post the errors in more details (maybe use https://gist.github.com to show code) and logs, might be able to post you in the right direction.

Christopher Knight (Xero Staff)  

Hello Christopher,

Thank you for you reply.
I did get it working locally, but still I feel I started with serveral examples and thus not sure If I got everything like it should (but yes, it is working locally).
Would you still be able to help me out with a good example for webforms?



richard latimer  

Hi Richard - we have 2 sample apps showing that SDK functionality


We also have a network of developers who can add more insight if you are looking to hire people: https://apps.xero.com/function/custom-made-integration

Hope that helps. Like I said if you want to post code, errors, or logs I can be of more help.

Christopher Knight (Xero Staff)  

Thank again Chris,

Im trying to understand the MVC example, but Im struggling a bit.
I think Im a little bit further then yesterday...

First, I request access to xero. For now I have a button the redirect to Xero , request access and returns an code, like so;

This code is provided by the developer community - Xero does not warrant it in any way

This even works in Azure. So far so good.
Then I need my accessToken , and I try to do as such;

This code is provided by the developer community - Xero does not warrant it in any way

Unfortunatly , Im getting an error on; xeroToken = Await client.RequestAccessTokenAsync(code)

The error is : System.Exception: An error occurred while sending the request.
Do you have any idea where this error is comming from? I do get an code back and can do the authentication part so I think im getting close.

Thank you!


richard latimer  

In the readme -> https://github.com/XeroAPI/Xero-NetStandard

I don't see any configuration that requires the clienthttp

Are you using the most recent version 3.12.1?


Christopher Knight (Xero Staff)  

Hi Chris,

Appologies for my delayed response.

You are right, I don't need to clienthttp.
nevertheless, I'm receiving the same error on the part "Await client.RequestAccessTokenAsync(code)"

I've checked and the authentication parts still goes well. Im receiving a code back, which I have in the var 'code' but still same error.

I have 3.12.1 for the Xero.netStandard.OAuth2 and version 1.3.0 for the Xero.NetStandard.OAuth2Client

What I find interesting that in the documention I see ;
Tenants = Await client.GetConnections(xeroToken)

Bu I don't see that option.. I only have GetConnectionsAsync , so there still seems to be something wrong?

Thank you very much for your support, I really appreciate it.



richard latimer  

Hi Richard - I think opening an issue in the github repo is the best path forward. It will notify all the contributors and someone from that specific community will be able to advise you more helpfully.


Christopher Knight (Xero Staff)  

Hi Chris,

I've created an issue in the github repo 11 days ago, but unfortunatly still no single reply. Is there any change you can do something or is there a community where I could hire another dev?

richard latimer  

Hey Richard - sorry you are still having issues.

We do have a community of developer who specialize in building Xero API integrations. You can learn more about them here: https://apps.xero.com/us/function/custom-made-integration

We also have a community thread where you can post to find programmers: https://community.xero.com/developer/topic/45131/

Christopher Knight (Xero Staff)