All URIs are relative to https://api.keap.com/crm, except if the operation defines another base path.
| Method | HTTP request | Description |
|---|---|---|
| createEmail() | POST /rest/v2/emails | Create an Email Record |
| createEmails() | POST /rest/v2/emails:batchAdd | Create a set of Email Records |
| deleteEmail() | DELETE /rest/v2/emails/{id} | Delete an Email Record |
| deleteEmails() | POST /rest/v2/emails:batchRemove | Remove a set of Email Records |
| getEmail() | GET /rest/v2/emails/{id} | Retrieve an Email |
| getEmailTemplate() | GET /rest/v2/emails/templates/{email_template_id} | Retrieve an email template |
| listEmails() | GET /rest/v2/emails | List Emails |
| sendEmail() | POST /rest/v2/emails:send | Send an Email |
| sendEmailTemplate() | POST /rest/v2/emails/templates:send | Send an email based on a template |
createEmail($create_email_sent_request): \Keap\Core\V2\Model\EmailSentWithContentCreate an Email Record
Creates a Record of an Email sent to a Contact
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure OAuth2 access token for authorization: oauth2
$config = Keap\Core\V2\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
$apiInstance = new Keap\Core\V2\Api\EmailApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$create_email_sent_request = new \Keap\Core\V2\Model\CreateEmailSentRequest(); // \Keap\Core\V2\Model\CreateEmailSentRequest
try {
$result = $apiInstance->createEmail($create_email_sent_request);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling EmailApi->createEmail: ', $e->getMessage(), PHP_EOL;
}| Name | Type | Description | Notes |
|---|---|---|---|
| create_email_sent_request | \Keap\Core\V2\Model\CreateEmailSentRequest |
\Keap\Core\V2\Model\EmailSentWithContent
- Content-Type:
application/json - Accept:
application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
createEmails($create_emails_sent_request): \Keap\Core\V2\Model\EmailsSentListCreate a set of Email Records
Creates a set of Records of Emails sent to Contacts, maximum 1000 per transaction.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure OAuth2 access token for authorization: oauth2
$config = Keap\Core\V2\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
$apiInstance = new Keap\Core\V2\Api\EmailApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$create_emails_sent_request = new \Keap\Core\V2\Model\CreateEmailsSentRequest(); // \Keap\Core\V2\Model\CreateEmailsSentRequest
try {
$result = $apiInstance->createEmails($create_emails_sent_request);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling EmailApi->createEmails: ', $e->getMessage(), PHP_EOL;
}| Name | Type | Description | Notes |
|---|---|---|---|
| create_emails_sent_request | \Keap\Core\V2\Model\CreateEmailsSentRequest |
\Keap\Core\V2\Model\EmailsSentList
- Content-Type:
application/json - Accept:
application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
deleteEmail($id)Delete an Email Record
Deletes a specific Email Record
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure OAuth2 access token for authorization: oauth2
$config = Keap\Core\V2\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
$apiInstance = new Keap\Core\V2\Api\EmailApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$id = 'id_example'; // string
try {
$apiInstance->deleteEmail($id);
} catch (Exception $e) {
echo 'Exception when calling EmailApi->deleteEmail: ', $e->getMessage(), PHP_EOL;
}| Name | Type | Description | Notes |
|---|---|---|---|
| id | string |
void (empty response body)
- Content-Type: Not defined
- Accept:
application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
deleteEmails($delete_emails_request): \Keap\Core\V2\Model\DeleteEmailsResponseRemove a set of Email Records
Removes a set of Email Records
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure OAuth2 access token for authorization: oauth2
$config = Keap\Core\V2\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
$apiInstance = new Keap\Core\V2\Api\EmailApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$delete_emails_request = new \Keap\Core\V2\Model\DeleteEmailsRequest(); // \Keap\Core\V2\Model\DeleteEmailsRequest
try {
$result = $apiInstance->deleteEmails($delete_emails_request);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling EmailApi->deleteEmails: ', $e->getMessage(), PHP_EOL;
}| Name | Type | Description | Notes |
|---|---|---|---|
| delete_emails_request | \Keap\Core\V2\Model\DeleteEmailsRequest |
\Keap\Core\V2\Model\DeleteEmailsResponse
- Content-Type:
application/json - Accept:
application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
getEmail($id): \Keap\Core\V2\Model\EmailSentWithContentRetrieve an Email
Retrieves a single Email that has been sent
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure OAuth2 access token for authorization: oauth2
$config = Keap\Core\V2\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
$apiInstance = new Keap\Core\V2\Api\EmailApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$id = 'id_example'; // string
try {
$result = $apiInstance->getEmail($id);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling EmailApi->getEmail: ', $e->getMessage(), PHP_EOL;
}| Name | Type | Description | Notes |
|---|---|---|---|
| id | string |
\Keap\Core\V2\Model\EmailSentWithContent
- Content-Type: Not defined
- Accept:
application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
getEmailTemplate($email_template_id): \Keap\Core\V2\Model\EmailTemplateRetrieve an email template
Retrieve an email template
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure OAuth2 access token for authorization: oauth2
$config = Keap\Core\V2\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
$apiInstance = new Keap\Core\V2\Api\EmailApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$email_template_id = 'email_template_id_example'; // string
try {
$result = $apiInstance->getEmailTemplate($email_template_id);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling EmailApi->getEmailTemplate: ', $e->getMessage(), PHP_EOL;
}| Name | Type | Description | Notes |
|---|---|---|---|
| email_template_id | string |
\Keap\Core\V2\Model\EmailTemplate
- Content-Type: Not defined
- Accept:
application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
listEmails($filter, $order_by, $page_size, $page_token): \Keap\Core\V2\Model\ListEmailsSentResponseList Emails
Retrieves a list of emails that have been sent
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure OAuth2 access token for authorization: oauth2
$config = Keap\Core\V2\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
$apiInstance = new Keap\Core\V2\Api\EmailApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$filter = 'filter_example'; // string | Filter to apply, allowed fields are: - (String) contact_id - (String) email - (String) start_created_time - (String) end_created_time
$order_by = 'order_by_example'; // string | Attribute and direction to order items. One of the following fields: - `created_time` One of the following directions: - `asc` - `desc`
$page_size = 0; // int | Total number of items to return per page
$page_token = 'page_token_example'; // string | Page token
try {
$result = $apiInstance->listEmails($filter, $order_by, $page_size, $page_token);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling EmailApi->listEmails: ', $e->getMessage(), PHP_EOL;
}| Name | Type | Description | Notes |
|---|---|---|---|
| filter | string | Filter to apply, allowed fields are: - (String) contact_id - (String) email - (String) start_created_time - (String) end_created_time | [optional] |
| order_by | string | Attribute and direction to order items. One of the following fields: - `created_time` One of the following directions: - `asc` - `desc` | [optional] |
| page_size | int | Total number of items to return per page | [optional] |
| page_token | string | Page token | [optional] |
\Keap\Core\V2\Model\ListEmailsSentResponse
- Content-Type: Not defined
- Accept:
application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
sendEmail($email_send_request)Send an Email
Sends an Email to a list of Contacts
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure OAuth2 access token for authorization: oauth2
$config = Keap\Core\V2\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
$apiInstance = new Keap\Core\V2\Api\EmailApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$email_send_request = new \Keap\Core\V2\Model\EmailSendRequest(); // \Keap\Core\V2\Model\EmailSendRequest
try {
$apiInstance->sendEmail($email_send_request);
} catch (Exception $e) {
echo 'Exception when calling EmailApi->sendEmail: ', $e->getMessage(), PHP_EOL;
}| Name | Type | Description | Notes |
|---|---|---|---|
| email_send_request | \Keap\Core\V2\Model\EmailSendRequest |
void (empty response body)
- Content-Type:
application/json - Accept:
application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
sendEmailTemplate($email_send_template_request)Send an email based on a template
Send an email based on a template
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure OAuth2 access token for authorization: oauth2
$config = Keap\Core\V2\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
$apiInstance = new Keap\Core\V2\Api\EmailApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$email_send_template_request = new \Keap\Core\V2\Model\EmailSendTemplateRequest(); // \Keap\Core\V2\Model\EmailSendTemplateRequest
try {
$apiInstance->sendEmailTemplate($email_send_template_request);
} catch (Exception $e) {
echo 'Exception when calling EmailApi->sendEmailTemplate: ', $e->getMessage(), PHP_EOL;
}| Name | Type | Description | Notes |
|---|---|---|---|
| email_send_template_request | \Keap\Core\V2\Model\EmailSendTemplateRequest |
void (empty response body)
- Content-Type:
application/json - Accept:
application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]