Skip to content

Latest commit

 

History

History
196 lines (132 loc) · 6.09 KB

NotificationsApi.md

File metadata and controls

196 lines (132 loc) · 6.09 KB

Phrase\NotificationsApi

All URIs are relative to https://api.phrase.com/v2

Method HTTP request Description
notificationsList GET /notifications List notifications
notificationsMarkAllAsRead POST /notifications/mark_all_as_read Mark all notifications as read
notificationsShow GET /notifications/{id} Get a single notification

notificationsList

\Phrase\Model\Notification[] notificationsList($x_phrase_app_otp, $page, $per_page, $unseen)

List notifications

List all notifications from the current user

Example

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

$config = Phrase\Configuration::getDefaultConfiguration()->setApiKey('Authorization', 'YOUR_API_KEY');
$config = Phrase\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'token');

$apiInstance = new Phrase\Api\NotificationsApi(
    // 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
);
$x_phrase_app_otp = 'x_phrase_app_otp_example'; // string | Two-Factor-Authentication token (optional)
$page = 1; // int | Page number
$per_page = 25; // int | Limit on the number of objects to be returned, between 1 and 100. 25 by default
$unseen = true; // bool | Include only unseen notifications

try {
    $result = $apiInstance->notificationsList($x_phrase_app_otp, $page, $per_page, $unseen);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling NotificationsApi->notificationsList: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
x_phrase_app_otp string Two-Factor-Authentication token (optional) [optional]
page int Page number [optional]
per_page int Limit on the number of objects to be returned, between 1 and 100. 25 by default [optional]
unseen bool Include only unseen notifications [optional]

Return type

\Phrase\Model\Notification[]

Authorization

Basic, Token

HTTP request headers

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

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

notificationsMarkAllAsRead

\Phrase\Model\Notification[] notificationsMarkAllAsRead($x_phrase_app_otp)

Mark all notifications as read

Mark all notifications of the current user as read

Example

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

$config = Phrase\Configuration::getDefaultConfiguration()->setApiKey('Authorization', 'YOUR_API_KEY');
$config = Phrase\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'token');

$apiInstance = new Phrase\Api\NotificationsApi(
    // 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
);
$x_phrase_app_otp = 'x_phrase_app_otp_example'; // string | Two-Factor-Authentication token (optional)

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

Parameters

Name Type Description Notes
x_phrase_app_otp string Two-Factor-Authentication token (optional) [optional]

Return type

\Phrase\Model\Notification[]

Authorization

Basic, Token

HTTP request headers

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

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

notificationsShow

\Phrase\Model\Notification notificationsShow($id, $x_phrase_app_otp)

Get a single notification

Get details on a single notification.

Example

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

$config = Phrase\Configuration::getDefaultConfiguration()->setApiKey('Authorization', 'YOUR_API_KEY');
$config = Phrase\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'token');

$apiInstance = new Phrase\Api\NotificationsApi(
    // 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 | ID
$x_phrase_app_otp = 'x_phrase_app_otp_example'; // string | Two-Factor-Authentication token (optional)

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

Parameters

Name Type Description Notes
id string ID
x_phrase_app_otp string Two-Factor-Authentication token (optional) [optional]

Return type

\Phrase\Model\Notification

Authorization

Basic, Token

HTTP request headers

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

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