Skip to content

Latest commit

 

History

History
472 lines (348 loc) · 19.1 KB

CredentialConnectionsApi.md

File metadata and controls

472 lines (348 loc) · 19.1 KB

CredentialConnectionsApi

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

Method HTTP request Description
checkRegistrationStatus POST /credential_connections/{id}/actions/check_registration_status Update a credential connection registration status
createCredentialConnection POST /credential_connections Create a credential connection
deleteCredentialConnection DELETE /credential_connections/{id} Delete a credential connection
listCredentialConnections GET /credential_connections List credential connections
retrieveCredentialConnection GET /credential_connections/{id} Retrieve a credential connection
updateCredentialConnection PATCH /credential_connections/{id} Update a credential connection

checkRegistrationStatus

RegistrationStatusResponse checkRegistrationStatus(id)

Update a credential connection registration status

Updates the registration_status for a credential connection, this endpoint also updates the registration_status and registration_status_updated_at fields in the credential connection

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.CredentialConnectionsApi;

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

        CredentialConnectionsApi apiInstance = new CredentialConnectionsApi(defaultClient);
        String id = "id_example"; // String | Identifies the resource.
        try {
            RegistrationStatusResponse result = apiInstance.checkRegistrationStatus(id);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling CredentialConnectionsApi#checkRegistrationStatus");
            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 String Identifies the resource.

Return type

RegistrationStatusResponse

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 credential connection registration status. -
400 Bad request, the request was unacceptable, often due to missing a required parameter. -
401 Unauthorized -
403 Unauthenticated response. Happens when the current user cannot be authenticated. -
404 Resource not found -

createCredentialConnection

CredentialConnectionResponse createCredentialConnection(createCredentialConnectionRequest)

Create a credential connection

Creates a credential connection.

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.CredentialConnectionsApi;

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

        CredentialConnectionsApi apiInstance = new CredentialConnectionsApi(defaultClient);
        CreateCredentialConnectionRequest createCredentialConnectionRequest = new CreateCredentialConnectionRequest(); // CreateCredentialConnectionRequest | Parameters that can be defined during credential connection creation
        try {
            CredentialConnectionResponse result = apiInstance.createCredentialConnection(createCredentialConnectionRequest);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling CredentialConnectionsApi#createCredentialConnection");
            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
createCredentialConnectionRequest CreateCredentialConnectionRequest Parameters that can be defined during credential connection creation

Return type

CredentialConnectionResponse

Authorization

bearerAuth

HTTP request headers

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

HTTP response details

Status code Description Response headers
201 Successful response with details about a credential connection. -
401 Unauthorized -
403 Unauthenticated response. Happens when the current user cannot be authenticated. -
422 Unprocessable entity -

deleteCredentialConnection

CredentialConnectionResponse deleteCredentialConnection(id)

Delete a credential connection

Deletes an existing credential connection.

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.CredentialConnectionsApi;

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

        CredentialConnectionsApi apiInstance = new CredentialConnectionsApi(defaultClient);
        String id = "id_example"; // String | Identifies the resource.
        try {
            CredentialConnectionResponse result = apiInstance.deleteCredentialConnection(id);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling CredentialConnectionsApi#deleteCredentialConnection");
            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 String Identifies the resource.

Return type

CredentialConnectionResponse

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 credential connection. -
400 Bad request, the request was unacceptable, often due to missing a required parameter. -
401 Unauthorized -
403 Unauthenticated response. Happens when the current user cannot be authenticated. -
404 Resource not found -

listCredentialConnections

ListCredentialConnectionsResponse listCredentialConnections().pageNumber(pageNumber).pageSize(pageSize).filterConnectionNameContains(filterConnectionNameContains).filterOutboundOutboundVoiceProfileId(filterOutboundOutboundVoiceProfileId).sort(sort).execute();

List credential connections

Returns a list of your credential connections.

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.CredentialConnectionsApi;

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

        CredentialConnectionsApi apiInstance = new CredentialConnectionsApi(defaultClient);
        Integer pageNumber = 1; // Integer | The page number to load
        Integer pageSize = 20; // Integer | The size of the page
        String filterConnectionNameContains = "My Connection"; // String | If present, connections with <code>connection_name</code> containing the given value will be returned. Matching is not case-sensitive. Requires at least three characters.
        String filterOutboundOutboundVoiceProfileId = "1293384261075731499"; // String | Identifies the associated outbound voice profile.
        String sort = "created_at"; // String | Specifies the sort order for results. By default sorting direction is ascending. To have the results sorted in descending order add the <code> -</code> prefix.<br/><br/> That is: <ul>   <li>     <code>connection_name</code>: sorts the result by the     <code>connection_name</code> field in ascending order.   </li>    <li>     <code>-connection_name</code>: sorts the result by the     <code>connection_name</code> field in descending order.   </li> </ul> <br/> If not given, results are sorted by <code>created_at</code> in descending order.
        try {
            ListCredentialConnectionsResponse result = api.listCredentialConnections()
                .pageNumber(pageNumber)
                .pageSize(pageSize)
                .filterConnectionNameContains(filterConnectionNameContains)
                .filterOutboundOutboundVoiceProfileId(filterOutboundOutboundVoiceProfileId)
                .sort(sort)
                .execute();
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling CredentialConnectionsApi#listCredentialConnections");
            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]
filterConnectionNameContains String If present, connections with <code>connection_name</code> containing the given value will be returned. Matching is not case-sensitive. Requires at least three characters. [optional]
filterOutboundOutboundVoiceProfileId String Identifies the associated outbound voice profile. [optional]
sort String Specifies the sort order for results. By default sorting direction is ascending. To have the results sorted in descending order add the <code> -</code> prefix.<br/><br/> That is: <ul> <li> <code>connection_name</code>: sorts the result by the <code>connection_name</code> field in ascending order. </li> <li> <code>-connection_name</code>: sorts the result by the <code>connection_name</code> field in descending order. </li> </ul> <br/> If not given, results are sorted by <code>created_at</code> in descending order. [optional] [default to created_at] [enum: created_at, connection_name, active]

Return type

ListCredentialConnectionsResponse

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 credential connections. -
400 Bad request, the request was unacceptable, often due to missing a required parameter. -
401 Unauthorized -
403 Unauthenticated response. Happens when the current user cannot be authenticated. -

retrieveCredentialConnection

CredentialConnectionResponse retrieveCredentialConnection(id)

Retrieve a credential connection

Retrieves the details of an existing credential connection.

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.CredentialConnectionsApi;

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

        CredentialConnectionsApi apiInstance = new CredentialConnectionsApi(defaultClient);
        String id = "id_example"; // String | Identifies the resource.
        try {
            CredentialConnectionResponse result = apiInstance.retrieveCredentialConnection(id);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling CredentialConnectionsApi#retrieveCredentialConnection");
            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 String Identifies the resource.

Return type

CredentialConnectionResponse

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 credential connection. -
400 Bad request, the request was unacceptable, often due to missing a required parameter. -
401 Unauthorized -
403 Unauthenticated response. Happens when the current user cannot be authenticated. -
404 Resource not found -

updateCredentialConnection

CredentialConnectionResponse updateCredentialConnection(id, updateCredentialConnectionRequest)

Update a credential connection

Updates settings of an existing credential connection.

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.CredentialConnectionsApi;

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

        CredentialConnectionsApi apiInstance = new CredentialConnectionsApi(defaultClient);
        String id = "id_example"; // String | Identifies the resource.
        UpdateCredentialConnectionRequest updateCredentialConnectionRequest = new UpdateCredentialConnectionRequest(); // UpdateCredentialConnectionRequest | Parameters that can be updated in a credential connection
        try {
            CredentialConnectionResponse result = apiInstance.updateCredentialConnection(id, updateCredentialConnectionRequest);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling CredentialConnectionsApi#updateCredentialConnection");
            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 String Identifies the resource.
updateCredentialConnectionRequest UpdateCredentialConnectionRequest Parameters that can be updated in a credential connection

Return type

CredentialConnectionResponse

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 credential connection. -
401 Unauthorized -
403 Unauthenticated response. Happens when the current user cannot be authenticated. -
404 Resource not found -
422 Unprocessable entity -