Webhook'lar
Hizmet, fatura, sipariş ve talep olayları için imzalı HTTPS geri çağrıları.
#GET/cloud/webhooks
Webhook'ları listeleKapsam: webhookslistWebhooksBu işlemin OpenAPI parçası
Yanıtlar
| 200 | Webhooks — data: array<Webhook> |
Örnekler
curl -s 'https://www.gyrohosting.com/api/v1/client/cloud/webhooks' \
-H "Authorization: Bearer $GYRO_TOKEN"
# kaynak gyro_webhook: https://registry.terraform.io/providers/gyro-hosting/gyro/latest/docs/resources/webhook
resource "gyro_webhook" "ops" {
url = "https://hooks.example.com/gyro"
events = ["service.active", "service.suspended", "invoice.paid"]
}
output "webhook_secret" {
value = gyro_webhook.ops.secret
sensitive = true
}
import os, uuid, requests
h = {"Authorization": "Bearer " + os.environ["GYRO_TOKEN"]}
r = requests.get("https://www.gyrohosting.com/api/v1/client/cloud/webhooks", headers=h, timeout=60)
r.raise_for_status()
print(r.json()["data"])
const res = await fetch("https://www.gyrohosting.com/api/v1/client/cloud/webhooks", {
method: "GET",
headers: {
"Authorization": `Bearer ${process.env.GYRO_TOKEN}`,
},
});
const { data, error } = await res.json();
if (!res.ok) throw new Error(`${error.code}: ${error.message}`);
#POST/cloud/webhooks
Webhook oluştur (gizli anahtar bir kez döner)Kapsam: webhookscreateWebhookBu işlemin OpenAPI parçası
Teslimler POST JSON'dur; başlıklar X-Gyro-Event, X-Gyro-Delivery, X-Gyro-Timestamp ve X-Gyro-Signature: sha256=HMAC_SHA256(secret, timestamp + "." + body) (beyaz etiketli bayi: X-Webhook-*). Zaman damgası 5 dakikadan eskiyse reddedin. Tekrar: üstel geri çekilme, 8 deneme; 20 ardışık hata webhook'u kapatır.
İstek gövdesi
| Alan | Tür | Açıklama |
|---|
url zorunlu | string | |
events | array<WebhookEvent> | empty = all |
description | string | |
customer_id | integer | Reseller main key only |
Yanıtlar
| 201 | Created (includes secret) — data: object |
| 422 | Validation or business rule failure (confirm_required, invalid_image, tool_action_failed ...) |
Örnekler
curl -s -X POST 'https://www.gyrohosting.com/api/v1/client/cloud/webhooks' \
-H "Authorization: Bearer $GYRO_TOKEN" \
-H "Content-Type: application/json" \
-d '{"url": "https://hooks.example.com/gyro", "events": ["service.active", "invoice.paid"]}'
gyro webhook create --help # tüm seçenekler
# kaynak gyro_webhook: https://registry.terraform.io/providers/gyro-hosting/gyro/latest/docs/resources/webhook
resource "gyro_webhook" "ops" {
url = "https://hooks.example.com/gyro"
events = ["service.active", "service.suspended", "invoice.paid"]
}
output "webhook_secret" {
value = gyro_webhook.ops.secret
sensitive = true
}
import os, uuid, requests
h = {"Authorization": "Bearer " + os.environ["GYRO_TOKEN"]}
r = requests.post("https://www.gyrohosting.com/api/v1/client/cloud/webhooks", headers=h, json={"url": "https://hooks.example.com/gyro", "events": ["service.active", "invoice.paid"]}, timeout=60)
r.raise_for_status()
print(r.json()["data"])
const res = await fetch("https://www.gyrohosting.com/api/v1/client/cloud/webhooks", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.GYRO_TOKEN}`,
"Content-Type": "application/json",
},
body: JSON.stringify({"url": "https://hooks.example.com/gyro", "events": ["service.active", "invoice.paid"]}),
});
const { data, error } = await res.json();
if (!res.ok) throw new Error(`${error.code}: ${error.message}`);
#GET/cloud/webhooks/{id}
Webhook'u getirKapsam: webhooksgetWebhookBu işlemin OpenAPI parçası
Parametreler
| Alan | in | Tür | Açıklama |
|---|
id zorunlu | path | integer | |
Yanıtlar
| 200 | Webhook — data: Webhook |
| 404 | Not found — also returned for objects owned by someone else |
Örnekler
curl -s 'https://www.gyrohosting.com/api/v1/client/cloud/webhooks/12345' \
-H "Authorization: Bearer $GYRO_TOKEN"
gyro webhook get 12345
# kaynak gyro_webhook: https://registry.terraform.io/providers/gyro-hosting/gyro/latest/docs/resources/webhook
resource "gyro_webhook" "ops" {
url = "https://hooks.example.com/gyro"
events = ["service.active", "service.suspended", "invoice.paid"]
}
output "webhook_secret" {
value = gyro_webhook.ops.secret
sensitive = true
}
import os, uuid, requests
h = {"Authorization": "Bearer " + os.environ["GYRO_TOKEN"]}
r = requests.get("https://www.gyrohosting.com/api/v1/client/cloud/webhooks/12345", headers=h, timeout=60)
r.raise_for_status()
print(r.json()["data"])
const res = await fetch("https://www.gyrohosting.com/api/v1/client/cloud/webhooks/12345", {
method: "GET",
headers: {
"Authorization": `Bearer ${process.env.GYRO_TOKEN}`,
},
});
const { data, error } = await res.json();
if (!res.ok) throw new Error(`${error.code}: ${error.message}`);
#PATCH/cloud/webhooks/{id}
Adres, olay, açıklama ya da durumu güncelleKapsam: webhooksupdateWebhookBu işlemin OpenAPI parçası
Parametreler
| Alan | in | Tür | Açıklama |
|---|
id zorunlu | path | integer | |
İstek gövdesi
| Alan | Tür | Açıklama |
|---|
url | string | |
events | array<WebhookEvent> | |
description | string | |
status | string (active, disabled) | |
Yanıtlar
| 200 | Webhook — data: Webhook |
| 404 | Not found — also returned for objects owned by someone else |
| 422 | Validation or business rule failure (confirm_required, invalid_image, tool_action_failed ...) |
Örnekler
curl -s -X PATCH 'https://www.gyrohosting.com/api/v1/client/cloud/webhooks/12345' \
-H "Authorization: Bearer $GYRO_TOKEN" \
-H "Content-Type: application/json" \
-d '{"url": "string", "events": ["service.created"], "description": "string", "status": "active"}'
gyro webhook update 12345 --help # tüm seçenekler
# kaynak gyro_webhook: https://registry.terraform.io/providers/gyro-hosting/gyro/latest/docs/resources/webhook
resource "gyro_webhook" "ops" {
url = "https://hooks.example.com/gyro"
events = ["service.active", "service.suspended", "invoice.paid"]
}
output "webhook_secret" {
value = gyro_webhook.ops.secret
sensitive = true
}
import os, uuid, requests
h = {"Authorization": "Bearer " + os.environ["GYRO_TOKEN"]}
r = requests.patch("https://www.gyrohosting.com/api/v1/client/cloud/webhooks/12345", headers=h, json={"url": "string", "events": ["service.created"], "description": "string", "status": "active"}, timeout=60)
r.raise_for_status()
print(r.json()["data"])
const res = await fetch("https://www.gyrohosting.com/api/v1/client/cloud/webhooks/12345", {
method: "PATCH",
headers: {
"Authorization": `Bearer ${process.env.GYRO_TOKEN}`,
"Content-Type": "application/json",
},
body: JSON.stringify({"url": "string", "events": ["service.created"], "description": "string", "status": "active"}),
});
const { data, error } = await res.json();
if (!res.ok) throw new Error(`${error.code}: ${error.message}`);
#DELETE/cloud/webhooks/{id}
Webhook'u silKapsam: webhooksdeleteWebhookBu işlemin OpenAPI parçası
Parametreler
| Alan | in | Tür | Açıklama |
|---|
id zorunlu | path | integer | |
Yanıtlar
| 200 | Deleted |
| 404 | Not found — also returned for objects owned by someone else |
Örnekler
curl -s -X DELETE 'https://www.gyrohosting.com/api/v1/client/cloud/webhooks/12345' \
-H "Authorization: Bearer $GYRO_TOKEN"
gyro webhook delete 12345
# kaynak gyro_webhook: https://registry.terraform.io/providers/gyro-hosting/gyro/latest/docs/resources/webhook
resource "gyro_webhook" "ops" {
url = "https://hooks.example.com/gyro"
events = ["service.active", "service.suspended", "invoice.paid"]
}
output "webhook_secret" {
value = gyro_webhook.ops.secret
sensitive = true
}
import os, uuid, requests
h = {"Authorization": "Bearer " + os.environ["GYRO_TOKEN"]}
r = requests.delete("https://www.gyrohosting.com/api/v1/client/cloud/webhooks/12345", headers=h, timeout=60)
r.raise_for_status()
print(r.json()["data"])
const res = await fetch("https://www.gyrohosting.com/api/v1/client/cloud/webhooks/12345", {
method: "DELETE",
headers: {
"Authorization": `Bearer ${process.env.GYRO_TOKEN}`,
},
});
const { data, error } = await res.json();
if (!res.ok) throw new Error(`${error.code}: ${error.message}`);
#POST/cloud/webhooks/{id}/test
Şimdi bir api.test olayı gönderKapsam: webhookstestWebhookBu işlemin OpenAPI parçası
Parametreler
| Alan | in | Tür | Açıklama |
|---|
id zorunlu | path | integer | |
Yanıtlar
| 200 | Result — data: object |
| 404 | Not found — also returned for objects owned by someone else |
Örnekler
curl -s -X POST 'https://www.gyrohosting.com/api/v1/client/cloud/webhooks/12345/test' \
-H "Authorization: Bearer $GYRO_TOKEN"
gyro webhook test 12345
import os, uuid, requests
h = {"Authorization": "Bearer " + os.environ["GYRO_TOKEN"]}
r = requests.post("https://www.gyrohosting.com/api/v1/client/cloud/webhooks/12345/test", headers=h, timeout=60)
r.raise_for_status()
print(r.json()["data"])
const res = await fetch("https://www.gyrohosting.com/api/v1/client/cloud/webhooks/12345/test", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.GYRO_TOKEN}`,
},
});
const { data, error } = await res.json();
if (!res.ok) throw new Error(`${error.code}: ${error.message}`);
#GET/cloud/webhooks/{id}/deliveries
Son 100 teslimKapsam: webhookslistWebhookDeliveriesBu işlemin OpenAPI parçası
Parametreler
| Alan | in | Tür | Açıklama |
|---|
id zorunlu | path | integer | |
Yanıtlar
| 200 | Deliveries — data: array<WebhookDelivery> |
| 404 | Not found — also returned for objects owned by someone else |
Örnekler
curl -s 'https://www.gyrohosting.com/api/v1/client/cloud/webhooks/12345/deliveries' \
-H "Authorization: Bearer $GYRO_TOKEN"
gyro webhook delivery list 12345
import os, uuid, requests
h = {"Authorization": "Bearer " + os.environ["GYRO_TOKEN"]}
r = requests.get("https://www.gyrohosting.com/api/v1/client/cloud/webhooks/12345/deliveries", headers=h, timeout=60)
r.raise_for_status()
print(r.json()["data"])
const res = await fetch("https://www.gyrohosting.com/api/v1/client/cloud/webhooks/12345/deliveries", {
method: "GET",
headers: {
"Authorization": `Bearer ${process.env.GYRO_TOKEN}`,
},
});
const { data, error } = await res.json();
if (!res.ok) throw new Error(`${error.code}: ${error.message}`);