Skip to content

Latest commit

 

History

History
205 lines (138 loc) · 7.67 KB

APINotificationCallbacksApi.md

File metadata and controls

205 lines (138 loc) · 7.67 KB

DocPlanner\Client\APINotificationCallbacksApi

All URIs are relative to https://www.{domain}/api/v3/integration

Method HTTP request Description
pullMultipleNotification GET /notifications/multiple
pullNotification GET /notifications
pushNotifications POST /{client-endpoint-url}
releaseNotifications POST /notifications/release

pullMultipleNotification

\DocPlanner\Client\Model\PullMultipleNotificationsResponse pullMultipleNotification($limit)

Pulling Notifications - You can pull multiple notifications via this endpoint. This page will respond to you with the earliest notifications you haven’t been pulled yet in the quantity limited by limit parameter. First In First Out (FIFO) principle applied here. This endpoint will respond with the collection of notifications and amount of remaining notifications. Important: Notifications that are not pulled in 72 hours are marked as expired and deleted from the system.

Example

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

// Configure OAuth2 access token for authorization: oauth2
$config = DocPlanner\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

$apiInstance = new DocPlanner\Client\Api\APINotificationCallbacksApi(
    // 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
);
$limit = 56; // int | Maximum number of notifications pulled. Can take value from 1 to 100. If not provided the default value of 1 is applied.

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

Parameters

Name Type Description Notes
limit int Maximum number of notifications pulled. Can take value from 1 to 100. If not provided the default value of 1 is applied. [optional]

Return type

\DocPlanner\Client\Model\PullMultipleNotificationsResponse

Authorization

oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/vnd.docplanner+json; charset=UTF-8, application/vnd.error+docplanner+json

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

pullNotification

\DocPlanner\Client\Model\Notification pullNotification()

Pulling Notifications - You can pull notifications via this endpoint. This page will respond to you with the earliest notification you haven’t been pulled yet. First In First Out (FIFO) principle applied here. This endpoint will respond with one notification per request until there aren’t any notifications left in the notification queue. Important: Notifications that are not pulled in 72 hours are marked as expired and deleted from the system.

Example

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

// Configure OAuth2 access token for authorization: oauth2
$config = DocPlanner\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

$apiInstance = new DocPlanner\Client\Api\APINotificationCallbacksApi(
    // 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->pullNotification();
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling APINotificationCallbacksApi->pullNotification: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

This endpoint does not need any parameter.

Return type

\DocPlanner\Client\Model\Notification

Authorization

oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/vnd.docplanner+json; charset=UTF-8, application/vnd.error+docplanner+json

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

pushNotifications

pushNotifications()

Pushing Notifications - To be able to use this method, client should give us an endpoint url, and we will be pushing notifications to this endpoint in real time. HTTP POST method will be used to push event data to endpoint. Note: Regardless of the response status (500, 200, 400) from the client endpoint, the events will be pushed only once. You can find every possible event notification requests below.

Example

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

$apiInstance = new DocPlanner\Client\Api\APINotificationCallbacksApi(
    // 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()
);

try {
    $apiInstance->pushNotifications();
} catch (Exception $e) {
    echo 'Exception when calling APINotificationCallbacksApi->pushNotifications: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

This endpoint does not need any parameter.

Return type

void (empty response body)

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

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

releaseNotifications

releaseNotifications()

Action allowing to trigger re-dispatching all the notifications that were not processed correctly. Call to this endpoint should be repeated periodically to ensure consistency between systems. Docplanner API allows to perform notifications release once per hour. Endpoint can be used only if Docplanner system is pushing events to the external endpoints.

Example

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

// Configure OAuth2 access token for authorization: oauth2
$config = DocPlanner\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

$apiInstance = new DocPlanner\Client\Api\APINotificationCallbacksApi(
    // 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 {
    $apiInstance->releaseNotifications();
} catch (Exception $e) {
    echo 'Exception when calling APINotificationCallbacksApi->releaseNotifications: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

This endpoint does not need any parameter.

Return type

void (empty response body)

Authorization

oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/vnd.error+docplanner+json

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