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/
PHP 5.5 and later
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
Download the files and include autoload.php
:
require_once('/path/to/./vendor/autoload.php');
To run the unit tests:
composer install
./vendor/bin/phpunit
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;
}
?>
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 |
- Type: API key
- API key parameter name: X-Auth-Token
- Location: HTTP header