Articles in this section

BulkCampaignSubmit v3.1

BulkCampaignSubmit is used to send a email message to a list of one or more recipients. There is no hard limit on the size of the list and millions of emails can be sent from a single invocation of this API. To use this API, you must create an XML file that contains a list of all the recipients and place it on an HTTP server where it can be retrieved by the MessageGears system. Then you make an API call and supply the URL where the recipient file is located along with the CampaignId of a promoted campaign. MessageGears will then retrieve the recipient file and perform a "mail merge" with the promoted Campaign content to generate the individual email messages.

Deprecated Versions

(none)

Required Parameters

Parameter Personalizable Description
Action   BulkCampaignSubmit
AccountId    The MessageGears account id to which this item belongs.
ApiKey    A secret key only known by you. Keep this key confidential.
CampaignId    The CampaignId of the campaign to be used to render the message. This Id is displayed when creating and promoting a campaign.
RecipientListXmlUrl    A URL pointing to a file that contains a list of recipient data. The file may be compressed using the "ZIP" or "GZIP" algorithms. Supported protocols are http, https, and Amazon S3 . The referenced file must have a ".xml" extension if uncompressed, ".zip" if compressed using ZIP, and ".gz" if compressed using Gzip.

Optional Parameters

Parameter Personalizable Description
ContextDataXml   This field is used to supply data to the template that is not directly related to the recipient. For example, this field could contain data about weekly airfare specials by city. The template could then select only the fares that originated from the same city as the recipients home. This helps make it easy to create templates with relevant data for each recipient.
NotificationEmailAddress    If this value is specified, any errors that are encountered in processing the job are emailed to this address. This can be very helpful for initial development and testing.
CorrelationId    This field allows you to supply your own job id. This Id will be returned with all reporting data (including the real-time data feed) and can make it much easier to match events coming out of MessageGears with the job they belong to in your own system.


Programming Examples

REST

Request

https://api.messagegears.net/3.1/WebService
?Action=BulkCampaignSubmit
&AccountId=123456789
&ApiKey=8bb6118f8fd6935ad0876a3be34a717d32708ffd
&CampaignId=22222222
&RecipientListXmlUrl=http://www.mycompany.com/file/WelcomeRecipients.xml

Response

<BulkJobSubmitResponse>
<RequestId>b23510-82279647-13fa-4930-8338-ec85988b6bed</RequestId>
<Result>REQUEST_SUCCESSFUL</Result>
</BulkJobSubmitResponse>

Java SDK

package com.messagegears.examples;

import com.messagegears.sdk.MessageGearsClient;
import com.messagegears.sdk.MessageGearsProperties;
import com.messagegears.sdk.model.request.BulkCampaignSubmitRequest;
import com.messagegears.sdk.output.ScreenWriter;
import com.messagegears.sdk.v3_1.BulkJobSubmitResponse;

public class BulkCampaignSubmit {
public static final String MY_EMAIL_ADDRESS = "place your email address here";
public static final String MY_MESSAGEGEARS_ACCOUNT_ID = "place your MessageGears account id here";
public static final String MY_MESSAGEGEARS_API_KEY = "place your MessageGears api key here";

public static void main(String[] args) {
// Create the properties object containing the necessary properties
MessageGearsProperties properties = new MessageGearsProperties();
properties.setMyMessageGearsAccountId(MY_MESSAGEGEARS_ACCOUNT_ID);
properties.setMyMessageGearsApiKey(MY_MESSAGEGEARS_API_KEY);

// Create the main client object
MessageGearsClient client = new MessageGearsClient(properties);

// Create a bulk campaign request
BulkCampaignSubmitRequest request = new BulkCampaignSubmitRequest();

// Set the URL where the recipient XML file can be retrieved
request.setRecipientListXmlUrl("http://www.mycompany.com/recipient.xml");

// Set the campaign id
request.setCampaignId(12345);

// Execute the request
BulkJobSubmitResponse response = client.bulkCampaignSubmit(request);

// Print the result (success or failure)
ScreenWriter.printResponse(response);
}

}

C# SDK

using System;
using MessageGears;
using MessageGears.Model;
using MessageGears.Model.Generated;

namespace MessageGears.Sample
{
public class BulkCampaignSample
{
// Replace this value with your email address
public const String MY_EMAIL_ADDRESS = "place your email address here";
public const String MY_MESSAGEGEARS_ACCOUNT_ID = "place your MessageGears account id here";
public const String MY_MESSAGEGEARS_API_KEY = "place your MessageGears api key here";

public static void Main ()
{
// Create the properties object containing the necessary properties
MessageGearsProperties props = new MessageGearsProperties();
props.MyMessageGearsAccountId = MY_MESSAGEGEARS_ACCOUNT_ID;
props.MyMessageGearsApiKey = MY_MESSAGEGEARS_API_KEY;

// Create the main client object
MessageGearsClient client = new MessageGearsClient(props);

// Create a bulk campaign request
BulkCampaignSubmitRequest request = new BulkCampaignSubmitRequest();

// Set the URL where the recipient XML file can be retrieved
request.RecipientListXmlUrl = "http://www.mycompany.com/recipient.xml";

// Set the campaign id
request.CampaignId = "12345";

// Execute the request
BulkJobSubmitResponse response = client.BulkCampaignSubmit(request);

// Print the result (success or failure)
client.PrintResponse(response);
}
}
}
Was this article helpful?
0 out of 0 found this helpful

Comments

0 comments

Article is closed for comments.