Skip to content

Latest commit

 

History

History
684 lines (509 loc) · 23.9 KB

MessagingProfilesApi.md

File metadata and controls

684 lines (509 loc) · 23.9 KB

MessagingProfilesApi

All URIs are relative to https://api.telnyx.com/v2

Method HTTP request Description
createMessagingProfile POST /messaging_profiles Create a messaging profile
deleteMessagingProfile DELETE /messaging_profiles/{id} Delete a messaging profile
getMessagingProfileMetrics GET /messaging_profiles/{id}/metrics Retrieve messaging profile metrics
listMessagingProfiles GET /messaging_profiles List messaging profiles
listProfileMetrics GET /messaging_profile_metrics List messaging profile metrics
listProfilePhoneNumbers GET /messaging_profiles/{id}/phone_numbers List phone numbers associated with a messaging profile
listProfileShortCodes GET /messaging_profiles/{id}/short_codes List short codes associated with a messaging profile
retrieveMessagingProfile GET /messaging_profiles/{id} Retrieve a messaging profile
updateMessagingProfile PATCH /messaging_profiles/{id} Update a messaging profile

createMessagingProfile

MessagingProfileResponse createMessagingProfile(createMessagingProfileRequest)

Create a messaging profile

Example

// 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.MessagingProfilesApi;

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");

        MessagingProfilesApi apiInstance = new MessagingProfilesApi(defaultClient);
        CreateMessagingProfileRequest createMessagingProfileRequest = new CreateMessagingProfileRequest(); // CreateMessagingProfileRequest | New Messaging Profile object
        try {
            MessagingProfileResponse result = apiInstance.createMessagingProfile(createMessagingProfileRequest);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling MessagingProfilesApi#createMessagingProfile");
            System.err.println("Status code: " + e.getCode());
            System.err.println("Reason: " + e.getResponseBody());
            System.err.println("Response headers: " + e.getResponseHeaders());
            e.printStackTrace();
        }
    }
}

Parameters

Name Type Description Notes
createMessagingProfileRequest CreateMessagingProfileRequest New Messaging Profile object

Return type

MessagingProfileResponse

Authorization

bearerAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Successful response with details about a messaging profile. -
0 Unexpected error -

deleteMessagingProfile

MessagingProfileResponse deleteMessagingProfile(id)

Delete a messaging profile

Example

import java.util.UUID;
// 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.MessagingProfilesApi;

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");

        MessagingProfilesApi apiInstance = new MessagingProfilesApi(defaultClient);
        UUID id = UUID.randomUUID(); // UUID | The id of the messaging profile to retrieve
        try {
            MessagingProfileResponse result = apiInstance.deleteMessagingProfile(id);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling MessagingProfilesApi#deleteMessagingProfile");
            System.err.println("Status code: " + e.getCode());
            System.err.println("Reason: " + e.getResponseBody());
            System.err.println("Response headers: " + e.getResponseHeaders());
            e.printStackTrace();
        }
    }
}

Parameters

Name Type Description Notes
id UUID The id of the messaging profile to retrieve

Return type

MessagingProfileResponse

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Successful response with details about a messaging profile. -
0 Unexpected error -

getMessagingProfileMetrics

RetrieveMessagingProfileMetricsResponse getMessagingProfileMetrics(id).timeFrame(timeFrame).execute();

Retrieve messaging profile metrics

Example

import java.util.UUID;
// 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.MessagingProfilesApi;

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");

        MessagingProfilesApi apiInstance = new MessagingProfilesApi(defaultClient);
        UUID id = UUID.randomUUID(); // UUID | The id of the messaging profile to retrieve
        String timeFrame = "1h"; // String | The timeframe for which you'd like to retrieve metrics.
        try {
            RetrieveMessagingProfileMetricsResponse result = api.getMessagingProfileMetrics(id)
                .timeFrame(timeFrame)
                .execute();
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling MessagingProfilesApi#getMessagingProfileMetrics");
            System.err.println("Status code: " + e.getCode());
            System.err.println("Reason: " + e.getResponseBody());
            System.err.println("Response headers: " + e.getResponseHeaders());
            e.printStackTrace();
        }
    }
}

Parameters

Name Type Description Notes
id UUID The id of the messaging profile to retrieve
timeFrame String The timeframe for which you'd like to retrieve metrics. [optional] [default to 24h] [enum: 1h, 3h, 24h, 3d, 7d, 30d]

Return type

RetrieveMessagingProfileMetricsResponse

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Successful response with details about a messaging profile's metrics. -
0 Unexpected error -

listMessagingProfiles

ListMessagingProfilesResponse listMessagingProfiles().pageNumber(pageNumber).pageSize(pageSize).filterName(filterName).execute();

List messaging profiles

Example

// 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.MessagingProfilesApi;

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");

        MessagingProfilesApi apiInstance = new MessagingProfilesApi(defaultClient);
        Integer pageNumber = 1; // Integer | The page number to load
        Integer pageSize = 20; // Integer | The size of the page
        String filterName = "filterName_example"; // String | Filter by name
        try {
            ListMessagingProfilesResponse result = api.listMessagingProfiles()
                .pageNumber(pageNumber)
                .pageSize(pageSize)
                .filterName(filterName)
                .execute();
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling MessagingProfilesApi#listMessagingProfiles");
            System.err.println("Status code: " + e.getCode());
            System.err.println("Reason: " + e.getResponseBody());
            System.err.println("Response headers: " + e.getResponseHeaders());
            e.printStackTrace();
        }
    }
}

Parameters

Name Type Description Notes
pageNumber Integer The page number to load [optional] [default to 1]
pageSize Integer The size of the page [optional] [default to 20]
filterName String Filter by name [optional]

Return type

ListMessagingProfilesResponse

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Successful response with a list of messaging profiles. -
0 Unexpected error -

listProfileMetrics

ListMessagingProfileMetricsResponse listProfileMetrics().pageNumber(pageNumber).pageSize(pageSize).id(id).timeFrame(timeFrame).execute();

List messaging profile metrics

Example

import java.util.UUID;
// 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.MessagingProfilesApi;

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");

        MessagingProfilesApi apiInstance = new MessagingProfilesApi(defaultClient);
        Integer pageNumber = 1; // Integer | The page number to load
        Integer pageSize = 20; // Integer | The size of the page
        UUID id = UUID.randomUUID(); // UUID | The id of the messaging profile(s) to retrieve
        String timeFrame = "1h"; // String | The timeframe for which you'd like to retrieve metrics.
        try {
            ListMessagingProfileMetricsResponse result = api.listProfileMetrics()
                .pageNumber(pageNumber)
                .pageSize(pageSize)
                .id(id)
                .timeFrame(timeFrame)
                .execute();
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling MessagingProfilesApi#listProfileMetrics");
            System.err.println("Status code: " + e.getCode());
            System.err.println("Reason: " + e.getResponseBody());
            System.err.println("Response headers: " + e.getResponseHeaders());
            e.printStackTrace();
        }
    }
}

Parameters

Name Type Description Notes
pageNumber Integer The page number to load [optional] [default to 1]
pageSize Integer The size of the page [optional] [default to 20]
id UUID The id of the messaging profile(s) to retrieve [optional]
timeFrame String The timeframe for which you'd like to retrieve metrics. [optional] [default to 24h] [enum: 1h, 3h, 24h, 3d, 7d, 30d]

Return type

ListMessagingProfileMetricsResponse

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Successful response with a list of messaging profile metrics. -
0 Unexpected error -

listProfilePhoneNumbers

ListMessagingProfilePhoneNumbersResponse listProfilePhoneNumbers(id).pageNumber(pageNumber).pageSize(pageSize).execute();

List phone numbers associated with a messaging profile

Example

import java.util.UUID;
// 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.MessagingProfilesApi;

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");

        MessagingProfilesApi apiInstance = new MessagingProfilesApi(defaultClient);
        UUID id = UUID.randomUUID(); // UUID | The id of the messaging profile to retrieve
        Integer pageNumber = 1; // Integer | The page number to load
        Integer pageSize = 20; // Integer | The size of the page
        try {
            ListMessagingProfilePhoneNumbersResponse result = api.listProfilePhoneNumbers(id)
                .pageNumber(pageNumber)
                .pageSize(pageSize)
                .execute();
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling MessagingProfilesApi#listProfilePhoneNumbers");
            System.err.println("Status code: " + e.getCode());
            System.err.println("Reason: " + e.getResponseBody());
            System.err.println("Response headers: " + e.getResponseHeaders());
            e.printStackTrace();
        }
    }
}

Parameters

Name Type Description Notes
id UUID The id of the messaging profile to retrieve
pageNumber Integer The page number to load [optional] [default to 1]
pageSize Integer The size of the page [optional] [default to 20]

Return type

ListMessagingProfilePhoneNumbersResponse

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Successful response with a list of messaging profile phone numbers. -
0 Unexpected error -

listProfileShortCodes

ListMessagingProfileShortCodesResponse listProfileShortCodes(id).pageNumber(pageNumber).pageSize(pageSize).execute();

List short codes associated with a messaging profile

Example

import java.util.UUID;
// 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.MessagingProfilesApi;

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");

        MessagingProfilesApi apiInstance = new MessagingProfilesApi(defaultClient);
        UUID id = UUID.randomUUID(); // UUID | The id of the messaging profile to retrieve
        Integer pageNumber = 1; // Integer | The page number to load
        Integer pageSize = 20; // Integer | The size of the page
        try {
            ListMessagingProfileShortCodesResponse result = api.listProfileShortCodes(id)
                .pageNumber(pageNumber)
                .pageSize(pageSize)
                .execute();
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling MessagingProfilesApi#listProfileShortCodes");
            System.err.println("Status code: " + e.getCode());
            System.err.println("Reason: " + e.getResponseBody());
            System.err.println("Response headers: " + e.getResponseHeaders());
            e.printStackTrace();
        }
    }
}

Parameters

Name Type Description Notes
id UUID The id of the messaging profile to retrieve
pageNumber Integer The page number to load [optional] [default to 1]
pageSize Integer The size of the page [optional] [default to 20]

Return type

ListMessagingProfileShortCodesResponse

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Successful response with a list of messaging profile short codes. -
0 Unexpected error -

retrieveMessagingProfile

MessagingProfileResponse retrieveMessagingProfile(id)

Retrieve a messaging profile

Example

import java.util.UUID;
// 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.MessagingProfilesApi;

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");

        MessagingProfilesApi apiInstance = new MessagingProfilesApi(defaultClient);
        UUID id = UUID.randomUUID(); // UUID | The id of the messaging profile to retrieve
        try {
            MessagingProfileResponse result = apiInstance.retrieveMessagingProfile(id);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling MessagingProfilesApi#retrieveMessagingProfile");
            System.err.println("Status code: " + e.getCode());
            System.err.println("Reason: " + e.getResponseBody());
            System.err.println("Response headers: " + e.getResponseHeaders());
            e.printStackTrace();
        }
    }
}

Parameters

Name Type Description Notes
id UUID The id of the messaging profile to retrieve

Return type

MessagingProfileResponse

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Successful response with details about a messaging profile. -
0 Unexpected error -

updateMessagingProfile

MessagingProfileResponse updateMessagingProfile(id, updateMessagingProfileRequest)

Update a messaging profile

Example

import java.util.UUID;
// 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.MessagingProfilesApi;

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");

        MessagingProfilesApi apiInstance = new MessagingProfilesApi(defaultClient);
        UUID id = UUID.randomUUID(); // UUID | The id of the messaging profile to retrieve
        UpdateMessagingProfileRequest updateMessagingProfileRequest = new UpdateMessagingProfileRequest(); // UpdateMessagingProfileRequest | New Messaging Profile object
        try {
            MessagingProfileResponse result = apiInstance.updateMessagingProfile(id, updateMessagingProfileRequest);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling MessagingProfilesApi#updateMessagingProfile");
            System.err.println("Status code: " + e.getCode());
            System.err.println("Reason: " + e.getResponseBody());
            System.err.println("Response headers: " + e.getResponseHeaders());
            e.printStackTrace();
        }
    }
}

Parameters

Name Type Description Notes
id UUID The id of the messaging profile to retrieve
updateMessagingProfileRequest UpdateMessagingProfileRequest New Messaging Profile object

Return type

MessagingProfileResponse

Authorization

bearerAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Successful response with details about a messaging profile. -
0 Unexpected error -