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 response = await client.messages.resend('message_id');
console.log(response.messageId);import os
from courier import Courier
client = Courier(
api_key=os.environ.get("COURIER_API_KEY"), # This is the default and can be omitted
)
response = client.messages.resend(
"message_id",
)
print(response.message_id)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"),
)
response, err := client.Messages.Resend(context.TODO(), "message_id")
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response.MessageID)
}
package com.courier.example;
import com.courier.client.CourierClient;
import com.courier.client.okhttp.CourierOkHttpClient;
import com.courier.models.messages.MessageResendParams;
import com.courier.models.messages.MessageResendResponse;
public final class Main {
private Main() {}
public static void main(String[] args) {
CourierClient client = CourierOkHttpClient.fromEnv();
MessageResendResponse response = client.messages().resend("message_id");
}
}require "courier"
courier = Courier::Client.new(api_key: "My API Key")
response = courier.messages.resend("message_id")
puts(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 {
$response = $client->messages->resend('message_id');
var_dump($response);
} catch (APIException $e) {
echo $e->getMessage();
}using System;
using TryCourier;
using TryCourier.Models.Messages;
CourierClient client = new();
MessageResendParams parameters = new() { MessageID = "message_id" };
var response = await client.Messages.Resend(parameters);
Console.WriteLine(response);courier messages resend \
--api-key 'My API Key' \
--message-id message_idcurl --request POST \
--url https://api.courier.com/messages/{message_id}/resend \
--header 'Authorization: Bearer <token>'{
"messageId": "1-5e2b2615-05efbb3acab9172f88dd3f6f"
}{
"message": "Message with ID <id> is not supported for resend.",
"type": "invalid_request_error"
}{
"message": "Example message text",
"type": "invalid_request_error"
}{
"message": "Too Many Requests",
"type": "rate_limit_error"
}Messages
Resend message
Resends a previously sent message to the same recipient and content, returning a new messageId. The original send request is not modified.
POST
/
messages
/
{message_id}
/
resend
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 response = await client.messages.resend('message_id');
console.log(response.messageId);import os
from courier import Courier
client = Courier(
api_key=os.environ.get("COURIER_API_KEY"), # This is the default and can be omitted
)
response = client.messages.resend(
"message_id",
)
print(response.message_id)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"),
)
response, err := client.Messages.Resend(context.TODO(), "message_id")
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response.MessageID)
}
package com.courier.example;
import com.courier.client.CourierClient;
import com.courier.client.okhttp.CourierOkHttpClient;
import com.courier.models.messages.MessageResendParams;
import com.courier.models.messages.MessageResendResponse;
public final class Main {
private Main() {}
public static void main(String[] args) {
CourierClient client = CourierOkHttpClient.fromEnv();
MessageResendResponse response = client.messages().resend("message_id");
}
}require "courier"
courier = Courier::Client.new(api_key: "My API Key")
response = courier.messages.resend("message_id")
puts(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 {
$response = $client->messages->resend('message_id');
var_dump($response);
} catch (APIException $e) {
echo $e->getMessage();
}using System;
using TryCourier;
using TryCourier.Models.Messages;
CourierClient client = new();
MessageResendParams parameters = new() { MessageID = "message_id" };
var response = await client.Messages.Resend(parameters);
Console.WriteLine(response);courier messages resend \
--api-key 'My API Key' \
--message-id message_idcurl --request POST \
--url https://api.courier.com/messages/{message_id}/resend \
--header 'Authorization: Bearer <token>'{
"messageId": "1-5e2b2615-05efbb3acab9172f88dd3f6f"
}{
"message": "Message with ID <id> is not supported for resend.",
"type": "invalid_request_error"
}{
"message": "Example message text",
"type": "invalid_request_error"
}{
"message": "Too Many Requests",
"type": "rate_limit_error"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
A unique identifier representing the message ID of the original message to resend.
Response
The resend request was accepted. A brand-new send has been enqueued and its messageId is returned in the response body.
The new message id for the resent message. It is distinct from the id of the original message that was resent.
Example:
"1-5e2b2615-05efbb3acab9172f88dd3f6f"
⌘I