All URIs are relative to https://api.sendx.io/api/v1/rest
| Method | HTTP request | Description |
|---|---|---|
| createCampaign | POST /campaign | Create campaign |
| deleteCampaign | DELETE /campaign/{identifier} | Delete campaign |
| getAllCampaigns | GET /campaign | Get all campaigns |
| getCampaign | GET /campaign/{identifier} | Get campaign by ID |
RestRCampaign createCampaign(restECampaign)
Create campaign
Creates a new email campaign.
// Import classes:
import sendx_java_sdk.ApiClient;
import sendx_java_sdk.ApiException;
import sendx_java_sdk.Configuration;
import sendx_java_sdk.auth.*;
import sendx_java_sdk.models.*;
import sendx_java_sdk.CampaignApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.sendx.io/api/v1/rest");
// Configure API key authorization: TeamApiKey
ApiKeyAuth TeamApiKey = (ApiKeyAuth) defaultClient.getAuthentication("TeamApiKey");
TeamApiKey.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//TeamApiKey.setApiKeyPrefix("Token");
CampaignApi apiInstance = new CampaignApi(defaultClient);
RestECampaign restECampaign = new RestECampaign(); // RestECampaign |
try {
RestRCampaign result = apiInstance.createCampaign(restECampaign);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling CampaignApi#createCampaign");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| restECampaign | RestECampaign |
- Content-Type: application/json
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 201 | ✅ Campaign created successfully | - |
| 400 | ❌ Bad Request - Invalid input data | - |
| 401 | ❌ Unauthorized - Invalid or missing API key | - |
| 403 | ❌ Forbidden - Resource name already exists | - |
| 422 | ❌ Unprocessable Entity - Invalid request format | - |
| 500 | ❌ Internal Server Error - System error occurred | - |
DeleteResponse deleteCampaign(identifier)
Delete campaign
Deletes a campaign.
// Import classes:
import sendx_java_sdk.ApiClient;
import sendx_java_sdk.ApiException;
import sendx_java_sdk.Configuration;
import sendx_java_sdk.auth.*;
import sendx_java_sdk.models.*;
import sendx_java_sdk.CampaignApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.sendx.io/api/v1/rest");
// Configure API key authorization: TeamApiKey
ApiKeyAuth TeamApiKey = (ApiKeyAuth) defaultClient.getAuthentication("TeamApiKey");
TeamApiKey.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//TeamApiKey.setApiKeyPrefix("Token");
CampaignApi apiInstance = new CampaignApi(defaultClient);
String identifier = "identifier_example"; // String | Campaign identifier to delete
try {
DeleteResponse result = apiInstance.deleteCampaign(identifier);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling CampaignApi#deleteCampaign");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| identifier | String | Campaign identifier to delete |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | ✅ Campaign deleted successfully | - |
| 400 | ❌ Bad Request - Invalid input data | - |
| 401 | ❌ Unauthorized - Invalid or missing API key | - |
| 404 | ❌ Not Found - Resource does not exist | - |
| 500 | ❌ Internal Server Error - System error occurred | - |
List<RestRCampaign> getAllCampaigns(offset, limit, campaignType)
Get all campaigns
Retrieves a paginated list of all campaigns.
// Import classes:
import sendx_java_sdk.ApiClient;
import sendx_java_sdk.ApiException;
import sendx_java_sdk.Configuration;
import sendx_java_sdk.auth.*;
import sendx_java_sdk.models.*;
import sendx_java_sdk.CampaignApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.sendx.io/api/v1/rest");
// Configure API key authorization: TeamApiKey
ApiKeyAuth TeamApiKey = (ApiKeyAuth) defaultClient.getAuthentication("TeamApiKey");
TeamApiKey.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//TeamApiKey.setApiKeyPrefix("Token");
CampaignApi apiInstance = new CampaignApi(defaultClient);
Integer offset = 0; // Integer | Number of campaigns to skip
Integer limit = 10; // Integer | Maximum number of campaigns to return
String campaignType = "all"; // String | Filter by campaign type
try {
List<RestRCampaign> result = apiInstance.getAllCampaigns(offset, limit, campaignType);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling CampaignApi#getAllCampaigns");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| offset | Integer | Number of campaigns to skip | [optional] [default to 0] |
| limit | Integer | Maximum number of campaigns to return | [optional] [default to 10] |
| campaignType | String | Filter by campaign type | [optional] [default to all] [enum: all, draft, scheduled, sent] |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | ✅ Campaigns retrieved successfully | - |
| 401 | ❌ Unauthorized - Invalid or missing API key | - |
| 500 | ❌ Internal Server Error - System error occurred | - |
RestRCampaign getCampaign(identifier)
Get campaign by ID
Retrieves detailed information about a specific campaign.
// Import classes:
import sendx_java_sdk.ApiClient;
import sendx_java_sdk.ApiException;
import sendx_java_sdk.Configuration;
import sendx_java_sdk.auth.*;
import sendx_java_sdk.models.*;
import sendx_java_sdk.CampaignApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.sendx.io/api/v1/rest");
// Configure API key authorization: TeamApiKey
ApiKeyAuth TeamApiKey = (ApiKeyAuth) defaultClient.getAuthentication("TeamApiKey");
TeamApiKey.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//TeamApiKey.setApiKeyPrefix("Token");
CampaignApi apiInstance = new CampaignApi(defaultClient);
String identifier = "identifier_example"; // String | Campaign identifier - `campaign_IMBoxK2iB5sUdgiNOjqAMA`
try {
RestRCampaign result = apiInstance.getCampaign(identifier);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling CampaignApi#getCampaign");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| identifier | String | Campaign identifier - `campaign_IMBoxK2iB5sUdgiNOjqAMA` |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | ✅ Campaign retrieved successfully | - |
| 400 | ❌ Bad Request - Invalid input data | - |
| 401 | ❌ Unauthorized - Invalid or missing API key | - |
| 404 | ❌ Not Found - Resource does not exist | - |
| 500 | ❌ Internal Server Error - System error occurred | - |