Xero - beautiful accounting software

Xero Developer Help Center

Xero Developer Community

Community > Wrapper libraries >

Java - sample code for private application

Started by Ronan Quirke (Community Manager) -   in Wrapper libraries

We have been quite light on some good code samples in Java to date.
Luckily most Java devs are pretty onto it, but it is always great to be able to offer easier ways to get started.

We've just received a quick how-to guide on Java for private API apps from a developer that got something working and wanted to share.

If you have any tips, suggestions or code to improve this sample, leave them here!
Hi Ronan,
I would like to have and share my C# app work with the private API apps but no luck from me as yet.
Can you please let me know what i need to get the requestToken.

Do i need the following:

ConsumerKey
ConsumerSecret
AccessTokenURI
AuthoriseURI
RequestTokenURI


I'm passing all the following but still getting 400 bad request.Can you confirm this is what i need or am i missing something.
Cheers
 

CRM Connector  

Hi 'CRM Connector' - please stop posting the same question on multiple threads - it is not helpful to anyone and just confuse other users.
 

Ronan Quirke (Community Manager)  

I would just like to say that i tried this example and i had to use different jar files to make it work for me. I used the following jar files :
oauth.jar
commons-codec-1.3.jar
apache-jakarta-commons-httpclient.jar
org.apache.commons.logging.jar
 

Avinash MS  

My java private application was actually a combination of rossjourdain's project and this example. I used the key generation info from Eric Nadalin's example and used rossjourdain's code and above mentioned jar files to make my app work.

 

Avinash MS  

Also I would like to mention that I had to remove ----begin RSA key ----, end RSA Key comments in the pkcs8-private key file, before using it with rossjourdain's code. Without which i was encountering invalidkeyexception
 

Avinash MS