0

I have created a report on my GoodData UI. Now I want to fetch this report using the API. I spent hours digging the API docs but I am unable to find a simple way to do so.

If I try gdc/execute/raw/, it returns

[error] => Array
    (
        [parameters] => Array
            (
                [0] => execute
            )

        [requestId] => 53fPgKcFdkjf8PZ5:4n6x9lp9vk3ydbvs
        [component] => GDC
        [errorClass] => GDC::Exception::NotFound
        [message] => resource %s not found
    )

If I try gdc/xtab2/executor3 it returns

[error] => Array
    (
        [parameters] => Array
            (
                [0] => report_req
                [1] => STRUCTURE INVALID - name of structure:'ReportReq'(tag:report_req),  /report_req/ExecutionObject: Object  does not match any alternative. Alternatives tried : [STRUCTURE INVALID - name of structure:'ReportReq' ...]
            )

        [requestId] => a0yRpNUpCPRsbPS0:6nagmwaw61h5g2bn
        [component] => Apache::REST
        [errorClass] => GDC::Exception::User
        [message] => Checking '%s', result %s
    )
Saqib
  • 2,470
  • 3
  • 19
  • 32
  • what do you mean by "fetching the report using API" ? Do you want to export it from the GoodData? All those reports are available for export using API or you can save report definition and then open the report in the UI. What is the use case here? – Jiri Tobolka Feb 18 '15 at 14:30
  • @JiriTobolka I just wanted to import the data in my app in CSV format. The link given in my answer below was according to my specific use case. – Saqib Feb 19 '15 at 06:14

2 Answers2

0

Your requests got 404 and 400 statuses respectively.

When you tried to use 'gdc/execute/raw/' the call that reached our side was: "request="POST /gdc/execute/raw/ HTTP/1.1"", instead of that it should look like "POST /gdc/app/projects/{your_project_id}/execute/raw/ HTTP/1.1", that's the reason your are getting a 'NotFound' error. Regarding 'gdc/xtab2/executor3' there's apparently something wrong within the body of the call.

Please post your calls here, their bodies and how exactly you are making them, or open a support ticket with those details at https://support.gooddata.com/home so that we can investigate further.

  • Thanks for the reply. Tried that, Now it's throwing this error Array ( [error] => Array ( [errorClass] => org.springframework.web.servlet.NoHandlerFoundException [trace] => [message] => No handler found for POST headers={content-type=[application/x-www-form-urlencoded], cookie=**** [component] => Webapp [errorId] => a8540094-ab1d-4f49-bdea-f5f199d6f9df [errorCode] => [parameters] => Array ( ) ) ) – Saqib Feb 12 '15 at 09:17
  • I'd need to know the calls you are using exactly to make sure they match the definition which is specified in http://docs.gooddata.apiary.io/#report. – Raúl Melgosa Feb 12 '15 at 09:38
  • I am trying "gdc/xtab2/executor3" as this seems the call that I really need. This is my post body { "report_req": { "reportDefinition": "/gdc/md/tczt086d90ok8bzoqzsxv97dogh8yt0i/obj/31494" } } – Saqib Feb 12 '15 at 11:04
  • Error I am getting for above request is [error] => Array([parameters] => Array ( [0] => report_req [1] => STRUCTURE INVALID - name of structure:'ReportReq'(tag:report_req), /report_req/ExecutionObject: Object does not match any alternative. Alternatives tried : [STRUCTURE INVALID - name of structure:'ReportReq'(tag:report_req), /report_req/ExecutionObject/case:/ExecuteContent: Object '' should be a hash reference - ...] ) [requestId] => NK0Y4llFGiZazCmS:jdowdjkdl4487d6v [component] => Apache::REST [errorClass] => GDC::Exception::User [message] => Checking '%s', result %s ) – Saqib Feb 12 '15 at 11:07
  • I can confirm the API calls work as expected after several tests. It seems will need to investigate further and check your current implementation to find out what's wrong there. For that investigation I'll need information that should not be displayed here, therefore, please raise a support ticket through our portal : https://support.gooddata.com. Thanks – Raúl Melgosa Feb 12 '15 at 13:11
0

Ultimately I followed this code piece https://gist.github.com/gnilrets/b9d2ce9890d8aaa07042

Much better than reading the whole GoodData API documentation.

Saqib
  • 2,470
  • 3
  • 19
  • 32