Search by

unione-repo / php8-sdk

unione-repo

All UniOne API methods require HTTPS connection. UniOne accepts HTTP POST requests in JSON format up to 10 megabytes long and returns HTTP response also in JSON. API endpoint (or base URL) depends on which datacenter the user is registered at.<br>The preferred way is to use https://api.unione.io/en/

Package info

github.com/unione-repo/php8-sdk

Homepage

pkg:composer/unione-repo/php8-sdk

Statistics

Installs: 0

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

dev-master 2026-02-06 14:13 UTC

This package is auto-updated.

Last update: 2026-09-18 12:47:05 UTC


README

All UniOne API methods require HTTPS connection. UniOne accepts HTTP POST requests in JSON format up to 10 megabytes long and returns HTTP response also in JSON. API endpoint (or base URL) depends on which datacenter the user is registered at.
The preferred way is to use https://api.unione.io/en/transactional/api/v1 endpoint, but also you can use https://eu1.unione.io/en/transactional/api/v1 or https://us1.unione.io/en/transactional/api/v1 directly, depending on the host your account was registered at.

For more information, please visit https://cp.unione.io/en/support.

Installation & Usage

Requirements

PHP 8.1 and later.

Composer

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

{
  "repositories": [
    {
      "type": "vcs",
      "url": "https://github.com/unione-repo/php8-sdk.git"
    }
  ],
  "require": {
    "unione-repo/php8-sdk": "*@dev"
  }
}

Then run composer install

Manual Installation

Download the files and include autoload.php:

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

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 = UniOne\Configuration::getDefaultConfiguration()->setApiKey('X-API-KEY', 'YOUR_API_KEY');
$config->setHost('api.unione.io');

$apiInstance = new UniOne\Api\EmailApi(
    // 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
);

$bodyObject = new \UniOne\Model\BodyObject();
$bodyObject
    ->setHtml("<b>Hello, {{to_name}}</b>");

$messageObject = new \UniOne\Model\MessageObject();
$messageObject
    ->setSubject("UniOne test email")
    ->setFromEmail("user@example.com")
    ->setRecipients([{"email":"email@example.com","substitutions":{"to_name":"John Smith"},"metadata":{"campaign_id":"c77f4f4e-3561-49f7-9f07-c35be01b4f43"}}])
    ->setBody($bodyObject);

$emailSendRequest = new \UniOne\Model\EmailSendRequest();
$emailSendRequest
    ->setMessage($messageObject);

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

API Endpoints

All URIs are relative to https://api.unione.io/en/transactional/api/v1

    ### URI(s):
- https://api.unione.io/en/transactional/api/v1 UniOne API-server instance
Class Method HTTP request Description
DomainApi domainDelete POST /domain/delete.json Deletes a domain. Attention: you should use project's API key to delete a project's domain.
DomainApi domainGetDnsRecords POST /domain/get-dns-records.json Returns info on domain DNS setup for using with UniOne.
DomainApi domainList POST /domain/list.json Returns a list of all registered domains for user or project, together with statuses of last validations.
DomainApi domainValidateDkim POST /domain/validate-dkim.json Validates DKIM record for domain.
DomainApi domainValidateVerificationRecord POST /domain/validate-verification-record.json Triggers verification record validation for domain.
EmailApi emailSend POST /email/send.json Sends an email or a bunch of emails
EmailApi emailSubscribe POST /email/subscribe.json Sends an email with (re)subscribe link.
EmailValidationApi emailValidationSingle POST /email-validation/single.json A maximum of two concurrent requests are allowed; if you send more requests, an error will be returned. Since the verification process should be completed promptly, we've set a time limit on email check. If we encounter a slow email server that does not respond in 5 seconds, you may get an “unknown” status.
EventDumpApi eventDumpCreate POST /event-dump/create.json This asynchronous method initiates the preparation of data dump in CSV format. The number of dump files created or stored is limited to 10; to order more files, you have to delete one of the previous ones or wait until they will be deleted automatically. A newly created dump file is kept for 8 hours. If the request period is more than a day or there are too many events then several files will be generated and each file will contain no more than 100,000 events. File contains columns with the following information - 'event_time', 'job_id', 'from_email', 'email', 'status', 'delivery_status', 'metadata', 'destination_response', 'user_agent', 'url', 'ip', 'tags' and 'project_id' (for accounts with projects enabled). You can change the fields and include 'subject' field using 'dump_fileds' parameter.
EventDumpApi eventDumpDelete POST /event-dump/delete.json Removes dump from queue or storage.
EventDumpApi eventDumpGet POST /event-dump/get.json Returns dump properties for a given identifier
EventDumpApi eventDumpList POST /event-dump/list.json This method does not require any parameters; returns the full list of existing dumps.
ObsoleteApi unsubscribedCheck POST /unsubscribed/check.json Checks if an email is unsubscribed.
ObsoleteApi unsubscribedList POST /unsubscribed/list.json Returns a list of all unsubscribed emails since provided date.
ObsoleteApi unsubscribedSet POST /unsubscribed/set.json Registers a new unsubscribed email.
ProjectApi projectCreate POST /project/create.json Creates a new project.
ProjectApi projectDelete POST /project/delete.json Deletes a project.
ProjectApi projectList POST /project/list.json Lists projects.
ProjectApi projectUpdate POST /project/update.json Updates a project.
SuppressionApi suppressionDelete POST /suppression/delete.json Deletes an email from suppression list (only records with is_deletable=true). If there are no entries of this email in the suppression list, API error 3003 is returned. If such entries exist but no one can be deleted, API error 3004 is returned. If daily limit of deletes exceeded, API error 906 is returned.
SuppressionApi suppressionGet POST /suppression/get.json Gets a reason and date of email suppression.
SuppressionApi suppressionList POST /suppression/list.json Returns a suppression list since provided date.
SuppressionApi suppressionSet POST /suppression/set.json Adds an email address to the suppression list. You can always remove this address from the suppression list later using the suppression/delete method.
SystemApi systemInfo POST /system/info.json Gets user or project info by API key.
TagApi tagDelete POST /tag/delete.json Removes tag.
TagApi tagList POST /tag/list.json This method returns the full list of user-defined tags. Does not receive any parameters.
TemplateApi templateDelete POST /template/delete.json Deletes a template by id.
TemplateApi templateGet POST /template/get.json Gets template properties by it's id.
TemplateApi templateList POST /template/list.json Returns the list of all or some templates of the account.
TemplateApi templateSet POST /template/set.json Creates or updates an email template.
WebhookApi webhookDelete POST /webhook/delete.json Deletes an event notification handler
WebhookApi webhookGet POST /webhook/get.json Gets properties of a webhook.
WebhookApi webhookList POST /webhook/list.json List all or some webhooks (event notification handlers) of a user or a project.
WebhookApi webhookSet POST /webhook/set.json Sets or edits a webhook, i.e. an event notification handler.

Models

Authorization

apiKeyAuth

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

Tests

To run the tests, use:

composer install
vendor/bin/phpunit

Author

About this package

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

  • API version: 1.76
    • Package version: 1.0.0
    • Generator version: 7.19.0
  • Build package: org.openapitools.codegen.languages.PhpNextgenClientCodegen