Connecting to Xero API

Phil (OmnisList) phil at pgpotter.co.uk
Wed Jun 2 07:58:44 UTC 2021


Hi Reg,

in the simplest of terms, for Xero you need to run this external 
executable...

For google calendar, another thing I originally did in Python, you 
don't, it will open up a browser window for you to authenticate the login.

I did manage to, reasonably easily, recreate the calendar code in Omnis.

I understand the black box element of the Omnis OAuth solution, but I 
think it works well in my calendar example.

I never followed through with trying to get Xero to work in Omnis.

regards
Phil Potter
Based in Chester in the UK.

On 02/06/2021 00:13, Reg Paling wrote:
> Hi Phil,
>
> Thank you - I will try Xero's xoauth piece as you recommend.
>
> When you say "People say Xero didn't do it correctly...", can you 
> elaborate or give me a link where I can understand why?  I am asking 
> because I will soon have to connect to Medicare Australia using OAuth 
> 2.0 and I suspect that this also may not easily fit the pattern which 
> Omnis OAuth 2.0 expects.  The Omnis OAuth 2.0 component looks like a 
> black box and I haven't found out how to know what's going on inside 
> the black box if things need to be "non-standard".  So I am wondering 
> whether to start by trying to use Omnis OAuth 2.0, or whether to start 
> by trying to roll my own.  Or perhaps integrate a node.js component if 
> there is one...
>
> A supplementary question: has anyone managed to connect to PRODA - 
> i.e. [Australia's Medical] Provider Digital Access system?
>
> And another supplementary question: what sort of things have Omnis 
> OAuth 2.0 been successfully used for and is there any sample code 
> available?  Yes, I know about the sample code in the Hub but which 
> services does it work for, and which services does it not work for?  
> For instance Mike, is it possible to make a connection to HMRC using 
> the sample window, or is extra code required to jump through the hoops 
> you mentioned in another post?
>
> Thanks,
> Reg
>
>
> 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 http://lists.omnis-dev.com
> Start a new message -> mailto:omnisdev-en at lists.omnis-dev.com 


More information about the omnisdev-en mailing list