0

I am able to create email send definitions through SOAP API but not through REST API.

  • Through SOAP API I can only create definitions having classic emails and not content builder emails.

  • Through Rest API I get response code 201. But it doesn't come up in the marketing Cloud UI.

------Rest API call example -----

payload = {
"definitionKey": "APISenddef",
"status": "Active",
"name": "RestAPI_senddef",
"description": "Created via REST",
"classification": "Default Transactional",
"content": {
"customerKey": "3f2d2031-5b3b-4d89-bbfd-f9c40294e9fb"
},
"subscriptions": {
"list": "TestList",
"autoAddSubscriber": True,
"updateSubscriber": True
},
"options": {
"trackLinks": True,
}
}

endpoint = base_api_url + '/messaging/v1/email/definitions'

headers = {
'content-type' : 'application/json', 
'user-agent' : 'Sarthak', 
'authorization' : 
'Bearer ' + authToken}

r = requests.post(endpoint, data=json.dumps(payload), headers=headers)

I need to create email send definitions having content builder emails attached. . How to achieve this?

1

So the route POST /messaging/v1/email/definitions is for transactional messaging api, which is newer and doesn't have an UI yet. You would do all actions through the api.

Why are you unable to use Content Builder Emails within a SOAP Call? Content Builder emails also have an email ID, which you can see in the UI:

enter image description here

  • Thank you so much. I didn't know earlier that "legacy ID" of the content builder asset corresponds to ID of the email object when using SOAP. I am able to create it using SOAP. – Sarthak Chauhan Nov 21 '19 at 7:32

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.