List physical-mail letters (paginated)
curl --request GET \
--url https://api.dairo.app/v1/letters \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.dairo.app/v1/letters"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.dairo.app/v1/letters', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.dairo.app/v1/letters",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.dairo.app/v1/letters"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.dairo.app/v1/letters")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.dairo.app/v1/letters")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"object": "list",
"data": [
{
"object": "letter",
"id": "<string>",
"status": "draft",
"fileName": "<string>",
"pageCount": 123,
"to": {
"country": "<string>",
"name": "<string>",
"company": "<string>",
"street": "<string>",
"houseNumber": "<string>",
"poBox": "<string>",
"addressLine2": "<string>",
"postalCode": "<string>",
"city": "<string>"
},
"from": {
"country": "<string>",
"name": "<string>",
"company": "<string>",
"street": "<string>",
"houseNumber": "<string>",
"poBox": "<string>",
"addressLine2": "<string>",
"postalCode": "<string>",
"city": "<string>"
},
"print": {
"mode": "color",
"sides": "simplex",
"addressPlacement": "left"
},
"delivery": "economy",
"paperTypes": [
"standard"
],
"autoSend": true,
"price": {
"currency": "<string>",
"amount": 123
},
"trackingNumber": "<string>",
"metadata": {},
"lastEventType": "<string>",
"lastEventAt": "2023-11-07T05:31:56Z",
"submittedAt": "2023-11-07T05:31:56Z",
"canceledAt": "2023-11-07T05:31:56Z",
"error": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"events": [
{
"object": "letter_event",
"eventId": "<string>",
"type": "<string>",
"letterId": "<string>",
"code": "<string>",
"description": "<string>",
"producer": "<string>",
"location": "<string>",
"hasImage": true,
"occurredAt": "2023-11-07T05:31:56Z",
"recordedAt": "2023-11-07T05:31:56Z"
}
],
"paymentSlip": "qr",
"dryRun": true,
"notifications": true,
"payment": {
"type": "qr",
"creditor": {
"name": "<string>",
"iban": "<string>",
"country": "<string>",
"bic": "<string>",
"street": "<string>",
"houseNumber": "<string>",
"postalCode": "<string>",
"city": "<string>"
},
"amount": 123,
"currency": "CHF",
"reference": "<string>",
"message": "<string>",
"debtor": {
"name": "<string>",
"street": "<string>",
"houseNumber": "<string>",
"postalCode": "<string>",
"city": "<string>",
"country": "<string>"
}
},
"undeliverableReason": "<string>",
"batchId": "<string>"
}
],
"pagination": {
"nextCursor": "<string>"
}
}{
"error": {
"message": "<string>",
"code": "<string>",
"type": "<string>",
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"code": "<string>",
"type": "<string>",
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"code": "<string>",
"type": "<string>",
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"code": "<string>",
"type": "<string>",
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"code": "<string>",
"type": "<string>",
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"code": "<string>",
"type": "<string>",
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"code": "<string>",
"type": "<string>",
"param": "<string>"
}
}Letters
List physical-mail letters
List physical-mail letters (paginated)
GET
/
v1
/
letters
List physical-mail letters (paginated)
curl --request GET \
--url https://api.dairo.app/v1/letters \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.dairo.app/v1/letters"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.dairo.app/v1/letters', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.dairo.app/v1/letters",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.dairo.app/v1/letters"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.dairo.app/v1/letters")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.dairo.app/v1/letters")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"object": "list",
"data": [
{
"object": "letter",
"id": "<string>",
"status": "draft",
"fileName": "<string>",
"pageCount": 123,
"to": {
"country": "<string>",
"name": "<string>",
"company": "<string>",
"street": "<string>",
"houseNumber": "<string>",
"poBox": "<string>",
"addressLine2": "<string>",
"postalCode": "<string>",
"city": "<string>"
},
"from": {
"country": "<string>",
"name": "<string>",
"company": "<string>",
"street": "<string>",
"houseNumber": "<string>",
"poBox": "<string>",
"addressLine2": "<string>",
"postalCode": "<string>",
"city": "<string>"
},
"print": {
"mode": "color",
"sides": "simplex",
"addressPlacement": "left"
},
"delivery": "economy",
"paperTypes": [
"standard"
],
"autoSend": true,
"price": {
"currency": "<string>",
"amount": 123
},
"trackingNumber": "<string>",
"metadata": {},
"lastEventType": "<string>",
"lastEventAt": "2023-11-07T05:31:56Z",
"submittedAt": "2023-11-07T05:31:56Z",
"canceledAt": "2023-11-07T05:31:56Z",
"error": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"events": [
{
"object": "letter_event",
"eventId": "<string>",
"type": "<string>",
"letterId": "<string>",
"code": "<string>",
"description": "<string>",
"producer": "<string>",
"location": "<string>",
"hasImage": true,
"occurredAt": "2023-11-07T05:31:56Z",
"recordedAt": "2023-11-07T05:31:56Z"
}
],
"paymentSlip": "qr",
"dryRun": true,
"notifications": true,
"payment": {
"type": "qr",
"creditor": {
"name": "<string>",
"iban": "<string>",
"country": "<string>",
"bic": "<string>",
"street": "<string>",
"houseNumber": "<string>",
"postalCode": "<string>",
"city": "<string>"
},
"amount": 123,
"currency": "CHF",
"reference": "<string>",
"message": "<string>",
"debtor": {
"name": "<string>",
"street": "<string>",
"houseNumber": "<string>",
"postalCode": "<string>",
"city": "<string>",
"country": "<string>"
}
},
"undeliverableReason": "<string>",
"batchId": "<string>"
}
],
"pagination": {
"nextCursor": "<string>"
}
}{
"error": {
"message": "<string>",
"code": "<string>",
"type": "<string>",
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"code": "<string>",
"type": "<string>",
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"code": "<string>",
"type": "<string>",
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"code": "<string>",
"type": "<string>",
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"code": "<string>",
"type": "<string>",
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"code": "<string>",
"type": "<string>",
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"code": "<string>",
"type": "<string>",
"param": "<string>"
}
}Authorizations
Dairo API key, e.g. dairo_test_... or dairo_live_...
Query Parameters
Required range:
1 <= x <= 100Available options:
draft, queued, processing, printable, submitted, in_transit, delivered, undeliverable, canceled, failed Filter to the member letters of one batch (the id returned by POST /v1/letters/batches).