How I can get report data via API?

Hi.
I'm just starting to play with modeanalytics, so don't hit me hard, pls. 
I didn't find a way to get report result data via API-query, only .csv and .pdf are available. 
This particular report may contain data or not. 
How can I query did report generate any data or not? Only by csv size comparison?

Thanks.

5replies Oldest first
  • Oldest first
  • Newest first
  • Active threads
  • Popular
  • forget it, found a workaround.
    sry for annoyance

    Reply Like
  • Hi Alexander,

    Could you share briefly what your workaround where like?

     

    Thanks,

    Espen

    Reply Like
  • Does anybody have any sample code?

    I can make a call to /api/xxx with no problem and it gets a JSON result. This implies my token auth is working.

    I'm getting 401 access errors, and my URI looks like:

    https://modeanalytics.com/api/xxx/reports/128c58442c33

    Code below.

    ------

    from urllib2 import Request, urlopen

     

    token = "xxxx"

    password = "yyyy"

     

    headers = {

      'Content-Type': 'application/json',

      'Accept': 'application/hal+json',

      'Authorization': "access_token %s" % (token)

    }

     

    # report

    # https://modeanalytics.com/xxx/reports/abcabcabc

     

    url = 'https://modeanalytics.com/api/xxx/reports/128c58442c33'

     

    print headers

    print url

     

    request = Request(url, headers=headers)

     

    response_body = urlopen(request).read()

    print response_body

    Reply Like
  • Hey Ryan Choi , I responded to your question in this thread: https://forum.modeanalytics.com/t/h4f7mb/get-report-data-from-api

    Reply Like
  • Hi Leqi Long . Question for you - could you give an example of what the Headers object should look like, including Authorization? I have my token and password but can't figure out how to include them in the headers (i.e. what are the header names? do the token and password go into the headers separately? etc.). Thank you!

    Reply Like
reply to topic
Like Follow
  • 4 mths agoLast active
  • 5Replies
  • 699Views
  • 5 Following

Create A New Discussion

Share your thoughts