https://github.com/mailmojo/mailmojo-php-sdk
PHP SDK for the Mailmojo API
https://github.com/mailmojo/mailmojo-php-sdk
Last synced: 6 months ago
JSON representation
PHP SDK for the Mailmojo API
- Host: GitHub
- URL: https://github.com/mailmojo/mailmojo-php-sdk
- Owner: mailmojo
- License: apache-2.0
- Created: 2016-12-13T13:47:00.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2022-02-24T21:17:37.000Z (over 4 years ago)
- Last Synced: 2024-11-28T12:35:59.885Z (over 1 year ago)
- Language: PHP
- Homepage:
- Size: 169 KB
- Stars: 1
- Watchers: 6
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
MailMojo SDK for PHP
====================
v1 of the MailMojo API
This package is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project:
- API version: 1.1.0
- Package version: 0.5.0
For more information, please visit [https://mailmojo.dev](https://mailmojo.dev)
## Requirements
PHP 5.5.0 and later
## Installation & Usage
### Composer
To install the bindings via [Composer](http://getcomposer.org/), add the following to `composer.json`:
```
{
"require": {
"eliksir/mailmojo-php-sdk": "0.5.0"
}
}
```
Then run `composer install`
### Manual Installation
Download the files and include `autoload.php`:
```php
require_once('/path/to/mailmojo/autoload.php');
```
## Tests
To run the unit tests:
```
composer install
./vendor/bin/phpunit
```
## Getting Started
Please follow the [installation procedure](#installation--usage). The following is an automatically generated
example executing one operation, just to illustrate how the library is used in general:
```php
setAccessToken('YOUR_ACCESS_TOKEN');
$api_instance = new MailMojo\Api\WebhookApi();
$id = 56; // int | ID of the webhook.
try {
$api_instance->deleteWebhook($id);
} catch (Exception $e) {
echo 'Exception when calling WebhookApi->deleteWebhook: ', $e->getMessage(), PHP_EOL;
}
?>
```
## Documentation for API Endpoints
All URIs are relative to *https://api.mailmojo.no*
Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*AccountApi* | [**createAccount**](docs/Api/AccountApi.md#createaccount) | **POST** /v1/accounts/ | Create an account.
*AccountApi* | [**getAccountByUsername**](docs/Api/AccountApi.md#getaccountbyusername) | **GET** /v1/accounts/{username}/ | Retrieve account details.
*AccountApi* | [**getDomain**](docs/Api/AccountApi.md#getdomain) | **GET** /v1/domains/{domain_id}/ | Retrieve domain details and authentication status.
*AccountApi* | [**getDomains**](docs/Api/AccountApi.md#getdomains) | **GET** /v1/domains/ | Retrieve a list of all domains and their status.
*AccountApi* | [**updateAccount**](docs/Api/AccountApi.md#updateaccount) | **POST** /v1/accounts/{username}/ | Update account details.
*AutomationApi* | [**getCampaignById**](docs/Api/AutomationApi.md#getcampaignbyid) | **GET** /v1/campaigns/{campaign_id}/ | Retrieve an automation campaign by id.
*ContactApi* | [**getContactByEmail**](docs/Api/ContactApi.md#getcontactbyemail) | **GET** /v1/contacts/{email}/ | Retrieve a contact in any list by email.
*ContactApi* | [**getContacts**](docs/Api/ContactApi.md#getcontacts) | **GET** /v1/contacts/ | Retrieve all contacts across every list.
*ContactApi* | [**getHistoricalContactStats**](docs/Api/ContactApi.md#gethistoricalcontactstats) | **GET** /v1/contacts/stats/ | Retrieve historical stats over contacts across every list.
*ContactApi* | [**getSubscriberOnListByEmail**](docs/Api/ContactApi.md#getsubscriberonlistbyemail) | **GET** /v1/lists/{list_id}/subscribers/{email}/ | Retrieve a subscriber.
*ContactApi* | [**getSubscribersOnList**](docs/Api/ContactApi.md#getsubscribersonlist) | **GET** /v1/lists/{list_id}/subscribers/ | Retrieve subscribers on a list.
*ContactApi* | [**getUnsubscribedOnList**](docs/Api/ContactApi.md#getunsubscribedonlist) | **GET** /v1/lists/{list_id}/unsubscribed/ | Retrieve unsubscribed contacts on a list.
*ContactApi* | [**subscribeContactToList**](docs/Api/ContactApi.md#subscribecontacttolist) | **POST** /v1/lists/{list_id}/subscribers/ | Subscribe a contact to the email list.
*ContactApi* | [**unsubscribeContactOnListByEmail**](docs/Api/ContactApi.md#unsubscribecontactonlistbyemail) | **DELETE** /v1/lists/{list_id}/subscribers/{email}/ | Unsubscribe a contact.
*ContactApi* | [**updateContact**](docs/Api/ContactApi.md#updatecontact) | **PATCH** /v1/contacts/{email}/ | Update details about a contact.
*EmbedApi* | [**createEmbedSession**](docs/Api/EmbedApi.md#createembedsession) | **POST** /v1/embed/ | Create a new embedded application session.
*FormApi* | [**formAddSubscriber**](docs/Api/FormApi.md#formaddsubscriber) | **PATCH** /v1/forms/{id}/subscribers/ | Add a subscriber through a form and track the conversion.
*FormApi* | [**getFormById**](docs/Api/FormApi.md#getformbyid) | **GET** /v1/forms/{id}/ | Retrieve a form.
*FormApi* | [**getForms**](docs/Api/FormApi.md#getforms) | **GET** /v1/forms/ | Retrieve all forms.
*FormApi* | [**trackFormView**](docs/Api/FormApi.md#trackformview) | **PATCH** /v1/forms/{id}/track/view/ | Track a view of a form.
*FormApi* | [**updateForm**](docs/Api/FormApi.md#updateform) | **PATCH** /v1/forms/{id}/ | Update a form partially.
*ListApi* | [**createList**](docs/Api/ListApi.md#createlist) | **POST** /v1/lists/ | Create an email list.
*ListApi* | [**createSegment**](docs/Api/ListApi.md#createsegment) | **POST** /v1/lists/{list_id}/segments/ | Create a segment in the email list.
*ListApi* | [**getListById**](docs/Api/ListApi.md#getlistbyid) | **GET** /v1/lists/{list_id}/ | Retrieve an email list.
*ListApi* | [**getLists**](docs/Api/ListApi.md#getlists) | **GET** /v1/lists/ | Retrieve all email lists.
*ListApi* | [**getSubscriberOnListByEmail**](docs/Api/ListApi.md#getsubscriberonlistbyemail) | **GET** /v1/lists/{list_id}/subscribers/{email}/ | Retrieve a subscriber.
*ListApi* | [**getSubscribersOnList**](docs/Api/ListApi.md#getsubscribersonlist) | **GET** /v1/lists/{list_id}/subscribers/ | Retrieve subscribers on a list.
*ListApi* | [**getUnsubscribedOnList**](docs/Api/ListApi.md#getunsubscribedonlist) | **GET** /v1/lists/{list_id}/unsubscribed/ | Retrieve unsubscribed contacts on a list.
*ListApi* | [**importSubscribersToList**](docs/Api/ListApi.md#importsubscriberstolist) | **POST** /v1/lists/{list_id}/subscribers/import/ | Subscribe contacts to the email list.
*ListApi* | [**subscribeContactToList**](docs/Api/ListApi.md#subscribecontacttolist) | **POST** /v1/lists/{list_id}/subscribers/ | Subscribe a contact to the email list.
*ListApi* | [**unsubscribeContactOnListByEmail**](docs/Api/ListApi.md#unsubscribecontactonlistbyemail) | **DELETE** /v1/lists/{list_id}/subscribers/{email}/ | Unsubscribe a contact.
*ListApi* | [**updateList**](docs/Api/ListApi.md#updatelist) | **PATCH** /v1/lists/{list_id}/ | Update an email list partially.
*NewsletterApi* | [**cancelNewsletter**](docs/Api/NewsletterApi.md#cancelnewsletter) | **PUT** /v1/newsletters/{newsletter_id}/cancel/ | Cancel a newsletter.
*NewsletterApi* | [**createNewsletter**](docs/Api/NewsletterApi.md#createnewsletter) | **POST** /v1/newsletters/ | Create a newsletter draft.
*NewsletterApi* | [**getNewsletterById**](docs/Api/NewsletterApi.md#getnewsletterbyid) | **GET** /v1/newsletters/{newsletter_id}/ | Retrieve a newsletter by id.
*NewsletterApi* | [**getNewsletters**](docs/Api/NewsletterApi.md#getnewsletters) | **GET** /v1/newsletters/ | Retrieve all newsletters.
*NewsletterApi* | [**sendNewsletter**](docs/Api/NewsletterApi.md#sendnewsletter) | **PUT** /v1/newsletters/{newsletter_id}/send/ | Send a newsletter.
*NewsletterApi* | [**testNewsletter**](docs/Api/NewsletterApi.md#testnewsletter) | **POST** /v1/newsletters/{newsletter_id}/send_test/ | Send a test newsletter.
*NewsletterApi* | [**updateNewsletter**](docs/Api/NewsletterApi.md#updatenewsletter) | **PATCH** /v1/newsletters/{newsletter_id}/ | Update a newsletter draft partially.
*PageApi* | [**getPageById**](docs/Api/PageApi.md#getpagebyid) | **GET** /v1/pages/{id}/ | Retrieve a landing page.
*PageApi* | [**getPages**](docs/Api/PageApi.md#getpages) | **GET** /v1/pages/ | Retrieve all landing pages.
*PageApi* | [**trackPageView**](docs/Api/PageApi.md#trackpageview) | **PATCH** /v1/pages/{id}/track/view/ | Track a view of a landing page.
*PageApi* | [**updatePage**](docs/Api/PageApi.md#updatepage) | **PATCH** /v1/pages/{id}/ | Update a landing page partially.
*SegmentApi* | [**createSegment**](docs/Api/SegmentApi.md#createsegment) | **POST** /v1/lists/{list_id}/segments/ | Create a segment in the email list.
*TemplateApi* | [**getTemplates**](docs/Api/TemplateApi.md#gettemplates) | **GET** /v1/templates/ | Retrieve all templates.
*WebhookApi* | [**createWebhook**](docs/Api/WebhookApi.md#createwebhook) | **POST** /v1/webhooks/ | Create a webhook.
*WebhookApi* | [**deleteWebhook**](docs/Api/WebhookApi.md#deletewebhook) | **DELETE** /v1/webhooks/{id}/ | Delete a webhook.
## Documentation For Models
- [AddFormSubscriber](docs/Model/AddFormSubscriber.md)
- [BaseContact](docs/Model/BaseContact.md)
- [CampaignDetail](docs/Model/CampaignDetail.md)
- [CampaignStatistics](docs/Model/CampaignStatistics.md)
- [Category](docs/Model/Category.md)
- [Contact](docs/Model/Contact.md)
- [ContactList](docs/Model/ContactList.md)
- [Domain](docs/Model/Domain.md)
- [Embed](docs/Model/Embed.md)
- [EmbedOptions](docs/Model/EmbedOptions.md)
- [Form](docs/Model/Form.md)
- [FormConversion](docs/Model/FormConversion.md)
- [HistoricalContactsStats](docs/Model/HistoricalContactsStats.md)
- [ImportResult](docs/Model/ImportResult.md)
- [InlineResponse200](docs/Model/InlineResponse200.md)
- [ListDetail](docs/Model/ListDetail.md)
- [MinimalSegment](docs/Model/MinimalSegment.md)
- [ModelList](docs/Model/ModelList.md)
- [NewsletterCreation](docs/Model/NewsletterCreation.md)
- [NewsletterDetail](docs/Model/NewsletterDetail.md)
- [NewsletterSend](docs/Model/NewsletterSend.md)
- [NewsletterSendTest](docs/Model/NewsletterSendTest.md)
- [NewsletterUpdate](docs/Model/NewsletterUpdate.md)
- [Page](docs/Model/Page.md)
- [PageMeta](docs/Model/PageMeta.md)
- [Schema](docs/Model/Schema.md)
- [Segment](docs/Model/Segment.md)
- [SegmentCreation](docs/Model/SegmentCreation.md)
- [SegmentTagPredicate](docs/Model/SegmentTagPredicate.md)
- [Statistics](docs/Model/Statistics.md)
- [Subscriber](docs/Model/Subscriber.md)
- [Template](docs/Model/Template.md)
- [TrackFormView](docs/Model/TrackFormView.md)
- [TrackPageView](docs/Model/TrackPageView.md)
- [User](docs/Model/User.md)
- [UserCreation](docs/Model/UserCreation.md)
- [WebhookCreation](docs/Model/WebhookCreation.md)
## Documentation For Authorization
## mailmojo_auth
- **Type**: OAuth
- **Flow**: accessCode
- **Authorization URL**: https://api.mailmojo.no/oauth/authorize/
- **Scopes**:
- **account**: Manage your MailMojo account.
- **account_creation**: Create new MailMojo accounts.
- **account_creation.trial_30**: Create new MailMojo accounts with a 30 day trial period.
- **account_settings**: Manage your MailMojo account settings.
- **campaigns**: Manage your automated campaigns.
- **campaigns:read**: Retrieve your automated campaigns.
- **contacts**: Manage your contacts across all your email lists.
- **contacts:read**: Retrieve your contacts across all your email lists.
- **embed**: Give you an embedded MailMojo application with access to your account.
- **events**: Track events on your forms and landing pages.
- **forms**: Manage your forms.
- **forms:read**: Retrieve your forms.
- **lists**: Manage your email lists, excluding subscribers.
- **lists:read**: Retrieve your email lists, excluding subscribers.
- **newsletters**: Manage your newsletters.
- **newsletters:read**: Retrieve your newsletters.
- **pages**: Manage your landing pages.
- **pages:read**: Retrieve your landing pages.
- **subscribe**: Add subscribers to email lists.
- **templates**: Manage your templates.
- **templates:read**: Retrieve your templates
- **webhooks**: Manage your webhooks.
## Author
hjelp@mailmojo.no