Xero - beautiful accounting software

Xero Developer Help Center

Xero Developer Community

Community > API Authentication >

ColdFusion Private application OAuth Access

Started by Matthew Bryant -   in API Authentication

Has anyone successfully accessed a Private Application using ColdFusion?

Any information or direction is appreciated.

kind regards

To answer my own question, ColdFusion can use the Java example. ColdFusion is simply a scripting language on top of Java.

Matthew Bryant  

Hi Matthew - Is there any chance you could share your solution in detail? I'm currently having issues trying to get this working.

Guy Arrowsmith  

If anyone has a solution, could you please provide a snippet or two? Problems I'm having specifically are with the RSA-SHA1 requirement. Be good to see how you guys have solved it.

John Wooding  

I finally found the solution and it is detailed very well here:
Coldfusion oAuth with Xero

After getting the signing right the Xero API was reporting back that it couldn't verify my signature because the CER file (public key) upload section in api.xero.com doesn't seem to work. I had to cut and paste the actual base64 encoded string (minus the first and last lines) and then save it.

I'm happy to help anyone who needs more clarification - just reply here.

Guy Arrowsmith  

Hey Guy, that's great. Actually, that was my thread on Stackoverflow. I got as far as returning results for specified customerIds, but as soon as I tried to pass other filters in the url, I got a signature error.

This works to return a single record with specified ContactID:
https://api.xero.com/api.xro/ 2.0/Contacts/dbb1f0b5-a71b- 4458-8462-104acd0fec6b?oauth_ consumer_key= 8HAG3BJ90JQUALKYEANCZLQAYCJUJQ &oauth_nonce= 3BD98C163B7FFF9F0A2997FDF9C476 BBD51E9930&oauth_signature= K3jbnc5SUBR% 2BhnyxpanVSfJMQWsJrAweD7ZN7Ofh %2Bf4T0QTsWE6yXarOnVWF8s7D% 2BIb% 2FZloYPEjvagkCNSMruf7GwcwgHxJ9 HpyVFQR6SXg% 2BxS0JwOOgUhKgrAHWZ367urbwlvD9 kwUceFHv8O4loMhlYYwgHWavlniBk% 2BQJ%2FYM%3D&oauth_signature_ method=RSA-SHA1&oauth_ timestamp=1339448382&oauth_ token= 8HAG3BJ90JQUALKYEANCZLQAYCJUJQ &oauth_version=1.0

This tells me to take a hike ("Failed to Validate Signature")
https://api.xero.com/api.xro/ 2.0/Contacts/dbb1f0b5-a71b- 4458-8462-104acd0fec6b?where= Name.Contains("xero")&order= Name&oauth_consumer_key= 8HAG3BJ90JQUALKYEANCZLQAYCJUJQ &oauth_nonce= 766F53F0B3A69E1A212FA261B60955 566B241400&oauth_signature= AFAEWgl% 2BxQP9BxmNGnXEyw7ZsFcaYral0% 2F%2Fe3VPm% 2BkbSIJl1ckvA8bHqOB1% 2B097BxAUqjN8rtTz6xmRRYMx2% 2Fa2n%2BuFv02dCz654GZn9AFJ% 2Bmg68UipD74dViuL3mjRviokEwygM MBahGuPNi9Dw0pYXs8wMWLyXfpfPOl q8UPk%3D&oauth_signature_ method=RSA-SHA1&oauth_ timestamp=1339447897&oauth_ token= 8HAG3BJ90JQUALKYEANCZLQAYCJUJQ &oauth_version=1.0

If you have resolved passing various filters, would you mind posting or emailing me at paulbaylis1 at yahoo dot com?

John Wooding  

hello there, any news on a solution here did anyone get it working correctly?

pcw pcw  

Hi pcw pcw, I have it working fine - what specifically are you having issues with?

Guy Arrowsmith  

Hi Guy,

Its an authentication issue, any chance you could email me some example code including the actual call to the xero api to stuartcalderpcw@yahoo.co.uk please

pcw pcw  

cant get passed your original error Guy, did u have to pasted the cer to get the signature to work ? this is the call im using to get the signature generated


pcw pcw  

This works for me: https://gist.github.com/mjb/8567585
Feedback welcome.

Matthew Bryant