You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The API client divides the features of Maileon's Partner REST API into specific consumable services. Each service provides all functions of it's specific category.
38
+
***AccountService:**
39
+
* Manage newsletter and customer accounts, api keys, mailing domains.
40
+
41
+
42
+
***BlacklistService:**
43
+
* Manage your blacklists.
44
+
45
+
46
+
***ContingentService:**
47
+
* Manage contingents and prepaid status.
48
+
49
+
50
+
***DistributorReportService:**
51
+
* Get Volume and SMS Reports.
52
+
53
+
54
+
***GeneralService:**
55
+
* Get domains list, validate domain, get locales.
56
+
57
+
58
+
***JobService:**
59
+
* Get jobs, create account job.
60
+
61
+
62
+
***ProductService:**
63
+
* Manage products and upload templates.
64
+
65
+
66
+
***ReportService:**
67
+
* Get report checks and report CSAs.
68
+
69
+
70
+
***RoleService:**
71
+
* Create or delete custom roles.
72
+
73
+
74
+
***UserService:**
75
+
* Manage user accounts and roles.
76
+
77
+
78
+
***WebhookService:**
79
+
* Manage webhooks.
80
+
81
+
## Examples
82
+
Get Newsletter Accounts:
83
+
```php
84
+
$service = new AccountService(['API_KEY' => 'Your API key'])
85
+
86
+
$response = $service->getNewsletterAccounts();
87
+
88
+
if(!$response->getResponse()->isSuccess()){
89
+
// handle error
90
+
}
91
+
92
+
$newsletterAccounts = $response->getData();
93
+
```
94
+
95
+
Create Job:
96
+
```php
97
+
$service = new JobService(['API_KEY' => 'Your API key'])
98
+
99
+
$response = $this->jobService->createAccountJob(
100
+
$locale,
101
+
$type,
102
+
$author,
103
+
$customerAccountName,
104
+
$newsletterAccountName,
105
+
$customDomain ?? null,
106
+
$providedDomain ?? null,
107
+
$subdomain ?? null,
108
+
$customDns ?? null,
109
+
$accountTemplateId ?? null,
110
+
$users ?? null,
111
+
$customerAccountId ?? null,
112
+
$domainAsLogin ?? null
113
+
);
114
+
115
+
if(!$response->getResponse()->isSuccess()){
116
+
// handle error
117
+
}
118
+
119
+
$data = $response->getData();
120
+
$jobId = $data['jobId'];
121
+
```
122
+
123
+
124
+
## Tests
125
+
In order to run the unit tests you need to have Docker installed.
126
+
127
+
First you need to create a .env file and add your API key:
128
+
```dotenv
129
+
MAILEON_PARTNER_API_KEY=**********
130
+
```
131
+
132
+
Run the following commands to create the container and install the required packages:
133
+
```
134
+
docker-compose up -d
135
+
136
+
docker exec -it partner-api composer install
137
+
```
138
+
139
+
Run the following commands to run the tests:
140
+
```shell
141
+
docker exec -it partner-api composer test
142
+
docker exec -it partner-api composer test-coverage // or this if you want to have the coverage generated
0 commit comments