salesforce-marketingcloud / FuelSDK-Python

FuelSDK for python
Other
126 stars 193 forks source link

accessing HTML from Content Builder emails #87

Open f4f343w4tcfwv4tz5tb5 opened 6 years ago

f4f343w4tcfwv4tz5tb5 commented 6 years ago

I have a simple scrip that downloads all of the HTML in our account and writes it to individual files. However, it doesn't seem to be able to access emails that are built in Content Builder. Will this functionality be added in the future?

tdsticks commented 6 years ago

You need to use the REST API for that, not SOAP. https://developer.salesforce.com/docs/atlas.en-us.mc-apis.meta/mc-apis/content-api.htm

f4f343w4tcfwv4tz5tb5 commented 6 years ago

Is there a flag for setting REST vs SOAP?

tdsticks commented 6 years ago

I believe it's more if the classes exist. The SDK already supports both REST and SOAP, just needs to have more of the REST calls added, like Asset.

Look at the objects.py file, line 57. They have some REST calls to the Campaign object in SFMC, but it looks like that's about it so far. So most likely you'll need to extend / add calls for the Asset REST calls (see my first comment). I've done this plenty of times with the PHP and Node SDK, though haven't done much Python writing as of late, which is a shame.

Try working with the Campaign class first and if that works for you, then add the other classes (REST calls) you need.

web20opensource commented 5 years ago

Someone can guide me more on how to interact with Content Builder using this FuelSDK python flavor?