JavaScript
import Cerca from '@cerca-dev/sdk';
const client = new Cerca({
apiKey: process.env['CERCA_API_KEY'], // This is the default and can be omitted
});
// Automatically fetches more pages as needed.
for await (const webhookSubscription of client.webhooks.list('fleet_abc123')) {
console.log(webhookSubscription.id);
}import os
from cerca import Cerca
client = Cerca(
api_key=os.environ.get("CERCA_API_KEY"), # This is the default and can be omitted
)
page = client.webhooks.list(
fleet_id="fleet_abc123",
)
page = page.subscriptions[0]
print(page.id)package main
import (
"context"
"fmt"
"github.com/matrices/cerca-go"
"github.com/matrices/cerca-go/option"
)
func main() {
client := cercago.NewClient(
option.WithAPIKey("My API Key"),
)
page, err := client.Webhooks.List(
context.TODO(),
"fleet_abc123",
cercago.WebhookListParams{},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", page)
}require "cerca"
cerca = Cerca::Client.new(api_key: "My API Key")
page = cerca.webhooks.list("fleet_abc123")
puts(page)cerca webhooks list \
--api-key 'My API Key' \
--fleet-id fleet_abc123curl --request GET \
--url https://api.cerca.dev/fleets/{fleetId}/webhooks \
--header 'Authorization: Bearer <token>'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.cerca.dev/fleets/{fleetId}/webhooks",
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;
}HttpResponse<String> response = Unirest.get("https://api.cerca.dev/fleets/{fleetId}/webhooks")
.header("Authorization", "Bearer <token>")
.asString();{
"cursor": "<string>",
"hasMore": true,
"subscriptions": [
{
"createdAt": "<string>",
"enabled": true,
"fleetId": "<string>",
"events": [],
"id": "<string>",
"updatedAt": "<string>",
"url": "<string>"
}
]
}{
"error": "<string>",
"code": "MONTHLY_TOKEN_BUDGET_EXCEEDED"
}{
"error": "<string>",
"code": "MONTHLY_TOKEN_BUDGET_EXCEEDED"
}{
"error": "<string>",
"code": "MONTHLY_TOKEN_BUDGET_EXCEEDED"
}{
"error": "<string>",
"code": "MONTHLY_TOKEN_BUDGET_EXCEEDED"
}{
"error": "<string>",
"code": "MONTHLY_TOKEN_BUDGET_EXCEEDED"
}{
"error": "<string>",
"code": "MONTHLY_TOKEN_BUDGET_EXCEEDED"
}{
"error": "<string>",
"code": "MONTHLY_TOKEN_BUDGET_EXCEEDED"
}Webhooks
List webhooks
GET
/
fleets
/
{fleetId}
/
webhooks
JavaScript
import Cerca from '@cerca-dev/sdk';
const client = new Cerca({
apiKey: process.env['CERCA_API_KEY'], // This is the default and can be omitted
});
// Automatically fetches more pages as needed.
for await (const webhookSubscription of client.webhooks.list('fleet_abc123')) {
console.log(webhookSubscription.id);
}import os
from cerca import Cerca
client = Cerca(
api_key=os.environ.get("CERCA_API_KEY"), # This is the default and can be omitted
)
page = client.webhooks.list(
fleet_id="fleet_abc123",
)
page = page.subscriptions[0]
print(page.id)package main
import (
"context"
"fmt"
"github.com/matrices/cerca-go"
"github.com/matrices/cerca-go/option"
)
func main() {
client := cercago.NewClient(
option.WithAPIKey("My API Key"),
)
page, err := client.Webhooks.List(
context.TODO(),
"fleet_abc123",
cercago.WebhookListParams{},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", page)
}require "cerca"
cerca = Cerca::Client.new(api_key: "My API Key")
page = cerca.webhooks.list("fleet_abc123")
puts(page)cerca webhooks list \
--api-key 'My API Key' \
--fleet-id fleet_abc123curl --request GET \
--url https://api.cerca.dev/fleets/{fleetId}/webhooks \
--header 'Authorization: Bearer <token>'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.cerca.dev/fleets/{fleetId}/webhooks",
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;
}HttpResponse<String> response = Unirest.get("https://api.cerca.dev/fleets/{fleetId}/webhooks")
.header("Authorization", "Bearer <token>")
.asString();{
"cursor": "<string>",
"hasMore": true,
"subscriptions": [
{
"createdAt": "<string>",
"enabled": true,
"fleetId": "<string>",
"events": [],
"id": "<string>",
"updatedAt": "<string>",
"url": "<string>"
}
]
}{
"error": "<string>",
"code": "MONTHLY_TOKEN_BUDGET_EXCEEDED"
}{
"error": "<string>",
"code": "MONTHLY_TOKEN_BUDGET_EXCEEDED"
}{
"error": "<string>",
"code": "MONTHLY_TOKEN_BUDGET_EXCEEDED"
}{
"error": "<string>",
"code": "MONTHLY_TOKEN_BUDGET_EXCEEDED"
}{
"error": "<string>",
"code": "MONTHLY_TOKEN_BUDGET_EXCEEDED"
}{
"error": "<string>",
"code": "MONTHLY_TOKEN_BUDGET_EXCEEDED"
}{
"error": "<string>",
"code": "MONTHLY_TOKEN_BUDGET_EXCEEDED"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Minimum string length:
1Example:
"fleet_abc123"
Query Parameters
Opaque pagination cursor returned by a previous request.
Example:
"cursor_abc123"
Maximum number of items to return. Defaults to 20 and preserves parseInt semantics.
Example:
"20"
⌘I