0

I'm new to the Marketing Cloud API and have run into a problem in trying to associate an email asset with a campaign using the endpoint

/hub/v1/campaigns/{campaignID}/assets

as described here: https://developer.salesforce.com/docs/atlas.en-us.noversion.mc-apis.meta/mc-apis/associateAssetToCampaign.htm

The specific error is:

Error code: 10000
Message: A general error occurred while trying to associate assets
HTTP status code: 400

I created the campaign manually by logging into the SFMC console. The email asset itself was created via API using:

/asset/v1/content/assets

The type of email is "htmlemail" (type ID 208).

My payload to associate the email with the campaign is:

{
"ids": ["42886"],
"type": "EMAIL"
}  

...where 42886 is the email asset ID.

When I log into the console and manually associate the email with the campaign, and then (as a GET call) use

/hub/v1/campaigns/{CampaignID}/assets 

to retrieve all the assets in my campaign, I notice that the type is "CMS_ASSET", so I also tried using "CMS_ASSET" as the type in my call to associate the email with the campaign (using a new, unassociated email) but received the same error.

I also tried "htmlemail" as the type.

Note: This problem has the same symptoms as an unresolved question from three years ago (Cannot associate Asset to Campaign - REST API), although that one was described as a new problem that occurred in a previously working integration.

Many thanks in advance for any help anyone might be able to offer.

0

It turns out that the problem was the installed package didn't have the correct permission to write campaigns. Once the permission was fixed, the call worked.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.