Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn more

View all

Sign in to view all badges

SOLVED

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

peterc82255801
Level 1
Level 1

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"

}

}

1 Accepted Solution
jantzen_belliston-Adobe
Correct answer by
Community Manager
Community Manager

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

View solution in original post

1 Reply
jantzen_belliston-Adobe
Correct answer by
Community Manager
Community Manager

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

View solution in original post