Skip to main content

TransactionalContentRetrieval v3.1

Transactional Content Retrieval is used to render a delivered transactional job or campaign.

Deprecated Versions​

(none)

Required Parameters​

ParameterDescription
ActionTransactionalContentRetrieval
AccountIdThe MessageGears account id to which this item belongs.
ApiKeyA secret key only known by you. Keep this key confidential.
OriginalRequestIdThe request id of the transactional job or campaign being retrieved

Response Values​

ParameterData TypeDescription
OriginalRequestIdStringThe request id of the retrieved content
FromAddressStringThe fully rendered From Address
FromNameStringThe fully rendered From Name
SubjectLineStringThe fully rendered Subject Line
TextContentStringThe fully rendered Text content
HtmlContentStringThe fully rendered HTML content
RecipientIdString(Optional) The recipient id of the recipient used to render the content
NameString(Optional) The name of the attached content
ContentTypeString(Optional) The content type of the attached content
CorrelationIdString(Optional) The correlation id of the content
JobCategoryString(Optional) The job category of the content

Programming Examples​

REST​

Request

https://api.messagegears.net/3.1/WebService  
?Action=TransactionalContentRetrieval
&AccountId=123456789
&ApiKey=8bb6118f8fd6935ad0876a3be34a717d32708ffd
&OriginalRequestId=t20815-868efa36-676c-46dc-a0ab-c24cad422621

Success Response

<TransactionalContent xmlns="http://messagegears.com/3.1/webService">  
<RequestId>n20915-44de2477-cd85-4d55-b906-2ca59d2d939d</RequestId>
<Result>REQUEST_SUCCESSFUL</Result>
<OriginalRequestId>t20815-868efa36-676c-46dc-a0ab-c24cad422621</OriginalRequestId>
<FromAddress>deliverability@messagegears.com</FromAddress>
<FromName>MessageGears</FromName>
<SubjectLine>MessageGears - Reliable Message Delivery</SubjectLine>
<TextContent></TextContent>
<HtmlContent>
<html>
<body>
<h1>MessageGears</h1>
<p>Reliable Message Delivery</p>
<p>Be sure to visit <a href="http://www.messagegears.com">www.messagegears.com</a> for more information.</p>
</body>
</html>
</HtmlContent>
<CorrelationId>CustomerPortal</CorrelationId>
<JobCategory></JobCategory>
<Attachments>
<Attachment>
<Name>Company Logo</Name>
<ContentType>image/png</ContentType>
</Attachment>
</Attachments>
</TransactionalContent>

Failure Response (Render Errors)

<TransactionalContent xmlns="http://messagegears.com/3.1/webService">  
<RequestId>n20915-fcfd3ada-bbf9-42cb-8b30-6b6c30690850</RequestId>
<Result>REQUEST_FAILED</Result>
<RenderErrors>
<RenderError>
<ErrorCode>com.messagegears.core.templating.TemplateMergeException</ErrorCode>
<ErrorMessage>Rendering Error; nested exception is freemarker.core.NonStringException: Error on line 1, column 14 in SUBJECT</ErrorMessage>
</RenderError>
</RenderErrors>
<OriginalRequestId>t20815-868efa36-676c-46dc-a0ab-c24cad422621</OriginalRequestId>
</TransactionalContent>

Java SDK​

Click here for more information on using the MessageGears Java SDK

package com.messagegears.sdk.examples;

import com.messagegears.sdk.MessageGearsClient;
import com.messagegears.sdk.MessageGearsProperties;
import com.messagegears.sdk.model.request.TransactionalContentRetrievalRequest;
import com.messagegears.sdk.output.ScreenWriter;
import com.messagegears.sdk.v3_1.TransactionalContent;

public class TransactionalContentRetrievalExample {

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 props = new MessageGearsProperties();
props.setMyMessageGearsAccountId(MY_MESSAGEGEARS_ACCOUNT_ID);
props.setMyMessageGearsApiKey(MY_MESSAGEGEARS_API_KEY);

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

TransactionalContentRetrievalRequest request = new TransactionalContentRetrievalRequest();
request.setOriginalRequestId("t20815-868efa36-676c-46dc-a0ab-c24cad422621");

TransactionalContent response = client.transactionalContentRetrieval(request);

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

C# SDK​

Click here for more information on using the MessageGears .Net SDK

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

namespace MessageGears.Examples
{
public class TransactionalContentRetrievalExample
{
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 MessageGears client object
MessageGearsClient client = new MessageGearsClient(props);

TransactionalContentRetrievalRequest request = new TransactionalContentRetrievalRequest();
request.OriginalRequestId = "t20815-868efa36-676c-46dc-a0ab-c24cad422621";
TransactionalContentRetrievalResponse response = client.TransactionalContentRetrieval(request);

// Print the result
client.PrintResponse(response);
}
}
}