0 Replies Latest reply: Dec 7, 2017 9:30 PM by Alexey Ryzhkov RSS

    With REST how to set correct Total Field Path from XML ?

    Alexey Ryzhkov

      Hello!

      I use REST connector with custom pagination because I can't use Offset way.

      I did it about 1.5 years ago but now it doesn't works.

      For Custom pagination it works but I can't undersant how get total records in Custom pagination.

       

      Also I didn't find solution for Offset way.

      I saw different examples how work with other paginations but not with Offset.

       

      Both ways Custom and Offset are welome if it possible to get Total from REST request and use it to load data.

      How to get from XML correct Total value and then use it in Total Field Path?

      Thanks in advance.

       

      Example is below.

      Curl request: http://api.worldbank.org/v2/countries?page=1&per_page=2

      For this case values for Total Field Path "root/total" or "total" don't work.

       

       

      Result:

      <?xml version="1.0" encoding="utf-8" ?>

       

      <wb:countries page="1" pages="152" per_page="2" total="304">

      <wb:country id="ABW">
      <wb:iso2Code>
      AW

       

      </wb:iso2Code>

      <wb:name>

      Aruba

       

      </wb:name>

      <wb:region id="LCN" iso2code="ZJ">

      Latin America & Caribbean

       

      </wb:region>

      <wb:adminregion id="" iso2code="" />

      <wb:incomeLevel id="HIC" iso2code="XD">

      High income

       

      </wb:incomeLevel>

      <wb:lendingType id="LNX" iso2code="XX">

      Not classified

       

      </wb:lendingType>

      <wb:capitalCity>

      Oranjestad

       

      </wb:capitalCity>

      <wb:longitude>

      -70.0167

       

      </wb:longitude>

      <wb:latitude>

      12.5167

       

      </wb:latitude>
      </wb:country>

      <wb:country id="AFG">

      ...

       

      </wb:country>
      </wb:countries>