Email Send API

Overview 

Allows the ability to send a single adhoc email without having to create a lead, prospect or owner within Aimbase. 

The necessary email data is submitted to our API via HTTP POST. The API will accept JSON or XML based on what content type is set in the Content-Type HTTP header. To submit JSON data set the Content-Type header to “application/json”, to submit XML set the Content-Type HTTP header to “application/xml”. 

When successfully posted, the Email Send API will create a “send” for the specified email and it’s subscribers in the Send grid of Aimbase.  


Possible response Codes: 

  • 200 (OK). This response indicates that the request was successful. 
  • 400 (Bad Request). This response indicates that the request was not successful. The response body will contain an error message. 
  • 500 (Internal Server Error). An unknown error occurred during the import. 

 

The HTTP endpoints that will accept the POST data are:  

  • https://{baseaddress}/Email/api/Send 

 

The post must be authenticated with a token. For more information on how to retrieve this token, please refer to Aimbase Authentication Web Service Specification. 


Authenticate message header example: 

Authenticate: Avala-Api {token} 


Lead Data Schema 

Field Name  Required  Format  Description 
Email Code  X  Max Length: 50  The code of the email being sent.  
Recipients  X  Max Length: 100  Defines the recipient’s email address that will receive the email. There can be more than one recipients but each will have their own set of attributes.  
Attributes    See Attributes section  These define the attributes that will be set in the email for the recipients, if there are attributes in the email they should be defined here.  

 

Attributes 

Attributes must be defined in the Email API to fill in attributes that are in the emails. Each attribute must match the attribute that is defined in the email (@Attributes.“AttributeName”). 

When included in the post, you list the attribute name as defined in Aimbase, and then the attribute value of the recipient.  

Each recipient has their own set of attributes. 

Please see Appendix C – Attributes by Email Type for a list of all attributes. These are automatic attributes, there can be custom attributes defined as well that would be in the email as @Attributes.Custom.“AttributeName 

 

Multiple Recipients 

To set multiple recipients, you must list out each recipient and their attributes. See appendix A for a sample json request with two recipients. 

 

APPENDIX A – Sample POST (JSON) 

{ 
    "EmailCode""InitialSurveyInvite", 
    "Recipients": { 
        "amyb@avalamarketing.com": { 
            "ProspectFirstName""Amy", 
            "ProspectLastName""Brown", 
            "SurveyTypeCode""R0", 
            "SurveyType""Initial" 
        }, 
        "scotti@avalamarketing.com": { 
            "ProspectFirstName""Scott", 
            "ProspectLastName""Isaak", 
            "SurveyTypeCode""R0", 
            "SurveyType""Initial" 
        } 
    } 


APPENDIX C – Automatic Attributes by Email Type 

General 
BaseUrl 
BulkExportDownloadUrl 
ErrorCount 
FileName 
FtpImportErrors 
FtpImportFileName 
ImportRunId 
OwnerProfileUrl 
PasswordResetKey 
TotalCount 
Username 


Contact Notification 
BaseUrl 
ContactEmail 
ContactFirstName 
ContactId 
ContactLastName 
ContactUid 
Custom 
Date 
ManufacturerCode 
ManufacturerName 
NotificationQueueUid 
WebSessionServiceUrl 


MARKETING 
BaseUrl 
CompanyName 
Custom 
Date 
DealerAddress 
DealerAddress2 
DealerCity 
DealerCountryCode 
DealerEmail 
DealerId 
DealerName 
DealerNumber 
DealerPhone 
DealerPostalCode 
DealerPrimaryContact 
DealerState 
DealerWebsiteUrl 
IsActive 
LeadCategoryName 
LeadDate 
LeadID 
LeadSourceName 
LeadTypeName 
LeadUid 
ManufacturerId 
NotificationQueueUid 
ProductBrand 
ProductBrandID 
ProductBrandLevel 
ProductCode 
ProductId 
ProductName 
ProductType 
ProductYear 
ProspectAddress1 
ProspectAddress2 
ProspectAggregationId 
ProspectCity 
ProspectCountryCode 
ProspectEmail 
ProspectFirstName 
ProspectHomePhone 
ProspectId 
ProspectLastName 
ProspectMobilePhone 
ProspectPostalCode 
ProspectState 
ProspectUid 
Score 
WebSessionServiceUrl 


CSI 
BaseUrl 
CommunicationOptInDate 
CommunicationOptInIpAddress 
CommunicationOptInSource 
Custom 
Date 
DealerEmail 
DealerId 
DealerName 
DealerNumber 
DealerPrimaryContact 
Email 
FirstName (reg) 
IsCommunicationOptIn 
LastName (reg) 
Manufacturer 
ManufacturerCode 
ManufacturerId 
ManufacturerName 
ManufacturerSignatureName 
ManufacturerSignatureTitle 
ModelYear 
NotificationQueueUid 
OwnerAddress1 
OwnerAddress2 
OwnerCity 
OwnerCountryCode 
OwnerEmail 
OwnerFirstName 
OwnerHomePhone 
OwnerId 
OwnerLanguageCode 
OwnerLastName 
OwnerMobilePhone 
OwnerPostalCode 
OwnerState 
OwnerTitle 
ProductBrand 
ProductBrandId 
ProductBrandLevel 
ProductCode 
ProductId 
ProductName 
ProductType 
PurchaseDate 
RegistrationHistoryId 
RegistrationTypeCode 
SerialNumber 
SurveyFormId 
SurveyKeyIDString 
SurveyKeyIDStringNoDash 
SurveyResponseDate 
SurveyResponseId 
SurveyResponseSourceName 
SurveyTypeCode 
SurveyTypeName 
WebSessionServiceUrl