JavaScript
import Courier from '@trycourier/courier';
const client = new Courier({
apiKey: process.env['COURIER_API_KEY'], // This is the default and can be omitted
});
await client.notifications.archive('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
)
client.notifications.archive(
"id",
)package main
import (
"context"
"github.com/trycourier/courier-go"
"github.com/trycourier/courier-go/option"
)
func main() {
client := courier.NewClient(
option.WithAPIKey("My API Key"),
)
err := client.Notifications.Archive(context.TODO(), "id")
if err != nil {
panic(err.Error())
}
}package com.courier.example;
import com.courier.client.CourierClient;
import com.courier.client.okhttp.CourierOkHttpClient;
import com.courier.models.notifications.NotificationArchiveParams;
public final class Main {
private Main() {}
public static void main(String[] args) {
CourierClient client = CourierOkHttpClient.fromEnv();
client.notifications().archive("id");
}
}require "courier"
courier = Courier::Client.new(api_key: "My API Key")
result = courier.notifications.archive("id")
puts(result)<?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 {
$result = $client->notifications->archive('id');
var_dump($result);
} catch (APIException $e) {
echo $e->getMessage();
}using TryCourier;
using TryCourier.Models.Notifications;
CourierClient client = new();
NotificationArchiveParams parameters = new() { ID = "id" };
await client.Notifications.Archive(parameters);courier notifications archive \
--api-key 'My API Key' \
--id idcurl --request DELETE \
--url https://api.courier.com/notifications/{id} \
--header 'Authorization: Bearer <token>'{
"type": "invalid_request_error",
"message": "Notification template nt_01kx4kepxgfq9ty3r3wyf61n5t not found"
}Notification Templates
Archive Notification Template
Archive a notification template.
DELETE
/
notifications
/
{id}
JavaScript
import Courier from '@trycourier/courier';
const client = new Courier({
apiKey: process.env['COURIER_API_KEY'], // This is the default and can be omitted
});
await client.notifications.archive('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
)
client.notifications.archive(
"id",
)package main
import (
"context"
"github.com/trycourier/courier-go"
"github.com/trycourier/courier-go/option"
)
func main() {
client := courier.NewClient(
option.WithAPIKey("My API Key"),
)
err := client.Notifications.Archive(context.TODO(), "id")
if err != nil {
panic(err.Error())
}
}package com.courier.example;
import com.courier.client.CourierClient;
import com.courier.client.okhttp.CourierOkHttpClient;
import com.courier.models.notifications.NotificationArchiveParams;
public final class Main {
private Main() {}
public static void main(String[] args) {
CourierClient client = CourierOkHttpClient.fromEnv();
client.notifications().archive("id");
}
}require "courier"
courier = Courier::Client.new(api_key: "My API Key")
result = courier.notifications.archive("id")
puts(result)<?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 {
$result = $client->notifications->archive('id');
var_dump($result);
} catch (APIException $e) {
echo $e->getMessage();
}using TryCourier;
using TryCourier.Models.Notifications;
CourierClient client = new();
NotificationArchiveParams parameters = new() { ID = "id" };
await client.Notifications.Archive(parameters);courier notifications archive \
--api-key 'My API Key' \
--id idcurl --request DELETE \
--url https://api.courier.com/notifications/{id} \
--header 'Authorization: Bearer <token>'{
"type": "invalid_request_error",
"message": "Notification template nt_01kx4kepxgfq9ty3r3wyf61n5t not found"
}⌘I