1

How to access response headers in json data sources?

Hello,

 

From the article on handling data sources with multiple pages:

https://support.klipfolio.com/hc/en-us/articles/218946328-Data-Sources-with-Multiple-Pages-

"A static data source query that returns the first page of data. The data returned by this query will contain a field, for example, 'total_pages' or 'total_records', that indicates the total number of pages or records returned by your query."

 

Where do I find that field? Do I have to define it in query parameters or link it with a variable?

 

Best regards,

Mariusz

8 comments

  • Avatar
    Janice Janczyn Official comment

    Hi Mariusz,

    The specific parameters depend on the data source type and would be described in the service's API guide. Which web service are you trying to access?

    Thanks,

         Janice

  • 0
    Avatar
    Mariusz Martusewicz

    I'm accesing Teamwork over its API. It generally works fine using json queries. Now I'm looking for a way to read values returned in "response headers" to handle multiple pages.

    Here is an API example, please scroll down a bit and see the info under "pagination": http://developer.teamwork.com/projectsapi#retrieve_all_proj

     

  • 0
    Avatar
    Janice Janczyn

    Hi Mariusz,

    It isn't possible to see the response headers in a datasource. The Teamwork API documentation (http://developer.teamwork.com/introduction#syncing_/_update_) also mentions using the updatedAfterDate parameter to filter data, would that help to return a subset of data based on date?

    Thanks,

           Janice

     

     

     

     

  • 0
    Avatar
    Mariusz Martusewicz

    Hi Janice,

    Sure, there are ways to limit the number of data, but it's about how to get it all, paginated or not.

    > It isn't possible to see the response headers in a datasource

    Please explain what's the issue here. Is it a question of native support for a given service/API?

     

    Best regards,

    Mariusz

  • 0
    Avatar
    Janice Janczyn

    Hi Mariusz,

    Klipfolio supports the Teamwork service--it is possible to get your data out of Teamwork using their REST API. However, because Teamwork uses header fields to provide total records and pages data and we do not provide access to the response headers, it isn't possible to paginate through their data. The workaround is to filter the data by date.

    Thanks, 

             Janice

  • 0
    Avatar
    T V

    I ave the same question as Mariusz, except that my datasource is Infusionsoft xml-rpc. I have looked through their documentation but response headers are not covered. Please advise! I am looking to retrieve a total number of records/entries.

    --Trudy 

  • 0
    Avatar
    Andrew Crowe

    Hi Janice, any update on response headers being included in datasource requests?

    Thanks, Andrew

  • 0
    Avatar
    Janice Janczyn

    Hi Andrew, there is no update at this time. If you'd like, you can add this as a request at Product Feedback & Feature Requests.

    Thank you,
                  Janice

Please sign in to leave a comment.