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 journeyTemplateGetResponse = await client.journeys.templates.retrieve('x', {
templateId: 'x',
});
console.log(journeyTemplateGetResponse.id);import os
from courier import Courier
client = Courier(
api_key=os.environ.get("COURIER_API_KEY"), # This is the default and can be omitted
)
journey_template_get_response = client.journeys.templates.retrieve(
notification_id="x",
template_id="x",
)
print(journey_template_get_response.id)package main
import (
"context"
"fmt"
"github.com/trycourier/courier-go/v4"
"github.com/trycourier/courier-go/v4/option"
)
func main() {
client := courier.NewClient(
option.WithAPIKey("My API Key"),
)
journeyTemplateGetResponse, err := client.Journeys.Templates.Get(
context.TODO(),
"x",
courier.JourneyTemplateGetParams{
TemplateID: "x",
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", journeyTemplateGetResponse.ID)
}
package com.courier.example;
import com.courier.client.CourierClient;
import com.courier.client.okhttp.CourierOkHttpClient;
import com.courier.models.journeys.JourneyTemplateGetResponse;
import com.courier.models.journeys.templates.TemplateRetrieveParams;
public final class Main {
private Main() {}
public static void main(String[] args) {
CourierClient client = CourierOkHttpClient.fromEnv();
TemplateRetrieveParams params = TemplateRetrieveParams.builder()
.templateId("x")
.notificationId("x")
.build();
JourneyTemplateGetResponse journeyTemplateGetResponse = client.journeys().templates().retrieve(params);
}
}require "courier"
courier = Courier::Client.new(api_key: "My API Key")
journey_template_get_response = courier.journeys.templates.retrieve("x", template_id: "x")
puts(journey_template_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 {
$journeyTemplateGetResponse = $client->journeys->templates->retrieve(
'x', templateID: 'x'
);
var_dump($journeyTemplateGetResponse);
} catch (APIException $e) {
echo $e->getMessage();
}using System;
using TryCourier;
using TryCourier.Models.Journeys.Templates;
CourierClient client = new();
TemplateRetrieveParams parameters = new()
{
TemplateID = "x",
NotificationID = "x",
};
var journeyTemplateGetResponse = await client.Journeys.Templates.Retrieve(parameters);
Console.WriteLine(journeyTemplateGetResponse);courier journeys:templates retrieve \
--api-key 'My API Key' \
--template-id x \
--notification-id xcurl --request GET \
--url https://api.courier.com/journeys/{templateId}/templates/{notificationId} \
--header 'Authorization: Bearer <token>'{
"name": "Welcome email",
"tags": [],
"brand": null,
"subscription": null,
"content": {
"scope": "default",
"version": "2022-01-01",
"elements": []
}
}{
"message": "Example message text",
"type": "invalid_request_error"
}{
"message": "Example message text",
"type": "invalid_request_error"
}Journeys
Fetch a journey-scoped notification template by id
Returns a journey’s own notification template with its name, brand, subscription topic, and content. Defaults to the published version.
GET
/
journeys
/
{templateId}
/
templates
/
{notificationId}
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 journeyTemplateGetResponse = await client.journeys.templates.retrieve('x', {
templateId: 'x',
});
console.log(journeyTemplateGetResponse.id);import os
from courier import Courier
client = Courier(
api_key=os.environ.get("COURIER_API_KEY"), # This is the default and can be omitted
)
journey_template_get_response = client.journeys.templates.retrieve(
notification_id="x",
template_id="x",
)
print(journey_template_get_response.id)package main
import (
"context"
"fmt"
"github.com/trycourier/courier-go/v4"
"github.com/trycourier/courier-go/v4/option"
)
func main() {
client := courier.NewClient(
option.WithAPIKey("My API Key"),
)
journeyTemplateGetResponse, err := client.Journeys.Templates.Get(
context.TODO(),
"x",
courier.JourneyTemplateGetParams{
TemplateID: "x",
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", journeyTemplateGetResponse.ID)
}
package com.courier.example;
import com.courier.client.CourierClient;
import com.courier.client.okhttp.CourierOkHttpClient;
import com.courier.models.journeys.JourneyTemplateGetResponse;
import com.courier.models.journeys.templates.TemplateRetrieveParams;
public final class Main {
private Main() {}
public static void main(String[] args) {
CourierClient client = CourierOkHttpClient.fromEnv();
TemplateRetrieveParams params = TemplateRetrieveParams.builder()
.templateId("x")
.notificationId("x")
.build();
JourneyTemplateGetResponse journeyTemplateGetResponse = client.journeys().templates().retrieve(params);
}
}require "courier"
courier = Courier::Client.new(api_key: "My API Key")
journey_template_get_response = courier.journeys.templates.retrieve("x", template_id: "x")
puts(journey_template_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 {
$journeyTemplateGetResponse = $client->journeys->templates->retrieve(
'x', templateID: 'x'
);
var_dump($journeyTemplateGetResponse);
} catch (APIException $e) {
echo $e->getMessage();
}using System;
using TryCourier;
using TryCourier.Models.Journeys.Templates;
CourierClient client = new();
TemplateRetrieveParams parameters = new()
{
TemplateID = "x",
NotificationID = "x",
};
var journeyTemplateGetResponse = await client.Journeys.Templates.Retrieve(parameters);
Console.WriteLine(journeyTemplateGetResponse);courier journeys:templates retrieve \
--api-key 'My API Key' \
--template-id x \
--notification-id xcurl --request GET \
--url https://api.courier.com/journeys/{templateId}/templates/{notificationId} \
--header 'Authorization: Bearer <token>'{
"name": "Welcome email",
"tags": [],
"brand": null,
"subscription": null,
"content": {
"scope": "default",
"version": "2022-01-01",
"elements": []
}
}{
"message": "Example message text",
"type": "invalid_request_error"
}{
"message": "Example message text",
"type": "invalid_request_error"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Journey id
Minimum string length:
1Notification template id
Minimum string length:
1Response
Notification template
A journey-scoped notification template.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Available options:
DRAFT, PUBLISHED ⌘I