---
schema_version: "1"
id: fe7545296f94dd5de73f8c163b4bbc6bd10637b83592cec83cee338c6c854b4e
title: ConnectApi Utilities
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/apexref/connectAPI_utilities.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/connectAPI_utilities.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: d19e06c22061d84ec94c0c9056fdebb7fe58cbdd943b733061a3acb4b3098988
description: The ConnectApi namespace contains a utility class.
---
# ConnectApi Utilities

The ConnectApi namespace contains a utility class.

| Utility | Description |
| --- | --- |
| ConnectApi.ConnectUtilities.unwrapApexWrapper() | Unwraps obfuscated, Apex-wrapped objects into known types such as Map<String, Object>. Example from Apex Debug log: core.connect.apex.ApexMapWrapper@7270879d |

## Example

This example calls [getManagedContentForSite(siteId, contentKeyOrId, showAbsoluteUrl)](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_ConnectAPI_ManagedContentDelivery_static_methods.htm#apex_ConnectAPI_ManagedContentDelivery_getManagedContentForSite_4 "Get a piece of published content for an Experience Cloud site.") to get a custom content type with an image reference and uses the ConnectApi.ConnectUtilities.unwrapApexWrapper() utility.

ConnectApi.ManagedContentDeliveryDocument res = 
    ConnectApi.ManagedContentDelivery.getManagedContentForSite ('0DMXXXXXXXXXXXXXXX','MCLXXXXXXXXXXXXXXXXXXXXXXXXX',true);

//before contentBody field ApexWrapper is unwrapped 
system.debug(res.contentBody); 

//unwrap contentBody field in res
Map<String,Object\> contentBody = (Map<String,Object\>)ConnectApi.ConnectUtilities.unwrapApexWrapper(res.contentBody);

//after contentBody field ApexWrapper is unwrapped, but image field still wrapped
system.debug(contentBody);

//before image field ApexWrapper is unwrapped 
system.debug(contentBody.get('Image')); 

//unwrap Image field in contentBody
Map<String,Object\> Image = (Map<String,Object\>)ConnectApi.ConnectUtilities.unwrapApexWrapper(contentBody.get('Image'));

//after image field ApexWrapper is unwrapped 
system.debug(Image); 

//replace wrapped primary\_image in contentBody with unwrapped version
contentBody.put('Image', Image);

//after contentBody field ApexWrapper is unwrapped, with image field also unwrapped
system.debug(contentBody);