1

I'm developing a cloud page for previewing emails by searching for their names. I use the /asset/v1/content/assets/query endpoint to search for the email name and retrieve the legacy ID needed for a subsequent call. The API call works well when searching for emails created by the parent Business Unit (BU). However, I also need to retrieve the legacy IDs of emails created by child BUs. These emails are shared with the parent BU and are located in a folder structure under a shared folder.

Currently, my query only searches for emails within the local folder. While specifying a specific folder to search in is an option, it's not practical as new folders are constantly being added to the shared folder structure.

How can I retrieve the legacy IDs of emails created by child BUs that are located in any folder under the shared BU (with the emails and folders shared with the parent BU)?

2 Answers 2

1

The below worked for me to fetch the Email created in a Child BU & shared with Parent BU.

Note that while generating the access token, ONLY upon using CHILD BU MID the email was fetched

{
    "grant_type": "client_credentials",
    "client_id": "{{et_clientId}}",
    "client_secret": "{{et_clientSecret}}",
    "account_id": "123567" // CHILD BU MID
}
curl --location 'https://zzz.rest.marketingcloudapis.com/asset/v1/content/assets/query' \
--header 'Content-Type: application/json' \
--data '{
    "page": {
        "page": 1,
        "pageSize": 50
    },
    "query": {
        "property": "id",
        "simpleOperator": "equals",
        "value": "61529"
    },
    "sort": [
        {
            "property": "id",
            "direction": "ASC"
        }
    ],
    "fields": [
        "enterpriseId",
        "memberId",
        "thumbnail",
        "category",
        "content",
        "data"
    ]
}'
1
  • Thank you for your time. I have tried this method, and it works. However, I was hoping to be able to fetch it using an access token with the parent MID.
    – Evelina
    Commented Jun 28 at 11:33
0

I've contacted SF support and received a solution for my issue. I'm sharing it here in case it helps anyone facing a similar problem.

"As I mentioned, the /asset/v1/content/assets/query endpoint's scope is limited to the specific Business Unit, which is why you couldn't retrieve the results for the shared content created in the other business unit

To access shared content created by different Business Units, you need to extend the endpoint to include shared content. We recommend adding ?scope=ours,shared to the endpoint:

asset/v1/content/assets/query?scope=ours,shared

This will allow you to retrieve content from shared assets created in different Business Units."

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .