Create campaign
v1
post
/1/newsletters/{domain}/campaigns
Create a campaign with the given parameters
Path parameters
domain
requiredinteger
Unique identifier of the Domain
Examples:45586
Body Parameters
application/jsoncontent_htmlstring
Examples:example
email_from_addrrequiredstring
Examples:example
email_from_namerequiredstring
Examples:example
force_sendedboolean
langrequiredstring
Possible values:de_DEen_GBes_ESfr_FRit_IT
Examples:de_DE
preheaderstring
Examples:example
recipientsobject
MaxLength:5
subjectrequiredstring
Examples:example
template_idinteger
Examples:61009
tracking_linkboolean
tracking_openingboolean
tracking_utmobject
unsub_linkboolean
Response Body
application/json
resultrequiredstring
Possible values:successerrorasynchronous
Result of the HTTP request
Examples:success
dataCampaign
Example request
<?php
use GuzzleHttp\Client;
$client = new Client();
$headers = [
'Authorization' => 'Bearer YOUR-TOKEN-HERE',
'Content-Type' => 'application/json'
];
$body = '{
"email_from_addr": "example",
"email_from_name": "example",
"lang": "de_DE",
"subject": "example"
}';
$request = new Request('POST', 'https://api.infomaniak.com/1/newsletters/{domain}/campaigns', $headers, $body);
$res = $client->sendAsync($request)->wait();
echo $res->getBody();
Example response
application/json
{"result":"success","data":{"id":78178,"status":"example","lang":"example","subject":"example","preheader":"example","email_from_name":"example","email_from_addr":"example","tracking_link":true,"tracking_opening":true,"tracking_utm":[],"next_step":"example","started_at":1731651924,"created_at":1731421916}}