Transactional Content Retrieval v3.1

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

Required Parameters

Parameter Personalizable Description
Action TransactionalContentRetrieval
AccountId The MessageGears account id to which this item belongs.
ApiKey A secret key only known by you. Keep this key confidential.
OriginalRequestId The request id of the transactional job or campaign being retrieved

Response Values

Parameter Data Type Description
OriginalRequestId String The request id of the retrieved content
FromAddress String The fully rendered From Address
FromName String The fully rendered From Name
SubjectLine String The fully rendered Subject Line
TextContent String The fully rendered Text content
HtmlContent String The fully rendered HTML content
RecipientId String (Optional) The recipient id of the recipient used to render the content
Name String (Optional) The name of the attached content
ContentType String (Optional) The content type of the attached content
CorrelationId String (Optional) The correlation id of the content
JobCategory String (Optional) The job category of the content

Programming Examples

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 (Rendering 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
        </RenderError>
    </RenderErrors>
    <OriginalRequestId>t20815-868efa36-676c-46dc-a0ab-c24cad422621</OriginalRequestId>
</TransactionalContent>

Click here to see more details about using the MessageGears Java SDK
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
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);
    }
}
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);
    }
}

Click here to see more details about using the MessageGears .Net SDK
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
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);
        }
    }
}
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);
 		}
 	}
}