Skip to content

The Mailing List Contacts features added #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 22, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 18 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ This API client provides type-safe Java interfaces for Qualtrics API, enabling s
- Retrieving project IDs for participants with incomplete project involvement
- Create, check status, and manage columns of imported data projects, as well as initiate, monitor, and download data exports
- Add, retrieve, update and delete single or multiple records in imported data projects
- Managing contacts within mailing lists
- Retrieving detailed history for contacts in mailing lists

## ✨ Why choose this client?

Expand Down Expand Up @@ -66,7 +68,19 @@ This API client provides type-safe Java interfaces for Qualtrics API, enabling s
- Get a record from imported data project
- Delete a record from imported data project
- Update a record in imported data project


- ✅ Mailing List Contacts API
- Create contact in mailing list
- List contacts in mailing list
- List bounced contacts in mailing list
- List opted-out contacts in mailing list
- Get contact in mailing list
- Update contact in mailing list
- Delete contact in mailing list

- ✅ Mailing List Contacts History API
- Get contact history in mailing list

## 🚨 Project status

> ⚠️ **Note: This is a development version!**
Expand All @@ -76,7 +90,7 @@ This API client provides type-safe Java interfaces for Qualtrics API, enabling s

## 📦 Version information

- **Current Version**: `0.1.2`
- **Current Version**: `0.1.3`
- **Supported API Version**: `v3`
- **Java Compatibility**: Java 17+

Expand All @@ -98,7 +112,7 @@ You can add the library to your project by including the dependency from Maven C
<dependency>
<groupId>pl.wtx.qualtrics</groupId>
<artifactId>qualtrics-api-client</artifactId>
<version>0.1.2</version>
<version>0.1.3</version>
</dependency>
```

Expand All @@ -116,7 +130,7 @@ Then add the locally built artifact to your project:
<dependency>
<groupId>pl.wtx.qualtrics</groupId>
<artifactId>qualtrics-api-client</artifactId>
<version>0.1.2</version>
<version>0.1.3</version>
</dependency>
```

Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>pl.wtx.qualtrics</groupId>
<artifactId>qualtrics-api-client</artifactId>
<version>0.1.2</version>
<version>0.1.3</version>
<packaging>jar</packaging>

<name>Qualtrics API Client for Java</name>
Expand Down
1,214 changes: 1,214 additions & 0 deletions src/main/java/pl/wtx/qualtrics/api/client/MailingListContactsApi.java

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,260 @@
/*
* Qualtrics API
* This is the API specification for Qualtrics platform.
*
* The version of the OpenAPI document: 3.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/


package pl.wtx.qualtrics.api.client;

import pl.wtx.qualtrics.api.client.invoker.ApiCallback;
import pl.wtx.qualtrics.api.client.invoker.ApiClient;
import pl.wtx.qualtrics.api.client.invoker.ApiException;
import pl.wtx.qualtrics.api.client.invoker.ApiResponse;
import pl.wtx.qualtrics.api.client.invoker.Configuration;
import pl.wtx.qualtrics.api.client.invoker.Pair;
import pl.wtx.qualtrics.api.client.invoker.ProgressRequestBody;
import pl.wtx.qualtrics.api.client.invoker.ProgressResponseBody;

import com.google.gson.reflect.TypeToken;

import java.io.IOException;


import pl.wtx.qualtrics.api.client.model.DefaultErrorResponse;
import pl.wtx.qualtrics.api.client.model.GetContactHistoryResponse;

import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class MailingListContactsHistoryApi {
private ApiClient localVarApiClient;
private int localHostIndex;
private String localCustomBaseUrl;

public MailingListContactsHistoryApi() {
this(Configuration.getDefaultApiClient());
}

public MailingListContactsHistoryApi(ApiClient apiClient) {
this.localVarApiClient = apiClient;
}

public ApiClient getApiClient() {
return localVarApiClient;
}

public void setApiClient(ApiClient apiClient) {
this.localVarApiClient = apiClient;
}

public int getHostIndex() {
return localHostIndex;
}

public void setHostIndex(int hostIndex) {
this.localHostIndex = hostIndex;
}

public String getCustomBaseUrl() {
return localCustomBaseUrl;
}

public void setCustomBaseUrl(String customBaseUrl) {
this.localCustomBaseUrl = customBaseUrl;
}

/**
* Build call for getMailingListContactHistory
* @param type The desired history type; one of two values: email and response (required)
* @param contactId The ID for the desired contact. (required)
* @param mailingListId The ID for the desired mailing list. (required)
* @param directoryId The directory ID, also known as a pool ID. (required)
* @param skipToken The start position for pagination. (optional)
* @param pageSize The maximum number of items to return per request (optional, default to 100)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
<table border="1">
<caption>Response Details</caption>
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> Successful Get Contact response </td><td> - </td></tr>
<tr><td> 400 </td><td> Invalid arguments response </td><td> - </td></tr>
<tr><td> 0 </td><td> A default error response </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getMailingListContactHistoryCall(@javax.annotation.Nonnull String type, @javax.annotation.Nonnull String contactId, @javax.annotation.Nonnull String mailingListId, @javax.annotation.Nonnull String directoryId, @javax.annotation.Nullable String skipToken, @javax.annotation.Nullable Integer pageSize, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };

// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}

Object localVarPostBody = null;

// create path and map variables
String localVarPath = "/directories/{directoryId}/mailinglists/{mailingListId}/contacts/{contactId}/history"
.replace("{" + "contactId" + "}", localVarApiClient.escapeString(contactId.toString()))
.replace("{" + "mailingListId" + "}", localVarApiClient.escapeString(mailingListId.toString()))
.replace("{" + "directoryId" + "}", localVarApiClient.escapeString(directoryId.toString()));

List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();

if (type != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("type", type));
}

if (skipToken != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("skipToken", skipToken));
}

if (pageSize != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("pageSize", pageSize));
}

final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}

final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}

String[] localVarAuthNames = new String[] { "api_token", "public_oauth2", "public_oauth2" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}

@SuppressWarnings("rawtypes")
private okhttp3.Call getMailingListContactHistoryValidateBeforeCall(@javax.annotation.Nonnull String type, @javax.annotation.Nonnull String contactId, @javax.annotation.Nonnull String mailingListId, @javax.annotation.Nonnull String directoryId, @javax.annotation.Nullable String skipToken, @javax.annotation.Nullable Integer pageSize, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'type' is set
if (type == null) {
throw new ApiException("Missing the required parameter 'type' when calling getMailingListContactHistory(Async)");
}

// verify the required parameter 'contactId' is set
if (contactId == null) {
throw new ApiException("Missing the required parameter 'contactId' when calling getMailingListContactHistory(Async)");
}

// verify the required parameter 'mailingListId' is set
if (mailingListId == null) {
throw new ApiException("Missing the required parameter 'mailingListId' when calling getMailingListContactHistory(Async)");
}

// verify the required parameter 'directoryId' is set
if (directoryId == null) {
throw new ApiException("Missing the required parameter 'directoryId' when calling getMailingListContactHistory(Async)");
}

return getMailingListContactHistoryCall(type, contactId, mailingListId, directoryId, skipToken, pageSize, _callback);

}

/**
* Get Contact History In Mailing List
* Retrieve the history for contacts in a mailing list. &lt;!--From Readme--&gt; For the last page of results, the value associated with _nextPage_ will be **null**. &lt;!-- theme: warning --&gt; &gt;### This API call is only available to XM Directory users.
* @param type The desired history type; one of two values: email and response (required)
* @param contactId The ID for the desired contact. (required)
* @param mailingListId The ID for the desired mailing list. (required)
* @param directoryId The directory ID, also known as a pool ID. (required)
* @param skipToken The start position for pagination. (optional)
* @param pageSize The maximum number of items to return per request (optional, default to 100)
* @return GetContactHistoryResponse
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table border="1">
<caption>Response Details</caption>
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> Successful Get Contact response </td><td> - </td></tr>
<tr><td> 400 </td><td> Invalid arguments response </td><td> - </td></tr>
<tr><td> 0 </td><td> A default error response </td><td> - </td></tr>
</table>
*/
public GetContactHistoryResponse getMailingListContactHistory(@javax.annotation.Nonnull String type, @javax.annotation.Nonnull String contactId, @javax.annotation.Nonnull String mailingListId, @javax.annotation.Nonnull String directoryId, @javax.annotation.Nullable String skipToken, @javax.annotation.Nullable Integer pageSize) throws ApiException {
ApiResponse<GetContactHistoryResponse> localVarResp = getMailingListContactHistoryWithHttpInfo(type, contactId, mailingListId, directoryId, skipToken, pageSize);
return localVarResp.getData();
}

/**
* Get Contact History In Mailing List
* Retrieve the history for contacts in a mailing list. &lt;!--From Readme--&gt; For the last page of results, the value associated with _nextPage_ will be **null**. &lt;!-- theme: warning --&gt; &gt;### This API call is only available to XM Directory users.
* @param type The desired history type; one of two values: email and response (required)
* @param contactId The ID for the desired contact. (required)
* @param mailingListId The ID for the desired mailing list. (required)
* @param directoryId The directory ID, also known as a pool ID. (required)
* @param skipToken The start position for pagination. (optional)
* @param pageSize The maximum number of items to return per request (optional, default to 100)
* @return ApiResponse&lt;GetContactHistoryResponse&gt;
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
<table border="1">
<caption>Response Details</caption>
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> Successful Get Contact response </td><td> - </td></tr>
<tr><td> 400 </td><td> Invalid arguments response </td><td> - </td></tr>
<tr><td> 0 </td><td> A default error response </td><td> - </td></tr>
</table>
*/
public ApiResponse<GetContactHistoryResponse> getMailingListContactHistoryWithHttpInfo(@javax.annotation.Nonnull String type, @javax.annotation.Nonnull String contactId, @javax.annotation.Nonnull String mailingListId, @javax.annotation.Nonnull String directoryId, @javax.annotation.Nullable String skipToken, @javax.annotation.Nullable Integer pageSize) throws ApiException {
okhttp3.Call localVarCall = getMailingListContactHistoryValidateBeforeCall(type, contactId, mailingListId, directoryId, skipToken, pageSize, null);
Type localVarReturnType = new TypeToken<GetContactHistoryResponse>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}

/**
* Get Contact History In Mailing List (asynchronously)
* Retrieve the history for contacts in a mailing list. &lt;!--From Readme--&gt; For the last page of results, the value associated with _nextPage_ will be **null**. &lt;!-- theme: warning --&gt; &gt;### This API call is only available to XM Directory users.
* @param type The desired history type; one of two values: email and response (required)
* @param contactId The ID for the desired contact. (required)
* @param mailingListId The ID for the desired mailing list. (required)
* @param directoryId The directory ID, also known as a pool ID. (required)
* @param skipToken The start position for pagination. (optional)
* @param pageSize The maximum number of items to return per request (optional, default to 100)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
<table border="1">
<caption>Response Details</caption>
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 200 </td><td> Successful Get Contact response </td><td> - </td></tr>
<tr><td> 400 </td><td> Invalid arguments response </td><td> - </td></tr>
<tr><td> 0 </td><td> A default error response </td><td> - </td></tr>
</table>
*/
public okhttp3.Call getMailingListContactHistoryAsync(@javax.annotation.Nonnull String type, @javax.annotation.Nonnull String contactId, @javax.annotation.Nonnull String mailingListId, @javax.annotation.Nonnull String directoryId, @javax.annotation.Nullable String skipToken, @javax.annotation.Nullable Integer pageSize, final ApiCallback<GetContactHistoryResponse> _callback) throws ApiException {

okhttp3.Call localVarCall = getMailingListContactHistoryValidateBeforeCall(type, contactId, mailingListId, directoryId, skipToken, pageSize, _callback);
Type localVarReturnType = new TypeToken<GetContactHistoryResponse>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
}
Loading
Loading