Xero - beautiful accounting software

Xero Developer Help Center

Xero Developer Community

Community > API Authentication >

Xero-Postman returns "oauth problem=consumer key unknown"

Started by Jordan Rhea -   in API Authentication

I am using the project at: https://github.com/XeroAPI/Xero-Postman

I followed the directions exactly to setup an app. I plan on using this key/secret pair to build out an apps script project later so I didn't worry about the domain. The example shows a demoapp.com domain.

http://i.imgur.com/bZY9aJF.png

Then I made sure to put that same key/secret pair into postman:

http://i.imgur.com/TaLCvMc.png

Finally when I hit send as in the demo I get a consumer_key_unknown response.

http://i.imgur.com/Om4KW4l.png

What am I missing???
Hey Jordan,

From your second screenshot it looks like only the initial values are set but the current values are still empty. There should be a button named 'reset all' or something similar in the panel where you entered those values to ensure that the current values have been populated. You can also set those values yourself within that edit section.

Cheers,
Matt
 

Matthew Mortimer (Xero Staff)  

Thanks Matt! That was it exactly. I guess the Postman interface has changed a little bit since the docs were first written.

Unfortunately I am not able to duplicate this request in apps script using the OAuth1 library.

OAuth1.createService('sheeo-reports')
.setOAuthVersion('1.0a')
.setAccessTokenUrl('https://api.xero.com/oauth/AccessToken')
.setRequestTokenUrl('https://api.xero.com/oauth/RequestToken')
.setAuthorizationUrl('https://api.xero.com/oauth/Authorize')
.setConsumerKey('PMK71XXXXXXXXXXXXXXXWMKA')
.setConsumerSecret('9KF1SFXXXXXXXXXXXXVK63SH0J')
.setCallbackFunction('authCallback')
.setPropertyStore(PropertiesService.getUserProperties()));

Does this look like it is missing something? I get the response:

Error starting OAuth flow: oauth_problem=xero_unknown_error&oauth_problem_advice=could%20not%20generate%20a%20request%20token

Should I start a new thread for this new problem?
 

Jordan Rhea