Skip to content
This repository has been archived by the owner on Jun 15, 2020. It is now read-only.

pushnews/php-sdk

Repository files navigation

.

Pushnews API documentation

This PHP package is automatically generated by the Swagger Codegen project:

  • API version: 2.1.0
  • Build package: io.swagger.codegen.languages.PhpClientCodegen For more information, please visit https://www.pushnews.eu/

Requirements

PHP 5.5 and later

Installation & Usage

Composer

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

{
  "repositories": [
    {
      "type": "git",
      "url": "https://github.com/pushnews/php-sdk.git"
    }
  ],
  "require": {
    "pushnews/php-sdk": "*@dev"
  }
}

Then run composer install

Manual Installation

Download the files and include autoload.php:

    require_once('/path/to/./vendor/autoload.php');

Tests

To run the unit tests:

composer install
./vendor/bin/phpunit

Getting Started

Please follow the installation procedure and then run the following:

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

// Configure API key authorization: ApiKeyAuth
$config = Pushnews\Configuration::getDefaultConfiguration()->setApiKey('X-Auth-Token', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Pushnews\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Auth-Token', 'Bearer');

$apiInstance = new Pushnews\Api\MailApi(
    // 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
);
$siteId = "siteId_example"; // string | Site ID
$body = new \Pushnews\Model\Mail(); // \Pushnews\Model\Mail | Mail object

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

?>

Documentation for API Endpoints

All URIs are relative to https://api.pushnews.eu/v2

Class Method HTTP request Description
MailApi emailSend POST /mail/{siteId} Send a Push Mail
PushApi pushSend POST /push/{siteId} Send a Push Notification

Documentation For Models

Documentation For Authorization

ApiKeyAuth

  • Type: API key
  • API key parameter name: X-Auth-Token
  • Location: HTTP header

Author

support@pushnews.eu