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 deviceSet = await client.previews.retrieveDeviceSet('deviceSetId');
console.log(deviceSet.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
)
device_set = client.previews.retrieve_device_set(
"deviceSetId",
)
print(device_set.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"),
)
deviceSet, err := client.Previews.GetDeviceSet(context.TODO(), "deviceSetId")
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", deviceSet.ID)
}
package com.courier.example;
import com.courier.client.CourierClient;
import com.courier.client.okhttp.CourierOkHttpClient;
import com.courier.models.previews.DeviceSet;
import com.courier.models.previews.PreviewRetrieveDeviceSetParams;
public final class Main {
private Main() {}
public static void main(String[] args) {
CourierClient client = CourierOkHttpClient.fromEnv();
DeviceSet deviceSet = client.previews().retrieveDeviceSet("deviceSetId");
}
}require "courier"
courier = Courier::Client.new(api_key: "My API Key")
device_set = courier.previews.retrieve_device_set("deviceSetId")
puts(device_set)<?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 {
$deviceSet = $client->previews->retrieveDeviceSet('deviceSetId');
var_dump($deviceSet);
} catch (APIException $e) {
echo $e->getMessage();
}using System;
using TryCourier;
using TryCourier.Models.Previews;
CourierClient client = new();
PreviewRetrieveDeviceSetParams parameters = new()
{
DeviceSetID = "deviceSetId"
};
var deviceSet = await client.Previews.RetrieveDeviceSet(parameters);
Console.WriteLine(deviceSet);courier previews retrieve-device-set \
--api-key 'My API Key' \
--device-set-id deviceSetIdcurl --request GET \
--url https://api.courier.com/previews/device-sets/{deviceSetId} \
--header 'Authorization: Bearer <token>'{
"id": "<string>",
"name": "<string>",
"device_ids": [
"<string>"
],
"created_at": "<string>",
"updated_at": "<string>",
"archived_at": "<string>"
}{
"message": "<string>",
"type": "invalid_request_error"
}Previews
Get Device Set
Retrieve a preview set by ID. Archived sets return 404.
GET
/
previews
/
device-sets
/
{deviceSetId}
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 deviceSet = await client.previews.retrieveDeviceSet('deviceSetId');
console.log(deviceSet.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
)
device_set = client.previews.retrieve_device_set(
"deviceSetId",
)
print(device_set.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"),
)
deviceSet, err := client.Previews.GetDeviceSet(context.TODO(), "deviceSetId")
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", deviceSet.ID)
}
package com.courier.example;
import com.courier.client.CourierClient;
import com.courier.client.okhttp.CourierOkHttpClient;
import com.courier.models.previews.DeviceSet;
import com.courier.models.previews.PreviewRetrieveDeviceSetParams;
public final class Main {
private Main() {}
public static void main(String[] args) {
CourierClient client = CourierOkHttpClient.fromEnv();
DeviceSet deviceSet = client.previews().retrieveDeviceSet("deviceSetId");
}
}require "courier"
courier = Courier::Client.new(api_key: "My API Key")
device_set = courier.previews.retrieve_device_set("deviceSetId")
puts(device_set)<?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 {
$deviceSet = $client->previews->retrieveDeviceSet('deviceSetId');
var_dump($deviceSet);
} catch (APIException $e) {
echo $e->getMessage();
}using System;
using TryCourier;
using TryCourier.Models.Previews;
CourierClient client = new();
PreviewRetrieveDeviceSetParams parameters = new()
{
DeviceSetID = "deviceSetId"
};
var deviceSet = await client.Previews.RetrieveDeviceSet(parameters);
Console.WriteLine(deviceSet);courier previews retrieve-device-set \
--api-key 'My API Key' \
--device-set-id deviceSetIdcurl --request GET \
--url https://api.courier.com/previews/device-sets/{deviceSetId} \
--header 'Authorization: Bearer <token>'{
"id": "<string>",
"name": "<string>",
"device_ids": [
"<string>"
],
"created_at": "<string>",
"updated_at": "<string>",
"archived_at": "<string>"
}{
"message": "<string>",
"type": "invalid_request_error"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
The preview set to retrieve, identified by the id returned when it was created.
Response
A named, reusable list of preview devices.
Unique identifier for the device set.
Human-readable name.
The devices in this set, by PreviewDevice.id.
ISO-8601 timestamp of when the set was created.
ISO-8601 timestamp of when the set was last written.
ISO-8601 timestamp of when the set was archived. Present only on the archive response, which is the one place the state is observable.
⌘I