How to read data from the Xero previewer in an easier way.

By | July 13, 2014

If you are integrating with XERO, then the Xero API previewer is a fantastic tool to quickly check query formats, data formats and data values as well. It returns real data from the account you logged in as and you can even copy and paste the results handraulically into another system for processing. The only issue is that it is quite hard to read.

Take for example:
xero-previewer

Where the contents show:

  f483dea8-6a1f-426b-be3c-17b4a38a8653
  OK
  Xero API Previewer
  2013-08-27T08:33:43.3599219Z
  
    
      
        4b3c8980-cc25-45a5-8821-91af40ef1ab1
        TestTo
      
      2013-06-30T00:00:00
      AUTHORISED
      Inclusive
      31000.00
      0.00
      31000.00
      2013-06-30T03:05:13.253
      USD
      1a848561-0fef-4872-88c1-0c9998e6720a
      
        edb716d5-001b-4a10-92a1-cbaaca4e0970
        Test1
      
      SPEND
      TestRef
      false
      false
    
    
      
        cb3e4439-fbf0-4a5b-84e3-3b3dfb531f28
        SpendTo
      
      2013-06-30T00:00:00
      AUTHORISED
      Inclusive
      40000.00
      0.00
      40000.00
      2013-06-30T03:09:27.897
      USD
      6961882c-141a-4caa-bf47-6db51b718fd7
      
        edb716d5-001b-4a10-92a1-cbaaca4e0970
        Test1
      
      SPEND
      SpendRef
      false
      false
    
    
      
        7b4acc9b-4fe3-4cce-9ef6-713838d0250e
        Test3
      
      2013-06-30T00:00:00
      AUTHORISED
      Inclusive
      130235.00
      0.00
      130235.00
      2013-06-30T06:28:19.537
      USD
      d54bf964-5366-4118-ab97-4b1b82a7b183
      
        a4865cca-73f0-4da6-8bb4-e9e2a5fd7fda
        AccountNameCC
      
      SPEND
      CCSpentRef
      false
      false
    
    
      
        067dd16c-d080-499c-b82b-843b71ae8e24
        AccountCCTo1
      
      2013-07-01T00:00:00
      AUTHORISED
      Inclusive
      101.00
      0.00
      101.00
      2013-07-01T02:31:35.127
      USD
      278b63c3-e656-4624-bf3b-154b97619afe
      
        4aee2adf-f64b-4299-9561-5cf899536325
        AccountCreditcard1
      
      SPEND
      AccountCCTo1Ref
      false
      false
    
    
      
        cca1d8f6-4d0d-4a3d-aaa2-634254c80a9d
        John
      
      2013-08-15T00:00:00
      AUTHORISED
      Inclusive
      40000.00
      0.00
      40000.00
      2013-08-14T22:08:23.427
      USD
      d039fe9f-a2d7-4f9a-9ada-257a63a12557
      
        a4865cca-73f0-4da6-8bb4-e9e2a5fd7fda
        AccountNameCC
      
      RECEIVE
      false
      false
    
    
      
        4b3c8980-cc25-45a5-8821-91af40ef1ab1
        TestTo
      
      2013-08-04T00:00:00
      AUTHORISED
      NoTax
      10800.00
      0.00
      10800.00
      2013-08-15T05:46:00.557
      USD
      6ffb0bb1-f842-4b93-bae8-6c15af7681b6
      
        0139cefc-944b-4d16-8070-fc45d4a0f774
        Saving Account
      
      SPEND-OVERPAYMENT
      false
      false
    
    
      
        80c98f3f-27fa-4cee-907b-07a1a748247e
        Test/Test1
      
      2013-08-15T00:00:00
      AUTHORISED
      Inclusive
      30000.00
      0.00
      30000.00
      2013-08-18T03:05:06.42
      USD
      a37dc5ae-c0b1-484c-b248-8b641fb37483
      
        edb716d5-001b-4a10-92a1-cbaaca4e0970
        Test1
      
      RECEIVE
      false
      false
    
    
      2013-06-30T00:00:00
      DELETED
      NoTax
      12.00
      2013-08-18T03:05:48.743
      USD
      4d6ccd40-8772-4518-b221-08e2125abd51
      
        edb716d5-001b-4a10-92a1-cbaaca4e0970
        Test1
      
      SPEND-TRANSFER
      false
      false
    
    
      2013-06-30T00:00:00
      DELETED
      NoTax
      12.00
      2013-08-18T03:05:48.743
      USD
      65b712a4-1092-4bc5-8f43-aa16d27efc99
      
        0139cefc-944b-4d16-8070-fc45d4a0f774
        Saving Account
      
      RECEIVE-TRANSFER
      false
      false
    
    
      
        fac19df4-e92b-45d1-9565-115933a65481
        Paul
      
      2013-08-18T00:00:00
      AUTHORISED
      Inclusive
      22000000.00
      0.00
      22000000.00
      2013-08-18T03:07:53.343
      USD
      ebbd4239-385e-48e7-b40e-c930a263b33e
      
        0139cefc-944b-4d16-8070-fc45d4a0f774
        Saving Account
      
      RECEIVE
      false
      false
    
    
      
        9b8d7fd5-9e81-4dcd-949b-c5236128d147
        My Test
      
      2013-08-17T00:00:00
      AUTHORISED
      Inclusive
      20000000.00
      0.00
      20000000.00
      2013-08-18T03:12:32.013
      USD
      9484a732-2ae7-44a8-af86-4e111710cdac
      
        0139cefc-944b-4d16-8070-fc45d4a0f774
        Saving Account
      
      RECEIVE
      false
      false
    
  

The trick is to copy this into notepad and save it as an XML file. Then use excel to import this XML file.

xero-xml-in-excel

Leave a Reply

Your email address will not be published.