Skip to content

Latest commit

 

History

History
311 lines (207 loc) · 10.1 KB

File metadata and controls

311 lines (207 loc) · 10.1 KB

Zernio\WebhooksApi

Configure webhooks for real-time notifications. Events: post.scheduled, post.published, post.failed, post.partial, post.cancelled, post.recycled, account.connected, account.disconnected, message.received, message.sent, comment.received, review.new, review.updated, webhook.test. Security: optional HMAC-SHA256 signature in X-Zernio-Signature header. Configure a secret key to enable verification. Custom headers supported.

All URIs are relative to https://zernio.com/api, except if the operation defines another base path.

Method HTTP request Description
createWebhookSettings() POST /v1/webhooks/settings Create webhook
deleteWebhookSettings() DELETE /v1/webhooks/settings Delete webhook
getWebhookSettings() GET /v1/webhooks/settings List webhooks
testWebhook() POST /v1/webhooks/test Send test webhook
updateWebhookSettings() PUT /v1/webhooks/settings Update webhook

createWebhookSettings()

createWebhookSettings($create_webhook_settings_request): \Zernio\Model\UpdateWebhookSettings200Response

Create webhook

Create a new webhook configuration. Maximum 10 webhooks per user. name, url and events are required. url must be a valid URL and events must contain at least one event. Whitespace is trimmed from url before validation. Webhooks are automatically disabled after 10 consecutive delivery failures.

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure Bearer (JWT) authorization: bearerAuth
$config = Zernio\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Zernio\Api\WebhooksApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$create_webhook_settings_request = {"name":"My Production Webhook","url":"https://example.com/webhook","secret":"your-secret-key","events":["post.scheduled","post.published","post.failed","post.partial","post.cancelled","post.recycled","account.connected","account.disconnected","message.received","comment.received","review.new","review.updated"],"isActive":true}; // \Zernio\Model\CreateWebhookSettingsRequest

try {
    $result = $apiInstance->createWebhookSettings($create_webhook_settings_request);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling WebhooksApi->createWebhookSettings: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
create_webhook_settings_request \Zernio\Model\CreateWebhookSettingsRequest

Return type

\Zernio\Model\UpdateWebhookSettings200Response

Authorization

bearerAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

deleteWebhookSettings()

deleteWebhookSettings($id): \Zernio\Model\UpdateYoutubeDefaultPlaylist200Response

Delete webhook

Permanently delete a webhook configuration.

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure Bearer (JWT) authorization: bearerAuth
$config = Zernio\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Zernio\Api\WebhooksApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$id = 'id_example'; // string | Webhook ID to delete

try {
    $result = $apiInstance->deleteWebhookSettings($id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling WebhooksApi->deleteWebhookSettings: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
id string Webhook ID to delete

Return type

\Zernio\Model\UpdateYoutubeDefaultPlaylist200Response

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

getWebhookSettings()

getWebhookSettings(): \Zernio\Model\GetWebhookSettings200Response

List webhooks

Retrieve all configured webhooks for the authenticated user. Supports up to 10 webhooks per user.

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure Bearer (JWT) authorization: bearerAuth
$config = Zernio\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Zernio\Api\WebhooksApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);

try {
    $result = $apiInstance->getWebhookSettings();
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling WebhooksApi->getWebhookSettings: ', $e->getMessage(), PHP_EOL;
}

Parameters

This endpoint does not need any parameter.

Return type

\Zernio\Model\GetWebhookSettings200Response

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

testWebhook()

testWebhook($test_webhook_request): \Zernio\Model\UnpublishPost200Response

Send test webhook

Send a test webhook to verify your endpoint is configured correctly. The test payload includes event: "webhook.test" to distinguish it from real events.

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure Bearer (JWT) authorization: bearerAuth
$config = Zernio\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Zernio\Api\WebhooksApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$test_webhook_request = {"webhookId":"507f1f77bcf86cd799439011"}; // \Zernio\Model\TestWebhookRequest

try {
    $result = $apiInstance->testWebhook($test_webhook_request);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling WebhooksApi->testWebhook: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
test_webhook_request \Zernio\Model\TestWebhookRequest

Return type

\Zernio\Model\UnpublishPost200Response

Authorization

bearerAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

updateWebhookSettings()

updateWebhookSettings($update_webhook_settings_request): \Zernio\Model\UpdateWebhookSettings200Response

Update webhook

Update an existing webhook configuration. All fields except _id are optional; only provided fields will be updated. When provided, name must be 1-50 characters, url must be a valid URL, and events must contain at least one event. Whitespace is trimmed from url before validation. Webhooks are automatically disabled after 10 consecutive delivery failures.

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure Bearer (JWT) authorization: bearerAuth
$config = Zernio\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Zernio\Api\WebhooksApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$update_webhook_settings_request = {"_id":"507f1f77bcf86cd799439011","url":"https://new-example.com/webhook","events":["post.published","post.failed"]}; // \Zernio\Model\UpdateWebhookSettingsRequest

try {
    $result = $apiInstance->updateWebhookSettings($update_webhook_settings_request);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling WebhooksApi->updateWebhookSettings: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
update_webhook_settings_request \Zernio\Model\UpdateWebhookSettingsRequest

Return type

\Zernio\Model\UpdateWebhookSettings200Response

Authorization

bearerAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]