Skip to main content
GET
/
journeys
/
{templateId}
/
templates
/
{notificationId}
/
content
JavaScript
import Courier from '@trycourier/courier';

const client = new Courier({
  apiKey: process.env['COURIER_API_KEY'], // This is the default and can be omitted
});

const notificationContentGetResponse = await client.journeys.templates.retrieveContent('x', {
  templateId: 'x',
});

console.log(notificationContentGetResponse.elements);
import os
from courier import Courier

client = Courier(
    api_key=os.environ.get("COURIER_API_KEY"),  # This is the default and can be omitted
)
notification_content_get_response = client.journeys.templates.retrieve_content(
    notification_id="x",
    template_id="x",
)
print(notification_content_get_response.elements)
package main

import (
	"context"
	"fmt"

	"github.com/trycourier/courier-go"
	"github.com/trycourier/courier-go/option"
)

func main() {
	client := courier.NewClient(
		option.WithAPIKey("My API Key"),
	)
	notificationContentGetResponse, err := client.Journeys.Templates.GetContent(
		context.TODO(),
		"x",
		courier.JourneyTemplateGetContentParams{
			TemplateID: "x",
		},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", notificationContentGetResponse.Elements)
}
package com.courier.example;

import com.courier.client.CourierClient;
import com.courier.client.okhttp.CourierOkHttpClient;
import com.courier.models.journeys.templates.TemplateRetrieveContentParams;
import com.courier.models.notifications.NotificationContentGetResponse;

public final class Main {
    private Main() {}

    public static void main(String[] args) {
        CourierClient client = CourierOkHttpClient.fromEnv();

        TemplateRetrieveContentParams params = TemplateRetrieveContentParams.builder()
            .templateId("x")
            .notificationId("x")
            .build();
        NotificationContentGetResponse notificationContentGetResponse = client.journeys().templates().retrieveContent(params);
    }
}
require "courier"

courier = Courier::Client.new(api_key: "My API Key")

notification_content_get_response = courier.journeys.templates.retrieve_content("x", template_id: "x")

puts(notification_content_get_response)
<?php

require_once dirname(__DIR__) . '/vendor/autoload.php';

use Courier\Client;
use Courier\Core\Exceptions\APIException;

$client = new Client(apiKey: getenv('COURIER_API_KEY') ?: 'My API Key');

try {
  $notificationContentGetResponse = $client
    ->journeys
    ->templates
    ->retrieveContent('x', templateID: 'x', version: 'version');

  var_dump($notificationContentGetResponse);
} catch (APIException $e) {
  echo $e->getMessage();
}
using System;
using TryCourier;
using TryCourier.Models.Journeys.Templates;

CourierClient client = new();

TemplateRetrieveContentParams parameters = new()
{
    TemplateID = "x",
    NotificationID = "x",
};

var notificationContentGetResponse = await client.Journeys.Templates.RetrieveContent(parameters);

Console.WriteLine(notificationContentGetResponse);
courier journeys:templates retrieve-content \
  --api-key 'My API Key' \
  --template-id x \
  --notification-id x
curl --request GET \
  --url https://api.courier.com/journeys/{templateId}/templates/{notificationId}/content \
  --header 'Authorization: Bearer <token>'
{
  "version": "2022-01-01",
  "elements": [
    {
      "id": "elem_channel_1",
      "type": "channel",
      "checksum": "abc123def456",
      "elements": [
        {
          "id": "elem_meta_1",
          "type": "meta",
          "checksum": "meta_abc123"
        },
        {
          "id": "elem_text_1",
          "type": "text",
          "checksum": "text_abc123"
        }
      ]
    }
  ]
}
{
  "message": "Example message text",
  "type": "invalid_request_error"
}
{
  "message": "Example message text",
  "type": "invalid_request_error"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

templateId
string
required

Journey id

Minimum string length: 1
notificationId
string
required

Notification template id

Minimum string length: 1

Query Parameters

version
string

Accepts draft, published, or a version string (e.g., v001). Defaults to published.

Response

Scoped notification content

Elemental content response for V2 templates. Contains versioned elements with content checksums.

version
string
required

Content version identifier.

Example:

"2022-01-01"

elements
ElementWithChecksums · object[]
required