unione-repo / php7-sdk
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/
Requires
- php: ^7.2
- ext-curl: *
- ext-json: *
- ext-mbstring: *
- guzzlehttp/psr7: ^1.8 || ^2.0
- php-http/async-client-implementation: ^1.0
- php-http/client-common: ^2.4
- php-http/discovery: ^1.14
- php-http/httplug: ^2.2
- psr/http-client-implementation: ^1.0
- psr/http-factory: ^1.0
- psr/http-factory-implementation: ^1.0
- psr/http-message: ^1.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.5
- guzzlehttp/guzzle: ^7.0
- php-http/guzzle7-adapter: ^1.0
- phpunit/phpunit: ^8.0 || ^9.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-09-18 13:13:43 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 7.2 and later.
Composer
To install the bindings via Composer, add the following to composer.json:
{
"repositories": [
{
"type": "vcs",
"url": "https://github.com/unione-repo/php7-sdk.git"
}
],
"require": {
"unione-repo/php7-sdk": "*@dev"
}
}
Then run composer install
Your project is free to choose the http client of your choice Please require packages that will provide http client functionality: https://packagist.org/providers/psr/http-client-implementation https://packagist.org/providers/php-http/async-client-implementation https://packagist.org/providers/psr/http-factory-implementation
As an example:
composer require guzzlehttp/guzzle php-http/guzzle7-adapter http-interop/http-factory-guzzle
Manual Installation
Download the files and include autoload.php:
<?php require_once('/path/to/php7-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 `Psr\Http\Client\ClientInterface`. // This is optional, `Psr18ClientDiscovery` will be used to find http client. For instance `GuzzleHttp\Client` implements that interface 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
| 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. |
| SystemApi | systemPing | POST /system/ping.json | Checks API key validity and returns user ID. |
| 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
- AttachmentsArrayInner
- BodyObject
- BypassComplainedInteger
- BypassGlobalInteger
- BypassUnavailableInteger
- BypassUnsubscribedInteger
- DomainDelete200Response
- DomainDeleteRequest
- DomainGetDnsRecords200Response
- DomainGetDnsRecordsRequest
- DomainList200Response
- DomainList200ResponseDomainsInner
- DomainList200ResponseDomainsInnerDkim
- DomainList200ResponseDomainsInnerVerificationRecord
- DomainListRequest
- DomainValidateDkimRequest
- DomainValidateVerificationRecord200Response
- DomainValidateVerificationRecordRequest
- EditorTypeString
- EmailSend200Response
- EmailSendRequest
- EmailSubscribeRequest
- EmailValidationSingle200Response
- EmailValidationSingleRequest
- ErrorResponse
- EventDumpCreate200Response
- EventDumpCreateRequest
- EventDumpDeleteRequest
- EventDumpFilesObject
- EventDumpGet200Response
- EventDumpGetRequest
- EventDumpList200Response
- EventDumpObject
- FilterObject
- HeadersObject
- InlineAttachmentsArrayInner
- MessageObject
- MessageObjectOptions
- MessageObjectRecipientsInner
- ProjectAccountingObject
- ProjectCreate200Response
- ProjectCreateRequest
- ProjectDeleteRequest
- ProjectList200Response
- ProjectListObject
- ProjectListRequest
- ProjectObject
- ProjectUpdate200Response
- ProjectUpdateObject
- ProjectUpdateRequest
- SuccessResponse
- SuccessStatusString
- SuppressionDeleteRequest
- SuppressionGet200Response
- SuppressionGetObject
- SuppressionGetRequest
- SuppressionList200Response
- SuppressionListObject
- SuppressionListRequest
- SuppressionSetRequest
- SystemInfo200Response
- SystemInfo200ResponseAccounting
- SystemPing200Response
- TagDeleteRequest
- TagList200Response
- TagsResponseObject
- TemplateEngineString
- TemplateGetRequest
- TemplateList200Response
- TemplateListObject
- TemplateListRequest
- TemplateObject
- TemplateSet200Response
- TemplateSetRequest
- TrackLinksInteger
- TrackReadInteger
- UnsubscribedCheck200Response
- UnsubscribedCheckRequest
- UnsubscribedList200Response
- UnsubscribedList200ResponseUnsubscribedInner
- UnsubscribedListRequest
- UnsubscribedSet200Response
- UnsubscribedSetRequest
- WebhookDeliveryInfoInteger
- WebhookEventFormatString
- WebhookEventsObject
- WebhookGetRequest
- WebhookList200Response
- WebhookListRequest
- WebhookObject
- WebhookSet200Response
- WebhookSetJsonPostRequest
- WebhookSetJsonPostRequestEventsByUserInner
- WebhookSetJsonPostRequestEventsByUserInnerEventsInner
- WebhookSetJsonPostRequestEventsByUserInnerEventsInnerEventData
- WebhookSetJsonPostRequestEventsByUserInnerEventsInnerEventDataDeliveryInfo
- WebhookSetRequest
- WebhookSingleEventInteger
- WebhookStatusString
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
- Package version:
- Build package:
org.openapitools.codegen.languages.PhpClientCodegen