Skip to content

Latest commit

 

History

History
279 lines (190 loc) · 10.8 KB

NotificationsApi.md

File metadata and controls

279 lines (190 loc) · 10.8 KB

Swagger\Client\NotificationsApi

All URIs are relative to http://api.getsirena.com/v1

Method HTTP request Description
deactivateSubscription DELETE /notifications/subscription/{subscriptionId}
getActiveSubscriptionById GET /notifications/subscription/{subscriptionId}
getActiveSubscriptions GET /notifications/subscriptions
getTopics GET /notifications/topics
newSubscription POST /notifications/subscriptions

deactivateSubscription

\Swagger\Client\Model\Subscription deactivateSubscription($subscription_id, $format)

Deactivates a subscription by its ID

Example

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

// Configure API key authorization: ApiKey
Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
// Configure OAuth2 access token for authorization: OAuth2
Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

$api_instance = new Swagger\Client\Api\NotificationsApi();
$subscription_id = "subscription_id_example"; // string | The id of the subscription
$format = "format_example"; // string | An optional flag to force a response format. Note that the API also supports content negotiation and honors the Accept header.

try {
    $result = $api_instance->deactivateSubscription($subscription_id, $format);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling NotificationsApi->deactivateSubscription: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
subscription_id string The id of the subscription
format string An optional flag to force a response format. Note that the API also supports content negotiation and honors the Accept header. [optional]

Return type

\Swagger\Client\Model\Subscription

Authorization

ApiKey, OAuth2

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json, text/csv, text/plain

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

getActiveSubscriptionById

\Swagger\Client\Model\Subscription getActiveSubscriptionById($subscription_id, $format)

Returns an active notification subscription by its ID

Example

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

// Configure API key authorization: ApiKey
Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
// Configure OAuth2 access token for authorization: OAuth2
Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

$api_instance = new Swagger\Client\Api\NotificationsApi();
$subscription_id = "subscription_id_example"; // string | The id of the subscription
$format = "format_example"; // string | An optional flag to force a response format. Note that the API also supports content negotiation and honors the Accept header.

try {
    $result = $api_instance->getActiveSubscriptionById($subscription_id, $format);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling NotificationsApi->getActiveSubscriptionById: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
subscription_id string The id of the subscription
format string An optional flag to force a response format. Note that the API also supports content negotiation and honors the Accept header. [optional]

Return type

\Swagger\Client\Model\Subscription

Authorization

ApiKey, OAuth2

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json, text/csv, text/plain

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

getActiveSubscriptions

\Swagger\Client\Model\Subscriptions getActiveSubscriptions($format)

Returns the list of active subscriptions. Note that subscriptions are currently limited to one per group.

Example

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

// Configure API key authorization: ApiKey
Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
// Configure OAuth2 access token for authorization: OAuth2
Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

$api_instance = new Swagger\Client\Api\NotificationsApi();
$format = "format_example"; // string | An optional flag to force a response format. Note that the API also supports content negotiation and honors the Accept header.

try {
    $result = $api_instance->getActiveSubscriptions($format);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling NotificationsApi->getActiveSubscriptions: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
format string An optional flag to force a response format. Note that the API also supports content negotiation and honors the Accept header. [optional]

Return type

\Swagger\Client\Model\Subscriptions

Authorization

ApiKey, OAuth2

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json, text/csv, text/plain

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

getTopics

\Swagger\Client\Model\Topics getTopics($format)

Returns information about the available notification topics. Topics can be subscribed to using Subscriptions.

Example

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

// Configure API key authorization: ApiKey
Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
// Configure OAuth2 access token for authorization: OAuth2
Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

$api_instance = new Swagger\Client\Api\NotificationsApi();
$format = "format_example"; // string | An optional flag to force a response format. Note that the API also supports content negotiation and honors the Accept header.

try {
    $result = $api_instance->getTopics($format);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling NotificationsApi->getTopics: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
format string An optional flag to force a response format. Note that the API also supports content negotiation and honors the Accept header. [optional]

Return type

\Swagger\Client\Model\Topics

Authorization

ApiKey, OAuth2

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json, text/csv, text/plain

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

newSubscription

\Swagger\Client\Model\Subscription newSubscription($subscription, $format)

Subscribe to notification topics. Note that subscriptions are currently limited to one per group, and subscribing twice will result in the first subscription being deactivated.

Example

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

// Configure API key authorization: ApiKey
Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
// Configure OAuth2 access token for authorization: OAuth2
Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

$api_instance = new Swagger\Client\Api\NotificationsApi();
$subscription = new \Swagger\Client\Model\NewSubscription(); // \Swagger\Client\Model\NewSubscription | 
$format = "format_example"; // string | An optional flag to force a response format. Note that the API also supports content negotiation and honors the Accept header.

try {
    $result = $api_instance->newSubscription($subscription, $format);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling NotificationsApi->newSubscription: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
subscription \Swagger\Client\Model\NewSubscription
format string An optional flag to force a response format. Note that the API also supports content negotiation and honors the Accept header. [optional]

Return type

\Swagger\Client\Model\Subscription

Authorization

ApiKey, OAuth2

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json, text/csv, text/plain

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