> ## Documentation Index
> Fetch the complete documentation index at: https://www.courier.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Fetch the content of a journey-scoped notification template

> Returns the Elemental elements and version of a journey-scoped template's content. Compare versions to see what changed between publishes.



## OpenAPI

````yaml /openapi-specs/openapi.documented.yml get /journeys/{templateId}/templates/{notificationId}/content
openapi: 3.0.1
info:
  title: Courier
  description: The Courier REST API for sending and managing notifications across channels.
  version: 0.0.1
servers:
  - url: https://api.courier.com
    description: Production
security: []
paths:
  /journeys/{templateId}/templates/{notificationId}/content:
    get:
      tags:
        - Journeys
      summary: Fetch the content of a journey-scoped notification template
      description: >-
        Returns the Elemental elements and version of a journey-scoped
        template's content. Compare versions to see what changed between
        publishes.
      operationId: journeys_getTemplateContent
      parameters:
        - in: path
          name: templateId
          schema:
            type: string
            minLength: 1
          required: true
          description: Journey id
        - in: path
          name: notificationId
          schema:
            type: string
            minLength: 1
          required: true
          description: Notification template id
        - name: version
          in: query
          description: >-
            Accepts `draft`, `published`, or a version string (e.g., `v001`).
            Defaults to `published`.
          required: false
          schema:
            type: string
          examples:
            published:
              value: published
              summary: Current published version (default)
            draft:
              value: draft
              summary: Current draft version
            historical:
              value: v001
              summary: Specific historical version
      responses:
        '200':
          description: Scoped notification content
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotificationContentGetResponse'
              examples:
                Example1:
                  summary: Elemental content response
                  value:
                    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
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequest'
              examples:
                Example:
                  value:
                    message: Example message text
                    type: invalid_request_error
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFound'
              examples:
                Example:
                  value:
                    message: Example message text
                    type: invalid_request_error
      security:
        - BearerAuth: []
      x-codeSamples:
        - lang: JavaScript
          source: >-
            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);
        - lang: Python
          source: >-
            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)
        - lang: Go
          source: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/trycourier/courier-go\"\n\t\"github.com/trycourier/courier-go/option\"\n)\n\nfunc main() {\n\tclient := courier.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tnotificationContentGetResponse, err := client.Journeys.Templates.GetContent(\n\t\tcontext.TODO(),\n\t\t\"x\",\n\t\tcourier.JourneyTemplateGetContentParams{\n\t\t\tTemplateID: \"x\",\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", notificationContentGetResponse.Elements)\n}\n"
        - lang: Java
          source: >-
            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);
                }
            }
        - lang: Ruby
          source: >-
            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)
        - lang: PHP
          source: >-
            <?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();
            }
        - lang: C#
          source: >-
            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);
        - lang: CLI
          source: |-
            courier journeys:templates retrieve-content \
              --api-key 'My API Key' \
              --template-id x \
              --notification-id x
components:
  schemas:
    NotificationContentGetResponse:
      title: NotificationContentGetResponse
      type: object
      description: >-
        Elemental content response for V2 templates. Contains versioned elements
        with content checksums.
      properties:
        version:
          type: string
          description: Content version identifier.
          example: '2022-01-01'
        elements:
          type: array
          items:
            $ref: '#/components/schemas/ElementWithChecksums'
      required:
        - version
        - elements
    BadRequest:
      title: BadRequest
      type: object
      properties:
        type:
          type: string
          enum:
            - invalid_request_error
      required:
        - type
      allOf:
        - $ref: '#/components/schemas/BaseError'
    NotFound:
      title: NotFound
      type: object
      properties:
        type:
          type: string
          enum:
            - invalid_request_error
      required:
        - type
      allOf:
        - $ref: '#/components/schemas/BaseError'
    ElementWithChecksums:
      title: ElementWithChecksums
      type: object
      description: >-
        An element with its content checksum and optional nested elements and
        locale checksums.
      properties:
        id:
          type: string
        checksum:
          type: string
          description: MD5 hash of translatable content.
        type:
          type: string
          description: Element type (text, meta, action, etc.).
        elements:
          type: array
          items:
            $ref: '#/components/schemas/ElementWithChecksums'
          description: Nested child elements (for group-type elements).
        locales:
          type: object
          additionalProperties:
            type: object
            properties:
              checksum:
                type: string
            required:
              - checksum
          description: Locale-specific content with checksums.
      required:
        - checksum
        - type
      additionalProperties: true
    BaseError:
      title: BaseError
      type: object
      properties:
        message:
          type: string
          description: A message describing the error that occurred.
      required:
        - message
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer

````