Skip to content

AhaSend/ahasend-java-client

Repository files navigation

ahasend-java-client

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

Requirements

Building the API client library requires:

  1. Java 1.7+
  2. Maven/Gradle

Installation

To install the API client library to your local Maven repository, simply execute:

mvn clean install

To deploy it to a remote Maven repository instead, configure the settings of the repository and execute:

mvn clean deploy

Refer to the OSSRH Guide for more information.

Maven users

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>

Gradle users

Add this dependency to your project's build file:

compile "com.ahasend:ahasend-java-client:1.0.1"

Others

At first generate the JAR by executing:

mvn clean package

Then manually install the following JARs:

  • target/ahasend-java-client-1.0.1.jar
  • target/lib/*.jar

Getting Started

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();
        }
    }
}

Documentation for API Endpoints

All URIs are relative to https://api.ahasend.com/v1

Class Method HTTP request Description
EmailApi sendEmail POST /email/send Send emails

Documentation for Models

Documentation for Authorization

Authentication schemes defined for the API:

api_key

  • Type: API key
  • API key parameter name: X-Api-Key
  • Location: HTTP header

Recommendation

It's recommended to create an instance of ApiClient per thread in a multithreaded environment to avoid any potential issues.

Author

[email protected]

About

Java client for using AhaSend APIs for sending emails, generated using Swagger Codegen

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors