Retrieve HTML of an asset

Overview

The get-html Ortto endpoint of the assets entity is used to retrieve the HTML of an asset and email details within Ortto’s customer data platform (CDP).

This will return for an asset:

  • The HTML
  • The from email
  • The from name
  • The subject
  • The preview text
  • The reply-to

This page provides descriptions of this endpoint’s:


HTTP method and request resource

POST https://api.ap3api.com/v1/assets/get-html

NOTE: Ortto customers who have their instance region set to Australia or Europe will need to use specific service endpoints relative to the region:

For example: https://api.eu.ap3api.com/v1/<entity/endpoint>

All other Ortto users will use the default service endpoint (https://api.ap3api.com/).


Path and query parameters

This endpoint takes no additional path and/or query parameters.


Headers

This endpoint requires a custom API key and content type (application/json for the request body) in the header of the request:

  • X-Api-Key: CUSTOM-PRIVATE-API-KEY
  • Content-Type: application/json

Request body

The request body consists of a JSON object whose valid elements are listed in the table below.

Example get HTML asset request body from Ortto's CDP

json

{ "asset_id": "63f3f1d0ae7e17e725033fe3" }

Valid request body elements

The following table lists all valid, optional request body elements that are available at this endpoint.

Element

Type

Description

asset_id

string

A string identifying the asset ID by their unique ID number.


Response payload

The following JSON object is an example of an assets HTML call that Ortto retrieves from your Ortto account’s CDP after a request to this endpoint.

NOTE: The response may vary based on the structure of your asset and it's HTML.

Due to the length of the response, the response below has been shortened but will contain content within the relevant sections when appropriate and the full HTML.

json

{ "html": "<full html>", "from_email":"emily+professional@ortto.com", "from_name":"", "subject":"Hi {{ people.first-name }}, welcome!", "preview":"", "reply_to":"" }

Response payload elements

The following table lists all elements (arrays, objects, or fields) in the response from a request to this endpoint.

Element

Type

Description

html

string

The full HTML and it's containing elements (head, title, body etc.).

from_email

string

The from email address the asset was set with.

from_name

string

The from name the asset was set with.

subject

string

The subject the asset was set with.

preview

string

The preview text the asset was set with.

reply_to

string

The reply to email address the asset was set with.


How to find asset IDs

NOTE: Only assets created in the asset manager will contain an asset ID.

If you create a campaign such as an email directly from the Campaigns navigation first, this will not include an asset ID to access.

To find the asset ID(s) for the asset_id element, follow these steps:

  1. Navigate to Marketing > Asset manager.
  2. Click on the asset you want to retrieve the ID for.
  3. Copy the asset ID from the URL.
Finding the asset ID in the URL.

NOTE: This can be used with an asset in a status of draft, unpublished changes and published.


A/B asset IDs

When an A/B campaign is published from an asset, the asset will be separated into asset name (Variant A) and asset name (Variant B).

Example of an A/B email asset with a Variant A and Variant B.

To access the correct ID, you can follow the same steps from how to find asset IDs but access the required variant to get its matching asset ID.