1

Remote API отчеты

(04/11/2012 02:14:32 отредактировано jecash)

Тема: Remote API отчеты

Требуется помощь по получению отчета.
Каким образом для команды report/exec_report
получить "reportResourceId" никак не могу найти.
есть все кроме "reportResourceId"

svc=core/search_item&sid='.$eid.'&params={"id":"190543","flags":1}'; //получаем пользователя
{"item":{"nm":"test","cls":1,"id":190543,"uacl":2097793},"flags":1}
===========================================================================
svc=core/search_item&sid='.$eid.'&params={"id":"190853","flags":1}'; //получаем объект
{"item":{"nm":"Nissan Atlas 441","cls":2,"id":190853,"uacl":638142382627},"flags":1}
===========================================================================
svc=core/update_data_flags&sid='.$eid.'&params={"spec":[{"type":"type","data":"avl_resource","flags":2001,"mode":0}]}';// получаем шаблоны
[{"i":180212,"d":{"nm":"templates","cls":3,"id":180212,"gd":"fc31ccf5521bf49537ebcf814640dcb3","drvrs":{},"unf":{},"ujb":{},"uacl":2200454562339},"f":2001},{"i":190544,"d":{"nm":"templates1","cls":3,"id":190544,"gd":"969846295246539e66bab7e785567135","drvrs":{},"unf":{},"ujb":{},"uacl":2200454562339},"f":2001}]
===========================================================================
svc=report/exec_report&sid='.$eid.'&params={"reportResourceId":[size=18]???????????[/size],"reportTemplateId":180212,"reportObjectId":190853,"reportObjectSecId":"","interval":{"from":'.(time()-3600).',"to":'.time().',"flags":0}}';

если в reportResourceId вставить id пользователя выдает
{"error":4}

помогите с решением проблемы.

2

Remote API отчеты

Re: Remote API отчеты

jecash
Шаблоны отчетов находятся в ресурсе, и соответственно вам необходимо использовать в качестве параметра "reportResourceId"  id avl_resource.
http://docs.gurtam.com/en/hosting/sdk/w … _templates

Mobile Development
Gurtam
3

Remote API отчеты

Re: Remote API отчеты

kopa пишет:

jecash
Шаблоны отчетов находятся в ресурсе, и соответственно вам необходимо использовать в качестве параметра "reportResourceId"  id avl_resource.
http://docs.gurtam.com/en/hosting/sdk/w … _templates

Здесь только ReportTemplateID
reportResourceID здесь нету

0x2000 – report templates:
{
    "rep":{
        <text>:{        /* sequence number of a report template */
            "id":<long>,    /* report template ID */
            "n":<text>,    /* report template name */
            "ct":<text>,    /* template type (see the list below) */
            "c":<ushort>    /* data report CRC16 */
        }
    }
}

Можно пример запроса.

4

Remote API отчеты

Re: Remote API отчеты

У ресурса флаг 0x1
   

"id":<uint>,    /* resource ID */

http://docs.gurtam.com/en/hosting/sdk/w … asic_props

Mobile Development
Gurtam
5

Remote API отчеты

Re: Remote API отчеты

kopa пишет:

У ресурса флаг 0x1
   

"id":<uint>,    /* resource ID */

http://docs.gurtam.com/en/hosting/sdk/w … asic_props

Спасибо нашел свою ошибку.

6

Remote API отчеты

Re: Remote API отчеты

jecash пишет:
kopa пишет:

У ресурса флаг 0x1
   

"id":<uint>,    /* resource ID */

http://docs.gurtam.com/en/hosting/sdk/w … asic_props

Спасибо нашел свою ошибку.

Возникла есче одна проблема нет детализации при выполнении отчетов, показывает только итоги.
хотя в виалоне в этом отчете детализация есть
Запрос
?svc=report/exec_report&sid='.$eid.'&params={"reportResourceId":180212,"reportTemplateId":1,"reportObjectId":280939,"reportObjectSecId":"0","interval":{"from":1351754811,"to":1352100411,"flags":1}}'

кусок ответа по топливу написано что 3 строки но их нету только итог
Array ( [name] => unit_fillings [label] => Заправки [flags] => 4368 [rows] => 3 [columns] => 5 [header] => Array ( [0] => № [1] => Время [2] => Положение [3] => Нач. уровень [4] => Заправлено ) [total] => Array ( [0] => [1] => 2012-11-03 23:36:16 [2] => [3] => 11.61 lt [4] => 88 lt ) )

7

Remote API отчеты

Re: Remote API отчеты

Для получения строк и подстрок используйте запросы Getting Rows и Getting Subrows соответственно.

Mobile Development
Gurtam