Connecting to Xero API

Reg Paling reg.paling at
Mon Jun 7 12:56:12 UTC 2021

Hi Phil,

I ended up getting it working using the command-line executable xoauth - 
calling it with $runapplescript on my Mac.  Sort of easy once you know 
how!  Happy to post my code if you're interested.

I have yet to write the code to manage token exxpiry and refresh.  
Hopefully I can use the Omnis OAuth2 worker for some of that.

Thanks for the help,

On 2/6/21 12:49 am, Phil (OmnisList) via omnisdev-en wrote:
> Hi Reg,
> Yes, but... I ended up using Python to do an integration...
> People say Xero didn't do it correctly...
> But whatever, to set up the connection, on windows at least, you need 
> to use their executable, xoauth.exe, which sets up the first 
> connection...
> (There is a Mac version also)
> after you have setup a connection on the accounts you are using...
> use this to tell you the required tokens you need.
> This is instead of a popup browser window to get the first set of tokens.
> once you have tokens, step one when I run the script, is to refresh 
> the tokens.
> which provides a valid access token, from which, generally most things 
> just work as normal.
> Refresh tokens last a long time, so in all likelihood, you will never 
> need to run the xoauth.exe ever again.
> I had done an integration when Xero were using OAUTH1, and then they 
> changed it, and the only resolution was to use there xoauth.exe to do 
> the initial login.
> In retrospect, I believe it would be achievable within Omnis to do 
> this, after the initial xoauth,exe setup...
> But my solution was not one for all users, so it was kept separate, so 
> only users needing this functionality, needed this script...
> regards
> Phil Potter
> Based in Chester in the UK.
> On 01/06/2021 15:26, Reg Paling wrote:
>> Hi all,
>> Has anyone succeeded in connecting to the Xero API?
>> I am trying to use the OAuth2 worker object and not getting far as 
>> yet... trying to work out terminology...
>> Regards,
>> Reg
>> _____________________________________________________________
>> Manage your list subscriptions at
>> Start a new message -> mailto:omnisdev-en at 
> _____________________________________________________________
> Manage your list subscriptions at
> Start a new message -> mailto:omnisdev-en at 

More information about the omnisdev-en mailing list