kyvio / mailvio-api
Official Mailvio provided RESTFul API php library
Requires
- php: >=5.6
- ext-curl: *
- ext-json: *
- ext-mbstring: *
- guzzlehttp/guzzle: ^6.2 || ^7.0
Requires (Dev)
- phpunit/phpunit: ~4.8
- satooshi/php-coveralls: ~1.0
- squizlabs/php_codesniffer: ~2.6
This package is auto-updated.
Last update: 2024-05-16 16:31:21 UTC
README
Mailvio provides a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/KVSocial/mailvio-api Possible responses | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed |
This PHP package is automatically generated by the Swagger Codegen project:
- API version: 3.0.0
- Build date: 2019-10-31T15:33:40.361+04:00
- Build package: class io.swagger.codegen.languages.PhpClientCodegen
Requirements
PHP 5.6 and later
Installation & Usage
Composer
To install the bindings via Composer:
composer require kyvio/mailvio-api
Further do:
- run
composer install
to get these dependencies added to your vendor directory - add the autoloader to your application with this line:
require("vendor/autoload.php")
Tests
To run the unit tests:
composer install
./vendor/bin/phpunit lib/Tests
Getting Started
Please follow the installation procedure and then run the following:
Getting Started
Example of GET request
<?php require_once(__DIR__ . '/vendor/autoload.php'); use Swagger\Client\Api\AccountApi; use Swagger\Client\ApiClient; // Configure API key authorization: api-key $configs = new \Swagger\Client\Configuration(); $configs->setApiKey('api-key', '{your-api-key}'); $configs->setSSLVerification(false); // Configure the Api client instance $apiClient = new ApiClient($configs); // Initialize the AccountApi class $accountClass = new AccountApi($apiClient); try { $accountInfo = $accountClass->getAccount(); print_r($accountInfo); } catch (Exception $e) { echo 'Exception when calling AccountApi->getAccount: ', $e->getMessage(), PHP_EOL; } ?>
Example of POST request
<?php require_once(__DIR__ . '/vendor/autoload.php'); use Swagger\Client\Api\ContactsApi; use Swagger\Client\Model\CreateContact; use Swagger\Client\ApiClient; // Configure API key authorization: api-key $configs = new \Swagger\Client\Configuration(); $configs->setApiKey('api-key', '{your-api-key}'); $configs->setSSLVerification(false); // Configure the Api client instance $apiClient = new ApiClient($configs); // Initialize the ContactsApi class $contactClass = new ContactsApi($apiClient); try { $contactModel = new CreateContact([ 'email' => 'someEmail@mail.com' ]); $contact = $contactClass->createContact($contactModel); echo "<pre>"; print_r($contact);die; } catch (Exception $e) { echo 'Exception when calling ContactsApi->createContact: ', $e->getMessage(), PHP_EOL; }
addContactToList
\Swagger\Client\Model\PostContactInfo addContactToList($list_id, $contact_emails)
Add existing contacts to a list
Example
<?php require_once(__DIR__ . '/vendor/autoload.php'); // Configure API key authorization: api-key Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed // Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); $api_instance = new Swagger\Client\Api\ContactsApi(); $list_id = 789; // int | Id of the list $contact_emails = new \Swagger\Client\Model\AddContactToList(); // \Swagger\Client\Model\AddContactToList | Emails addresses of the contacts try { $result = $api_instance->addContactToList($list_id, $contact_emails); print_r($result); } catch (Exception $e) { echo 'Exception when calling ContactsApi->addContactToList: ', $e->getMessage(), PHP_EOL; } ?>
createAttribute
createAttribute($attribute_category, $attribute_name, $create_attribute)
Creates contact attribute
Example
<?php require_once(__DIR__ . '/vendor/autoload.php'); // Configure API key authorization: api-key Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed // Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); $api_instance = new Swagger\Client\Api\ContactsApi(); $attribute_category = "attribute_category_example"; // string | Category of the attribute $attribute_name = "attribute_name_example"; // string | Name of the attribute $create_attribute = new \Swagger\Client\Model\CreateAttribute(); // \Swagger\Client\Model\CreateAttribute | Values to create an attribute try { $api_instance->createAttribute($attribute_category, $attribute_name, $create_attribute); } catch (Exception $e) { echo 'Exception when calling ContactsApi->createAttribute: ', $e->getMessage(), PHP_EOL; } ?>
createContact
\Swagger\Client\Model\CreateUpdateContactModel createContact($create_contact)
Create a contact
Example
<?php require_once(__DIR__ . '/vendor/autoload.php'); // Configure API key authorization: api-key Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed // Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); $api_instance = new Swagger\Client\Api\ContactsApi(); $create_contact = new \Swagger\Client\Model\CreateContact(); // \Swagger\Client\Model\CreateContact | Values to create a contact try { $result = $api_instance->createContact($create_contact); print_r($result); } catch (Exception $e) { echo 'Exception when calling ContactsApi->createContact: ', $e->getMessage(), PHP_EOL; } ?>
createFolder
\Swagger\Client\Model\CreateModel createFolder($create_folder)
Create a folder
Example
<?php require_once(__DIR__ . '/vendor/autoload.php'); // Configure API key authorization: api-key Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed // Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); $api_instance = new Swagger\Client\Api\ContactsApi(); $create_folder = new \Swagger\Client\Model\CreateUpdateFolder(); // \Swagger\Client\Model\CreateUpdateFolder | Name of the folder try { $result = $api_instance->createFolder($create_folder); print_r($result); } catch (Exception $e) { echo 'Exception when calling ContactsApi->createFolder: ', $e->getMessage(), PHP_EOL; } ?>
createList
\Swagger\Client\Model\CreateModel createList($create_list)
Create a list
Example
<?php require_once(__DIR__ . '/vendor/autoload.php'); // Configure API key authorization: api-key Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed // Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); $api_instance = new Swagger\Client\Api\ContactsApi(); $create_list = new \Swagger\Client\Model\CreateList(); // \Swagger\Client\Model\CreateList | Values to create a list try { $result = $api_instance->createList($create_list); print_r($result); } catch (Exception $e) { echo 'Exception when calling ContactsApi->createList: ', $e->getMessage(), PHP_EOL; } ?>
deleteAttribute
deleteAttribute($attribute_category, $attribute_name)
Deletes an attribute
Example
<?php require_once(__DIR__ . '/vendor/autoload.php'); // Configure API key authorization: api-key Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed // Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); $api_instance = new Swagger\Client\Api\ContactsApi(); $attribute_category = "attribute_category_example"; // string | Category of the attribute $attribute_name = "attribute_name_example"; // string | Name of the existing attribute try { $api_instance->deleteAttribute($attribute_category, $attribute_name); } catch (Exception $e) { echo 'Exception when calling ContactsApi->deleteAttribute: ', $e->getMessage(), PHP_EOL; } ?>
deleteContact
deleteContact($email)
Deletes a contact
Example
<?php require_once(__DIR__ . '/vendor/autoload.php'); // Configure API key authorization: api-key Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed // Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); $api_instance = new Swagger\Client\Api\ContactsApi(); $email = "email_example"; // string | Email (urlencoded) of the contact try { $api_instance->deleteContact($email); } catch (Exception $e) { echo 'Exception when calling ContactsApi->deleteContact: ', $e->getMessage(), PHP_EOL; } ?>
deleteFolder
deleteFolder($folder_id)
Delete a folder (and all its lists)
Example
<?php require_once(__DIR__ . '/vendor/autoload.php'); // Configure API key authorization: api-key Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed // Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); $api_instance = new Swagger\Client\Api\ContactsApi(); $folder_id = 789; // int | Id of the folder try { $api_instance->deleteFolder($folder_id); } catch (Exception $e) { echo 'Exception when calling ContactsApi->deleteFolder: ', $e->getMessage(), PHP_EOL; } ?>
deleteList
deleteList($list_id)
Delete a list
Example
<?php require_once(__DIR__ . '/vendor/autoload.php'); // Configure API key authorization: api-key Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed // Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); $api_instance = new Swagger\Client\Api\ContactsApi(); $list_id = 789; // int | Id of the list try { $api_instance->deleteList($list_id); } catch (Exception $e) { echo 'Exception when calling ContactsApi->deleteList: ', $e->getMessage(), PHP_EOL; } ?>
getAttributes
\Swagger\Client\Model\GetAttributes getAttributes()
Lists all attributes
Example
<?php require_once(__DIR__ . '/vendor/autoload.php'); // Configure API key authorization: api-key Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed // Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); $api_instance = new Swagger\Client\Api\ContactsApi(); try { $result = $api_instance->getAttributes(); print_r($result); } catch (Exception $e) { echo 'Exception when calling ContactsApi->getAttributes: ', $e->getMessage(), PHP_EOL; } ?>
getContactInfo
\Swagger\Client\Model\GetExtendedContactDetails getContactInfo($email)
Retrieves contact informations
Example
<?php require_once(__DIR__ . '/vendor/autoload.php'); // Configure API key authorization: api-key Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed // Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); $api_instance = new Swagger\Client\Api\ContactsApi(); $email = "email_example"; // string | Email (urlencoded) of the contact OR its SMS attribute value try { $result = $api_instance->getContactInfo($email); print_r($result); } catch (Exception $e) { echo 'Exception when calling ContactsApi->getContactInfo: ', $e->getMessage(), PHP_EOL; } ?>
getContactStats
\Swagger\Client\Model\GetContactCampaignStats getContactStats($email)
Get the campaigns statistics for a contact
Example
<?php require_once(__DIR__ . '/vendor/autoload.php'); // Configure API key authorization: api-key Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed // Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); $api_instance = new Swagger\Client\Api\ContactsApi(); $email = "email_example"; // string | Email address (urlencoded) of the contact try { $result = $api_instance->getContactStats($email); print_r($result); } catch (Exception $e) { echo 'Exception when calling ContactsApi->getContactStats: ', $e->getMessage(), PHP_EOL; } ?>
getContacts
\Swagger\Client\Model\GetContacts getContacts($limit, $offset, $modified_since)
Get all the contacts
Example
<?php require_once(__DIR__ . '/vendor/autoload.php'); // Configure API key authorization: api-key Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed // Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); $api_instance = new Swagger\Client\Api\ContactsApi(); $limit = 50; // int | Number of documents per page $offset = 0; // int | Index of the first document of the page $modified_since = new \DateTime(); // \DateTime | Filter (urlencoded) the contacts modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result. try { $result = $api_instance->getContacts($limit, $offset, $modified_since); print_r($result); } catch (Exception $e) { echo 'Exception when calling ContactsApi->getContacts: ', $e->getMessage(), PHP_EOL; } ?>
getContactsFromList
\Swagger\Client\Model\GetContacts getContactsFromList($list_id, $modified_since, $limit, $offset)
Get the contacts in a list
Example
<?php require_once(__DIR__ . '/vendor/autoload.php'); // Configure API key authorization: api-key Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed // Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); $api_instance = new Swagger\Client\Api\ContactsApi(); $list_id = 789; // int | Id of the list $modified_since = new \DateTime(); // \DateTime | Filter (urlencoded) the contacts modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result. $limit = 50; // int | Number of documents per page $offset = 0; // int | Index of the first document of the page try { $result = $api_instance->getContactsFromList($list_id, $modified_since, $limit, $offset); print_r($result); } catch (Exception $e) { echo 'Exception when calling ContactsApi->getContactsFromList: ', $e->getMessage(), PHP_EOL; } ?>
getFolder
\Swagger\Client\Model\GetFolder getFolder($folder_id)
Returns folder details
Example
<?php require_once(__DIR__ . '/vendor/autoload.php'); // Configure API key authorization: api-key Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed // Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); $api_instance = new Swagger\Client\Api\ContactsApi(); $folder_id = 789; // int | id of the folder try { $result = $api_instance->getFolder($folder_id); print_r($result); } catch (Exception $e) { echo 'Exception when calling ContactsApi->getFolder: ', $e->getMessage(), PHP_EOL; } ?>
getFolderLists
\Swagger\Client\Model\GetFolderLists getFolderLists($folder_id, $limit, $offset)
Get the lists in a folder
Example
<?php require_once(__DIR__ . '/vendor/autoload.php'); // Configure API key authorization: api-key Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed // Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); $api_instance = new Swagger\Client\Api\ContactsApi(); $folder_id = 789; // int | Id of the folder $limit = 10; // int | Number of documents per page $offset = 0; // int | Index of the first document of the page try { $result = $api_instance->getFolderLists($folder_id, $limit, $offset); print_r($result); } catch (Exception $e) { echo 'Exception when calling ContactsApi->getFolderLists: ', $e->getMessage(), PHP_EOL; } ?>
getFolders
\Swagger\Client\Model\GetFolders getFolders($limit, $offset)
Get all the folders
Example
<?php require_once(__DIR__ . '/vendor/autoload.php'); // Configure API key authorization: api-key Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed // Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); $api_instance = new Swagger\Client\Api\ContactsApi(); $limit = 10; // int | Number of documents per page $offset = 0; // int | Index of the first document of the page try { $result = $api_instance->getFolders($limit, $offset); print_r($result); } catch (Exception $e) { echo 'Exception when calling ContactsApi->getFolders: ', $e->getMessage(), PHP_EOL; } ?>
getList
\Swagger\Client\Model\GetExtendedList getList($list_id)
Get the details of a list
Example
<?php require_once(__DIR__ . '/vendor/autoload.php'); // Configure API key authorization: api-key Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed // Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); $api_instance = new Swagger\Client\Api\ContactsApi(); $list_id = 789; // int | Id of the list try { $result = $api_instance->getList($list_id); print_r($result); } catch (Exception $e) { echo 'Exception when calling ContactsApi->getList: ', $e->getMessage(), PHP_EOL; } ?>
getLists
\Swagger\Client\Model\GetLists getLists($limit, $offset)
Get all the lists
Example
<?php require_once(__DIR__ . '/vendor/autoload.php'); // Configure API key authorization: api-key Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed // Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); $api_instance = new Swagger\Client\Api\ContactsApi(); $limit = 10; // int | Number of documents per page $offset = 0; // int | Index of the first document of the page try { $result = $api_instance->getLists($limit, $offset); print_r($result); } catch (Exception $e) { echo 'Exception when calling ContactsApi->getLists: ', $e->getMessage(), PHP_EOL; } ?>
importContacts
\Swagger\Client\Model\CreatedProcessId importContacts($request_contact_import)
Import contacts
It returns the background process ID which on completion calls the notify URL that you have set in the input.
Example
<?php require_once(__DIR__ . '/vendor/autoload.php'); // Configure API key authorization: api-key Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed // Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); $api_instance = new Swagger\Client\Api\ContactsApi(); $request_contact_import = new \Swagger\Client\Model\RequestContactImport(); // \Swagger\Client\Model\RequestContactImport | Values to import contacts in Mailvio. To know more about the expected format, please have a look at ``https://help.api.mailvio.com/hc/en-us/articles/209499265-Build-contacts-lists-for-your-email-marketing-campaigns`` try { $result = $api_instance->importContacts($request_contact_import); print_r($result); } catch (Exception $e) { echo 'Exception when calling ContactsApi->importContacts: ', $e->getMessage(), PHP_EOL; } ?>
removeContactFromList
\Swagger\Client\Model\PostContactInfo removeContactFromList($list_id, $contact_emails)
Remove existing contacts from a list
Example
<?php require_once(__DIR__ . '/vendor/autoload.php'); // Configure API key authorization: api-key Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed // Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); $api_instance = new Swagger\Client\Api\ContactsApi(); $list_id = 789; // int | Id of the list $contact_emails = new \Swagger\Client\Model\RemoveContactFromList(); // \Swagger\Client\Model\RemoveContactFromList | Emails adresses of the contact try { $result = $api_instance->removeContactFromList($list_id, $contact_emails); print_r($result); } catch (Exception $e) { echo 'Exception when calling ContactsApi->removeContactFromList: ', $e->getMessage(), PHP_EOL; } ?>
requestContactExport
\Swagger\Client\Model\CreatedProcessId requestContactExport($request_contact_export)
Export contacts
It returns the background process ID which on completion calls the notify URL that you have set in the input. File will be available in csv.
Example
<?php require_once(__DIR__ . '/vendor/autoload.php'); // Configure API key authorization: api-key Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed // Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); $api_instance = new Swagger\Client\Api\ContactsApi(); $request_contact_export = new \Swagger\Client\Model\RequestContactExport(); // \Swagger\Client\Model\RequestContactExport | Values to request a contact export try { $result = $api_instance->requestContactExport($request_contact_export); print_r($result); } catch (Exception $e) { echo 'Exception when calling ContactsApi->requestContactExport: ', $e->getMessage(), PHP_EOL; } ?>
updateAttribute
updateAttribute($attribute_category, $attribute_name, $update_attribute)
Updates contact attribute
Example
<?php require_once(__DIR__ . '/vendor/autoload.php'); // Configure API key authorization: api-key Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed // Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); $api_instance = new Swagger\Client\Api\ContactsApi(); $attribute_category = "attribute_category_example"; // string | Category of the attribute $attribute_name = "attribute_name_example"; // string | Name of the existing attribute $update_attribute = new \Swagger\Client\Model\UpdateAttribute(); // \Swagger\Client\Model\UpdateAttribute | Values to update an attribute try { $api_instance->updateAttribute($attribute_category, $attribute_name, $update_attribute); } catch (Exception $e) { echo 'Exception when calling ContactsApi->updateAttribute: ', $e->getMessage(), PHP_EOL; } ?>
updateContact
updateContact($email, $update_contact)
Updates a contact
Example
<?php require_once(__DIR__ . '/vendor/autoload.php'); // Configure API key authorization: api-key Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed // Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); $api_instance = new Swagger\Client\Api\ContactsApi(); $email = "email_example"; // string | Email (urlencoded) of the contact $update_contact = new \Swagger\Client\Model\UpdateContact(); // \Swagger\Client\Model\UpdateContact | Values to update a contact try { $api_instance->updateContact($email, $update_contact); } catch (Exception $e) { echo 'Exception when calling ContactsApi->updateContact: ', $e->getMessage(), PHP_EOL; } ?>
updateFolder
updateFolder($folder_id, $update_folder)
Update a contact folder
Example
<?php require_once(__DIR__ . '/vendor/autoload.php'); // Configure API key authorization: api-key Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed // Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); $api_instance = new Swagger\Client\Api\ContactsApi(); $folder_id = 789; // int | Id of the folder $update_folder = new \Swagger\Client\Model\CreateUpdateFolder(); // \Swagger\Client\Model\CreateUpdateFolder | Name of the folder try { $api_instance->updateFolder($folder_id, $update_folder); } catch (Exception $e) { echo 'Exception when calling ContactsApi->updateFolder: ', $e->getMessage(), PHP_EOL; } ?>
updateList
updateList($list_id, $update_list)
Update a list
Example
<?php require_once(__DIR__ . '/vendor/autoload.php'); // Configure API key authorization: api-key Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed // Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); $api_instance = new Swagger\Client\Api\ContactsApi(); $list_id = 789; // int | Id of the list $update_list = new \Swagger\Client\Model\UpdateList(); // \Swagger\Client\Model\UpdateList | Values to update a list try { $api_instance->updateList($list_id, $update_list); } catch (Exception $e) { echo 'Exception when calling ContactsApi->updateList: ', $e->getMessage(), PHP_EOL; } ?>
Documentation for API Endpoints
All URIs are relative to https://api.mailvio.com/v3/
Class | Method | HTTP request | Description |
---|---|---|---|
AccountApi | getAccount | GET /account | Get your account informations, plans and credits details |
AttributesApi | createAttribute | POST /contacts/attributes/{attributeCategory}/{attributeName} | Creates contact attribute |
AttributesApi | deleteAttribute | DELETE /contacts/attributes/{attributeCategory}/{attributeName} | Deletes an attribute |
AttributesApi | getAttributes | GET /contacts/attributes | Lists all attributes |
AttributesApi | updateAttribute | PUT /contacts/attributes/{attributeCategory}/{attributeName} | Updates contact attribute |
ContactsApi | addContactToList | POST /contacts/lists/{listId}/contacts/add | Add existing contacts to a list |
ContactsApi | createAttribute | POST /contacts/attributes/{attributeCategory}/{attributeName} | Creates contact attribute |
ContactsApi | createContact | POST /contacts | Create a contact |
ContactsApi | createFolder | POST /contacts/folders | Create a folder |
ContactsApi | createList | POST /contacts/lists | Create a list |
ContactsApi | deleteAttribute | DELETE /contacts/attributes/{attributeCategory}/{attributeName} | Deletes an attribute |
ContactsApi | deleteContact | DELETE /contacts/{email} | Deletes a contact |
ContactsApi | deleteFolder | DELETE /contacts/folders/{folderId} | Delete a folder (and all its lists) |
ContactsApi | deleteList | DELETE /contacts/lists/{listId} | Delete a list |
ContactsApi | getAttributes | GET /contacts/attributes | Lists all attributes |
ContactsApi | getContactInfo | GET /contacts/{email} | Retrieves contact informations |
ContactsApi | getContactStats | GET /contacts/{email}/campaignStats | Get the campaigns statistics for a contact |
ContactsApi | getContacts | GET /contacts | Get all the contacts |
ContactsApi | getContactsFromList | GET /contacts/lists/{listId}/contacts | Get the contacts in a list |
ContactsApi | getFolder | GET /contacts/folders/{folderId} | Returns folder details |
ContactsApi | getFolderLists | GET /contacts/folders/{folderId}/lists | Get the lists in a folder |
ContactsApi | getFolders | GET /contacts/folders | Get all the folders |
ContactsApi | getList | GET /contacts/lists/{listId} | Get the details of a list |
ContactsApi | getLists | GET /contacts/lists | Get all the lists |
ContactsApi | importContacts | POST /contacts/import | Import contacts |
ContactsApi | removeContactFromList | POST /contacts/lists/{listId}/contacts/remove | Remove existing contacts from a list |
ContactsApi | requestContactExport | POST /contacts/export | Export contacts |
ContactsApi | updateAttribute | PUT /contacts/attributes/{attributeCategory}/{attributeName} | Updates contact attribute |
ContactsApi | updateContact | PUT /contacts/{email} | Updates a contact |
ContactsApi | updateFolder | PUT /contacts/folders/{folderId} | Update a contact folder |
ContactsApi | updateList | PUT /contacts/lists/{listId} | Update a list |
EmailCampaignsApi | createEmailCampaign | POST /emailCampaigns | Create an email campaign |
EmailCampaignsApi | deleteEmailCampaign | DELETE /emailCampaigns/{campaignId} | Delete an email campaign |
EmailCampaignsApi | emailExportRecipients | POST /emailCampaigns/{campaignId}/exportRecipients | Export the recipients of a campaign |
EmailCampaignsApi | getEmailCampaign | GET /emailCampaigns/{campaignId} | Get campaign informations |
EmailCampaignsApi | getEmailCampaigns | GET /emailCampaigns | Return all your created campaigns |
EmailCampaignsApi | getSharedTemplateUrl | GET /emailCampaigns/{campaignId}/sharedUrl | Get unique URL for the email campaign or transactional template. This URL can be shared with other Mailvio users. |
EmailCampaignsApi | sendEmailCampaignNow | POST /emailCampaigns/{campaignId}/sendNow | Send an email campaign id of the campaign immediately |
EmailCampaignsApi | sendReport | POST /emailCampaigns/{campaignId}/sendReport | Send the report of a campaigns |
EmailCampaignsApi | sendTestEmail | POST /emailCampaigns/{campaignId}/sendTest | Send an email campaign to your test list |
EmailCampaignsApi | updateCampaignStatus | PUT /emailCampaigns/{campaignId}/status | Update a campaign status |
EmailCampaignsApi | updateEmailCampaign | PUT /emailCampaigns/{campaignId} | Update a campaign |
FoldersApi | createFolder | POST /contacts/folders | Create a folder |
FoldersApi | deleteFolder | DELETE /contacts/folders/{folderId} | Delete a folder (and all its lists) |
FoldersApi | getFolder | GET /contacts/folders/{folderId} | Returns folder details |
FoldersApi | getFolderLists | GET /contacts/folders/{folderId}/lists | Get the lists in a folder |
FoldersApi | getFolders | GET /contacts/folders | Get all the folders |
FoldersApi | updateFolder | PUT /contacts/folders/{folderId} | Update a contact folder |
ListsApi | addContactToList | POST /contacts/lists/{listId}/contacts/add | Add existing contacts to a list |
ListsApi | createList | POST /contacts/lists | Create a list |
ListsApi | deleteList | DELETE /contacts/lists/{listId} | Delete a list |
ListsApi | getContactsFromList | GET /contacts/lists/{listId}/contacts | Get the contacts in a list |
ListsApi | getFolderLists | GET /contacts/folders/{folderId}/lists | Get the lists in a folder |
ListsApi | getList | GET /contacts/lists/{listId} | Get the details of a list |
ListsApi | getLists | GET /contacts/lists | Get all the lists |
ListsApi | removeContactFromList | POST /contacts/lists/{listId}/contacts/remove | Remove existing contacts from a list |
ListsApi | updateList | PUT /contacts/lists/{listId} | Update a list |
ProcessApi | getProcess | GET /processes/{processId} | Return the informations for a process |
ProcessApi | getProcesses | GET /processes | Return all the processes for your account |
SMSCampaignsApi | createSmsCampaign | POST /smsCampaigns | Creates an SMS campaign |
SMSCampaignsApi | deleteSmsCampaign | DELETE /smsCampaigns/{campaignId} | Delete the SMS campaign |
SMSCampaignsApi | getSmsCampaign | GET /smsCampaigns/{campaignId} | Get an SMS campaign |
SMSCampaignsApi | getSmsCampaigns | GET /smsCampaigns | Returns the informations for all your created SMS campaigns |
SMSCampaignsApi | requestSmsRecipientExport | POST /smsCampaigns/{campaignId}/exportRecipients | Exports the recipients of the specified campaign. |
SMSCampaignsApi | sendSmsCampaignNow | POST /smsCampaigns/{campaignId}/sendNow | Send your SMS campaign immediately |
SMSCampaignsApi | sendSmsReport | POST /smsCampaigns/{campaignId}/sendReport | Send report of SMS campaigns |
SMSCampaignsApi | sendTestSms | POST /smsCampaigns/{campaignId}/sendTest | Send an SMS |
SMSCampaignsApi | updateSmsCampaign | PUT /smsCampaigns/{campaignId} | Updates an SMS campaign |
SMSCampaignsApi | updateSmsCampaignStatus | PUT /smsCampaigns/{campaignId}/status | Update the campaign status |
SMTPApi | createSmtpTemplate | POST /smtp/templates | Create a transactional email template |
SMTPApi | deleteHardbounces | POST /smtp/deleteHardbounces | Delete hardbounces |
SMTPApi | deleteSmtpTemplate | DELETE /smtp/templates/{templateId} | Delete an inactive transactional email template |
SMTPApi | getAggregatedSmtpReport | GET /smtp/statistics/aggregatedReport | Get your transactional email activity aggregated over a period of time |
SMTPApi | getEmailEventReport | GET /smtp/statistics/events | Get all your transactional email activity (unaggregated events) |
SMTPApi | getSmtpReport | GET /smtp/statistics/reports | Get your transactional email activity aggregated per day |
SMTPApi | getSmtpTemplate | GET /smtp/templates/{templateId} | Returns the template informations |
SMTPApi | getSmtpTemplates | GET /smtp/templates | Get the list of transactional email templates |
SMTPApi | getTransacBlockedContacts | GET /smtp/blockedContacts | Get the list of blocked or unsubscribed transactional contacts |
SMTPApi | getTransacEmailContent | GET /smtp/emails/{uuid} | Get the personalized content of a sent transactional email |
SMTPApi | getTransacEmailsList | GET /smtp/emails | Get the list of transactional emails on the basis of allowed filters |
SMTPApi | sendTemplate | POST /smtp/templates/{templateId}/send | Send a template |
SMTPApi | sendTestTemplate | POST /smtp/templates/{templateId}/sendTest | Send a template to your test list |
SMTPApi | sendTransacEmail | POST /smtp/email | Send a transactional email |
SMTPApi | updateSmtpTemplate | PUT /smtp/templates/{templateId} | Updates a transactional email templates |
SendersApi | createSender | POST /senders | Create a new sender |
SendersApi | deleteSender | DELETE /senders/{senderId} | Delete a sender |
SendersApi | getIps | GET /senders/ips | Return all the dedicated IPs for your account |
SendersApi | getIpsFromSender | GET /senders/{senderId}/ips | Return all the dedicated IPs for a sender |
SendersApi | getSenders | GET /senders | Get the list of all your senders |
SendersApi | updateSender | PUT /senders/{senderId} | Update a sender |
TransactionalSMSApi | getSmsEvents | GET /transactionalSMS/statistics/events | Get all the SMS activity (unaggregated events) |
TransactionalSMSApi | getTransacAggregatedSmsReport | GET /transactionalSMS/statistics/aggregatedReport | Get your SMS activity aggregated over a period of time |
TransactionalSMSApi | getTransacSmsReport | GET /transactionalSMS/statistics/reports | Get your SMS activity aggregated per day |
TransactionalSMSApi | sendTransacSms | POST /transactionalSMS/sms | Send the SMS campaign to the specified mobile number |
WebhooksApi | createWebhook | POST /webhooks | Create a webhook |
WebhooksApi | deleteWebhook | DELETE /webhooks/{webhookId} | Delete a webhook |
WebhooksApi | getWebhook | GET /webhooks/{webhookId} | Get a webhook details |
WebhooksApi | getWebhooks | GET /webhooks | Get all webhooks |
WebhooksApi | updateWebhook | PUT /webhooks/{webhookId} | Update a webhook |
Documentation For Models
- AddContactToList
- CreateAttribute
- CreateAttributeEnumeration
- CreateContact
- CreateEmailCampaign
- CreateEmailCampaignRecipients
- CreateEmailCampaignSender
- CreateList
- CreateModel
- CreateSender
- CreateSenderIps
- CreateSenderModel
- CreateSmsCampaign
- CreateSmsCampaignRecipients
- CreateSmtpEmail
- CreateSmtpTemplate
- CreateSmtpTemplateSender
- CreateUpdateContactModel
- CreateUpdateFolder
- CreateWebhook
- CreatedProcessId
- DeleteHardbounces
- EmailExportRecipients
- ErrorModel
- GetAccount
- GetAggregatedReport
- GetAttributes
- GetAttributesAttributes
- GetAttributesEnumeration
- GetCampaignOverview
- GetCampaignRecipients
- GetCampaignStats
- GetClient
- GetContactCampaignStats
- GetContactCampaignStatsClicked
- GetContactCampaignStatsLinks
- GetContactCampaignStatsMessagesSent
- GetContactCampaignStatsOpened
- GetContactCampaignStatsTransacAttributes
- GetContactCampaignStatsUnsubscriptions
- GetContactCampaignStatsUnsubscriptionsAdminUnsubscription
- GetContactCampaignStatsUnsubscriptionsUserUnsubscription
- GetContactDetails
- GetContacts
- GetEmailCampaign
- GetEmailCampaigns
- GetEmailEventReport
- GetEmailEventReportEvents
- GetExtendedCampaignOverview
- GetExtendedCampaignStats
- GetExtendedClient
- GetExtendedContactDetails
- GetExtendedList
- GetFolder
- GetFolderLists
- GetFolders
- GetIp
- GetIpFromSender
- GetIps
- GetIpsFromSender
- GetList
- GetLists
- GetProcess
- GetProcesses
- GetReports
- GetReportsReports
- GetSendersList
- GetSendersListIps
- GetSendersListSenders
- GetSharedTemplateUrl
- GetSmsCampaign
- GetSmsCampaignOverview
- GetSmsCampaignStats
- GetSmsCampaigns
- GetSmsEventReport
- GetSmsEventReportEvents
- GetSmtpTemplateOverview
- GetSmtpTemplateOverviewSender
- GetSmtpTemplates
- GetStatsByDomain
- GetTransacAggregatedSmsReport
- GetTransacBlockedContacts
- GetTransacBlockedContactsContacts
- GetTransacEmailContent
- GetTransacEmailContentEvents
- GetTransacEmailsList
- GetTransacEmailsListTransactionalEmails
- GetTransacSmsReport
- GetTransacSmsReportReports
- GetWebhook
- GetWebhooks
- ManageIp
- PostContactInfo
- PostContactInfoContacts
- PostSendFailed
- PostSendSmsTestFailed
- RemoveContactFromList
- RequestContactExport
- RequestContactImport
- RequestContactImportNewList
- RequestSmsRecipientExport
- SendEmail
- SendEmailAttachment
- SendReport
- SendReportEmail
- SendSms
- SendSmtpEmail
- SendSmtpEmailAttachment
- SendSmtpEmailBcc
- SendSmtpEmailCc
- SendSmtpEmailReplyTo
- SendSmtpEmailSender
- SendSmtpEmailTo
- SendTemplateEmail
- SendTestEmail
- SendTestSms
- SendTransacSms
- UpdateAttribute
- UpdateAttributeEnumeration
- UpdateCampaignStatus
- UpdateContact
- UpdateEmailCampaign
- UpdateEmailCampaignRecipients
- UpdateEmailCampaignSender
- UpdateList
- UpdateSender
- UpdateSmsCampaign
- UpdateSmtpTemplate
- UpdateSmtpTemplateSender
- UpdateWebhook
Documentation For Authorization
api-key
- Type: API key
- API key parameter name: api-key
- Location: HTTP header