API to fetch reports

Marco Pracucci's Avatar

Marco Pracucci

18 Apr, 2017 08:00 AM

Hi there,
do you have an API to fetch reports?

Thank you,
Marco

  1. Support Staff 1 Posted by brandi on 18 Apr, 2017 07:06 PM

    brandi's Avatar

    Hi Marco,

    We do! Here's our KB on API.

    Thanks,
    Brandi

  2. brandi closed this discussion on 18 Apr, 2017 07:06 PM.

  3. Marco Pracucci re-opened this discussion on 19 Apr, 2017 03:14 PM

  4. 2 Posted by Marco Pracucci on 19 Apr, 2017 03:14 PM

    Marco Pracucci's Avatar

    Hi Brandi,
    can you point me to the exact page describing the Reports API? I can't
    really find it. I can just find some doc about the csv structure, but no
    information about Reports API.

    Thank you,
    Marco

  5. Support Staff 3 Posted by brandi on 19 Apr, 2017 06:52 PM

    brandi's Avatar

    Hi Marco,

    What is it specifically that you are looking to do?

  6. 4 Posted by Marco Pracucci on 20 Apr, 2017 05:04 AM

    Marco Pracucci's Avatar
  7. Support Staff 5 Posted by brandi on 21 Apr, 2017 06:16 PM

    brandi's Avatar

    Hi Marco,

    Checking on this. Thanks for your patience.

  8. 6 Posted by Marco Pracucci on 24 Apr, 2017 12:13 PM

    Marco Pracucci's Avatar

    Hi there,
    is there any news on this?

    Marco

  9. Support Staff 7 Posted by Courtenay on 25 Apr, 2017 12:29 AM

    Courtenay's Avatar

    Hey Marco, we don't have an API specifically for reports (no-one has ever asked for it, in five years). The report data is already in json, so you could probably script it pretty easily.

  10. 8 Posted by Marco Pracucci on 25 Apr, 2017 11:36 AM

    Marco Pracucci's Avatar

    What do you mean the report data is already in Json? Can you point me to an
    URL? I've just seen csv export.

    Marco

  11. Support Staff 9 Posted by Courtenay on 28 Apr, 2017 01:52 AM

    Courtenay's Avatar

    If you have/are a web developer you can look at the urls in a reporting page, they make a simple request to the current url + ".js" and the result comes back in handy json. So you could script fetching those pages without too much difficulty. Rather than using the api you'd create a session by logging in then make the request to the page with the authenticity token for the request and the session id. It's fairly liberal in what it accepts for auth - basic auth, multipass encrypted token, or cookie with session key.

  12. Support Staff 10 Posted by Courtenay on 28 Apr, 2017 01:53 AM

    Courtenay's Avatar

    so e.g. on our site the page is https://help.tenderapp.com/dashboard/reporting/stats and it requests https://help.tenderapp.com/dashboard/reporting/stats.js?type=week&start=Mon%20Apr%2024%202017%2000:00:00%20GMT+1200%20(NZST)&end=Sun%20Apr%2030%202017%2000:00:00%20GMT+1200%20(NZST)&authenticity_token=7fe441cdb7c89836b476bf185a78931c1a13f37a71b251d2d7598abe2feca81e

  13. Support Staff 11 Posted by Courtenay on 28 Apr, 2017 01:56 AM

    Courtenay's Avatar

    This is not an officially supported API but the structure hasn't ever changed and there are no plans to change it, and I wrote it, so this is as close as we'll get to a reports API in the near future :) I know we could "just" add an endpoint that points to this same url from the api but the dev queue isn't LIFO!
    anyway, let me know if that works for you. I highly doubt that calling the JSON from the browser works (and would strongly recommend against it given you have to embed your credentials in the call) so this is a backend thing only.

  14. 12 Posted by Marco Pracucci on 02 May, 2017 05:35 PM

    Marco Pracucci's Avatar

    Thanks for all the good information. I'm good to continue working on this.

    Marco

    #resolve

  15. brandi closed this discussion on 02 May, 2017 06:07 PM.

Discussions are closed to public comments.
If you need help with Tender please start a new discussion.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac