AhaSend Email API
- API version: 1.0.1
- Build date: 2024-04-15T10:12:27.933925439Z[GMT]
This is the API documentation for sending emails via AhaSend.com. To use this API you need to get your API Key from your account under the API Keys page.
Automatically generated by the Swagger Codegen
Building the API client library requires:
- Java 1.7+
- Maven/Gradle
To install the API client library to your local Maven repository, simply execute:
mvn clean installTo deploy it to a remote Maven repository instead, configure the settings of the repository and execute:
mvn clean deployRefer to the OSSRH Guide for more information.
Add this dependency to your project's POM:
<dependency>
<groupId>com.ahasend</groupId>
<artifactId>ahasend-java-client</artifactId>
<version>1.0.1</version>
<scope>compile</scope>
</dependency>Add this dependency to your project's build file:
compile "com.ahasend:ahasend-java-client:1.0.1"At first generate the JAR by executing:
mvn clean packageThen manually install the following JARs:
target/ahasend-java-client-1.0.1.jartarget/lib/*.jar
Please follow the installation instruction and execute the following Java code:
import com.ahasend.client.*;
import com.ahasend.client.auth.*;
import com.ahasend.client.model.*;
import com.ahasend.client.api.EmailApi;
import java.io.File;
import java.util.*;
public class EmailApiExample {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure API key authorization: api_key
ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key");
api_key.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key.setApiKeyPrefix("Token");
EmailApi apiInstance = new EmailApi();
Email body = new Email(); // Email | Email object.
String contentType = "application/json"; // Only application/json is supported for now.
try {
SuccessfulResponse result = apiInstance.sendEmail(body, contentType);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling EmailApi#sendEmail");
e.printStackTrace();
}
}
}All URIs are relative to https://api.ahasend.com/v1
| Class | Method | HTTP request | Description |
|---|---|---|---|
| EmailApi | sendEmail | POST /email/send | Send emails |
Authentication schemes defined for the API:
- Type: API key
- API key parameter name: X-Api-Key
- Location: HTTP header
It's recommended to create an instance of ApiClient per thread in a multithreaded environment to avoid any potential issues.