Skip to content

Latest commit

 

History

History
215 lines (146 loc) · 9.51 KB

EmailCampaignsABTestsApi.md

File metadata and controls

215 lines (146 loc) · 9.51 KB

OpenAPI\Client\EmailCampaignsABTestsApi

All URIs are relative to https://api.cc.email/v3, except if the operation defines another base path.

Method HTTP request Description
createEmailCampaignABTestUsingPOST() POST /emails/activities/{campaign_activity_id}/abtest POST (Create) an A/B Test for an Email Campaign Activity
deleteEmailCampaignABTestUsingDELETE() DELETE /emails/activities/{campaign_activity_id}/abtest DELETE an A/B Test for an Email Campaign Activity
retrieveEmailCampaignABTestUsingGET() GET /emails/activities/{campaign_activity_id}/abtest GET A/B Test Details for an Email Campaign Activity

createEmailCampaignABTestUsingPOST()

createEmailCampaignABTestUsingPOST($campaign_activity_id, $abtest): 'ConstantContact\Client\Model\ABTestData

POST (Create) an A/B Test for an Email Campaign Activity

Use this method to create a new A/B test for a primary email campaign activity. You must specify an alternative subject line, the percentage of contact to use for the A/B test, and the number of hours to wait after the A/B test is sent before determining the winning subject line. To create an A/B test, the campaign must have a current_status of DRAFT. When you create an A/B test, the type changes from Newsletter (code= 10) to A/B Test (code= 57).

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure OAuth2 access token for authorization: oauth2_access_code
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Configure API key authorization: api_key
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKey('x-api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('x-api-key', 'Bearer');

// Configure OAuth2 access token for authorization: oauth2_implicit
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new OpenAPI\Client\Api\EmailCampaignsABTestsApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$campaign_activity_id = 91569d46-00e4-4a4d-9a4c-d17d98740d04; // string | The unique ID for the primary email campaign activity.
$abtest = new 'ConstantContact\Client\Model\ABTestData(); // 'ConstantContact\Client\Model\ABTestData | Specify the `alternative_subject` line, `test_size` percentage of contacts (value must from `5` to `50` inclusively), and the `winner_wait_duration` (value must be `6`, `12`, `24`, or `48` hours).

try {
    $result = $apiInstance->createEmailCampaignABTestUsingPOST($campaign_activity_id, $abtest);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling EmailCampaignsABTestsApi->createEmailCampaignABTestUsingPOST: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
campaign_activity_id string The unique ID for the primary email campaign activity.
abtest \OpenAPI\Client\Model\ABTestData Specify the `alternative_subject` line, `test_size` percentage of contacts (value must from `5` to `50` inclusively), and the `winner_wait_duration` (value must be `6`, `12`, `24`, or `48` hours).

Return type

\OpenAPI\Client\Model\ABTestData

Authorization

oauth2_access_code, api_key, oauth2_implicit

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

deleteEmailCampaignABTestUsingDELETE()

deleteEmailCampaignABTestUsingDELETE($campaign_activity_id)

DELETE an A/B Test for an Email Campaign Activity

Deletes an A/B Test on an primary email campaign activity. You can only delete A/B tests that have a current_status of Draft. Deleting an A/B tests reverts the email campaign activity type from A/B Test (code= 57) back to NewsLetter (code= 10). Constant Contact uses the original subject line, rather than the alternate A/B test subject line, when an A/B test is deleted.

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure OAuth2 access token for authorization: oauth2_access_code
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Configure API key authorization: api_key
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKey('x-api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('x-api-key', 'Bearer');

// Configure OAuth2 access token for authorization: oauth2_implicit
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new OpenAPI\Client\Api\EmailCampaignsABTestsApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$campaign_activity_id = 91569d46-00e4-4a4d-9a4c-d17d98740d04; // string | The unique ID for the primary email campaign activity.

try {
    $apiInstance->deleteEmailCampaignABTestUsingDELETE($campaign_activity_id);
} catch (Exception $e) {
    echo 'Exception when calling EmailCampaignsABTestsApi->deleteEmailCampaignABTestUsingDELETE: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
campaign_activity_id string The unique ID for the primary email campaign activity.

Return type

void (empty response body)

Authorization

oauth2_access_code, api_key, oauth2_implicit

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

[Back to top] [Back to API list] [Back to Model list] [Back to README]

retrieveEmailCampaignABTestUsingGET()

retrieveEmailCampaignABTestUsingGET($campaign_activity_id): 'ConstantContact\Client\Model\ABTestData

GET A/B Test Details for an Email Campaign Activity

Use this method to get A/B test details for a primary email campaign activity, such as the alternate email subject line, the contact test percentage size, and the number of hours to wait to determine the winning subject line to use. Currently, A/B tests support subject line only.

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure OAuth2 access token for authorization: oauth2_access_code
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Configure API key authorization: api_key
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKey('x-api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('x-api-key', 'Bearer');

// Configure OAuth2 access token for authorization: oauth2_implicit
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new OpenAPI\Client\Api\EmailCampaignsABTestsApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$campaign_activity_id = 91569d46-00e4-4a4d-9a4c-d17d98740d04; // string | The unique ID for the primary email campaign activity.

try {
    $result = $apiInstance->retrieveEmailCampaignABTestUsingGET($campaign_activity_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling EmailCampaignsABTestsApi->retrieveEmailCampaignABTestUsingGET: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
campaign_activity_id string The unique ID for the primary email campaign activity.

Return type

\OpenAPI\Client\Model\ABTestData

Authorization

oauth2_access_code, api_key, oauth2_implicit

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]