0

I have set up a private app in Xero and want to make an html request (using my credentials) to get a JSON response. For example, to do a GET response to this url:https://api.xero.com/api.xro/2.0/Accounts.

With other APIs I've used, I could test out my requests by simply typing the endpoint into the address bar of an internet browser and get the JSON response in the browser.

I'm having trouble figuring out what that html request would be if it featured my Consumer Key and maybe also my RSA Private Key?

Is this even possible using the Xero Authorisation process?

1 Answers1

0

It won't be easy to do this in a browser window. Xero uses OAuth 1.0a, which requires an authorization header to be supplied that includes a string signed with your private key.

The easiest thing to do will be to pick the SDK in your favourite language and plug your consumer key & secret in there: https://developer.xero.com/documentation/libraries/overview

rustyskates
  • 856
  • 4
  • 10
  • Thanks - I've explored this but I'm trying to access the data to import into Microsoft Power BI. This uses the same language as PowerQuery (I believe called 'M'). I believe that the only way to get this to work is by making the API request a url that returns a JSON. Sadly Power BI doesn't natively support Oauth 1.0a – Samuel Hanes Jan 15 '18 at 05:36
  • In case it helps - there's already a PowerBI/Xero integration: https://www.xero.com/nz/partnerships/microsoft-powerbi/ – rustyskates Jan 16 '18 at 03:47