Skip to content

Commit 7802a12

Browse files
committed
Init: First commit
0 parents  commit 7802a12

File tree

94 files changed

+29603
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

94 files changed

+29603
-0
lines changed

.gitignore

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# ref: https://github.com/github/gitignore/blob/master/Composer.gitignore
2+
3+
composer.phar
4+
/vendor/
5+
6+
# Commit your application's lock file https://getcomposer.org/doc/01-basic-usage.md#commit-your-composer-lock-file-to-version-control
7+
# You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file
8+
# composer.lock
9+
10+
# php-cs-fixer cache
11+
.php_cs.cache
12+
.php-cs-fixer.cache
13+
14+
# PHPUnit cache
15+
.phpunit.result.cache

.openapi-generator-ignore

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# OpenAPI Generator Ignore
2+
# Generated by openapi-generator https://github.com/openapitools/openapi-generator
3+
4+
# Use this file to prevent files from being overwritten by the generator.
5+
# The patterns follow closely to .gitignore or .dockerignore.
6+
7+
# As an example, the C# client generator defines ApiClient.cs.
8+
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
9+
#ApiClient.cs
10+
11+
# You can match any string of characters against a directory, file or extension with a single asterisk (*):
12+
#foo/*/qux
13+
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
14+
15+
# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
16+
#foo/**/qux
17+
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
18+
19+
# You can also negate patterns with an exclamation (!).
20+
# For example, you can ignore all files in a docs folder with the file extension .md:
21+
#docs/*.md
22+
# Then explicitly reverse the ignore rule for a single file:
23+
#!docs/README.md

.openapi-generator/FILES

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
.gitignore
2+
.openapi-generator-ignore
3+
.php-cs-fixer.dist.php
4+
.travis.yml
5+
README.md
6+
composer.json
7+
docs/Api/CampaignApi.md
8+
docs/Api/ContactApi.md
9+
docs/Api/ListApi.md
10+
docs/Api/ReportsApi.md
11+
docs/Api/SenderApi.md
12+
docs/Api/TagsApi.md
13+
docs/Model/Campaign.md
14+
docs/Model/CampaignDashboardData.md
15+
docs/Model/CampaignRequest.md
16+
docs/Model/Contact.md
17+
docs/Model/ContactRequest.md
18+
docs/Model/CreateResponse.md
19+
docs/Model/DashboardStats.md
20+
docs/Model/DeleteCampaign200Response.md
21+
docs/Model/DeleteRequest.md
22+
docs/Model/DeleteResponse.md
23+
docs/Model/LastSentCampaignStat.md
24+
docs/Model/ListModel.md
25+
docs/Model/ListRequest.md
26+
docs/Model/ReportData.md
27+
docs/Model/Response.md
28+
docs/Model/Sender.md
29+
docs/Model/SenderRequest.md
30+
docs/Model/SenderResponse.md
31+
docs/Model/Tag.md
32+
docs/Model/TagRequest.md
33+
git_push.sh
34+
phpunit.xml.dist
35+
src/ApiException.php
36+
src/Configuration.php
37+
src/HeaderSelector.php
38+
src/ObjectSerializer.php
39+
src/api/CampaignApi.php
40+
src/api/ContactApi.php
41+
src/api/ListApi.php
42+
src/api/ReportsApi.php
43+
src/api/SenderApi.php
44+
src/api/TagsApi.php
45+
src/model/Campaign.php
46+
src/model/CampaignDashboardData.php
47+
src/model/CampaignRequest.php
48+
src/model/Contact.php
49+
src/model/ContactRequest.php
50+
src/model/CreateResponse.php
51+
src/model/DashboardStats.php
52+
src/model/DeleteCampaign200Response.php
53+
src/model/DeleteRequest.php
54+
src/model/DeleteResponse.php
55+
src/model/LastSentCampaignStat.php
56+
src/model/ListModel.php
57+
src/model/ListRequest.php
58+
src/model/ModelInterface.php
59+
src/model/ReportData.php
60+
src/model/Response.php
61+
src/model/Sender.php
62+
src/model/SenderRequest.php
63+
src/model/SenderResponse.php
64+
src/model/Tag.php
65+
src/model/TagRequest.php
66+
test/Api/CampaignApiTest.php
67+
test/Api/ContactApiTest.php
68+
test/Api/ListApiTest.php
69+
test/Api/ReportsApiTest.php
70+
test/Api/SenderApiTest.php
71+
test/Api/TagsApiTest.php
72+
test/Model/CampaignDashboardDataTest.php
73+
test/Model/CampaignRequestTest.php
74+
test/Model/CampaignTest.php
75+
test/Model/ContactRequestTest.php
76+
test/Model/ContactTest.php
77+
test/Model/CreateResponseTest.php
78+
test/Model/DashboardStatsTest.php
79+
test/Model/DeleteCampaign200ResponseTest.php
80+
test/Model/DeleteRequestTest.php
81+
test/Model/DeleteResponseTest.php
82+
test/Model/LastSentCampaignStatTest.php
83+
test/Model/ListModelTest.php
84+
test/Model/ListRequestTest.php
85+
test/Model/ReportDataTest.php
86+
test/Model/ResponseTest.php
87+
test/Model/SenderRequestTest.php
88+
test/Model/SenderResponseTest.php
89+
test/Model/SenderTest.php
90+
test/Model/TagRequestTest.php
91+
test/Model/TagTest.php

.openapi-generator/VERSION

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
7.8.0

.php-cs-fixer.dist.php

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<?php
2+
3+
/**
4+
* @generated
5+
* @link https://github.com/FriendsOfPHP/PHP-CS-Fixer/blob/HEAD/doc/config.rst
6+
*/
7+
$finder = PhpCsFixer\Finder::create()
8+
->in(__DIR__)
9+
->exclude('vendor')
10+
->exclude('test')
11+
->exclude('tests')
12+
;
13+
14+
$config = new PhpCsFixer\Config();
15+
return $config->setRules([
16+
'@PSR12' => true,
17+
'phpdoc_order' => true,
18+
'array_syntax' => [ 'syntax' => 'short' ],
19+
'strict_comparison' => true,
20+
'strict_param' => true,
21+
'no_trailing_whitespace' => false,
22+
'no_trailing_whitespace_in_comment' => false,
23+
'braces' => false,
24+
'single_blank_line_at_eof' => false,
25+
'blank_line_after_namespace' => false,
26+
'no_leading_import_slash' => false,
27+
])
28+
->setFinder($finder)
29+
;

.travis.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
language: php
2+
# Bionic environment has preinstalled PHP from 7.1 to 7.4
3+
# https://docs.travis-ci.com/user/reference/bionic/#php-support
4+
dist: bionic
5+
php:
6+
- 7.4
7+
before_install: "composer install"
8+
script: "vendor/bin/phpunit"

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2024 SendX
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 157 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,157 @@
1+
# SendX PHP SDK
2+
3+
## Introduction
4+
5+
SendX is an email marketing product. It helps you convert website visitors to customers, send them promotional emails, engage with them using drip sequences and craft custom journeys using powerful but simple automations.
6+
7+
The SendX API is organized around REST. Our API has predictable resource-oriented URLs, accepts form-encoded request bodies, returns JSON-encoded responses, and uses standard HTTP response codes, authentication, and verbs.
8+
The SendX Rest API doesn’t support bulk updates. You can work on only one object per request. <br>
9+
10+
11+
12+
## Installation & Usage
13+
14+
### Requirements
15+
16+
PHP 7.4 and later.
17+
Should also work with PHP 8.0.
18+
19+
### Composer
20+
21+
To install the bindings via [Composer](https://getcomposer.org/), add the following to `composer.json`:
22+
23+
```json
24+
{
25+
"repositories": [
26+
{
27+
"type": "vcs",
28+
"url": "https://github.com/sendx/sendx-php-sdk.git"
29+
}
30+
],
31+
"require": {
32+
"sendx/sendx-php-sdk": "*@dev"
33+
}
34+
}
35+
```
36+
37+
Then run `composer install`
38+
39+
### Manual Installation
40+
41+
Download the files and include `autoload.php`:
42+
43+
```php
44+
<?php
45+
require_once('/path/to/sendx/vendor/autoload.php');
46+
```
47+
48+
## Getting Started
49+
50+
Please follow the [installation procedure](#installation--usage) and then run the following:
51+
52+
```php
53+
<?php
54+
require_once(__DIR__ . '/vendor/autoload.php');
55+
56+
57+
58+
// Configure API key authorization: apiKeyAuth
59+
$config = sendx\Configuration::getDefaultConfiguration()->setApiKey('X-Team-ApiKey', 'YOUR_API_KEY');
60+
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
61+
// $config = sendx\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Team-ApiKey', 'Bearer');
62+
63+
64+
$apiInstance = new sendx\Api\CampaignApi(
65+
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
66+
// This is optional, `GuzzleHttp\Client` will be used as default.
67+
new GuzzleHttp\Client(),
68+
$config
69+
);
70+
$campaign_request = new \sendx\model\CampaignRequest(); // \sendx\model\CampaignRequest | The campaign content
71+
72+
try {
73+
$result = $apiInstance->createCampaign($campaign_request);
74+
print_r($result);
75+
} catch (Exception $e) {
76+
echo 'Exception when calling CampaignApi->createCampaign: ', $e->getMessage(), PHP_EOL;
77+
}
78+
79+
```
80+
81+
## API Endpoints
82+
83+
All URIs are relative to *https://api.sendx.io/api/v1/rest*
84+
85+
Class | Method | HTTP request | Description
86+
------------ | ------------- | ------------- | -------------
87+
*CampaignApi* | [**createCampaign**](docs/Api/CampaignApi.md#createcampaign) | **POST** /campaign | Create Campaign
88+
*CampaignApi* | [**deleteCampaign**](docs/Api/CampaignApi.md#deletecampaign) | **DELETE** /campaign/{campaignId} | Delete Campaign
89+
*CampaignApi* | [**editCampaign**](docs/Api/CampaignApi.md#editcampaign) | **PUT** /campaign/{campaignId} | Edit Campaign
90+
*CampaignApi* | [**getAllCampaigns**](docs/Api/CampaignApi.md#getallcampaigns) | **GET** /campaign | Get All Campaigns
91+
*CampaignApi* | [**getCampaignById**](docs/Api/CampaignApi.md#getcampaignbyid) | **GET** /campaign/{campaignId} | Get Campaign By Id
92+
*ContactApi* | [**createContact**](docs/Api/ContactApi.md#createcontact) | **POST** /contact | Create a contact
93+
*ContactApi* | [**deleteContact**](docs/Api/ContactApi.md#deletecontact) | **DELETE** /contact/{contactId} | Delete Contact
94+
*ContactApi* | [**getAllContacts**](docs/Api/ContactApi.md#getallcontacts) | **GET** /contact | Get All Contacts
95+
*ContactApi* | [**getContactById**](docs/Api/ContactApi.md#getcontactbyid) | **GET** /contact/{contactId} | Get Contact by ID
96+
*ContactApi* | [**unsubscribeContact**](docs/Api/ContactApi.md#unsubscribecontact) | **POST** /contact/unsubscribe/{contactId} | Unsubscribe Contact
97+
*ContactApi* | [**updateContact**](docs/Api/ContactApi.md#updatecontact) | **PUT** /contact/{contactId} | Update Contact
98+
*ListApi* | [**createList**](docs/Api/ListApi.md#createlist) | **POST** /list | Create List
99+
*ListApi* | [**deleteList**](docs/Api/ListApi.md#deletelist) | **DELETE** /list/{listId} | Delete List
100+
*ListApi* | [**getAllLists**](docs/Api/ListApi.md#getalllists) | **GET** /list | Get All Lists
101+
*ListApi* | [**getListById**](docs/Api/ListApi.md#getlistbyid) | **GET** /list/{listId} | Get List
102+
*ListApi* | [**updateList**](docs/Api/ListApi.md#updatelist) | **PUT** /list/{listId} | Update List
103+
*ReportsApi* | [**getCampaignReport**](docs/Api/ReportsApi.md#getcampaignreport) | **GET** /report/campaign/{campaignId} | Get CampaignReport Data
104+
*SenderApi* | [**createSender**](docs/Api/SenderApi.md#createsender) | **POST** /sender | Create Sender
105+
*SenderApi* | [**getAllSenders**](docs/Api/SenderApi.md#getallsenders) | **GET** /sender | Get All Senders
106+
*TagsApi* | [**createTag**](docs/Api/TagsApi.md#createtag) | **POST** /tag | Create a Tag
107+
*TagsApi* | [**deleteTag**](docs/Api/TagsApi.md#deletetag) | **DELETE** /tag/{tagId} | Delete a Tag
108+
*TagsApi* | [**getAllTags**](docs/Api/TagsApi.md#getalltags) | **GET** /tag | Get All Tags
109+
*TagsApi* | [**getTagById**](docs/Api/TagsApi.md#gettagbyid) | **GET** /tag/{tagId} | Get a Tag by ID
110+
*TagsApi* | [**updateTag**](docs/Api/TagsApi.md#updatetag) | **PUT** /tag/{tagId} | Update a Tag
111+
112+
## Models
113+
114+
- [Campaign](docs/Model/Campaign.md)
115+
- [CampaignDashboardData](docs/Model/CampaignDashboardData.md)
116+
- [CampaignRequest](docs/Model/CampaignRequest.md)
117+
- [Contact](docs/Model/Contact.md)
118+
- [ContactRequest](docs/Model/ContactRequest.md)
119+
- [CreateResponse](docs/Model/CreateResponse.md)
120+
- [DashboardStats](docs/Model/DashboardStats.md)
121+
- [DeleteCampaign200Response](docs/Model/DeleteCampaign200Response.md)
122+
- [DeleteRequest](docs/Model/DeleteRequest.md)
123+
- [DeleteResponse](docs/Model/DeleteResponse.md)
124+
- [LastSentCampaignStat](docs/Model/LastSentCampaignStat.md)
125+
- [ListModel](docs/Model/ListModel.md)
126+
- [ListRequest](docs/Model/ListRequest.md)
127+
- [ReportData](docs/Model/ReportData.md)
128+
- [Response](docs/Model/Response.md)
129+
- [Sender](docs/Model/Sender.md)
130+
- [SenderRequest](docs/Model/SenderRequest.md)
131+
- [SenderResponse](docs/Model/SenderResponse.md)
132+
- [Tag](docs/Model/Tag.md)
133+
- [TagRequest](docs/Model/TagRequest.md)
134+
135+
## Authorization
136+
137+
Authentication schemes defined for the API:
138+
### apiKeyAuth
139+
140+
- **Type**: API key
141+
- **API key parameter name**: X-Team-ApiKey
142+
- **Location**: HTTP header
143+
144+
145+
## Tests
146+
147+
To run the tests, use:
148+
149+
```bash
150+
composer install
151+
vendor/bin/phpunit
152+
```
153+
154+
## Author
155+
156+
support@sendx.io
157+

composer.json

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
{
2+
"name": "sendx/sendx-php-sdk",
3+
"version": "1.0.0",
4+
"description": "# Introduction SendX is an email marketing product. It helps you convert website visitors to customers, send them promotional emails, engage with them using drip sequences and craft custom journeys using powerful but simple automations. The SendX API is organized around REST. Our API has predictable resource-oriented URLs, accepts form-encoded request bodies, returns JSON-encoded responses, and uses standard HTTP response codes, authentication, and verbs. The SendX Rest API doesn’t support bulk updates. You can work on only one object per request. <br>",
5+
"keywords": [
6+
"php",
7+
"sdk",
8+
"rest",
9+
"api",
10+
"email",
11+
"marketing",
12+
"email_marketing",
13+
"sendx",
14+
"backend",
15+
"tool"
16+
],
17+
"homepage": "https://sendx.io",
18+
"license": "MIT",
19+
"authors": [
20+
{
21+
"name": "SendX",
22+
"homepage": "https://sendx.io"
23+
}
24+
],
25+
"require": {
26+
"php": "^7.4 || ^8.0",
27+
"ext-curl": "*",
28+
"ext-json": "*",
29+
"ext-mbstring": "*",
30+
"guzzlehttp/guzzle": "^7.3",
31+
"guzzlehttp/psr7": "^1.7 || ^2.0"
32+
},
33+
"require-dev": {
34+
"phpunit/phpunit": "^8.0 || ^9.0",
35+
"friendsofphp/php-cs-fixer": "^3.5"
36+
},
37+
"autoload": {
38+
"psr-4": { "sendx\\" : "src/" }
39+
},
40+
"autoload-dev": {
41+
"psr-4": { "sendx\\Test\\" : "test/" }
42+
}
43+
}

0 commit comments

Comments
 (0)