v1.0.0
OpenAPI 3.1.0

Add a translation to a one-time send test group

US region

Client Libraries

Add a translation to a one-time send test group

Add a language variant to a specific A/B test group in a one-time send (referred to as a "newsletter" in our APIs). The new variant is a copy of the default template in the test group with the content you provide. The payload the endpoint accepts depends on the parent one-time send's channel type: if it's an email, the payload will be an email variant; if it's an SMS, the payload will be an SMS variant.

You cannot add language variants to a one-time send that has already been sent, or to one-time sends created with the drag-and-drop editor or Design Studio.

Path Parameters
  • newsletter_id
    Type: integer
    required

    The identifier of a one-time send.

  • test_group_id
    Type: string
    required

    The ID of the A/B test group.

Body
required
application/json
  • Add a language variant to a one-time send. The payload the endpoint accepts depends on the parent one-time send's channel type.

    Add a language variant to an email one-time send. Requires language, subject, and body.

    • body
      Type: string
      required

      The HTML body content for the variant.

    • language
      Type: string
      required

      The language tag for the new variant, e.g. es, fr, de.

    • subject
      Type: string
      required

      The subject line for the variant.

    • body_amp
      Type: string

      The AMP HTML body content for the variant.

    • body_plain
      Type: string

      The plaintext body content for the variant.

    • preheader_text
      Type: string

      The preheader text for the email variant.

Responses
  • application/json
  • 400

    The request is invalid. Possible reasons include: the one-time send has already been sent, the test group does not exist, or the one-time send uses Design Studio or drag-and-drop editor.

  • 404

    The one-time send does not exist.

  • 422

    Validation error. Possible reasons: language is missing, required content fields are missing for the channel type, or the language variant already exists.

  • application/json
Request Example for post/v1/newsletters/{newsletter_id}/test_group/{test_group_id}/language
{
  "body": "<html><body><h1>¡Hola!</h1></body></html>",
  "language": "es",
  "subject": "¡Hola, {{ customer.name }}!",
  "body_amp": "",
  "body_plain": "",
  "preheader_text": "Mira nuestras últimas novedades"
}
{
  "newsletter": {
    "content_ids": [
      45
    ],
    "created": 1481653919,
    "deduplicate_id": "128275:1484870424",
    "id": 128275,
    "name": "Weekly Product Update",
    "recipient_segment_ids": [
      42,
      99
    ],
    "sent_at": 1481653929,
    "subscription_topic_id": 5,
    "tags": [
      "Product Updates"
    ],
    "type": "email",
    "updated": 1481653929
  }
}