2015-02-11 52 views
0

我已经在我的GoodData UI上创建了一个报告。现在我想使用API​​获取此报告。我花了几个小时来挖掘API文档,但我无法找到一个简单的方法来做到这一点。使用GoodData API提取报告

如果我尝试GDC /执行/生/,则返回

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

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

如果我尝试GDC/xtab2/executor3返回

[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 
    ) 
+0

你是什么意思“使用API​​获取报告”?你想从GoodData中导出它吗?所有这些报告都可以使用API​​导出,或者可以保存报告定义,然后在UI中打开报告。这里的用例是什么? – 2015-02-18 14:30:43

+0

@JiriTobolka我只是想以CSV格式导入我的应用程序中的数据。我在下面的答案中给出的链接是根据我的具体用例。 – Saqib 2015-02-19 06:14:47

回答

0

你的请求得到了404和400状态分别。

当您尝试使用'gdc/execute/raw /'时,到达我们这边的调用是:“request =”POST/gdc/execute/raw/HTTP/1.1“”,而不是它应该看起来像“POST/gdc/app/projects/{your_project_id}/execute/raw/HTTP/1.1”,这就是您收到'NotFound'错误的原因。关于'gdc/xtab2/executor3',在调用的主体内显然是有问题的。

请在这里发表您的来电,他们的身体和你究竟如何使他们,或打开与https://support.gooddata.com/home那些细节的支持票,以便我们进一步调查。

+0

感谢您的回复。试过了,现在它抛出这个错误阵列 ( [错误] =>阵列 ( [errorClass] => org.springframework.web.servlet.NoHandlerFoundException [微量] => [消息] =>没有找到处理程序for post headers = {content-type = [application/x-www-form-urlencoded],cookie = **** [component] => Webapp [errorId] => a8540094-ab1d-4f49-bdea-f5f199d6f9df [的errorCode] => [参数] =>阵列 ( ) ) ) – Saqib 2015-02-12 09:17:32

+0

我需要知道你正在使用完全相同,以确保他们的DEFI匹配通话这是在http://docs.gooddata.apiary.io/#report中指定的。 – 2015-02-12 09:38:02

+0

<?php $ ch = curl_init(); curl_setopt($ ch,CURLOPT_URL,“https://private-anon-d14b9fe16-gooddata.apiary-mock.com/gdc/xtab2/executor3”); curl_setopt($ ch,CURLOPT_RETURNTRANSFER,TRUE); curl_setopt($ ch,CURLOPT_HEADER,FALSE); curl_setopt($ ch,CURLOPT_POST,TRUE); curl_setopt($ ch,CURLOPT_POSTFIELDS,“{\ n \”report_req \“:{\ n \”report \“:\”/ gdc/md/{project-id}/obj/{obj-id} \“\ n} \ n}“); curl_setopt($ ch,CURLOPT_HTTPHEADER,array(“Accept:application/json”)); $ response = curl_exec($ ch); curl_close($ ch); var_dump($ response); – 2015-02-12 09:40:12