Hi All,
Bit stumped on creating a campaign using a template in an API call.
I’m working with a python script in order to create and populate emails using a CSV. If possible id prefer the campaigns be created in the platform rather then sent.
Using the script I’m able to create campaigns, however, the template is not being populated. Rather, the tags just remain.
using test request here:
I find I’m having the same issue. Campaign created but no populating the template.
The sample request can be found below and the template I’m using is simply
{{params.APIR}}}}
curl --request POST
–url https://api.brevo.com/v3/emailCampaigns
–header ‹ accept: application/json ›
–header ‹ api-key: [redacted but correct] ›
–header ‹ content-type: application/json ›
–data ’
{
« sender »: {
« name »: « [redacted but correct] »,
« email »: « [redacted but correct] »
},
« inlineImageActivation »: false,
« params »: {
« APIR »: « 2345 »
},
« sendAtBestTime »: false,
« abTesting »: false,
« ipWarmupEnable »: false,
« name »: « test »,
« templateId »: 216,
« subject »: « test »,
« previewText »: « test »
}
’
I’m clearly missing something and id much appreciate if anyone had some insight into what’s happening!
Hi @OliverK , just to rule out it’s an SDK issue, have you tried to do this as a curl request?
curl --request POST \
--url https://api.brevo.com/v3/emailCampaigns \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '
{
"inlineImageActivation": false,
"params": {
"fname": "Mike"
},
"sendAtBestTime": false,
"abTesting": false,
"ipWarmupEnable": false
}
'
1 « J'aime »
Hi Mauricio,
Thanks for the response, unfortunately the curl request below results in the same issue.
An email is successfully created where the sender, subject and preview text are all correct. The design leverages the correct template but {{params.APIR}}
remains on the email and is not populated by the params given, in this case 2345.
Is it that populating a template in this way is not supported by brevo? and id be best to format the email using html instead?
Also apologies for my poor formatting earlier!
curl --request POST \
--url https://api.brevo.com/v3/emailCampaigns \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--header 'api-key: ~~' \
--data '
{
"sender": {
"name": "~~",
"email": "~~"
"inlineImageActivation": false,
"params": {
"APIR": "2345"
},
"sendAtBestTime": false,
"abTesting": false,
"ipWarmupEnable": false
"name": "test",
"templateId": 216,
"subject": "test",
"previewText": "test"
}
'
Thanks again!