Why isn't this API request working - i don't get it | Community
Skip to main content
July 6, 2017
Solved

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

  • July 6, 2017
  • 1 reply
  • 878 views

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"

}

}

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by jantzen_b

Since this is an older post, I'm assuming you've solved this issue. Incase others find this post, I'll post the link to the documentation below:

https://www.adobe.io/apis/experiencecloud/analytics/docs.html

1 reply

jantzen_b
Adobe Employee
jantzen_bAdobe EmployeeAccepted solution
Adobe Employee
March 5, 2021

Since this is an older post, I'm assuming you've solved this issue. Incase others find this post, I'll post the link to the documentation below:

https://www.adobe.io/apis/experiencecloud/analytics/docs.html