All URIs are relative to https://api.telnyx.com/v2
Method | HTTP request | Description |
---|---|---|
acceptCampaign | POST /campaign/acceptSharing/{campaignId} | Accept Shared Campaign |
deactivateCampaign | DELETE /campaign/{campaignId} | Deactivate My Campaign |
getCampaign | GET /campaign/{campaignId} | Get My Campaign |
getCampaignCost | GET /campaign/usecase/cost | Get Campaign Cost |
getCampaignMnoMetadata | GET /campaign/{campaignId}/mnoMetadata | Get Campaign Mno Metadata |
getCampaignOperationStatus | GET /campaign/{campaignId}/operationStatus | Get My Campaign Operation Status |
getCampaignOsrAttributes | GET /campaign/{campaignId}/osr/attributes | Get My Osr Campaign Attributes |
getCampaignSharingStatus | GET /campaign/{campaignId}/sharing | Get Sharing Status |
getCampaigns | GET /campaign | List Campaigns |
getUsecaseQualification | GET /campaignBuilder/brand/{brandId}/usecase/{usecase} | Qualify By Usecase |
postCampaign | POST /campaignBuilder | Submit Campaign |
updateCampaign | PUT /campaign/{campaignId} | Update My Campaign |
Object acceptCampaign(campaignId)
Accept Shared Campaign
Manually accept a campaign shared with Telnyx
// Import classes:
import com.telnyx.sdk.ApiClient;
import com.telnyx.sdk.ApiException;
import com.telnyx.sdk.Configuration;
import com.telnyx.sdk.auth.*;
import com.telnyx.sdk.model.*;
import com.telnyx.sdk.api.CampaignApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.telnyx.com/v2");
// Configure HTTP bearer authorization: bearerAuth
HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
bearerAuth.setBearerToken("BEARER TOKEN");
CampaignApi apiInstance = new CampaignApi(defaultClient);
String campaignId = "campaignId_example"; // String | TCR's ID for the campaign to import
try {
Object result = apiInstance.acceptCampaign(campaignId);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling CampaignApi#acceptCampaign");
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 |
---|---|---|---|
campaignId | String | TCR's ID for the campaign to import |
Object
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Successful Response | - |
422 | Validation Error | - |
CampaignDeletionResponse deactivateCampaign(campaignId)
Deactivate My Campaign
Terminate a campaign. Note that once deactivated, a campaign cannot be restored.
// Import classes:
import com.telnyx.sdk.ApiClient;
import com.telnyx.sdk.ApiException;
import com.telnyx.sdk.Configuration;
import com.telnyx.sdk.auth.*;
import com.telnyx.sdk.model.*;
import com.telnyx.sdk.api.CampaignApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.telnyx.com/v2");
// Configure HTTP bearer authorization: bearerAuth
HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
bearerAuth.setBearerToken("BEARER TOKEN");
CampaignApi apiInstance = new CampaignApi(defaultClient);
String campaignId = "campaignId_example"; // String |
try {
CampaignDeletionResponse result = apiInstance.deactivateCampaign(campaignId);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling CampaignApi#deactivateCampaign");
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 |
---|---|---|---|
campaignId | String |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Successful Response | - |
422 | Validation Error | - |
CampaignCSP getCampaign(campaignId)
Get My Campaign
Retrieve campaign details by campaignId
.
// Import classes:
import com.telnyx.sdk.ApiClient;
import com.telnyx.sdk.ApiException;
import com.telnyx.sdk.Configuration;
import com.telnyx.sdk.auth.*;
import com.telnyx.sdk.model.*;
import com.telnyx.sdk.api.CampaignApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.telnyx.com/v2");
// Configure HTTP bearer authorization: bearerAuth
HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
bearerAuth.setBearerToken("BEARER TOKEN");
CampaignApi apiInstance = new CampaignApi(defaultClient);
String campaignId = "campaignId_example"; // String |
try {
CampaignCSP result = apiInstance.getCampaign(campaignId);
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 |
---|---|---|---|
campaignId | String |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Successful Response | - |
422 | Validation Error | - |
CampaignCost getCampaignCost(usecase)
Get Campaign Cost
// Import classes:
import com.telnyx.sdk.ApiClient;
import com.telnyx.sdk.ApiException;
import com.telnyx.sdk.Configuration;
import com.telnyx.sdk.auth.*;
import com.telnyx.sdk.model.*;
import com.telnyx.sdk.api.CampaignApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.telnyx.com/v2");
// Configure HTTP bearer authorization: bearerAuth
HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
bearerAuth.setBearerToken("BEARER TOKEN");
CampaignApi apiInstance = new CampaignApi(defaultClient);
String usecase = "usecase_example"; // String |
try {
CampaignCost result = apiInstance.getCampaignCost(usecase);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling CampaignApi#getCampaignCost");
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 |
---|---|---|---|
usecase | String |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Successful Response | - |
422 | Validation Error | - |
Object getCampaignMnoMetadata(campaignId)
Get Campaign Mno Metadata
Get the campaign metadata for each MNO it was submitted to
// Import classes:
import com.telnyx.sdk.ApiClient;
import com.telnyx.sdk.ApiException;
import com.telnyx.sdk.Configuration;
import com.telnyx.sdk.auth.*;
import com.telnyx.sdk.model.*;
import com.telnyx.sdk.api.CampaignApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.telnyx.com/v2");
// Configure HTTP bearer authorization: bearerAuth
HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
bearerAuth.setBearerToken("BEARER TOKEN");
CampaignApi apiInstance = new CampaignApi(defaultClient);
String campaignId = "campaignId_example"; // String | ID of the campaign in question
try {
Object result = apiInstance.getCampaignMnoMetadata(campaignId);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling CampaignApi#getCampaignMnoMetadata");
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 |
---|---|---|---|
campaignId | String | ID of the campaign in question |
Object
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Successful Response | - |
422 | Validation Error | - |
Object getCampaignOperationStatus(campaignId)
Get My Campaign Operation Status
Retrieve campaign's operation status at MNO level.
// Import classes:
import com.telnyx.sdk.ApiClient;
import com.telnyx.sdk.ApiException;
import com.telnyx.sdk.Configuration;
import com.telnyx.sdk.auth.*;
import com.telnyx.sdk.model.*;
import com.telnyx.sdk.api.CampaignApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.telnyx.com/v2");
// Configure HTTP bearer authorization: bearerAuth
HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
bearerAuth.setBearerToken("BEARER TOKEN");
CampaignApi apiInstance = new CampaignApi(defaultClient);
String campaignId = "campaignId_example"; // String |
try {
Object result = apiInstance.getCampaignOperationStatus(campaignId);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling CampaignApi#getCampaignOperationStatus");
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 |
---|---|---|---|
campaignId | String |
Object
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Successful Response | - |
422 | Validation Error | - |
Object getCampaignOsrAttributes(campaignId)
Get My Osr Campaign Attributes
// Import classes:
import com.telnyx.sdk.ApiClient;
import com.telnyx.sdk.ApiException;
import com.telnyx.sdk.Configuration;
import com.telnyx.sdk.auth.*;
import com.telnyx.sdk.model.*;
import com.telnyx.sdk.api.CampaignApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.telnyx.com/v2");
// Configure HTTP bearer authorization: bearerAuth
HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
bearerAuth.setBearerToken("BEARER TOKEN");
CampaignApi apiInstance = new CampaignApi(defaultClient);
String campaignId = "campaignId_example"; // String |
try {
Object result = apiInstance.getCampaignOsrAttributes(campaignId);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling CampaignApi#getCampaignOsrAttributes");
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 |
---|---|---|---|
campaignId | String |
Object
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Successful Response | - |
422 | Validation Error | - |
CampaignSharingChain getCampaignSharingStatus(campaignId)
Get Sharing Status
// Import classes:
import com.telnyx.sdk.ApiClient;
import com.telnyx.sdk.ApiException;
import com.telnyx.sdk.Configuration;
import com.telnyx.sdk.auth.*;
import com.telnyx.sdk.model.*;
import com.telnyx.sdk.api.CampaignApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.telnyx.com/v2");
// Configure HTTP bearer authorization: bearerAuth
HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
bearerAuth.setBearerToken("BEARER TOKEN");
CampaignApi apiInstance = new CampaignApi(defaultClient);
String campaignId = "campaignId_example"; // String | ID of the campaign in question
try {
CampaignSharingChain result = apiInstance.getCampaignSharingStatus(campaignId);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling CampaignApi#getCampaignSharingStatus");
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 |
---|---|---|---|
campaignId | String | ID of the campaign in question |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Successful Response | - |
422 | Validation Error | - |
CampaignRecordSetCSP getCampaigns(brandId, page, recordsPerPage)
List Campaigns
Retrieve a list of campaigns associated with a supplied brandId
.
// Import classes:
import com.telnyx.sdk.ApiClient;
import com.telnyx.sdk.ApiException;
import com.telnyx.sdk.Configuration;
import com.telnyx.sdk.auth.*;
import com.telnyx.sdk.model.*;
import com.telnyx.sdk.api.CampaignApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.telnyx.com/v2");
// Configure HTTP bearer authorization: bearerAuth
HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
bearerAuth.setBearerToken("BEARER TOKEN");
CampaignApi apiInstance = new CampaignApi(defaultClient);
String brandId = "brandId_example"; // String |
Integer page = 1; // Integer | The 1-indexed page number to get. The default value is `1`.
Integer recordsPerPage = 10; // Integer | The amount of records per page, limited to between 1 and 500 inclusive. The default value is `10`.
try {
CampaignRecordSetCSP result = apiInstance.getCampaigns(brandId, page, recordsPerPage);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling CampaignApi#getCampaigns");
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 |
---|---|---|---|
brandId | String | ||
page | Integer | The 1-indexed page number to get. The default value is `1`. | [optional] [default to 1] |
recordsPerPage | Integer | The amount of records per page, limited to between 1 and 500 inclusive. The default value is `10`. | [optional] [default to 10] |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Successful Response | - |
422 | Validation Error | - |
UsecaseMetadata getUsecaseQualification(usecase, brandId)
Qualify By Usecase
This endpoint allows you to see whether or not the supplied brand is suitable for your desired campaign use case.
// Import classes:
import com.telnyx.sdk.ApiClient;
import com.telnyx.sdk.ApiException;
import com.telnyx.sdk.Configuration;
import com.telnyx.sdk.auth.*;
import com.telnyx.sdk.model.*;
import com.telnyx.sdk.api.CampaignApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.telnyx.com/v2");
// Configure HTTP bearer authorization: bearerAuth
HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
bearerAuth.setBearerToken("BEARER TOKEN");
CampaignApi apiInstance = new CampaignApi(defaultClient);
String usecase = "usecase_example"; // String |
String brandId = "brandId_example"; // String |
try {
UsecaseMetadata result = apiInstance.getUsecaseQualification(usecase, brandId);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling CampaignApi#getUsecaseQualification");
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 |
---|---|---|---|
usecase | String | ||
brandId | String |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Successful Response | - |
422 | Validation Error | - |
ResponseSubmitCampaignPublicCampaignbuilderPost postCampaign(campaignRequest)
Submit Campaign
Before creating a campaign, use the Qualify By Usecase endpoint to ensure that the brand you want to assign a new campaign to is qualified for the desired use case of that campaign. Please note: After campaign creation, you'll only be able to edit the campaign's sample messages. Creating a campaign will entail an upfront, non-refundable three month's cost that will depend on the campaign's use case (see 10DLC Costs section for details).
// Import classes:
import com.telnyx.sdk.ApiClient;
import com.telnyx.sdk.ApiException;
import com.telnyx.sdk.Configuration;
import com.telnyx.sdk.auth.*;
import com.telnyx.sdk.model.*;
import com.telnyx.sdk.api.CampaignApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.telnyx.com/v2");
// Configure HTTP bearer authorization: bearerAuth
HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
bearerAuth.setBearerToken("BEARER TOKEN");
CampaignApi apiInstance = new CampaignApi(defaultClient);
CampaignRequest campaignRequest = new CampaignRequest(); // CampaignRequest |
try {
ResponseSubmitCampaignPublicCampaignbuilderPost result = apiInstance.postCampaign(campaignRequest);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling CampaignApi#postCampaign");
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 |
---|---|---|---|
campaignRequest | CampaignRequest |
ResponseSubmitCampaignPublicCampaignbuilderPost
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Successful Response | - |
422 | Validation Error | - |
Campaign updateCampaign(campaignId, updateCampaign)
Update My Campaign
Update a campaign's properties by campaignId
. Please note: only sample messages are editable.
// Import classes:
import com.telnyx.sdk.ApiClient;
import com.telnyx.sdk.ApiException;
import com.telnyx.sdk.Configuration;
import com.telnyx.sdk.auth.*;
import com.telnyx.sdk.model.*;
import com.telnyx.sdk.api.CampaignApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.telnyx.com/v2");
// Configure HTTP bearer authorization: bearerAuth
HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
bearerAuth.setBearerToken("BEARER TOKEN");
CampaignApi apiInstance = new CampaignApi(defaultClient);
String campaignId = "campaignId_example"; // String |
UpdateCampaign updateCampaign = new UpdateCampaign(); // UpdateCampaign |
try {
Campaign result = apiInstance.updateCampaign(campaignId, updateCampaign);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling CampaignApi#updateCampaign");
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 |
---|---|---|---|
campaignId | String | ||
updateCampaign | UpdateCampaign |
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Successful Response | - |
422 | Validation Error | - |