ec/cns-client

European Commision / Corporate Notification System (CNS) REST API Client

0.0.1 2022-12-26 16:14 UTC

This package is auto-updated.

Last update: 2024-04-26 19:11:55 UTC


README

Version v1.2.0 of Corporate Notification System (CNS) REST API.

Installation & Usage

Requirements

PHP 7.4 and later. Should also work with PHP 8.0.

Composer

To install the bindings via Composer, add the following to composer.json:

{
  "repositories": [
    {
      "type": "vcs",
      "url": "https://github.com/GIT_USER_ID/GIT_REPO_ID.git"
    }
  ],
  "require": {
    "GIT_USER_ID/GIT_REPO_ID": "*@dev"
  }
}

Then run composer install

Manual Installation

Download the files and include autoload.php:

<?php
require_once('/path/to/OpenAPIClient-php/vendor/autoload.php');

Getting Started

Please follow the installation procedure and then run the following:

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




$apiInstance = new EC\CNS\Client\Api\ClientSystemsApi(
    // 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()
);
$client_system_key = 'client_system_key_example'; // string | The unique client system key identifier.
$client_system_password = 'client_system_password_example'; // string | Client System Password.
$white_list_request = new \EC\CNS\Client\Model\WhiteListRequest(); // \EC\CNS\Client\Model\WhiteListRequest | Smtp addresses list for a Client System.

try {
    $result = $apiInstance->addWhiteList($client_system_key, $client_system_password, $white_list_request);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ClientSystemsApi->addWhiteList: ', $e->getMessage(), PHP_EOL;
}

API Endpoints

All URIs are relative to /cns/services/rest

Class Method HTTP request Description
ClientSystemsApi addWhiteList POST /v1/clientSystems/whiteList/add
ClientSystemsApi removeWhiteList POST /v1/clientSystems/whiteList/remove
ClientSystemsApi v1ClientSystemsDetailsGet GET /v1/clientSystems/details
ClientSystemsApi v1ClientSystemsGet GET /v1/clientSystems
ClientSystemsApi v1ClientSystemsIdGet GET /v1/clientSystems/{id}
ClientSystemsApi v1ClientSystemsWhiteListGet GET /v1/clientSystems/whiteList
NotificationsApi v1NotificationsBulkPost POST /v1/notifications/bulk
NotificationsApi v1NotificationsBulkStatusReferenceIdGet GET /v1/notifications/bulk/status/{referenceId}
NotificationsApi v1NotificationsGet GET /v1/notifications
NotificationsApi v1NotificationsIdGet GET /v1/notifications/{id}
NotificationsApi v1NotificationsIdPost POST /v1/notifications/{id}
NotificationsApi v1NotificationsPost POST /v1/notifications
UserPreferencesApi getUserPreferences GET /v1/users/{email}
UserPreferencesApi savePreferences POST /v1/users/{email}

Models

Authorization

All endpoints do not require authorization.

Tests

To run the tests, use:

composer install
vendor/bin/phpunit

Author

DIGIT-CNS-SUPPORT@ec.europa.eu

About this package

This PHP package is automatically generated by the OpenAPI Generator project:

  • API version: v1.2.0
  • Build package: org.openapitools.codegen.languages.PhpClientCodegen