Query certificates with filtering, sorting and pagination
curl --request POST \
--url https://api.draftt.io/v1/certificates/query \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"pageSize": 20,
"filter": {
"status": {
"$eq": "active"
},
"expirationDate": {
"$gte": "2024-12-22T13:47:25.036Z"
}
},
"sort": {
"expirationDate": "asc"
},
"pageToken": "eyJ1bmlxdWVGaWVsZE5hbWUiOiJpZCIsInNvcnQiOnsiZXhwaXJhdGlvbkRhdGUiOnsiZGlyZWN0aW9uIjoiYXNjIn19fQ=="
}
'import requests
url = "https://api.draftt.io/v1/certificates/query"
payload = {
"pageSize": 20,
"filter": {
"status": { "$eq": "active" },
"expirationDate": { "$gte": "2024-12-22T13:47:25.036Z" }
},
"sort": { "expirationDate": "asc" },
"pageToken": "eyJ1bmlxdWVGaWVsZE5hbWUiOiJpZCIsInNvcnQiOnsiZXhwaXJhdGlvbkRhdGUiOnsiZGlyZWN0aW9uIjoiYXNjIn19fQ=="
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
pageSize: 20,
filter: {status: {$eq: 'active'}, expirationDate: {$gte: '2024-12-22T13:47:25.036Z'}},
sort: {expirationDate: 'asc'},
pageToken: 'eyJ1bmlxdWVGaWVsZE5hbWUiOiJpZCIsInNvcnQiOnsiZXhwaXJhdGlvbkRhdGUiOnsiZGlyZWN0aW9uIjoiYXNjIn19fQ=='
})
};
fetch('https://api.draftt.io/v1/certificates/query', 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.draftt.io/v1/certificates/query",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'pageSize' => 20,
'filter' => [
'status' => [
'$eq' => 'active'
],
'expirationDate' => [
'$gte' => '2024-12-22T13:47:25.036Z'
]
],
'sort' => [
'expirationDate' => 'asc'
],
'pageToken' => 'eyJ1bmlxdWVGaWVsZE5hbWUiOiJpZCIsInNvcnQiOnsiZXhwaXJhdGlvbkRhdGUiOnsiZGlyZWN0aW9uIjoiYXNjIn19fQ=='
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.draftt.io/v1/certificates/query"
payload := strings.NewReader("{\n \"pageSize\": 20,\n \"filter\": {\n \"status\": {\n \"$eq\": \"active\"\n },\n \"expirationDate\": {\n \"$gte\": \"2024-12-22T13:47:25.036Z\"\n }\n },\n \"sort\": {\n \"expirationDate\": \"asc\"\n },\n \"pageToken\": \"eyJ1bmlxdWVGaWVsZE5hbWUiOiJpZCIsInNvcnQiOnsiZXhwaXJhdGlvbkRhdGUiOnsiZGlyZWN0aW9uIjoiYXNjIn19fQ==\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.draftt.io/v1/certificates/query")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"pageSize\": 20,\n \"filter\": {\n \"status\": {\n \"$eq\": \"active\"\n },\n \"expirationDate\": {\n \"$gte\": \"2024-12-22T13:47:25.036Z\"\n }\n },\n \"sort\": {\n \"expirationDate\": \"asc\"\n },\n \"pageToken\": \"eyJ1bmlxdWVGaWVsZE5hbWUiOiJpZCIsInNvcnQiOnsiZXhwaXJhdGlvbkRhdGUiOnsiZGlyZWN0aW9uIjoiYXNjIn19fQ==\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.draftt.io/v1/certificates/query")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"pageSize\": 20,\n \"filter\": {\n \"status\": {\n \"$eq\": \"active\"\n },\n \"expirationDate\": {\n \"$gte\": \"2024-12-22T13:47:25.036Z\"\n }\n },\n \"sort\": {\n \"expirationDate\": \"asc\"\n },\n \"pageToken\": \"eyJ1bmlxdWVGaWVsZE5hbWUiOiJpZCIsInNvcnQiOnsiZXhwaXJhdGlvbkRhdGUiOnsiZGlyZWN0aW9uIjoiYXNjIn19fQ==\"\n}"
response = http.request(request)
puts response.read_body{
"nextPageToken": "eyJ1bmlxdWVGaWVsZE5hbWUiOiJpZCIsInNvcnQiOnsiZXhwaXJhdGlvbkRhdGUiOnsiZGlyZWN0aW9uIjoiYXNjIn19fQ==",
"items": [
{
"id": "12345",
"integrationId": "456",
"uniqueIdentifier": "cert-prod-web-2024",
"type": "ssl",
"status": "active",
"issuer": "Let's Encrypt Authority X3",
"keyAlgorithm": "RSA",
"renewalEligibility": "eligible",
"domainName": "example.com",
"domains": [
"example.com",
"www.example.com",
"api.example.com"
],
"inUseBy": [
"web-server-1",
"load-balancer-2"
],
"created": "2024-01-15T10:30:00.000Z",
"issuedAt": "2024-01-15T10:30:00.000Z",
"validityStartDate": "2024-01-15T10:30:00.000Z",
"expirationDate": "2024-04-15T10:30:00.000Z",
"dueDate": "2024-03-15T10:30:00.000Z",
"details": {
"serialNumber": "03E7B2B58A6E8B9C4D2F1A0E5C7B8D6F",
"signatureAlgorithm": "SHA256withRSA"
},
"createdAt": "2024-01-15T10:30:00.000Z",
"updatedAt": "2024-02-15T10:30:00.000Z",
"deletedAt": null,
"componentIds": [
789,
1234
],
"displayType": "SSL Certificate"
}
]
}{
"error": {
"message": "<string>"
}
}{
"error": {
"message": "<string>"
}
}{
"error": {
"message": "<string>"
}
}{
"error": {
"message": "<string>"
}
}{
"error": {
"message": "<string>"
}
}{
"error": {
"message": "<string>"
}
}Certificate
Query certificates with filtering, sorting and pagination
Query certificates with filtering, sorting and pagination
POST
/
certificates
/
query
Query certificates with filtering, sorting and pagination
curl --request POST \
--url https://api.draftt.io/v1/certificates/query \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"pageSize": 20,
"filter": {
"status": {
"$eq": "active"
},
"expirationDate": {
"$gte": "2024-12-22T13:47:25.036Z"
}
},
"sort": {
"expirationDate": "asc"
},
"pageToken": "eyJ1bmlxdWVGaWVsZE5hbWUiOiJpZCIsInNvcnQiOnsiZXhwaXJhdGlvbkRhdGUiOnsiZGlyZWN0aW9uIjoiYXNjIn19fQ=="
}
'import requests
url = "https://api.draftt.io/v1/certificates/query"
payload = {
"pageSize": 20,
"filter": {
"status": { "$eq": "active" },
"expirationDate": { "$gte": "2024-12-22T13:47:25.036Z" }
},
"sort": { "expirationDate": "asc" },
"pageToken": "eyJ1bmlxdWVGaWVsZE5hbWUiOiJpZCIsInNvcnQiOnsiZXhwaXJhdGlvbkRhdGUiOnsiZGlyZWN0aW9uIjoiYXNjIn19fQ=="
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
pageSize: 20,
filter: {status: {$eq: 'active'}, expirationDate: {$gte: '2024-12-22T13:47:25.036Z'}},
sort: {expirationDate: 'asc'},
pageToken: 'eyJ1bmlxdWVGaWVsZE5hbWUiOiJpZCIsInNvcnQiOnsiZXhwaXJhdGlvbkRhdGUiOnsiZGlyZWN0aW9uIjoiYXNjIn19fQ=='
})
};
fetch('https://api.draftt.io/v1/certificates/query', 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.draftt.io/v1/certificates/query",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'pageSize' => 20,
'filter' => [
'status' => [
'$eq' => 'active'
],
'expirationDate' => [
'$gte' => '2024-12-22T13:47:25.036Z'
]
],
'sort' => [
'expirationDate' => 'asc'
],
'pageToken' => 'eyJ1bmlxdWVGaWVsZE5hbWUiOiJpZCIsInNvcnQiOnsiZXhwaXJhdGlvbkRhdGUiOnsiZGlyZWN0aW9uIjoiYXNjIn19fQ=='
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.draftt.io/v1/certificates/query"
payload := strings.NewReader("{\n \"pageSize\": 20,\n \"filter\": {\n \"status\": {\n \"$eq\": \"active\"\n },\n \"expirationDate\": {\n \"$gte\": \"2024-12-22T13:47:25.036Z\"\n }\n },\n \"sort\": {\n \"expirationDate\": \"asc\"\n },\n \"pageToken\": \"eyJ1bmlxdWVGaWVsZE5hbWUiOiJpZCIsInNvcnQiOnsiZXhwaXJhdGlvbkRhdGUiOnsiZGlyZWN0aW9uIjoiYXNjIn19fQ==\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.draftt.io/v1/certificates/query")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"pageSize\": 20,\n \"filter\": {\n \"status\": {\n \"$eq\": \"active\"\n },\n \"expirationDate\": {\n \"$gte\": \"2024-12-22T13:47:25.036Z\"\n }\n },\n \"sort\": {\n \"expirationDate\": \"asc\"\n },\n \"pageToken\": \"eyJ1bmlxdWVGaWVsZE5hbWUiOiJpZCIsInNvcnQiOnsiZXhwaXJhdGlvbkRhdGUiOnsiZGlyZWN0aW9uIjoiYXNjIn19fQ==\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.draftt.io/v1/certificates/query")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"pageSize\": 20,\n \"filter\": {\n \"status\": {\n \"$eq\": \"active\"\n },\n \"expirationDate\": {\n \"$gte\": \"2024-12-22T13:47:25.036Z\"\n }\n },\n \"sort\": {\n \"expirationDate\": \"asc\"\n },\n \"pageToken\": \"eyJ1bmlxdWVGaWVsZE5hbWUiOiJpZCIsInNvcnQiOnsiZXhwaXJhdGlvbkRhdGUiOnsiZGlyZWN0aW9uIjoiYXNjIn19fQ==\"\n}"
response = http.request(request)
puts response.read_body{
"nextPageToken": "eyJ1bmlxdWVGaWVsZE5hbWUiOiJpZCIsInNvcnQiOnsiZXhwaXJhdGlvbkRhdGUiOnsiZGlyZWN0aW9uIjoiYXNjIn19fQ==",
"items": [
{
"id": "12345",
"integrationId": "456",
"uniqueIdentifier": "cert-prod-web-2024",
"type": "ssl",
"status": "active",
"issuer": "Let's Encrypt Authority X3",
"keyAlgorithm": "RSA",
"renewalEligibility": "eligible",
"domainName": "example.com",
"domains": [
"example.com",
"www.example.com",
"api.example.com"
],
"inUseBy": [
"web-server-1",
"load-balancer-2"
],
"created": "2024-01-15T10:30:00.000Z",
"issuedAt": "2024-01-15T10:30:00.000Z",
"validityStartDate": "2024-01-15T10:30:00.000Z",
"expirationDate": "2024-04-15T10:30:00.000Z",
"dueDate": "2024-03-15T10:30:00.000Z",
"details": {
"serialNumber": "03E7B2B58A6E8B9C4D2F1A0E5C7B8D6F",
"signatureAlgorithm": "SHA256withRSA"
},
"createdAt": "2024-01-15T10:30:00.000Z",
"updatedAt": "2024-02-15T10:30:00.000Z",
"deletedAt": null,
"componentIds": [
789,
1234
],
"displayType": "SSL Certificate"
}
]
}{
"error": {
"message": "<string>"
}
}{
"error": {
"message": "<string>"
}
}{
"error": {
"message": "<string>"
}
}{
"error": {
"message": "<string>"
}
}{
"error": {
"message": "<string>"
}
}{
"error": {
"message": "<string>"
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Show child attributes
Show child attributes
If empty - will return all fields, if passed will only return selected field
Available options:
id, integrationId, uniqueIdentifier, type, status, issuer, keyAlgorithm, renewalEligibility, domainName, domains, inUseBy, created, issuedAt, validityStartDate, expirationDate, dueDate, details, createdAt, updatedAt, deletedAt, componentIds Optional sorting options, if not passed will sort by creation date in ascending order, sorting by a non-unique value will sub-sort by a creation date in ascending order
Show child attributes
Show child attributes
Base64 token for pagination
Number of items to return per page
Required range:
1 <= x <= 1000