Why isn't this API request working - i don't get it

Avatar

Avatar

peterc82255801

Avatar

peterc82255801

peterc82255801

06-07-2017

Hi Forum,

The following request is working fine

---------------------------------------------------------

var report = new Report({

id: "RefTypeDirect",

dataElement: "#RefTypeDirect",

totalElement: "#refTotalsDirect",

loadingDisable: true,

animateTotal: true

});

report.run({

"reportDescription":{

"reportSuiteID": config.reportSuite,

"dateFrom": new Date(new Date().setDate(new Date().getDate()-90)).toJSON().slice(0,10),

"dateTo": new Date().toJSON().slice(0,10),

//"dateGranularity": "week",

"metrics": [

{ "id": "instances" }

],

"elements": [

   { "id": "referrertype" }

                            ],

                            "segments": [

                            {

                                "element": "referrertype",

                                    "selected": ["Typed/Bookmarked"]

},

],

"currentData": "true"

}

}

---------------------------------------------------------

But the following doesn't work...i can't see why...same syntax but difference dimension?!?

var report = new Report({

id: "devTypeDesktop",

dataElement: "#devTypeDesktop",

totalElement: "#devTotalsDesktop",

loadingDisable: true,

animateTotal: true

});

report.run({

"reportDescription":{

"reportSuiteID": config.reportSuite,

"dateFrom": new Date(new Date().setDate(new Date().getDate()-90)).toJSON().slice(0,10),

"dateTo": new Date().toJSON().slice(0,10),

//"dateGranularity": "week",

"metrics": [

{ "id": "instances" }

],

"elements": [

   { "id": "mobileDeviceType" }

                            ],

                            "segments": [

                            {

                                "element": "mobileDeviceType",

                                    "selected": ["Other"]

},

],

"currentData": "true"

}

}

Accepted Solutions (0)

Answers (0)