How to send local images with html using API?

Is there a way to send images with html using API?
I’m creating campaign using API method (in C#): http://api.createsend.com/api/v3/campaigns/{clientid}.{xml|json}.
As parameter it takes
"HtmlUrl": "http://example.com/campaigncontent/index.html",
"TextUrl": "http://example.com/campaigncontent/index.txt".
Using this method I can only include aspx or html page. But how am I to include local images (I mean situation when I have in my html: <img src=’pict.jpg’/>) ? Is this possible? Or I have to put them on some server to be available online and refer to them in html as <img src=’http://myserver.pict.jpg’>?
Is there a way to send zip file containing html and my local images using API methods? It’s definitely possible using Campaign Monitor interface, but can I do it using API? That would work for me just fine.

Thanks in advance.

Carissa Carissa, 4 years ago

Hi Patrycja! To use an image in your HTML via the API, you will need to place the image on your site, include its address in an HTML file, and then place that HTML file on your site. Local files, zipped or otherwise, won't work with the API. You can only import local files through the app, sorry!


Carissa
Campaign Monitor
Patrycja, 4 years ago

Thank you very much for information.
Could you tell me where on your site I can place images and html? What about css file? Is there some kind upload mechanism, which lets me to point my html and images files and after upload it gives me http address to this files?

roshodgekiss roshodgekiss, 4 years ago

Hi Patrycja, as Carissa mentioned, you will need to host the images, html and CSS files on your own servers when creating a campaign via the API. During the campaign import process, we'll make the CSS inline.

After import, a campaign ID is returned, which you can use to access your campaign. Alternately, you can get the PreviewURL for your campaign using our drafts API method.

Thanks, Patrycja - let us know if you have any questions about this :)


Get in touch with us on Twitter: http://twitter.com/campaignmonitor
We're also on Facebook: http://facebook.com/campaignmonitor

Join 200,000 companies around the world that use Campaign Monitor to run email marketing campaigns that deliver results for their business.

Get started for free
1-888-533-8098