Xero - beautiful accounting software

Xero Developer Help Center

Xero Developer Community

Community > Getting Started >

Integrating Xero with an iOS application

Started by Kumar Sharma -   in Getting Started

How can I integrate Xero with iOS applications. Is there any documentation or SDK on it? Any help would be much appreciated.

Many Thanks :)
Hi Kumar,

Xero's API authentication is based on oAuth 1.0. This authentication model is not appropriate for client-side SDKs. The best approach for working with native iOS applications is to implement the connection to Xero API via server-side code.

You can see a list of server-side libraries here.

http://developer.xero.com/code-samples/

Thanks
Sid
 

Sidney Maestre (Community Manager)  

Hi Xero Staff,

I have a doubt on this. Xero validation/authentication is done at server side or iOS side? If at iOS side, can you just tell me what security measures we need to perform for sending key & secret to server?

Thanks,
Deepak
 

Deepak Gupta  

Hello Sid/Xero Staff,
I have just started integrating at iOS side using xero API end point - https://api.xero.com/api.xro/2.0/. For this i have created private application (http://developer.xero.com/documentation/getting-started/private-applications/). so far i am following the docs on APIs. I hope this way we can integrate at iOS side?
 

Kumar Sharma  

Hi Kumar,

Just for your information, we need to authenticate the xero account first before heading for API integartion (https://api.xero.com/api.xro/2.0/).


Thanks,

Deepak
 

Deepak Gupta  

Hi Deepak,
For development purpose, i have created a free account using my email id (kumar.asom@gmail.com) and proceeding with a Demo company. Please guide me if i am wrong.

Many Thanks.
 

Kumar Sharma  

Hi Kumar,

I did the same steps. Created the free account & added one organization into it. After that i created application just like in facebook. Once you are done with adding the application(https://app.xero.com/Application?redirectCount=0&apToken=179b6101-d5e6-44bf-a57b-1622fe26b61a), it returns you with secret & key. With the help of these , you need to authenticate your app(http://developer.xero.com/documentation/api/api-overview/). By Clicking on the OAuth (v1.0a), it provides you the steps of authentication.

By the way, i am still on the way of implementing it.


Will keep you updated once i am done.

Thanks,

Deepak
 

Deepak Gupta  

Hi Deepak,
Thank you. Please let me know when APIs are ready. I will be following this once my boss confirms me what exactly iOS app should send to XERO. At the moment, i am bit confused on this matter regarding how & what information should send. Ours is Point of Sale (POS) application in iOS both cloud & non-cloud based. My boss wants me to integrate with non-cloud based first. I hope soon this can be achieved.
 

Kumar Sharma  

Hi Kumar,

Don't dependent on me. I am not from Xero Team. Follow this url : http://oauth.net/core/1.0a/ for to authenticate this app before using the API.

Thanks,

Deepak
 

Deepak Gupta  

Hi Deepak,
Sorry i misunderstood. Anyways, please let me know if anything you come to know more about integration. I will also keep updating you. Thank you very much.
 

Kumar Sharma  

No Problem ..
 

Deepak Gupta  

Hi Xero Staff,

Can you tell me how we can authenticate user ? I didn't see anything for User authorization on the website or may be i have missed it?


Thanks,

Deepak
 

Deepak Gupta  

Hi Deepak,
I am sorry, same here, not found anything for user authorization. not sure where this is mentioned.
Are you able to authenticate your app using OAuth (v1.0a) protocol? if so could please let me know how did this?
 

Kumar Sharma  

Hi Kumar,

Follow this link : http://developer.xero.com/partner/

if this helps not sure.

 

Deepak Gupta  

Hi Deepak,
Are you able to make any progress? I got following response from Henzard regarding authentication:
"if you are using phonegap then you would need middle ware. But if your running native then have a look at OAuth2Client".

Have not tried yet using above. will try it today.
 

Kumar Sharma  

Hey Kumar,

Just like we do FB integration, similarly we need to do Xero integration.

Streps :

1. Create Account - > Create App

2. We will be having a Secret & Key once you are done with Create App.

3. Use this Secret & key for authorization

4. Once you have the oauth , use it for login (https://login.xero.com/?wa=wsignin1.0&wtrealm=https%3a%2f%2fmy.xero.com%2f&wctx=rm%3d0%26id%3dpassive%26ru%3d%252fMyXero%252fAPIAuthorise.aspx%253foauth_token%253dZIO7MYQ5BHENWMBRHY0JHOL2EMMYFG%2526scope%253d&wct=2015-02-19T09%3a17%3a54Z&oauth_token=ZIO7MYQ5BHENWMBRHY0JHOL2EMMYFG)

5. Also mention Call back url . Refer link : http://developer.xero.com/documentation/getting-started/partner-applications/#title5


Follow these steps & let me know if you still have any query on this.

Thanks,

Deepak
 

Deepak Gupta  

Hi Deepak,
Thanks for the line. Will try it and let you know.
 

Kumar Sharma  

Hi Deepak,
Could you please share how you made authorisation using Secret & Key to get access token? I am facing some issues with it.
 

Kumar Sharma  

Hi Kumar,

Please use oauth library provide by google for iOS. It would provide you the oauth token using your "key" & "secret".

 

Deepak Gupta  

Hi,

I'm doing a local or a native way to try and authorize from the iOS end. I'm in the Authorize part but it says that the page requires a valid OAuth even if I setup the tokenSecret and the accessToken. ( oauth_token and oauth_token_secret )

Now, I've read some threads and it says that its because of the URL of the company and OAuth callback domain. I'm don't know what to use for both of these fields 'cause I'm accessing the links through the app and not communicating any web server. Is there a way we can do this? Or should we do the server side way?

How did you guys do it for your ios applications?
 

Shlby Puerto