unione 1.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/AGENTS.md +99 -0
- data/LICENSE +21 -0
- data/README.md +270 -0
- data/docs/ConfirmedEmail.md +109 -0
- data/docs/Domain.md +257 -0
- data/docs/Email.md +126 -0
- data/docs/EmailValidation.md +54 -0
- data/docs/EventDump.md +157 -0
- data/docs/Obsolete.md +119 -0
- data/docs/Project.md +174 -0
- data/docs/Suppression.md +163 -0
- data/docs/System.md +73 -0
- data/docs/Tag.md +73 -0
- data/docs/Template.md +164 -0
- data/docs/Webhook.md +182 -0
- data/lib/unione/api/confirmed_email/confirmed_email_api.rb +47 -0
- data/lib/unione/api/confirmed_email/model/confirmed_email.rb +49 -0
- data/lib/unione/api/confirmed_email/model/confirmed_email_create_response.rb +50 -0
- data/lib/unione/api/confirmed_email/model/confirmed_email_delete_response.rb +50 -0
- data/lib/unione/api/confirmed_email/model/confirmed_email_list_response.rb +50 -0
- data/lib/unione/api/confirmed_email/model/confirmed_email_request.rb +42 -0
- data/lib/unione/api/domain/domain_api.rb +129 -0
- data/lib/unione/api/domain/model/dkim_status.rb +18 -0
- data/lib/unione/api/domain/model/domain_delete_request.rb +42 -0
- data/lib/unione/api/domain/model/domain_delete_response.rb +51 -0
- data/lib/unione/api/domain/model/domain_get_dns_records_request.rb +42 -0
- data/lib/unione/api/domain/model/domain_get_dns_records_response.rb +76 -0
- data/lib/unione/api/domain/model/domain_get_sandbox_domain_response.rb +51 -0
- data/lib/unione/api/domain/model/domain_list_request.rb +60 -0
- data/lib/unione/api/domain/model/domain_list_response.rb +51 -0
- data/lib/unione/api/domain/model/domain_list_response_domains_item.rb +58 -0
- data/lib/unione/api/domain/model/domain_list_response_domains_item_dkim.rb +52 -0
- data/lib/unione/api/domain/model/domain_list_response_domains_item_verification_record.rb +50 -0
- data/lib/unione/api/domain/model/domain_validate_dkim_request.rb +42 -0
- data/lib/unione/api/domain/model/domain_validate_dkim_response.rb +51 -0
- data/lib/unione/api/domain/model/domain_validate_verification_record_request.rb +42 -0
- data/lib/unione/api/domain/model/domain_validate_verification_record_response.rb +51 -0
- data/lib/unione/api/email/email_api.rb +56 -0
- data/lib/unione/api/email/model/email_send_request.rb +42 -0
- data/lib/unione/api/email/model/email_send_response.rb +83 -0
- data/lib/unione/api/email/model/email_subscribe_request.rb +58 -0
- data/lib/unione/api/email/model/message_object.rb +291 -0
- data/lib/unione/api/email/model/message_object_options.rb +70 -0
- data/lib/unione/api/email/model/message_object_recipients_item.rb +77 -0
- data/lib/unione/api/email_validation/email_validation_api.rb +34 -0
- data/lib/unione/api/email_validation/model/email_validation_single_request.rb +42 -0
- data/lib/unione/api/email_validation/model/email_validation_single_response.rb +140 -0
- data/lib/unione/api/event_dump/event_dump_api.rb +67 -0
- data/lib/unione/api/event_dump/model/event_dump_create_request.rb +119 -0
- data/lib/unione/api/event_dump/model/event_dump_create_response.rb +52 -0
- data/lib/unione/api/event_dump/model/event_dump_delete_request.rb +43 -0
- data/lib/unione/api/event_dump/model/event_dump_files_object.rb +51 -0
- data/lib/unione/api/event_dump/model/event_dump_get_request.rb +43 -0
- data/lib/unione/api/event_dump/model/event_dump_get_response.rb +51 -0
- data/lib/unione/api/event_dump/model/event_dump_list_response.rb +52 -0
- data/lib/unione/api/event_dump/model/event_dump_object.rb +66 -0
- data/lib/unione/api/event_dump/model/filter_object.rb +139 -0
- data/lib/unione/api/obsolete/model/obsolete_unsubscribed_check_request.rb +42 -0
- data/lib/unione/api/obsolete/model/obsolete_unsubscribed_check_response.rb +59 -0
- data/lib/unione/api/obsolete/model/obsolete_unsubscribed_list_request.rb +43 -0
- data/lib/unione/api/obsolete/model/obsolete_unsubscribed_list_response.rb +51 -0
- data/lib/unione/api/obsolete/model/obsolete_unsubscribed_list_response_unsubscribed_item.rb +50 -0
- data/lib/unione/api/obsolete/model/obsolete_unsubscribed_set_message.rb +25 -0
- data/lib/unione/api/obsolete/model/obsolete_unsubscribed_set_request.rb +42 -0
- data/lib/unione/api/obsolete/model/obsolete_unsubscribed_set_response.rb +64 -0
- data/lib/unione/api/obsolete/obsolete_api.rb +57 -0
- data/lib/unione/api/project/model/project_create_request.rb +42 -0
- data/lib/unione/api/project/model/project_create_response.rb +60 -0
- data/lib/unione/api/project/model/project_delete_request.rb +52 -0
- data/lib/unione/api/project/model/project_list_object.rb +146 -0
- data/lib/unione/api/project/model/project_list_request.rb +50 -0
- data/lib/unione/api/project/model/project_list_response.rb +51 -0
- data/lib/unione/api/project/model/project_object.rb +94 -0
- data/lib/unione/api/project/model/project_update_object.rb +130 -0
- data/lib/unione/api/project/model/project_update_request.rb +60 -0
- data/lib/unione/api/project/model/project_update_response.rb +52 -0
- data/lib/unione/api/project/project_api.rb +71 -0
- data/lib/unione/api/suppression/model/suppression_delete_request.rb +42 -0
- data/lib/unione/api/suppression/model/suppression_get_object.rb +91 -0
- data/lib/unione/api/suppression/model/suppression_get_request.rb +52 -0
- data/lib/unione/api/suppression/model/suppression_get_response.rb +59 -0
- data/lib/unione/api/suppression/model/suppression_list_object.rb +91 -0
- data/lib/unione/api/suppression/model/suppression_list_request.rb +94 -0
- data/lib/unione/api/suppression/model/suppression_list_response.rb +61 -0
- data/lib/unione/api/suppression/model/suppression_set_request.rb +69 -0
- data/lib/unione/api/suppression/suppression_api.rb +63 -0
- data/lib/unione/api/system/model/project_accounting_object.rb +62 -0
- data/lib/unione/api/system/model/system_info_response.rb +95 -0
- data/lib/unione/api/system/model/system_info_response_accounting.rb +68 -0
- data/lib/unione/api/system/model/system_ping_response.rb +51 -0
- data/lib/unione/api/system/system_api.rb +35 -0
- data/lib/unione/api/tag/model/tag_delete_request.rb +42 -0
- data/lib/unione/api/tag/model/tag_list_response.rb +51 -0
- data/lib/unione/api/tag/model/tags_response_object.rb +50 -0
- data/lib/unione/api/tag/tag_api.rb +40 -0
- data/lib/unione/api/template/model/editor_type.rb +19 -0
- data/lib/unione/api/template/model/template_delete_request.rb +42 -0
- data/lib/unione/api/template/model/template_get_request.rb +42 -0
- data/lib/unione/api/template/model/template_get_response.rb +51 -0
- data/lib/unione/api/template/model/template_list_object.rb +232 -0
- data/lib/unione/api/template/model/template_list_request.rb +52 -0
- data/lib/unione/api/template/model/template_list_response.rb +51 -0
- data/lib/unione/api/template/model/template_object.rb +201 -0
- data/lib/unione/api/template/model/template_set_request.rb +42 -0
- data/lib/unione/api/template/model/template_set_response.rb +51 -0
- data/lib/unione/api/template/template_api.rb +66 -0
- data/lib/unione/api/webhook/model/block_type.rb +20 -0
- data/lib/unione/api/webhook/model/device_type.rb +22 -0
- data/lib/unione/api/webhook/model/domain_status.rb +19 -0
- data/lib/unione/api/webhook/model/event_name.rb +19 -0
- data/lib/unione/api/webhook/model/traffic_type.rb +24 -0
- data/lib/unione/api/webhook/model/webhook_callback.rb +52 -0
- data/lib/unione/api/webhook/model/webhook_callback_events_by_user_item.rb +66 -0
- data/lib/unione/api/webhook/model/webhook_callback_events_by_user_item_events_item.rb +52 -0
- data/lib/unione/api/webhook/model/webhook_callback_events_by_user_item_events_item_event_data.rb +167 -0
- data/lib/unione/api/webhook/model/webhook_callback_events_by_user_item_events_item_event_data_delivery_info.rb +192 -0
- data/lib/unione/api/webhook/model/webhook_delete_request.rb +42 -0
- data/lib/unione/api/webhook/model/webhook_event_format.rb +18 -0
- data/lib/unione/api/webhook/model/webhook_events_object.rb +52 -0
- data/lib/unione/api/webhook/model/webhook_get_request.rb +42 -0
- data/lib/unione/api/webhook/model/webhook_get_response.rb +51 -0
- data/lib/unione/api/webhook/model/webhook_list_request.rb +51 -0
- data/lib/unione/api/webhook/model/webhook_list_response.rb +51 -0
- data/lib/unione/api/webhook/model/webhook_object.rb +123 -0
- data/lib/unione/api/webhook/model/webhook_set_request.rb +109 -0
- data/lib/unione/api/webhook/model/webhook_set_response.rb +51 -0
- data/lib/unione/api/webhook/model/webhook_status.rb +21 -0
- data/lib/unione/api/webhook/webhook_api.rb +89 -0
- data/lib/unione/client/api_client.rb +93 -0
- data/lib/unione/client/api_error.rb +22 -0
- data/lib/unione/client/configuration.rb +49 -0
- data/lib/unione/client/decode.rb +33 -0
- data/lib/unione/common/model/attachments_array_item.rb +59 -0
- data/lib/unione/common/model/body_object.rb +57 -0
- data/lib/unione/common/model/email_counter_mode.rb +21 -0
- data/lib/unione/common/model/email_status.rb +23 -0
- data/lib/unione/common/model/headers_object.rb +72 -0
- data/lib/unione/common/model/inline_attachments_array_item.rb +59 -0
- data/lib/unione/common/model/success_response.rb +41 -0
- data/lib/unione/common/model/template_engine.rb +19 -0
- data/lib/unione/common/model/verification_record_status.rb +16 -0
- data/lib/unione/uni_one_client.rb +127 -0
- data/lib/unione/version.rb +5 -0
- data/lib/unione.rb +130 -0
- metadata +187 -0
data/docs/Obsolete.md
ADDED
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
# Obsolete
|
|
2
|
+
|
|
3
|
+
[Back to the list of sections](../README.md)
|
|
4
|
+
|
|
5
|
+
Obsolete methods dealing with unsubscribes. We recommend using the more flexible [suppression](https://docs.unione.io/en/web-api-ref#suppression) methods instead. Note that you can't resubscribe an unsubscribed recipient using WebAPI, but you can send him an email with subscription link using email/subscribe method.
|
|
6
|
+
|
|
7
|
+
`UniOne::Api::Obsolete::ObsoleteApi`, `client.obsolete`
|
|
8
|
+
|
|
9
|
+
| Method | Endpoint | Description |
|
|
10
|
+
|---|---|---|
|
|
11
|
+
| [`unsubscribed_set`](#unsubscribed_set) | `POST /unsubscribed/set.json` | Registers a new unsubscribed email. |
|
|
12
|
+
| [`unsubscribed_check`](#unsubscribed_check) | `POST /unsubscribed/check.json` | Checks if an email is unsubscribed. |
|
|
13
|
+
| [`unsubscribed_list`](#unsubscribed_list) | `POST /unsubscribed/list.json` | Returns a list of all unsubscribed emails since provided date. |
|
|
14
|
+
|
|
15
|
+
## unsubscribed_set
|
|
16
|
+
|
|
17
|
+
`POST /unsubscribed/set.json` · [Documentation](https://docs.unione.io/en/web-api-ref#unsubscribed-set)
|
|
18
|
+
|
|
19
|
+
Registers a new unsubscribed email.
|
|
20
|
+
|
|
21
|
+
After registering an email as unsubscribed all future attempts to send a message to this email will be rejected. Please note that there's no way to remove an email from unsubscribed thru the API. But you can send an email with a link to resubscribe using [email/subscribe](https://docs.unione.io/en/web-api-ref#email-subscribe) method or remove "unsubscribed" status manually on [Email Search page](https://cp.unione.io/en/user/email) in control panel (but only a limited number of unsubscribed email per day can be removed).
|
|
22
|
+
|
|
23
|
+
### Request: `ObsoleteUnsubscribedSetRequest`
|
|
24
|
+
|
|
25
|
+
| Field | Type | Required | Description |
|
|
26
|
+
|---|---|---|---|
|
|
27
|
+
| `address` | `String` | yes | Email to be unsubscribed. |
|
|
28
|
+
|
|
29
|
+
### Response: `ObsoleteUnsubscribedSetResponse`
|
|
30
|
+
|
|
31
|
+
| Field | Type | Description |
|
|
32
|
+
|---|---|---|
|
|
33
|
+
| `status` | `String` | "success" string (`success`) |
|
|
34
|
+
| `address` | `String` | The unsubscribed email. |
|
|
35
|
+
| `message` | `ObsoleteUnsubscribedSetMessage` | Unsubscription process details:<br><br>- "unsubscribed" if email has just been unsubscribed,<br>- "was inactive" if it was inactive due some reason,<br>- "was unsubscribed" if it already was unsubscribed before the call,<br>- "added and unsubscribed" if it's a new email without status history and it was added and then unsubscribed immediately. (`unsubscribed`, `was inactive`, `was unsubscribed`, `added and unsubscribed`) |
|
|
36
|
+
|
|
37
|
+
### Example
|
|
38
|
+
|
|
39
|
+
```ruby
|
|
40
|
+
require 'unione'
|
|
41
|
+
|
|
42
|
+
Obsolete = UniOne::Api::Obsolete::Model
|
|
43
|
+
|
|
44
|
+
client = UniOne.client('YOUR_API_KEY')
|
|
45
|
+
|
|
46
|
+
response = client.obsolete.unsubscribed_set(Obsolete::ObsoleteUnsubscribedSetRequest.new(
|
|
47
|
+
address: 'email@example.com'
|
|
48
|
+
))
|
|
49
|
+
p response.address
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## unsubscribed_check
|
|
53
|
+
|
|
54
|
+
`POST /unsubscribed/check.json` · [Documentation](https://docs.unione.io/en/web-api-ref#unsubscribed-check)
|
|
55
|
+
|
|
56
|
+
Checks if an email is unsubscribed.
|
|
57
|
+
|
|
58
|
+
### Request: `ObsoleteUnsubscribedCheckRequest`
|
|
59
|
+
|
|
60
|
+
| Field | Type | Required | Description |
|
|
61
|
+
|---|---|---|---|
|
|
62
|
+
| `address` | `String` | yes | Email to check. |
|
|
63
|
+
|
|
64
|
+
### Response: `ObsoleteUnsubscribedCheckResponse`
|
|
65
|
+
|
|
66
|
+
| Field | Type | Description |
|
|
67
|
+
|---|---|---|
|
|
68
|
+
| `status` | `String` | "success" string (`success`) |
|
|
69
|
+
| `address` | `String` | Email that was checked. |
|
|
70
|
+
| `is_unsubscribed` | `Boolean` | true if unsubscribed, false if not. |
|
|
71
|
+
|
|
72
|
+
### Example
|
|
73
|
+
|
|
74
|
+
```ruby
|
|
75
|
+
require 'unione'
|
|
76
|
+
|
|
77
|
+
Obsolete = UniOne::Api::Obsolete::Model
|
|
78
|
+
|
|
79
|
+
client = UniOne.client('YOUR_API_KEY')
|
|
80
|
+
|
|
81
|
+
response = client.obsolete.unsubscribed_check(Obsolete::ObsoleteUnsubscribedCheckRequest.new(
|
|
82
|
+
address: 'email@example.com'
|
|
83
|
+
))
|
|
84
|
+
p response.address
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
## unsubscribed_list
|
|
88
|
+
|
|
89
|
+
`POST /unsubscribed/list.json` · [Documentation](https://docs.unione.io/en/web-api-ref#unsubscribed-list)
|
|
90
|
+
|
|
91
|
+
Returns a list of all unsubscribed emails since provided date.
|
|
92
|
+
|
|
93
|
+
### Request: `ObsoleteUnsubscribedListRequest`
|
|
94
|
+
|
|
95
|
+
| Field | Type | Required | Description |
|
|
96
|
+
|---|---|---|---|
|
|
97
|
+
| `date_from` | `String` | | Date in the format YYYY-MM-DD to get all unsubscribed emails from the "date_from" to the present day. If the parameter is not specified, the default period is today (from 00:00 UTC). |
|
|
98
|
+
|
|
99
|
+
### Response: `ObsoleteUnsubscribedListResponse`
|
|
100
|
+
|
|
101
|
+
| Field | Type | Description |
|
|
102
|
+
|---|---|---|
|
|
103
|
+
| `status` | `String` | "success" string (`success`) |
|
|
104
|
+
| `unsubscribed` | `Array<ObsoleteUnsubscribedListResponseUnsubscribedItem>` | Array of object describing unsubscribed emails. |
|
|
105
|
+
|
|
106
|
+
### Example
|
|
107
|
+
|
|
108
|
+
```ruby
|
|
109
|
+
require 'unione'
|
|
110
|
+
|
|
111
|
+
Obsolete = UniOne::Api::Obsolete::Model
|
|
112
|
+
|
|
113
|
+
client = UniOne.client('YOUR_API_KEY')
|
|
114
|
+
|
|
115
|
+
response = client.obsolete.unsubscribed_list(Obsolete::ObsoleteUnsubscribedListRequest.new(
|
|
116
|
+
date_from: '2020-10-14'
|
|
117
|
+
))
|
|
118
|
+
p response.unsubscribed
|
|
119
|
+
```
|
data/docs/Project.md
ADDED
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
# Project
|
|
2
|
+
|
|
3
|
+
[Back to the list of sections](../README.md)
|
|
4
|
+
|
|
5
|
+
Projects allow you to group several independent domains, webhooks, templates, and unsubscription lists together. It's very useful if you have your own clients and manage their data from a single UniOne account. Each project receives its own API key, and all API calls with that API key only deal with the data of that project. This way, you can assign a separate project for each client and be sure that they won't conflict; e.g. unsubscribing from one project won't affect another.
|
|
6
|
+
|
|
7
|
+
Projects methods are disabled by default due to antispam measures. To enable them, [contact support](https://cp.unione.io/en/support).
|
|
8
|
+
|
|
9
|
+
Please note that sending domains are confirmed and used on per-project basis by default. But it's possible to allow projects to send emails from domains confirmed for main account - just [ask support](https://cp.unione.io/en/support) to enable it.
|
|
10
|
+
|
|
11
|
+
`UniOne::Api::Project::ProjectApi`, `client.project`
|
|
12
|
+
|
|
13
|
+
| Method | Endpoint | Description |
|
|
14
|
+
|---|---|---|
|
|
15
|
+
| [`create`](#create) | `POST /project/create.json` | Creates a new project. |
|
|
16
|
+
| [`update`](#update) | `POST /project/update.json` | Updates a project. |
|
|
17
|
+
| [`list`](#list) | `POST /project/list.json` | Lists projects. |
|
|
18
|
+
| [`delete`](#delete) | `POST /project/delete.json` | Deletes a project. |
|
|
19
|
+
|
|
20
|
+
## create
|
|
21
|
+
|
|
22
|
+
`POST /project/create.json` · [Documentation](https://docs.unione.io/en/web-api-ref#project-create)
|
|
23
|
+
|
|
24
|
+
Creates a new project.
|
|
25
|
+
|
|
26
|
+
### Request: `ProjectCreateRequest`
|
|
27
|
+
|
|
28
|
+
| Field | Type | Required | Description |
|
|
29
|
+
|---|---|---|---|
|
|
30
|
+
| `project` | `ProjectObject` | yes | Object with project properties. |
|
|
31
|
+
|
|
32
|
+
### Response: `ProjectCreateResponse`
|
|
33
|
+
|
|
34
|
+
| Field | Type | Description |
|
|
35
|
+
|---|---|---|
|
|
36
|
+
| `status` | `String` | "success" string (`success`) |
|
|
37
|
+
| `project_id` | `String` | Unqiue project identifier, ASCII string up to 36 characters long. |
|
|
38
|
+
| `project_api_key` | `String` | API key of the project. You can use it instead of the user API key parameter in all methods except project/* methods. |
|
|
39
|
+
|
|
40
|
+
### Example
|
|
41
|
+
|
|
42
|
+
```ruby
|
|
43
|
+
require 'unione'
|
|
44
|
+
|
|
45
|
+
Project = UniOne::Api::Project::Model
|
|
46
|
+
|
|
47
|
+
client = UniOne.client('YOUR_API_KEY')
|
|
48
|
+
|
|
49
|
+
response = client.project.create(Project::ProjectCreateRequest.new(
|
|
50
|
+
project: Project::ProjectObject.new(
|
|
51
|
+
name: 'Project 1A',
|
|
52
|
+
country: 'ES',
|
|
53
|
+
backend_domain_id: 1234,
|
|
54
|
+
unsubscribe_page_id: 1
|
|
55
|
+
)
|
|
56
|
+
))
|
|
57
|
+
p response.project_id
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
## update
|
|
61
|
+
|
|
62
|
+
`POST /project/update.json` · [Documentation](https://docs.unione.io/en/web-api-ref#project-update)
|
|
63
|
+
|
|
64
|
+
Updates a project.
|
|
65
|
+
|
|
66
|
+
### Request: `ProjectUpdateRequest`
|
|
67
|
+
|
|
68
|
+
| Field | Type | Required | Description |
|
|
69
|
+
|---|---|---|---|
|
|
70
|
+
| `project_id` | `String` | | Unique project identifier. You should identify project to update either with project_id or with project_api_key field. But we recommend usage of project_id as a more secure option. |
|
|
71
|
+
| `project_api_key` | `String` | | Optional project API key. You should identify project to update either with project_id or with project_api_key field. But we recommend usage of project_id as a more secure option. |
|
|
72
|
+
| `project` | `ProjectUpdateObject` | yes | Object with project properties. |
|
|
73
|
+
|
|
74
|
+
### Response: `ProjectUpdateResponse`
|
|
75
|
+
|
|
76
|
+
| Field | Type | Description |
|
|
77
|
+
|---|---|---|
|
|
78
|
+
| `status` | `String` | "success" string (`success`) |
|
|
79
|
+
| `project_api_key` | `String` | API key of the project. Returned only if the project to update was identified by project_api_key. Not returned in case of updating by project_id. |
|
|
80
|
+
|
|
81
|
+
### Example
|
|
82
|
+
|
|
83
|
+
```ruby
|
|
84
|
+
require 'unione'
|
|
85
|
+
|
|
86
|
+
Project = UniOne::Api::Project::Model
|
|
87
|
+
|
|
88
|
+
client = UniOne.client('YOUR_API_KEY')
|
|
89
|
+
|
|
90
|
+
response = client.project.update(Project::ProjectUpdateRequest.new(
|
|
91
|
+
project_id: '1234567890',
|
|
92
|
+
project_api_key: 'your api_key',
|
|
93
|
+
project: Project::ProjectUpdateObject.new(
|
|
94
|
+
name: 'Project 1A',
|
|
95
|
+
country: 'ES',
|
|
96
|
+
backend_domain_id: 1234,
|
|
97
|
+
unsubscribe_page_id: 1
|
|
98
|
+
)
|
|
99
|
+
))
|
|
100
|
+
p response.project_api_key
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
## list
|
|
104
|
+
|
|
105
|
+
`POST /project/list.json` · [Documentation](https://docs.unione.io/en/web-api-ref#project-list)
|
|
106
|
+
|
|
107
|
+
Lists projects.
|
|
108
|
+
|
|
109
|
+
### Request: `ProjectListRequest`
|
|
110
|
+
|
|
111
|
+
| Field | Type | Required | Description |
|
|
112
|
+
|---|---|---|---|
|
|
113
|
+
| `project_id` | `String` | | Optional possibility to specify project_id to include only this project to list. |
|
|
114
|
+
| `project_api_key` | `String` | | Optional possibility to specify project_api_key to include only this project to list. |
|
|
115
|
+
|
|
116
|
+
### Response: `ProjectListResponse`
|
|
117
|
+
|
|
118
|
+
| Field | Type | Description |
|
|
119
|
+
|---|---|---|
|
|
120
|
+
| `status` | `String` | "success" string (`success`) |
|
|
121
|
+
| `projects` | `Array<ProjectListObject>` | Array of objects where each object represents one project. |
|
|
122
|
+
|
|
123
|
+
### Example
|
|
124
|
+
|
|
125
|
+
```ruby
|
|
126
|
+
require 'unione'
|
|
127
|
+
|
|
128
|
+
Project = UniOne::Api::Project::Model
|
|
129
|
+
|
|
130
|
+
client = UniOne.client('YOUR_API_KEY')
|
|
131
|
+
|
|
132
|
+
response = client.project.list(Project::ProjectListRequest.new(
|
|
133
|
+
project_id: '1234567890',
|
|
134
|
+
project_api_key: 'your api_key'
|
|
135
|
+
))
|
|
136
|
+
p response.projects
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
## delete
|
|
140
|
+
|
|
141
|
+
`POST /project/delete.json` · [Documentation](https://docs.unione.io/en/web-api-ref#project-delete)
|
|
142
|
+
|
|
143
|
+
Deletes a project.
|
|
144
|
+
|
|
145
|
+
The project will be moved to the "trash bin" before being permanently deleted. You can restore the project by contacting support.
|
|
146
|
+
|
|
147
|
+
### Request: `ProjectDeleteRequest`
|
|
148
|
+
|
|
149
|
+
| Field | Type | Required | Description |
|
|
150
|
+
|---|---|---|---|
|
|
151
|
+
| `project_id` | `String` | | Unique project identifier. You should identify project to delete either with project_id or with project_api_key field. We recommend usage of project_id as a more secure option. |
|
|
152
|
+
| `project_api_key` | `String` | | Optional project API key. You should identify project to delete either with project_id or with project_api_key field. We recommend usage of project_id as a more secure option. |
|
|
153
|
+
|
|
154
|
+
### Response: `SuccessResponse`
|
|
155
|
+
|
|
156
|
+
| Field | Type | Description |
|
|
157
|
+
|---|---|---|
|
|
158
|
+
| `status` | `String` | "success" string (`success`) |
|
|
159
|
+
|
|
160
|
+
### Example
|
|
161
|
+
|
|
162
|
+
```ruby
|
|
163
|
+
require 'unione'
|
|
164
|
+
|
|
165
|
+
Project = UniOne::Api::Project::Model
|
|
166
|
+
|
|
167
|
+
client = UniOne.client('YOUR_API_KEY')
|
|
168
|
+
|
|
169
|
+
response = client.project.delete(Project::ProjectDeleteRequest.new(
|
|
170
|
+
project_id: '1234567890',
|
|
171
|
+
project_api_key: 'your api_key'
|
|
172
|
+
))
|
|
173
|
+
p response
|
|
174
|
+
```
|
data/docs/Suppression.md
ADDED
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
# Suppression
|
|
2
|
+
|
|
3
|
+
[Back to the list of sections](../README.md)
|
|
4
|
+
|
|
5
|
+
Methods for managing suppression lists. An email can be added to suppression list because of unsubscription, bounce or complain.
|
|
6
|
+
|
|
7
|
+
`UniOne::Api::Suppression::SuppressionApi`, `client.suppression`
|
|
8
|
+
|
|
9
|
+
| Method | Endpoint | Description |
|
|
10
|
+
|---|---|---|
|
|
11
|
+
| [`set`](#set) | `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](https://docs.unione.io/en/web-api-ref#suppression-delete) method. |
|
|
12
|
+
| [`get`](#get) | `POST /suppression/get.json` | Gets a reason and date of email suppression. |
|
|
13
|
+
| [`list`](#list) | `POST /suppression/list.json` | Returns a suppression list since provided date. |
|
|
14
|
+
| [`delete`](#delete) | `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. |
|
|
15
|
+
|
|
16
|
+
## set
|
|
17
|
+
|
|
18
|
+
`POST /suppression/set.json` · [Documentation](https://docs.unione.io/en/web-api-ref#suppression-set)
|
|
19
|
+
|
|
20
|
+
Adds an email address to the suppression list. You can always remove this address from the suppression list later using the [suppression/delete](https://docs.unione.io/en/web-api-ref#suppression-delete) method.
|
|
21
|
+
|
|
22
|
+
### Request: `SuppressionSetRequest`
|
|
23
|
+
|
|
24
|
+
| Field | Type | Required | Description |
|
|
25
|
+
|---|---|---|---|
|
|
26
|
+
| `email` | `String` | yes | Email to add in suppression list. |
|
|
27
|
+
| `cause` | `String` | yes | Cause of email being suppressed. One of:<br><br>- __unsubscribed__ - email is unsubscribed;<br>- __temporary_unavailable__ - the email address is unavailable. This means that over the next three days sending to this address will return an error. Email may be temporarily unavailable due to several reasons, e.g.:<br><br>- a previous email has been rejected by the recipient's server for spam;<br>- the recipient's mailbox is full or is not used;<br>- recipient's domain does not accept mail;<br>- sending server was rejected due to blacklisting;<br><br>- __permanent_unavailable__ - the email address is permanently unavailable due to multiple hard bounces;<br>- __complained__ - the recipient reported spam in the previous emails; |
|
|
28
|
+
| `created` | `String` | | When suppression was created, in UTC timezone in "YYYY-MM-DD hh:mm:ss" format. |
|
|
29
|
+
|
|
30
|
+
### Response: `SuccessResponse`
|
|
31
|
+
|
|
32
|
+
| Field | Type | Description |
|
|
33
|
+
|---|---|---|
|
|
34
|
+
| `status` | `String` | "success" string (`success`) |
|
|
35
|
+
|
|
36
|
+
### Example
|
|
37
|
+
|
|
38
|
+
```ruby
|
|
39
|
+
require 'unione'
|
|
40
|
+
|
|
41
|
+
Suppression = UniOne::Api::Suppression::Model
|
|
42
|
+
|
|
43
|
+
client = UniOne.client('YOUR_API_KEY')
|
|
44
|
+
|
|
45
|
+
response = client.suppression.set(Suppression::SuppressionSetRequest.new(
|
|
46
|
+
email: 'email@example.com',
|
|
47
|
+
cause: 'unsubscribed',
|
|
48
|
+
created: '2021-12-19 10:15:49'
|
|
49
|
+
))
|
|
50
|
+
p response
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## get
|
|
54
|
+
|
|
55
|
+
`POST /suppression/get.json` · [Documentation](https://docs.unione.io/en/web-api-ref#suppression-get)
|
|
56
|
+
|
|
57
|
+
Gets a reason and date of email suppression.
|
|
58
|
+
|
|
59
|
+
### Request: `SuppressionGetRequest`
|
|
60
|
+
|
|
61
|
+
| Field | Type | Required | Description |
|
|
62
|
+
|---|---|---|---|
|
|
63
|
+
| `email` | `String` | yes | Email to get suppression details for. |
|
|
64
|
+
| `all_projects` | `Boolean` | | If a user has projects functionality enabled, he/she can pass all_projects=true to search in all projects' data. |
|
|
65
|
+
|
|
66
|
+
### Response: `SuppressionGetResponse`
|
|
67
|
+
|
|
68
|
+
| Field | Type | Description |
|
|
69
|
+
|---|---|---|
|
|
70
|
+
| `status` | `String` | "success" string (`success`) |
|
|
71
|
+
| `email` | `String` | The email for which suppression details were requested. |
|
|
72
|
+
| `suppressions` | `Array<SuppressionGetObject>` | Array of suppression objects. |
|
|
73
|
+
|
|
74
|
+
### Example
|
|
75
|
+
|
|
76
|
+
```ruby
|
|
77
|
+
require 'unione'
|
|
78
|
+
|
|
79
|
+
Suppression = UniOne::Api::Suppression::Model
|
|
80
|
+
|
|
81
|
+
client = UniOne.client('YOUR_API_KEY')
|
|
82
|
+
|
|
83
|
+
response = client.suppression.get(Suppression::SuppressionGetRequest.new(
|
|
84
|
+
email: 'email@example.com'
|
|
85
|
+
))
|
|
86
|
+
p response.email
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
## list
|
|
90
|
+
|
|
91
|
+
`POST /suppression/list.json` · [Documentation](https://docs.unione.io/en/web-api-ref#suppression-list)
|
|
92
|
+
|
|
93
|
+
Returns a suppression list since provided date.
|
|
94
|
+
|
|
95
|
+
### Request: `SuppressionListRequest`
|
|
96
|
+
|
|
97
|
+
| Field | Type | Required | Description |
|
|
98
|
+
|---|---|---|---|
|
|
99
|
+
| `cause` | `String` | | Cause of email being suppressed. One of:<br><br>- __unsubscribed__ - email is unsubscribed;<br>- __temporary_unavailable__ - the email address is unavailable. This means that over the next three days sending to this address will return an error. Email may be temporarily unavailable due to several reasons, e.g.:<br><br>- a previous email has been rejected by the recipient's server for spam;<br>- the recipient's mailbox is full or is not used;<br>- recipient's domain does not accept mail;<br>- sending server was rejected due to blacklisting;<br><br>- __permanent_unavailable__ - the email address is permanently unavailable due to multiple hard bounces;<br>- __complained__ - the recipient reported spam in the previous emails;<br>- __blocked__ - sending to the email is prohibited by administration of UniOne.<br>We may add some new causes in the future. |
|
|
100
|
+
| `source` | `String` | | Source of email being suppressed. One of:<br><br>- __user__ - suppressed by user with [suppression/set](https://docs.unione.io/en/web-api-ref#suppression-set);<br>- __system__ - sending to the email is prohibited by system, for example due to multiple hard bounces;<br>- __subscriber__ - the recipient reported spam or unsubscribed in the previous emails. |
|
|
101
|
+
| `start_time` | `String` | | Date in the format YYYY-MM-DD hh:mm:ss to get suppression list from the "start_time" to the present day. Ignored if "cursor" is not empty. |
|
|
102
|
+
| `cursor` | `String` | | The parameter indicates from which position the selection is to be started. Must be empty or omitted for the first data chunk. In order to get subsequent chunks, you must set the "cursor" parameter in your request, using the value received in response to the previous request. |
|
|
103
|
+
| `limit` | `Integer` | | Limits the number of records to be returned at one time, default is 50. |
|
|
104
|
+
|
|
105
|
+
### Response: `SuppressionListResponse`
|
|
106
|
+
|
|
107
|
+
| Field | Type | Description |
|
|
108
|
+
|---|---|---|
|
|
109
|
+
| `status` | `String` | "success" string (`success`) |
|
|
110
|
+
| `suppressions` | `Array<SuppressionListObject>` | Array of suppression objects. |
|
|
111
|
+
| `cursor` | `String` | The parameter indicates from which position the selection is to be started. Must be empty or omitted for the first data chunk. In order to get subsequent chunks, you must set the "cursor" parameter in your request, using the value received in response to the previous request. |
|
|
112
|
+
|
|
113
|
+
### Example
|
|
114
|
+
|
|
115
|
+
```ruby
|
|
116
|
+
require 'unione'
|
|
117
|
+
|
|
118
|
+
Suppression = UniOne::Api::Suppression::Model
|
|
119
|
+
|
|
120
|
+
client = UniOne.client('YOUR_API_KEY')
|
|
121
|
+
|
|
122
|
+
response = client.suppression.list(Suppression::SuppressionListRequest.new(
|
|
123
|
+
cause: 'unsubscribed',
|
|
124
|
+
source: 'user',
|
|
125
|
+
start_time: '2020-10-14 17:00:00',
|
|
126
|
+
cursor: 'Ajfb6Hvdkn3hdhhvG57xbdufhG5',
|
|
127
|
+
limit: 50
|
|
128
|
+
))
|
|
129
|
+
p response.suppressions
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
## delete
|
|
133
|
+
|
|
134
|
+
`POST /suppression/delete.json` · [Documentation](https://docs.unione.io/en/web-api-ref#suppression-delete)
|
|
135
|
+
|
|
136
|
+
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.
|
|
137
|
+
|
|
138
|
+
### Request: `SuppressionDeleteRequest`
|
|
139
|
+
|
|
140
|
+
| Field | Type | Required | Description |
|
|
141
|
+
|---|---|---|---|
|
|
142
|
+
| `email` | `String` | yes | An email to delete from suppression list. |
|
|
143
|
+
|
|
144
|
+
### Response: `SuccessResponse`
|
|
145
|
+
|
|
146
|
+
| Field | Type | Description |
|
|
147
|
+
|---|---|---|
|
|
148
|
+
| `status` | `String` | "success" string (`success`) |
|
|
149
|
+
|
|
150
|
+
### Example
|
|
151
|
+
|
|
152
|
+
```ruby
|
|
153
|
+
require 'unione'
|
|
154
|
+
|
|
155
|
+
Suppression = UniOne::Api::Suppression::Model
|
|
156
|
+
|
|
157
|
+
client = UniOne.client('YOUR_API_KEY')
|
|
158
|
+
|
|
159
|
+
response = client.suppression.delete(Suppression::SuppressionDeleteRequest.new(
|
|
160
|
+
email: 'email@example.com'
|
|
161
|
+
))
|
|
162
|
+
p response
|
|
163
|
+
```
|
data/docs/System.md
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# System
|
|
2
|
+
|
|
3
|
+
[Back to the list of sections](../README.md)
|
|
4
|
+
|
|
5
|
+
System operations.
|
|
6
|
+
|
|
7
|
+
`UniOne::Api::System::SystemApi`, `client.system`
|
|
8
|
+
|
|
9
|
+
| Method | Endpoint | Description |
|
|
10
|
+
|---|---|---|
|
|
11
|
+
| [`ping`](#ping) | `POST /system/ping.json` | Checks API key validity and returns user ID. |
|
|
12
|
+
| [`info`](#info) | `POST /system/info.json` | Gets user or project info by API key. |
|
|
13
|
+
|
|
14
|
+
## ping
|
|
15
|
+
|
|
16
|
+
`POST /system/ping.json` · [Documentation](https://docs.unione.io/en/web-api-ref#system-ping)
|
|
17
|
+
|
|
18
|
+
Checks API key validity and returns user ID.
|
|
19
|
+
|
|
20
|
+
### Request
|
|
21
|
+
|
|
22
|
+
The method has no parameters.
|
|
23
|
+
|
|
24
|
+
### Response: `SystemPingResponse`
|
|
25
|
+
|
|
26
|
+
| Field | Type | Description |
|
|
27
|
+
|---|---|---|
|
|
28
|
+
| `status` | `String` | "success" string (`success`) |
|
|
29
|
+
| `user_id` | `Integer` | Unique user identifier. |
|
|
30
|
+
|
|
31
|
+
### Example
|
|
32
|
+
|
|
33
|
+
```ruby
|
|
34
|
+
require 'unione'
|
|
35
|
+
|
|
36
|
+
client = UniOne.client('YOUR_API_KEY')
|
|
37
|
+
|
|
38
|
+
response = client.system.ping
|
|
39
|
+
p response.user_id
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## info
|
|
43
|
+
|
|
44
|
+
`POST /system/info.json` · [Documentation](https://docs.unione.io/en/web-api-ref#system-info)
|
|
45
|
+
|
|
46
|
+
Gets user or project info by API key.
|
|
47
|
+
|
|
48
|
+
### Request
|
|
49
|
+
|
|
50
|
+
The method has no parameters.
|
|
51
|
+
|
|
52
|
+
### Response: `SystemInfoResponse`
|
|
53
|
+
|
|
54
|
+
| Field | Type | Description |
|
|
55
|
+
|---|---|---|
|
|
56
|
+
| `status` | `String` | "success" string (`success`) |
|
|
57
|
+
| `user_id` | `Integer` | Unique user identifier. |
|
|
58
|
+
| `email` | `String` | Email of the user. |
|
|
59
|
+
| `project_id` | `String` | Unqiue project identifier, ASCII string up to 36 characters long. Present only if the API key used for request is the project API key. |
|
|
60
|
+
| `project_name` | `String` | Project name, unique for user account. Present only if the API key used for request is the project API key. |
|
|
61
|
+
| `project_accounting` | `ProjectAccountingObject` | Object with email counter properties. Present only if the API key used for request is the user API key. |
|
|
62
|
+
| `accounting` | `SystemInfoResponseAccounting` | Object with accounting period properties. Present only if the API key used for request is the user API key. |
|
|
63
|
+
|
|
64
|
+
### Example
|
|
65
|
+
|
|
66
|
+
```ruby
|
|
67
|
+
require 'unione'
|
|
68
|
+
|
|
69
|
+
client = UniOne.client('YOUR_API_KEY')
|
|
70
|
+
|
|
71
|
+
response = client.system.info
|
|
72
|
+
p response.user_id
|
|
73
|
+
```
|
data/docs/Tag.md
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# Tag
|
|
2
|
+
|
|
3
|
+
[Back to the list of sections](../README.md)
|
|
4
|
+
|
|
5
|
+
This family of methods is used to manage user-defined tags. Tags are used to categorize letters based on your own criteria, e. g. to create a distinction between marketing and transactional letters or group together all notifications for a particular order type. UniOne allows you to assign tags to all outgoing emails, and the tags you’ve set may then be used to filter and analyze delivery statistics.
|
|
6
|
+
|
|
7
|
+
`UniOne::Api::Tag::TagApi`, `client.tag`
|
|
8
|
+
|
|
9
|
+
| Method | Endpoint | Description |
|
|
10
|
+
|---|---|---|
|
|
11
|
+
| [`list`](#list) | `POST /tag/list.json` | This method returns the full list of user-defined tags. Does not receive any parameters. |
|
|
12
|
+
| [`delete`](#delete) | `POST /tag/delete.json` | Removes tag. |
|
|
13
|
+
|
|
14
|
+
## list
|
|
15
|
+
|
|
16
|
+
`POST /tag/list.json` · [Documentation](https://docs.unione.io/en/web-api-ref#tag-list)
|
|
17
|
+
|
|
18
|
+
This method returns the full list of user-defined tags. Does not receive any parameters.
|
|
19
|
+
|
|
20
|
+
### Request
|
|
21
|
+
|
|
22
|
+
The method has no parameters.
|
|
23
|
+
|
|
24
|
+
### Response: `TagListResponse`
|
|
25
|
+
|
|
26
|
+
| Field | Type | Description |
|
|
27
|
+
|---|---|---|
|
|
28
|
+
| `status` | `String` | "success" string (`success`) |
|
|
29
|
+
| `tags` | `Array<TagsResponseObject>` | An array of objects containing data for user-defined tags. |
|
|
30
|
+
|
|
31
|
+
### Example
|
|
32
|
+
|
|
33
|
+
```ruby
|
|
34
|
+
require 'unione'
|
|
35
|
+
|
|
36
|
+
client = UniOne.client('YOUR_API_KEY')
|
|
37
|
+
|
|
38
|
+
response = client.tag.list
|
|
39
|
+
p response.tags
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## delete
|
|
43
|
+
|
|
44
|
+
`POST /tag/delete.json` · [Documentation](https://docs.unione.io/en/web-api-ref#tag-delete)
|
|
45
|
+
|
|
46
|
+
Removes tag.
|
|
47
|
+
|
|
48
|
+
### Request: `TagDeleteRequest`
|
|
49
|
+
|
|
50
|
+
| Field | Type | Required | Description |
|
|
51
|
+
|---|---|---|---|
|
|
52
|
+
| `tag_id` | `Integer` | yes | Unique tag id. |
|
|
53
|
+
|
|
54
|
+
### Response: `SuccessResponse`
|
|
55
|
+
|
|
56
|
+
| Field | Type | Description |
|
|
57
|
+
|---|---|---|
|
|
58
|
+
| `status` | `String` | "success" string (`success`) |
|
|
59
|
+
|
|
60
|
+
### Example
|
|
61
|
+
|
|
62
|
+
```ruby
|
|
63
|
+
require 'unione'
|
|
64
|
+
|
|
65
|
+
Tag = UniOne::Api::Tag::Model
|
|
66
|
+
|
|
67
|
+
client = UniOne.client('YOUR_API_KEY')
|
|
68
|
+
|
|
69
|
+
response = client.tag.delete(Tag::TagDeleteRequest.new(
|
|
70
|
+
tag_id: 54
|
|
71
|
+
))
|
|
72
|
+
p response
|
|
73
|
+
```
|