Skip to content

Latest commit

 

History

History
234 lines (182 loc) · 7.35 KB

MfaApi.md

File metadata and controls

234 lines (182 loc) · 7.35 KB

MfaApi

All URIs are relative to http://localhost

Method HTTP request Description
generateMessagingCode POST /accounts/{accountId}/code/messaging Messaging Authentication Code
generateVoiceCode POST /accounts/{accountId}/code/voice Voice Authentication Code
verifyCode POST /accounts/{accountId}/code/verify Verify Authentication Code

generateMessagingCode

MessagingCodeResponse generateMessagingCode(accountId, codeRequest)

Messaging Authentication Code

Send an MFA code via text message (SMS).

Example

// Import classes:
import com.bandwidth.sdk.ApiClient;
import com.bandwidth.sdk.ApiException;
import com.bandwidth.sdk.Configuration;
import com.bandwidth.sdk.auth.*;
import com.bandwidth.sdk.models.*;
import com.bandwidth.sdk.api.MfaApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("http://localhost");
    
    // Configure HTTP basic authorization: Basic
    HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic");
    Basic.setUsername("YOUR USERNAME");
    Basic.setPassword("YOUR PASSWORD");

    MfaApi apiInstance = new MfaApi(defaultClient);
    String accountId = "9900000"; // String | Your Bandwidth Account ID.
    CodeRequest codeRequest = new CodeRequest(); // CodeRequest | MFA code request body.
    try {
      MessagingCodeResponse result = apiInstance.generateMessagingCode(accountId, codeRequest);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling MfaApi#generateMessagingCode");
      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
accountId String Your Bandwidth Account ID.
codeRequest CodeRequest MFA code request body.

Return type

MessagingCodeResponse

Authorization

Basic

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 OK -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
500 Internal Server Error -

generateVoiceCode

VoiceCodeResponse generateVoiceCode(accountId, codeRequest)

Voice Authentication Code

Send an MFA Code via a phone call.

Example

// Import classes:
import com.bandwidth.sdk.ApiClient;
import com.bandwidth.sdk.ApiException;
import com.bandwidth.sdk.Configuration;
import com.bandwidth.sdk.auth.*;
import com.bandwidth.sdk.models.*;
import com.bandwidth.sdk.api.MfaApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("http://localhost");
    
    // Configure HTTP basic authorization: Basic
    HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic");
    Basic.setUsername("YOUR USERNAME");
    Basic.setPassword("YOUR PASSWORD");

    MfaApi apiInstance = new MfaApi(defaultClient);
    String accountId = "9900000"; // String | Your Bandwidth Account ID.
    CodeRequest codeRequest = new CodeRequest(); // CodeRequest | MFA code request body.
    try {
      VoiceCodeResponse result = apiInstance.generateVoiceCode(accountId, codeRequest);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling MfaApi#generateVoiceCode");
      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
accountId String Your Bandwidth Account ID.
codeRequest CodeRequest MFA code request body.

Return type

VoiceCodeResponse

Authorization

Basic

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 OK -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
500 Internal Server Error -

verifyCode

VerifyCodeResponse verifyCode(accountId, verifyCodeRequest)

Verify Authentication Code

Verify a previously sent MFA code.

Example

// Import classes:
import com.bandwidth.sdk.ApiClient;
import com.bandwidth.sdk.ApiException;
import com.bandwidth.sdk.Configuration;
import com.bandwidth.sdk.auth.*;
import com.bandwidth.sdk.models.*;
import com.bandwidth.sdk.api.MfaApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("http://localhost");
    
    // Configure HTTP basic authorization: Basic
    HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic");
    Basic.setUsername("YOUR USERNAME");
    Basic.setPassword("YOUR PASSWORD");

    MfaApi apiInstance = new MfaApi(defaultClient);
    String accountId = "9900000"; // String | Your Bandwidth Account ID.
    VerifyCodeRequest verifyCodeRequest = new VerifyCodeRequest(); // VerifyCodeRequest | MFA code verify request body.
    try {
      VerifyCodeResponse result = apiInstance.verifyCode(accountId, verifyCodeRequest);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling MfaApi#verifyCode");
      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
accountId String Your Bandwidth Account ID.
verifyCodeRequest VerifyCodeRequest MFA code verify request body.

Return type

VerifyCodeResponse

Authorization

Basic

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 OK -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
429 Too Many Requests -
500 Internal Server Error -