Retrieving custom dimension tracked data in Visit summery api

Hii
I am using the Live module’s reporting API:

matomo-url/index.php?module=API&method=Live.getLastVisitsDetails&idSite=MY_SITE_ID&period=day&date=today&format=JSON&token_auth=MY_TOKEN_AUTH&filter_limit=-1

In the response, I receive an actionDetails array for each user, structured like this:

"actionDetails": [
            {
                "type": "event",
                "url": "",
                "pageIdAction": 109,
                "idpageview": "",
                "serverTimePretty": "Nov 21, 2024 5:57:23 AM",
                "pageId": 171750,
                "eventCategory": "VIEW_DETAIL",
                "eventAction": "VIEW_VIDEO",
                "pageviewPosition": 5,
                "timestamp": 1732168643,
                "icon": "plugins/Morpheus/images/event.png",
                "iconSVG": "plugins/Morpheus/images/event.svg",
                "title": "Event",
                "subtitle": "",
                "eventName": "",
                "eventValue": 0
            },
]

Currently, I can retrieve custom dimension data at the user level but not for each action in the actionDetails array.

I would like to retrieve the tracked custom dimension data for all the actions made by the user within actionDetails. How can I achieve this?

Hi @Janvi_Gabani
Action custom dimensions are attached to individual actions (see dimension2, dimension4, dimension5 in below example), whereas Visit custom dimensions are attached to individual visits (see dimension1 in below example).
Sample from the demo site:

[
    {
        "idSite": 1,
        "idVisit": 14100545,
        "visitIp": null,
        "visitorId": false,
        "fingerprint": false,
        "actionDetails": [
            {
                "type": "action",
                "url": "https:\/\/divezone.net\/diving\/mataking-island",
                "pageTitle": "Best Diving sites in Mataking Island \u2013 Malaysia Scuba dive reviews by Divezone",
                "pageIdAction": 653,
                "idpageview": "xpTO5y",
                "serverTimePretty": "21 nov. 2024 09:11:19",
                "pageId": 38889330,
                "timeSpent": 0,
                "timeSpentPretty": "0s",
                "pageviewPosition": 1,
                "title": "Best Diving sites in Mataking Island \u2013 Malaysia Scuba dive reviews by Divezone",
                "subtitle": "https:\/\/divezone.net\/diving\/mataking-island",
                "icon": "",
                "iconSVG": "plugins\/Morpheus\/images\/action.svg",
                "timestamp": 1732180279,
                "dimension2": "Julien",
                "dimension4": "Mataking Island",
                "dimension5": "diving",
            }
        ],
        "goalConversions": 0,
        "siteCurrency": "USD",
        "siteCurrencySymbol": "$",
        "serverDate": "2024-11-21",
        "visitServerHour": "8",
        "lastActionTimestamp": 1732176679,
        "lastActionDateTime": "2024-11-21 08:11:19",
        "siteName": "Demo Site",
        "serverTimestamp": 1732176679,
        "firstActionTimestamp": 1732176679,
        "serverTimePretty": "09:11:19",
        "serverDatePretty": "Jeudi 21 novembre 2024",
        "serverDatePrettyFirstAction": "Jeudi 21 novembre 2024",
        "serverTimePrettyFirstAction": "09:11:19",
        "userId": null,
        "visitorType": "returning",
        "visitorTypeIcon": "plugins\/Live\/images\/returningVisitor.png",
        "visitConverted": 0,
        "visitConvertedIcon": null,
        "visitCount": 75,
        "visitEcommerceStatus": "none",
        "visitEcommerceStatusIcon": null,
        "daysSinceFirstVisit": 532,
        "secondsSinceFirstVisit": 45964800,
        "daysSinceLastEcommerceOrder": 0,
        "secondsSinceLastEcommerceOrder": null,
        "visitDuration": 0,
        "visitDurationPretty": "0s",
        "searches": 0,
        "actions": 1,
        "interactions": 1,
        "referrerType": "search",
        "referrerTypeName": "Moteurs de recherche",
        "referrerName": "Google",
        "referrerKeyword": "Mot clef ind\u00e9fini",
        "referrerKeywordPosition": null,
        "referrerUrl": "https:\/\/www.google.com.hk\/",
        "referrerSearchEngineUrl": "http:\/\/google.com",
        "referrerSearchEngineIcon": "plugins\/Morpheus\/icons\/dist\/searchEngines\/google.com.png",
        "referrerSocialNetworkUrl": null,
        "referrerSocialNetworkIcon": null,
        "languageCode": "",
        "language": "Inconnu",
        "deviceType": "Bureau",
        "deviceTypeIcon": "plugins\/Morpheus\/icons\/dist\/devices\/desktop.png",
        "deviceBrand": "Apple",
        "deviceModel": "G\u00e9n\u00e9rique Bureau",
        "operatingSystem": "Mac 10.13",
        "operatingSystemName": "Mac",
        "operatingSystemIcon": "plugins\/Morpheus\/icons\/dist\/os\/MAC.png",
        "operatingSystemCode": "MAC",
        "operatingSystemVersion": "10.13",
        "browserFamily": "Blink",
        "browserFamilyDescription": "Blink (Chrome, Opera)",
        "browser": "Chrome 66.0",
        "browserName": "Chrome",
        "browserIcon": "plugins\/Morpheus\/icons\/dist\/browsers\/CH.png",
        "browserCode": "CH",
        "browserVersion": "66.0",
        "totalEcommerceRevenue": 0,
        "totalEcommerceConversions": 0,
        "totalEcommerceItems": 0,
        "totalAbandonedCartsRevenue": 0,
        "totalAbandonedCarts": 0,
        "totalAbandonedCartsItems": 0,
        "events": 0,
        "continent": "Asie",
        "continentCode": "asi",
        "country": "R.A.S. chinoise de Hong Kong",
        "countryCode": "hk",
        "countryFlag": "plugins\/Morpheus\/icons\/dist\/flags\/hk.png",
        "region": null,
        "regionCode": null,
        "city": null,
        "location": "R.A.S. chinoise de Hong Kong",
        "latitude": "22.291000",
        "longitude": "114.150000",
        "visitLocalTime": "22:05:11",
        "visitLocalHour": "22",
        "daysSinceLastVisit": 7,
        "secondsSinceLastVisit": 604800,
        "resolution": "1680x1050",
        "plugins": "cookie, pdf",
        "pluginsIcons": [
            {
                "pluginIcon": "plugins\/Morpheus\/icons\/dist\/plugins\/cookie.png",
                "pluginName": "cookie"
            },
            {
                "pluginIcon": "plugins\/Morpheus\/icons\/dist\/plugins\/pdf.png",
                "pluginName": "pdf"
            }
        ],
        "dimension1": "guest",
        "adClickId": "",
        "adProviderId": "",
        "adProviderName": "",
        "crashes": 0,
        "formConversions": 0,
        "sessionReplayUrl": null,
        "campaignId": "",
        "campaignContent": "",
        "campaignKeyword": "",
        "campaignMedium": "",
        "campaignName": "",
        "campaignSource": "",
        "campaignGroup": "",
        "campaignPlacement": ""
    }
]