Skip to main content
GET
/
translations
/
{domain}
/
{locale}
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 translation = await client.translations.retrieve('locale', { domain: 'domain' });

console.log(translation);
import os
from courier import Courier

client = Courier(
api_key=os.environ.get("COURIER_API_KEY"), # This is the default and can be omitted
)
translation = client.translations.retrieve(
locale="locale",
domain="domain",
)
print(translation)
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"),
)
translation, err := client.Translations.Get(
context.TODO(),
"locale",
courier.TranslationGetParams{
Domain: "domain",
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", translation)
}
package com.courier.example;

import com.courier.client.CourierClient;
import com.courier.client.okhttp.CourierOkHttpClient;
import com.courier.models.translations.TranslationRetrieveParams;

public final class Main {
private Main() {}

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

TranslationRetrieveParams params = TranslationRetrieveParams.builder()
.domain("domain")
.locale("locale")
.build();
String translation = client.translations().retrieve(params);
}
}
require "courier"

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

translation = courier.translations.retrieve("locale", domain: "domain")

puts(translation)
<?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 {
$translation = $client->translations->retrieve('locale', domain: 'domain');

var_dump($translation);
} catch (APIException $e) {
echo $e->getMessage();
}
using System;
using TryCourier;
using TryCourier.Models.Translations;

CourierClient client = new();

TranslationRetrieveParams parameters = new()
{
Domain = "domain",
Locale = "locale",
};

var translation = await client.Translations.Retrieve(parameters);

Console.WriteLine(translation);
courier translations retrieve \
--api-key 'My API Key' \
--domain domain \
--locale locale
curl --request GET \
--url https://api.courier.com/translations/{domain}/{locale} \
--header 'Authorization: Bearer <token>'
"string"
{
"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

domain
string
required

The domain you want to retrieve translations for. Only default is supported at the moment

locale
string
required

The locale you want to retrieve the translations for

Response

.po file translation content

The response is of type string.