diff --git a/site/specs/messaging.yml b/site/specs/messaging.yml index de4129a53..4b418a374 100644 --- a/site/specs/messaging.yml +++ b/site/specs/messaging.yml @@ -83,29 +83,34 @@ paths: } - lang: Java source: | - import com.bandwidth.BandwidthClient; - import com.bandwidth.http.response.ApiResponse; - import com.bandwidth.messaging.models.Media; - - import java.util.concurrent.CompletableFuture; - import java.util.concurrent.ExecutionException; - import java.util.List; - - public class Sample { - public static final String USERNAME = "api-username"; - public static final String PASSWORD = "api-password"; - public static final String ACCOUNT_ID = "12345"; - + 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.MediaApi; + + public class Example { public static void main(String[] args) { - BandwidthClient client = new BandwidthClient.Builder() - .messagingBasicAuthCredentials(USERNAME, PASSWORD) - .build(); + ApiClient defaultClient = Configuration.getDefaultApiClient(); + + // Configure HTTP basic authorization: Basic + HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); + Basic.setUsername("YOUR USERNAME"); + Basic.setPassword("YOUR PASSWORD"); + MediaApi apiInstance = new MediaApi(defaultClient); + String accountId = "9900000"; // String | Your Bandwidth Account ID. + String continuationToken = "1XEi2tsFtLo1JbtLwETnM1ZJ+PqAa8w6ENvC5QKvwyrCDYII663Gy5M4s40owR1tjkuWUif6qbWvFtQJR5/ipqbUnfAqL254LKNlPy6tATCzioKSuHuOqgzloDkSwRtX0LtcL2otHS69hK343m+SjdL+vlj71tT39"; // String | Continuation token used to retrieve subsequent media. try { - CompletableFuture>> completableFuture = client.getMessagingClient().getAPIController().listMediaAsync(ACCOUNT_ID, null); - System.out.println(completableFuture.get().getResult()); - } catch (InterruptedException | ExecutionException e) { - System.out.println(e.getMessage()); + List result = apiInstance.listMedia(accountId, continuationToken); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling MediaApi#listMedia"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } } } @@ -186,24 +191,23 @@ paths: print(e.response_code) - lang: Ruby source: | - require 'bandwidth' + require 'bandwidth-sdk' - include Bandwidth - include Bandwidth::Messaging + Bandwidth.configure do |config| + config.username = 'api-username' + config.password = 'api-password' + end - bandwidth_client = Bandwidth::Client.new( - messaging_basic_auth_user_name: "api-username", - messaging_basic_auth_password: "api-password" - ) - messaging_client = bandwidth_client.messaging_client.client + api_instance = Bandwidth::MediaApi.new + account_id = '12345' begin - media = messaging_client.list_media("12345") - media.data.each { |item| - puts item.media_name - } - rescue APIException => e - puts e.response_code + result = api_instance.list_media(account_id) + result.each do |item| + p item.media_name + end + rescue Bandwidth::ApiError => e + p "Error when calling MediaApi->list_media: #{e}" end /users/{accountId}/media/{mediaId}: get: @@ -387,24 +391,23 @@ paths: print(e.response_code) - lang: Ruby source: | - require 'bandwidth' - - include Bandwidth - include Bandwidth::Messaging + require 'bandwidth-sdk' + Bandwidth.configure do |config| + config.username = 'api-username' + config.password = 'api-password' + end - bandwidth_client = Bandwidth::Client.new( - messaging_basic_auth_user_name: "api-username", - messaging_basic_auth_password: "api-password" - ) - messaging_client = bandwidth_client.messaging_client.client + api_instance = Bandwidth::MediaApi.new + account_id = '12345' + media_id = '14762070468292kw2fuqty55yp2b2/0/bw.png' begin - downloaded_media = messaging_client.get_media("12345", ENV['MEDIA_ID']) - f = File.open("file_to_write", "wb") - f.puts(downloaded_media.data) - f.close() - rescue APIException => e - puts e.response_code + result = api_instance.get_media(account_id, media_id) + f = File.open('file_to_write', 'wb') + f.p(result) + f.close + rescue Bandwidth::ApiError => e + p "Error when calling MediaApi->get_media: #{e}" end put: summary: Upload Media @@ -498,32 +501,36 @@ paths: } - lang: Java source: | - import com.bandwidth.BandwidthClient; - import com.bandwidth.http.response.ApiResponse; - import com.bandwidth.utilities.FileWrapper; - - import java.io.File; - import java.util.concurrent.CompletableFuture; - import java.util.concurrent.ExecutionException; - - public class Sample { - public static final String USERNAME = "api-username"; - public static final String PASSWORD = "api-password"; - public static final String ACCOUNT_ID = "12345"; - + 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.MediaApi; + + public class Example { public static void main(String[] args) { - BandwidthClient client = new BandwidthClient.Builder() - .messagingBasicAuthCredentials(USERNAME, PASSWORD) - .build(); - - String mediaId = "media-id-123"; - FileWrapper fileWrapper = new FileWrapper(new File("/path/to/file")); - + ApiClient defaultClient = Configuration.getDefaultApiClient(); + + // Configure HTTP basic authorization: Basic + HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); + Basic.setUsername("YOUR USERNAME"); + Basic.setPassword("YOUR PASSWORD"); + + MediaApi apiInstance = new MediaApi(defaultClient); + String accountId = "9900000"; // String | Your Bandwidth Account ID. + String mediaId = "14762070468292kw2fuqty55yp2b2/0/bw.png"; // String | Media ID to retrieve. + File body = new File("/path/to/file"); // File | + String contentType = "audio/wav"; // String | The media type of the entity-body. + String cacheControl = "no-cache"; // String | General-header field is used to specify directives that MUST be obeyed by all caching mechanisms along the request/response chain. try { - CompletableFuture> completableFuture = client.getMessagingClient().getAPIController().uploadMediaAsync(ACCOUNT_ID, mediaId, fileWrapper, "content/type", "no-cache"); - System.out.println(completableFuture.get().getResult()); - } catch (InterruptedException | ExecutionException e) { - System.out.println(e.getMessage()); + apiInstance.uploadMedia(accountId, mediaId, body, contentType, cacheControl); + } catch (ApiException e) { + System.err.println("Exception when calling MediaApi#uploadMedia"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } } } @@ -646,31 +653,26 @@ paths: print(e.response_code) - lang: Ruby source: | - require 'bandwidth' + require 'bandwidth-sdk' - include Bandwidth - include Bandwidth::Messaging + Bandwidth.configure do |config| + config.username = 'api-username' + config.password = 'api-password' + end - bandwidth_client = Bandwidth::Client.new( - messaging_basic_auth_user_name: "api-username", - messaging_basic_auth_password: "api-password" - ) - messaging_client = bandwidth_client.messaging_client.client + api_instance = Bandwidth::MediaApi.new + account_id = '12345' + media_id = '14762070468292kw2fuqty55yp2b2/0/bw.png' + body = '12345' + opts = { + content_type: 'application/octet-stream', + cache_control: 'no-cache' + } begin - #f = File.open("some_file", "rb") - #file_content = f.read - file_content = "12345" - messaging_client.upload_media( - "12345", - ENV['MEDIA_ID'], - file_content, - :content_type => "application/octet-stream", - :cache_control => "no-cache" - ) - f.close() - rescue APIException => e - puts e.response_code + api_instance.upload_media(account_id, media_id, body, opts) + rescue Bandwidth::ApiError => e + p "Error when calling MediaApi->upload_media: #{e}" end delete: summary: Delete Media @@ -747,32 +749,34 @@ paths: } - lang: Java source: | - import com.bandwidth.BandwidthClient; - import com.bandwidth.http.response.ApiResponse; - import com.bandwidth.messaging.models.BandwidthMessage; - import com.bandwidth.messaging.models.MessageRequest; - - import java.util.concurrent.CompletableFuture; - import java.util.concurrent.ExecutionException; - import java.util.Collections; - - public class Sample { - public static final String USERNAME = "api-username"; - public static final String PASSWORD = "api-password"; - public static final String ACCOUNT_ID = "12345"; - + 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.MediaApi; + + public class Example { public static void main(String[] args) { - String mediaId = "media-id-123"; + ApiClient defaultClient = Configuration.getDefaultApiClient(); - BandwidthClient client = new BandwidthClient.Builder() - .messagingBasicAuthCredentials(USERNAME, PASSWORD) - .build(); + // Configure HTTP basic authorization: Basic + HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); + Basic.setUsername("YOUR USERNAME"); + Basic.setPassword("YOUR PASSWORD"); + MediaApi apiInstance = new MediaApi(defaultClient); + String accountId = "9900000"; // String | Your Bandwidth Account ID. + String mediaId = "14762070468292kw2fuqty55yp2b2/0/bw.png"; // String | Media ID to retrieve. try { - CompletableFuture> completableFuture = client.getMessagingClient().getAPIController().deleteMediaAsync(ACCOUNT_ID, mediaId); - System.out.println(completableFuture.get().getResult()); - } catch (InterruptedException | ExecutionException e) { - System.out.println(e.getMessage()); + File result = apiInstance.getMedia(accountId, mediaId); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling MediaApi#getMedia"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } } } @@ -856,21 +860,21 @@ paths: print(e.response_code) - lang: Ruby source: | - require 'bandwidth' + require 'bandwidth-sdk' - include Bandwidth - include Bandwidth::Messaging + Bandwidth.configure do |config| + config.username = 'api-username' + config.password = 'api-password' + end - bandwidth_client = Bandwidth::Client.new( - messaging_basic_auth_user_name: "api-username", - messaging_basic_auth_password: "api-password" - ) - messaging_client = bandwidth_client.messaging_client.client + api_instance = Bandwidth::MediaApi.new + account_id = '12345' + media_id = '14762070468292kw2fuqty55yp2b2/0/bw.png' begin - messaging_client.delete_media("12345", ENV['MEDIA_ID']) - rescue APIException => e - puts e.response_code + api_instance.delete_media(account_id, media_id) + rescue Bandwidth::ApiError => e + p "Error when calling MediaApi->delete_media: #{e}" end /users/{accountId}/messages: get: @@ -954,30 +958,48 @@ paths: } - lang: Java source: | - import com.bandwidth.BandwidthClient; - import com.bandwidth.http.response.ApiResponse; - import com.bandwidth.messaging.models.BandwidthMessagesList; - - import java.util.concurrent.CompletableFuture; - import java.util.concurrent.ExecutionException; - - public class Sample { - public static final String USERNAME = "api-username"; - public static final String PASSWORD = "api-password"; - public static final String ACCOUNT_ID = "12345"; - + 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.MessagesApi; + + public class Example { public static void main(String[] args) { - String bandwidthNumber = "+15554443333"; - - BandwidthClient client = new BandwidthClient.Builder() - .messagingBasicAuthCredentials(USERNAME, PASSWORD) - .build(); - + ApiClient defaultClient = Configuration.getDefaultApiClient(); + + // Configure HTTP basic authorization: Basic + HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); + Basic.setUsername("YOUR USERNAME"); + Basic.setPassword("YOUR PASSWORD"); + + MessagesApi apiInstance = new MessagesApi(defaultClient); + String accountId = "9900000"; // String | Your Bandwidth Account ID. + String messageId = "9e0df4ca-b18d-40d7-a59f-82fcdf5ae8e6"; // String | The ID of the message to search for. Special characters need to be encoded using URL encoding. Message IDs could come in different formats, e.g., 9e0df4ca-b18d-40d7-a59f-82fcdf5ae8e6 and 1589228074636lm4k2je7j7jklbn2 are valid message ID formats. Note that you must include at least one query parameter. + String sourceTn = "%2B15554443333"; // String | The phone number that sent the message. Accepted values are: a single full phone number a comma separated list of full phone numbers (maximum of 10) or a single partial phone number (minimum of 5 characters e.g. '%2B1919'). + String destinationTn = "%2B15554443333"; // String | The phone number that received the message. Accepted values are: a single full phone number a comma separated list of full phone numbers (maximum of 10) or a single partial phone number (minimum of 5 characters e.g. '%2B1919'). + MessageStatusEnum messageStatus = MessageStatusEnum.fromValue("RECEIVED"); // MessageStatusEnum | The status of the message. One of RECEIVED QUEUED SENDING SENT FAILED DELIVERED ACCEPTED UNDELIVERED. + ListMessageDirectionEnum messageDirection = ListMessageDirectionEnum.fromValue("INBOUND"); // ListMessageDirectionEnum | The direction of the message. One of INBOUND OUTBOUND. + String carrierName = "Verizon"; // String | The name of the carrier used for this message. Possible values include but are not limited to Verizon and TMobile. Special characters need to be encoded using URL encoding (i.e. AT&T should be passed as AT%26T). + MessageTypeEnum messageType = MessageTypeEnum.fromValue("sms"); // MessageTypeEnum | The type of message. Either sms or mms. + Integer errorCode = 9902; // Integer | The error code of the message. + String fromDateTime = "2022-09-14T18:20:16.000Z"; // String | The start of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days. + String toDateTime = "2022-09-14T18:20:16.000Z"; // String | The end of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days. + String campaignId = "CJEUMDK"; // String | The campaign ID of the message. + String sort = "sourceTn:desc"; // String | The field and direction to sort by combined with a colon. Direction is either asc or desc. + String pageToken = "gdEewhcJLQRB5"; // String | A base64 encoded value used for pagination of results. + Integer limit = 50; // Integer | The maximum records requested in search result. Default 100. The sum of limit and after cannot be more than 10000. + Boolean limitTotalCount = true; // Boolean | When set to true, the response's totalCount field will have a maximum value of 10,000. When set to false, or excluded, this will give an accurate totalCount of all messages that match the provided filters. If you are experiencing latency, try using this parameter to limit your results. try { - CompletableFuture> completableFuture = client.getMessagingClient().getAPIController().getMessagesAsync(ACCOUNT_ID, null, bandwidthNumber, null, null, null, null, null, null, null); - System.out.println(completableFuture.get().getResult()); - } catch (InterruptedException | ExecutionException e) { - System.out.println(e.getMessage()); + MessagesList result = apiInstance.listMessages(accountId, messageId, sourceTn, destinationTn, messageStatus, messageDirection, carrierName, messageType, errorCode, fromDateTime, toDateTime, campaignId, sort, pageToken, limit, limitTotalCount); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling MessagesApi#listMessages"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } } } @@ -1059,22 +1081,21 @@ paths: print(e.response_code) - lang: Ruby source: | - require 'bandwidth' + require 'bandwidth-sdk' - include Bandwidth - include Bandwidth::Messaging + Bandwidth.configure do |config| + config.username = 'api-username' + config.password = 'api-password' + end - bandwidth_client = Bandwidth::Client.new( - messaging_basic_auth_user_name: "api-username", - messaging_basic_auth_password: "api-password" - ) - messaging_client = bandwidth_client.messaging_client.client + api_instance = Bandwidth::MessagesApi.new + account_id = '12345' begin - result = messaging_client.get_messages("12345", :source_tn => "+15554443333") - puts result.data.total_count - rescue APIException => e - puts e.response_code + result = api_instance.list_messages(account_id) + p result.total_count + rescue Bandwidth::ApiError => e + p "Error when calling MessagesApi->list_messages: #{e}" end post: summary: Create Message @@ -1179,40 +1200,33 @@ paths: } - lang: Java source: | - import com.bandwidth.BandwidthClient; - import com.bandwidth.http.response.ApiResponse; - import com.bandwidth.messaging.models.BandwidthMessage; - import com.bandwidth.messaging.models.MessageRequest; - - import java.util.concurrent.CompletableFuture; - import java.util.concurrent.ExecutionException; - import java.util.Collections; - - public class Sample { - public static final String USERNAME = "api-username"; - public static final String PASSWORD = "api-password"; - public static final String ACCOUNT_ID = "12345"; - + 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.MessagesApi; + + public class Example { public static void main(String[] args) { - String messagingApplicationId = "1234-asdf"; - String to = "+15553334444"; - String from = "+15554443333"; - - BandwidthClient client = new BandwidthClient.Builder() - .messagingBasicAuthCredentials(USERNAME, PASSWORD) - .build(); - - MessageRequest request = new MessageRequest(); - request.setApplicationId(messagingApplicationId); - request.setTo(Collections.singletonList(to)); - request.setFrom(from); - request.setText("Hello world"); - + ApiClient defaultClient = Configuration.getDefaultApiClient(); + // Configure HTTP basic authorization: Basic + HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); + Basic.setUsername("YOUR USERNAME"); + Basic.setPassword("YOUR PASSWORD"); + + MessagesApi apiInstance = new MessagesApi(defaultClient); + String accountId = "9900000"; // String | Your Bandwidth Account ID. + MessageRequest messageRequest = new MessageRequest(); // MessageRequest | try { - CompletableFuture> completableFuture = client.getMessagingClient().getAPIController().createMessageAsync(ACCOUNT_ID, request); - System.out.println(completableFuture.get().getResult()); - } catch (InterruptedException | ExecutionException e) { - System.out.println(e.getMessage()); + Message result = apiInstance.createMessage(accountId, messageRequest); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling MessagesApi#createMessage"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } } } @@ -1336,28 +1350,29 @@ paths: print(e.response_code) - lang: Ruby source: | - require 'bandwidth' + require 'bandwidth-sdk' - include Bandwidth - include Bandwidth::Messaging + Bandwidth.configure do |config| + config.username = 'api-username' + config.password = 'api-password' + end - bandwidth_client = Bandwidth::Client.new( - messaging_basic_auth_user_name: "api-username", - messaging_basic_auth_password: "api-password" + api_instance = Bandwidth::MessagesApi.new + account_id = '12345' + message_request = Bandwidth::MessageRequest.new( + { + application_id: '1234-asdf', + to: ['+15553334444'], + from: '+15554443333', + text: 'Hello world!' + } ) - messaging_client = bandwidth_client.messaging_client.client - body = MessageRequest.new - body.application_id = "1234-asdf" - body.to = ["+15553334444"] - body.from = "+15554443333" - body.text = 'Hey, check this out!' - body.tag = '{"test": "message"}' begin - result = messaging_client.create_message("12345", body) - puts 'messageId: ' + result.data.id - rescue APIException => e - puts e.response_code + result = api_instance.create_message(account_id, message_request) + p "messageId: #{result.id}" + rescue Bandwidth::ApiError => e + p "Error when calling MessagesApi->create_message: #{e}" end components: parameters: diff --git a/site/specs/multi-factor-auth.yml b/site/specs/multi-factor-auth.yml index 27cace8f2..2d9691a36 100644 --- a/site/specs/multi-factor-auth.yml +++ b/site/specs/multi-factor-auth.yml @@ -101,52 +101,35 @@ paths: } } - lang: Java - source: > - import com.bandwidth.BandwidthClient; - - import com.bandwidth.http.response.ApiResponse; - - import - com.bandwidth.multifactorauth.models.TwoFactorCodeRequestSchema; - - import com.bandwidth.multifactorauth.models.TwoFactorVoiceResponse; - - - import java.util.concurrent.CompletableFuture; - - import java.util.concurrent.ExecutionException; - - - public class Sample { - public static final String USERNAME = "api-username"; - public static final String PASSWORD = "api-password"; - public static final String ACCOUNT_ID = "12345"; - public static final String APPLICATION_ID = "1234-qwer"; - + source: | + 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) { - BandwidthClient client = new BandwidthClient.Builder() - .multiFactorAuthBasicAuthCredentials(USERNAME, PASSWORD) - .build(); - - String to = "+15553334444"; - String from = "+15554443333"; - String scope = "sample"; - int digits = 6; - String message = "Your temporary {NAME} {SCOPE} code is {CODE}"; - - TwoFactorCodeRequestSchema request = new TwoFactorCodeRequestSchema(); - request.setApplicationId(APPLICATION_ID); - request.setTo(to); - request.setFrom(from); - request.setScope(scope); - request.setDigits(digits); - request.setMessage(message); + ApiClient defaultClient = Configuration.getDefaultApiClient(); + // 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 { - CompletableFuture> completableFuture = client.getMultiFactorAuthClient().getMFAController().createVoiceTwoFactorAsync(ACCOUNT_ID, request); - System.out.println(completableFuture.get().getResult()); - } catch (InterruptedException | ExecutionException e) { - System.out.println(e.getMessage()); + 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(); } } } @@ -291,29 +274,30 @@ paths: print(e.response_code) - lang: Ruby source: | - require 'bandwidth' + require 'bandwidth-sdk' - include Bandwidth - include Bandwidth::MultiFactorAuth + Bandwidth.configure do |config| + config.username = 'api-username' + config.password = 'api-password' + end - bandwidth_client = Bandwidth::Client.new( - multi_factor_auth_basic_auth_user_name: "api-username", - multi_factor_auth_basic_auth_password: "api-password" + api_instance = Bandwidth::MFAApi.new + account_id = '12345' + code_request = Bandwidth::CodeRequest.new( + { + to: '+15553334444', + from: '+15554443333', + application_id: '1234-qwer', + message: 'Your temporary {NAME} {SCOPE} code is {CODE}', + digits: 6 + } ) - auth_client = bandwidth_client.multi_factor_auth_client.mfa - body = TwoFactorCodeRequestSchema.new - body.application_id = "1234-qwer" - body.to = "+15553334444" - body.from = "+15554443333" - body.digits = 6 - body.scope = "scope" - body.message = "Your temporary {NAME} {SCOPE} code is {CODE}" begin - result = auth_client.create_voice_two_factor("12345", body) - puts 'callId: ' + result.data.call_id - rescue APIException => e - puts e.response_code + result = api_instance.generate_voice_code(account_id, code_request) + p "callId: #{result.call_id}" + rescue Bandwidth::ApiError => e + p "Error when calling MFAApi->generate_voice_code: #{e}" end /accounts/{accountId}/code/messaging: post: @@ -401,53 +385,35 @@ paths: } } - lang: Java - source: > - import com.bandwidth.BandwidthClient; - - import com.bandwidth.http.response.ApiResponse; - - import - com.bandwidth.multifactorauth.models.TwoFactorCodeRequestSchema; - - import - com.bandwidth.multifactorauth.models.TwoFactorMessagingResponse; - - - import java.util.concurrent.CompletableFuture; - - import java.util.concurrent.ExecutionException; - - - public class Sample { - public static final String USERNAME = "api-username"; - public static final String PASSWORD = "api-password"; - public static final String ACCOUNT_ID = "12345"; - public static final String APPLICATION_ID = "1234-asdf"; - + source: | + 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) { - BandwidthClient client = new BandwidthClient.Builder() - .multiFactorAuthBasicAuthCredentials(USERNAME, PASSWORD) - .build(); - - String to = "+15553334444"; - String from = "+15554443333"; - String scope = "sample"; - int digits = 6; - String message = "Your temporary {NAME} {SCOPE} code is {CODE}"; - - TwoFactorCodeRequestSchema request = new TwoFactorCodeRequestSchema(); - request.setApplicationId(APPLICATION_ID); - request.setTo(to); - request.setFrom(from); - request.setScope(scope); - request.setDigits(digits); - request.setMessage(message); + ApiClient defaultClient = Configuration.getDefaultApiClient(); + + // 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 { - CompletableFuture> completableFuture = client.getMultiFactorAuthClient().getMFAController().createMessagingTwoFactorAsync(ACCOUNT_ID, request); - System.out.println(completableFuture.get().getResult()); - } catch (InterruptedException | ExecutionException e) { - System.out.println(e.getMessage()); + 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(); } } } @@ -591,29 +557,30 @@ paths: print(e.response_code) - lang: Ruby source: | - require 'bandwidth' + require 'bandwidth-sdk' - include Bandwidth - include Bandwidth::MultiFactorAuth + Bandwidth.configure do |config| + config.username = 'api-username' + config.password = 'api-password' + end - bandwidth_client = Bandwidth::Client.new( - multi_factor_auth_basic_auth_user_name: "api-username", - multi_factor_auth_basic_auth_password: "api-password" + api_instance = Bandwidth::MFAApi.new + account_id = '12345' + code_request = Bandwidth::CodeRequest.new( + { + to: '+15553334444', + from: '+15554443333', + application_id: '1234-asdf', + message: 'Your temporary {NAME} {SCOPE} code is {CODE}', + digits: 6 + } ) - auth_client = bandwidth_client.multi_factor_auth_client.mfa - body = TwoFactorCodeRequestSchema.new - body.application_id = "1234-asdf" - body.to = "+15553334444" - body.from = "+15554443333" - body.digits = 6 - body.scope = "scope" - body.message = "Your temporary {NAME} {SCOPE} code is {CODE}" begin - result = auth_client.create_messaging_two_factor("12345", body) - puts 'messageId: ' + result.data.message_id - rescue APIException => e - puts e.response_code + result = api_instance.generate_messaging_code(account_id, code_request) + p "messageId: #{result.message_id}" + rescue Bandwidth::ApiError => e + p "Error when calling MFAApi->generate_messaging_code: #{e}" end /accounts/{accountId}/code/verify: post: @@ -699,51 +666,35 @@ paths: } } - lang: Java - source: > - import com.bandwidth.BandwidthClient; - - import com.bandwidth.http.response.ApiResponse; - - import - com.bandwidth.multifactorauth.models.TwoFactorVerifyCodeResponse; - - import - com.bandwidth.multifactorauth.models.TwoFactorVerifyRequestSchema; - - - import java.util.concurrent.CompletableFuture; - - import java.util.concurrent.ExecutionException; - - - public class Sample { - public static final String USERNAME = "api-username"; - public static final String PASSWORD = "api-password"; - public static final String ACCOUNT_ID = "12345"; - public static final String APPLICATION_ID = "1234-qwer"; - + source: | + 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) { - BandwidthClient client = new BandwidthClient.Builder() - .multiFactorAuthBasicAuthCredentials(USERNAME, PASSWORD) - .build(); - - String to = "+15553334444"; - String scope = "sample"; - String code = "159193"; - int expirationTimeInMinutes = 3; - - TwoFactorVerifyRequestSchema request = new TwoFactorVerifyRequestSchema(); - request.setApplicationId(APPLICATION_ID); - request.setTo(to); - request.setScope(scope); - request.setCode(code); - request.setExpirationTimeInMinutes(expirationTimeInMinutes); + ApiClient defaultClient = Configuration.getDefaultApiClient(); + + // 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 { - CompletableFuture> completableFuture = client.getMultiFactorAuthClient().getMFAController().createVerifyTwoFactorAsync(ACCOUNT_ID, request); - System.out.println(completableFuture.get().getResult()); - } catch (InterruptedException | ExecutionException e) { - System.out.println(e.getMessage()); + 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(); } } } @@ -906,28 +857,28 @@ paths: print(e.response_code) - lang: Ruby source: | - require 'bandwidth' + require 'bandwidth-sdk' - include Bandwidth - include Bandwidth::MultiFactorAuth + Bandwidth.configure do |config| + config.username = 'api-username' + config.password = 'api-password' + end - bandwidth_client = Bandwidth::Client.new( - multi_factor_auth_basic_auth_user_name: "api-username", - multi_factor_auth_basic_auth_password: "api-password" + api_instance = Bandwidth::MFAApi.new + account_id = '12345' + verify_code_request = Bandwidth::VerifyCodeRequest.new( + { + to: '+15553334444', + expiration_time_in_minutes: 3, + code: '123456' + } ) - auth_client = bandwidth_client.multi_factor_auth_client.mfa - body = TwoFactorVerifyRequestSchema.new - body.application_id = "1234-qwer" - body.to = "+15553334444" - body.scope = "scope" - body.code = "123456" - body.expiration_time_in_minutes = 3 begin - result = auth_client.create_verify_two_factor("12345", body) - puts 'valid?: ' + result.data.valid - rescue APIException => e - puts e.response_code + result = api_instance.verify_code(account_id, verify_code_request) + p "valid?: #{result.valid}" + rescue Bandwidth::ApiError => e + p "Error when calling MFAApi->verify_code: #{e}" end components: schemas: diff --git a/site/specs/numbers_v2.yml b/site/specs/numbers_v2.yml index 00b2e0896..5b3e1aaef 100644 --- a/site/specs/numbers_v2.yml +++ b/site/specs/numbers_v2.yml @@ -1076,7 +1076,7 @@ components: CustomerOrderIdQueryParam: description: >- The Customer Order ID is an ID assigned by the account owner to provide - a reference number for the importVoiceTnOrder. + a reference number for the order. example: ABCCorp12345 in: query name: customerOrderId @@ -1252,14 +1252,6 @@ components: schema: format: int32 type: integer - SipPeerIdQueryParam: - description: SipPeer ID, also known as Location - example: 50139 - in: query - name: sipPeerId - required: false - schema: - type: integer SipPeerTnsPageQueryParam: description: The number of the paged results to be displayed. example: 4 @@ -7226,8 +7218,6 @@ components: required: - TelephoneNumbers - SiteId - - Subscriber - - LoaAuthorizingPerson type: object title: ImportTnOrder ImportTnOrderResponse: @@ -11946,8 +11936,6 @@ components: properties: Address: $ref: '#/components/schemas/Address' - BillingIdentifier: - type: string CallVerificationEnabled: type: boolean CallingName: @@ -14995,7 +14983,7 @@ components: properties: featureName: description: Feature Name - example: ORDERING + example: Ordering type: string xml: name: FeatureName @@ -15553,7 +15541,7 @@ components: features: items: description: Feature Name - example: ORDERING + example: Ordering type: string xml: name: Feature @@ -15577,7 +15565,7 @@ components: features: items: description: Feature Name - example: ORDERING + example: Ordering type: string xml: name: Feature @@ -25393,9 +25381,9 @@ paths: /accounts/{accountId}/importTnChecker: post: description: >- -

Request portability information on a set of TNs. SipPeerId is an + Request importability information on a set of TNs. SipPeerId is an optional value. If SipPeerId is not specified, the id of the default - Sip-Peer for the provided SiteId will be used.

+ Sip-Peer for the provided SiteId will be used. operationId: CreateRequestImportTnChecker parameters: - $ref: '#/components/parameters/AccountIdPathParam' @@ -25456,11 +25444,11 @@ paths: 7201 - +161746052083 is not a valid NANPA telephone number. + +161746052083 is not a valid NANP telephone number. 7201 - +161746052082 is not a valid NANPA telephone number. + +161746052082 is not a valid NANP telephone number. schema: @@ -25471,84 +25459,37 @@ paths: empty.
  • List of TNs is more than 5000 TNs.
  • The account does not have the necessary (IMPORT_TNS) flag.
  • TNs are invalid (they are not actual TNs, and there are duplicates). - summary: Check Tns hostability + summary: Check Tns importability tags: - Hosted Messaging - /accounts/{accountId}/importTnOrders: + /accounts/{accountId}/importTnOrders/messaging: get: description: > Retrieves the importtnorders requests for the given account ID. A maximum of 1,000 orders can be retrieved per request. If no date range - or specific query parameter (marked by * below) - is provided, the order results will be limited to the last two years. - operationId: ReadImportTnOrders + or required query parameter is provided, the order results will be + limited to the last two years. + + + In this table are presented capabilities that are not universally + available. The following request query parameters are only allowed for + numbers from specific region/country: + + | Number Region | Request Query Parameter | + + |:--------------|:------------------------| + + |NANP|loaType| + operationId: ReadImportMessagingTnOrders parameters: - $ref: '#/components/parameters/AccountIdPathParam' - - description: The status of the importTnOrder being searched for. - example: PARTIAL - in: query - name: status - required: false - schema: - items: - type: string - type: array - - description: A Telephone Number (TN) that is referenced in the order - example: '+19199918388' - in: query - name: tn - required: true - schema: - type: string - - description: >- - The Customer Order ID is an ID assigned by the account owner to - provide a reference number for the importTnOrder. - example: ABCCorp12345 - in: query - name: customerOrderId - required: true - schema: - type: string - - description: >- - Checks the order's creation date against this value. Orders that - have a creation date after this date will be included. Format is - yyyy-MM-dd - example: '2013-10-22' - in: query - name: createdDateFrom - required: false - schema: - type: string - - description: >- - Checks the order's creation date against this value. Orders that - have a creation date before this date will be included. Format is - yyyy-MM-dd - example: '2013-10-25' - in: query - name: createdDateTo - required: false - schema: - type: string - - description: >- - For Date-based searches, the starting date of a date range - (inclusive) that will be used to find Import Tn Orders that were - modified within the date range. It is in the form yyyy-MM-dd. - example: '2013-10-22' - in: query - name: modifiedDateFrom - required: false - schema: - type: string - - description: >- - For Date-based searches, the ending date of a date range (inclusive) - that will be used to find Import Tn Orders that were modified within - the date range. It is in the form yyyy-MM-dd. - example: '2013-10-25' - in: query - name: modifiedDateTo - required: false - schema: - type: string + - $ref: '#/components/parameters/StatusQueryParam' + - $ref: '#/components/parameters/TnQueryParam' + - $ref: '#/components/parameters/CustomerOrderIdQueryParam' + - $ref: '#/components/parameters/CreatedDateFromQueryParam' + - $ref: '#/components/parameters/CreatedDateToQueryParam' + - $ref: '#/components/parameters/ModifiedDateFromQueryParam' + - $ref: '#/components/parameters/ModifiedDateToQueryParam' - description: Indentify the LoaType on TNs. example: SUBSCRIBER in: query @@ -25602,7 +25543,7 @@ paths: associated with the order, the state of the order, and a list of the successfully imported Telephone Numbers, and descriptions of any encountered errors. - summary: List Import Tn orders + summary: List Import Messaging Tn orders tags: - Hosted Messaging post: @@ -25615,7 +25556,21 @@ paths: the telephone numbers were successfully imported and "PARTIAL" if some of the telephone numbers were imported. A failed order with will have a staus of "FAILED" and no telephone numbers would have been imported. - operationId: CreateImportTnOrder + + + The following request parameters are only required for numbers from + specific region/country: + + | Number Region | Request Parameter | + + |:--------------|:------------------------| + + |NANP|LoaAuthorizingPerson| + + |NANP|LoaType| + + |NANP|Subscriber| + operationId: CreateImportMessagingTnOrder parameters: - $ref: '#/components/parameters/AccountIdPathParam' requestBody: @@ -25626,28 +25581,28 @@ paths: value: |- - ICPA123ABC + ICPA123ABC 743 - 303716 - - ABC Inc. - - 11235 - Back - Denver - CO - 27541 - Canyon - - - The Authguy - CARRIER - - +19199918388 - +14158714245 - +14352154439 - +14352154466 - + 303716 + + ABC Inc. + + 11235 + Back + Denver + CO + 27541 + Canyon + + + The Authguy + CARRIER + + +19199918388 + +14158714245 + +14352154439 + +14352154466 + schema: $ref: '#/components/schemas/ImportTnOrderRequest' @@ -25721,426 +25676,16 @@ paths: The order failed; one of the input parameters is invalid. The error text and an error code will be provided in the ErrorList element.

    - summary: Import Tn order + summary: Import Messaging Tn order tags: - Hosted Messaging - /accounts/{accountId}/importTnOrders/voice: - get: - description: > - Retrieves the ImportVoiceTnOrder requests for the given account ID. A - maximum of 1,000 orders can be retrieved per request. If no date range - or specific query parameter (marked by * below) - is provided, the order results will be limited to the last two years. - operationId: ReadImportVoiceTnOrders - parameters: - - $ref: '#/components/parameters/AccountIdPathParam' - - $ref: '#/components/parameters/StatusQueryParam' - - $ref: '#/components/parameters/TnQueryParam' - - $ref: '#/components/parameters/CustomerOrderIdQueryParam' - - $ref: '#/components/parameters/CreatedDateFromQueryParam' - - $ref: '#/components/parameters/CreatedDateToQueryParam' - - $ref: '#/components/parameters/ModifiedDateFromQueryParam' - - $ref: '#/components/parameters/ModifiedDateToQueryParam' - - $ref: '#/components/parameters/SipPeerIdQueryParam' - responses: - '200': - content: - application/xml: - examples: - example: - value: |- - - - 2 - - 14 - 1 - CustomerOrderId - systemUser - 2019-01-24T11:08:09.770Z - 2019-01-24T11:08:09.770Z - import_voice_tn_orders - COMPLETE - 211a103c-5f9c-4117-8833-c574bdc390fd - - - 14 - 2 - CustomerOrderId - systemUser - 2019-01-24T10:43:16.934Z - 2019-01-24T10:43:16.934Z - import_voice_tn_orders - PARTIAL - 8dc32f09-2329-4c73-b702-526f46b02712 - - - schema: - $ref: '#/components/schemas/ImportVoiceTnOrdersResponseList' - description: >- - The descriptive payload for the importVoiceTnOrders query provides - information about the orders found by the query, including the data - associated with the order, the state of the order, and a list of the - successfully imported Telephone Numbers, and descriptions of any - encountered errors. - summary: List Import Voice Tn orders - tags: - - Hosted Voice - post: - description: >- - Creates an ImportVoiceTnOrders request to add numbers under the given - site ID and sipPeer ID as specified in the body. - - A successfully submitted order will have a status of "RECEIVED". A - successfully completed order will have a status of "COMPLETE" if all of - the telephone numbers were successfully imported and "PARTIAL" if some - of the telephone numbers were imported. A failed order with will have a - staus of "FAILED" and no telephone numbers would have been imported. - operationId: CreateVoiceImportTnOrder - parameters: - - $ref: '#/components/parameters/AccountIdPathParam' - requestBody: - content: - application/xml: - examples: - example: - value: |- - - - ICPA123ABC - 743 - 303716 - - +19199918388 - +14158714245 - +14352154439 - +14352154466 - - - schema: - $ref: '#/components/schemas/ImportVoiceTnOrderRequest' - responses: - '201': - content: - application/xml: - examples: - example: - value: |- - - - - SJM000001 - 2018-01-20T02:59:54.000Z - 9900012 - smckinnon - b05de7e6-0cab-4c83-81bb-9379cba8efd0 - 2018-01-20T02:59:54.000Z - 202 - 520565 - - +19199918388 - +14158714245 - +14352154439 - +14352154466 - - PROCESSING - - - - schema: - $ref: '#/components/schemas/ImportVoiceTnOrderResponse' - description: >- - The order has been created and an order ID will be specified in the - payload and in the header. - '400': - content: - application/xml: - examples: - example: - value: |- - - - FAILED - - 7309 - The site id was not supplied or is invalid. - - - 7312 - The sippeer id is invalid. - - - schema: - $ref: '#/components/schemas/ImportVoiceTnOrderError' - description: >- - The order failed; one of the input parameters is invalid. The error - text and an error code will be provided in the ErrorList - element.

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -

    - ErrorCode -

    -
    -

    - Description -

    -
    -

    - 25010 -

    -
    -

    - The account does not have permission to use the endpoint requested, please contact support if you believe you should have permission. -

    -
    -

    - 5052 -

    -
    -

    - Customer order ID is invalid. Only alphanumeric values, dashes and spaces are allowed. Max length is 255 characters. -

    -

    - 1003 -

    -
    -

    - SiteId is required. -

    -
    -

    - 5073 -

    -
    -

    - Telephone number is required. -

    -
    -

    - 5095 -

    -
    -

    - The count of telephone numbers in order exceeds the maximum size of 5000. -

    -
    -

    - 1003 -

    -
    -

    - TelephoneNumbers is required. -

    -

    - 5070 -

    -
    -

    - Telephone number is invalid. -

    -

    - 5093 -

    -
    -

    - Order cannot contain duplicate telephone numbers. -

    - summary: Import Voice Tn order - tags: - - Hosted Voice - /accounts/{accountId}/importTnOrders/voice/{orderId}: - get: - description: Retrieve information about a importVoiceTnOrder with specified ID. - operationId: ReadImportVoiceTnOrder - parameters: - - $ref: '#/components/parameters/AccountIdPathParam' - - $ref: '#/components/parameters/OrderIdPathParam' - responses: - '200': - content: - application/xml: - examples: - example: - value: |- - - - 2018-01-09T02:58:04.615Z - 9900012 - sjm - bf1305b8-8998-1111-2222-51ba3ce52d4e - 2018-01-09T02:58:05.298Z - 65487 - 885544 - - +12106078250 - +12109678273 - +12109678331 - +12109678337 - +12266401468 - - PARTIAL - - - 7518 - Telephone Number Not Active. - - +12262665583 - - - - - schema: - $ref: '#/components/schemas/ImportVoiceTnOrderResponse' - description: >- - The information has been successfully retrieved and displayed in the - payload. - - - - - - - - - - - - - - - - - - -
    -

    - ErrorCode -

    -
    -

    - Description -

    -
    -

    - 19014 -

    -
    -

    - Numbers cannot be imported by this account at this time. -

    -
    -

    - 5061 -

    -
    -

    - The SiteId submitted is invalid. -

    -

    - 5023 -

    -
    -

    - SIP peer submitted is invalid. -

    -
    - summary: Fetch Import Voice Tn order status - tags: - - Hosted Voice - /accounts/{accountId}/importTnOrders/voice/{orderId}/history: - get: - description: Retrieves the history of the specified importVoiceTnOrder. - operationId: ReadImportVoiceTnOrderHistory - parameters: - - $ref: '#/components/parameters/AccountIdPathParam' - - $ref: '#/components/parameters/OrderIdPathParam' - responses: - '200': - content: - application/xml: - examples: - example: - value: |- - - - - 2015-06-16T14:03:10.225Z - Import Voice TN order is received. - admin - RECEIVED - - - 2015-06-16T14:03:10.330Z - Import TN order is processing. - admin - PROCESSING - - - 2015-06-16T14:03:10.789Z - Import Voice TN order is partial. - admin - PARTIAL - - - schema: - $ref: '#/components/schemas/OrderHistoryWrapper' - description: >- - The history has been successfully retrieved and displayed in the - payload. - summary: Fetch Import Voice Tn order history - tags: - - Hosted Voice - /accounts/{accountId}/importTnOrders/{orderId}: + /accounts/{accountId}/importTnOrders/messaging/{orderId}: get: description: Retrieve information about a importTnOrder with specified ID. - operationId: ReadImportTnOrder + operationId: ReadImportMessagingTnOrder parameters: - $ref: '#/components/parameters/AccountIdPathParam' - - description: Import Tn order's ID - example: 093a9f9b-1a78-4e47-b6e2-776a484596f4 - in: path - name: orderId - required: true - schema: - type: string + - $ref: '#/components/parameters/OrderIdPathParam' responses: '200': content: @@ -26193,22 +25738,16 @@ paths: description: >- The information has been successfully retrieved and displayed in the payload. - summary: Fetch Import Tn order status + summary: Fetch Import Messaging Tn order status tags: - Hosted Messaging - /accounts/{accountId}/importTnOrders/{orderId}/history: + /accounts/{accountId}/importTnOrders/messaging/{orderId}/history: get: description: Retrieves the history of the specified importTnOrder. - operationId: ReadImportTnOrderHistory + operationId: ReadImportMessagingTnOrderHistory parameters: - $ref: '#/components/parameters/AccountIdPathParam' - - description: Import Tn order's ID - example: 093a9f9b-1a78-4e47-b6e2-776a484596f4 - in: path - name: orderId - required: true - schema: - type: string + - $ref: '#/components/parameters/OrderIdPathParam' responses: '200': content: @@ -26242,18 +25781,18 @@ paths: description: >- The history has been successfully retrieved and displayed in the payload. - summary: Fetch Import Tn order history + summary: Fetch Import Messaging Tn order history tags: - Hosted Messaging - /accounts/{accountId}/importTnOrders/{orderId}/loas: + /accounts/{accountId}/importTnOrders/messaging/{orderId}/loas: get: description: >- Retrieves the list of the loa (and other) files associated with the order. - operationId: ReadImportTnOrderLoas + operationId: ReadImportMessagingTnOrderLoas parameters: - $ref: '#/components/parameters/AccountIdPathParam' - - description: Import Tn order's ID + - description: Import Messaging Tn order's ID example: 093a9f9b-1a78-4e47-b6e2-776a484596f4 in: path name: orderId @@ -26293,7 +25832,7 @@ paths: description: >- The list of all files is being returned. This response includes the case where the list is empty. - summary: Fetch Import Tn order loas + summary: Fetch Import Messaging Tn order loas [NANP] tags: - Hosted Messaging post: @@ -26335,10 +25874,10 @@ paths:
  • application/vnd.openxmlformats-officedocument.wordprocessingml.document
  • - operationId: CreateImportTnOrderLoas + operationId: CreateImportMessagingTnOrderLoas parameters: - $ref: '#/components/parameters/AccountIdPathParam' - - description: Import Tn order's ID + - description: Import Messaging Tn order's ID example: 093a9f9b-1a78-4e47-b6e2-776a484596f4 in: path name: orderId @@ -26390,16 +25929,16 @@ paths: on the identified resource. '400': description: A 400 indicates that the requested upload failed. - summary: Import Tn order loas + summary: Import Messaging Tn order loas [NANP] tags: - Hosted Messaging - /accounts/{accountId}/importTnOrders/{orderId}/loas/{fileId}: + /accounts/{accountId}/importTnOrders/messaging/{orderId}/loas/{fileId}: delete: description: Deletes the file associated with the order - operationId: DeleteImportTnOrderLoasFile + operationId: DeleteImportMessagingTnOrderLoasFile parameters: - $ref: '#/components/parameters/AccountIdPathParam' - - description: Import Tn order's ID + - description: Import Messaging Tn order's ID example: 093a9f9b-1a78-4e47-b6e2-776a484596f4 in: path name: orderId @@ -26420,15 +25959,15 @@ paths: description: >- a 404 indicates that the indicated file was not found in conjunction with the order id. - summary: Removing Import Tn order loas file + summary: Removing Import Messaging Tn order loas file [NANP] tags: - Hosted Messaging get: description: Retrieves the file associated with the order. - operationId: ReadImportTnOrderLoasFile + operationId: ReadImportMessagingTnOrderLoasFile parameters: - $ref: '#/components/parameters/AccountIdPathParam' - - description: Import Tn order's ID + - description: Import Messaging Tn order's ID example: 093a9f9b-1a78-4e47-b6e2-776a484596f4 in: path name: orderId @@ -26455,17 +25994,17 @@ paths: description: >- a 404 indicates that the indicated file was not found in conjunction with the order id. - summary: Fetch Import Tn order loas file + summary: Fetch Import Messaging Tn order loas file [NANP] tags: - Hosted Messaging put: description: >- A PUT on the filename will update / replace the identified file id. The format of the PUT is identical to that of the POST. - operationId: UpdateImportTnOrderLoasFile + operationId: UpdateImportMessagingTnOrderLoasFile parameters: - $ref: '#/components/parameters/AccountIdPathParam' - - description: Import Tn order's ID + - description: Import Messaging Tn order's ID example: 093a9f9b-1a78-4e47-b6e2-776a484596f4 in: path name: orderId @@ -26504,16 +26043,16 @@ paths: description: A 400 indicates that the requested upload failed. '404': description: A 404 indicates that the file was not available for replacement. - summary: Updating Import Tn order loas file + summary: Updating Import Messaging Tn order loas file [NANP] tags: - Hosted Messaging - /accounts/{accountId}/importTnOrders/{orderId}/loas/{fileId}/metadata: + /accounts/{accountId}/importTnOrders/messaging/{orderId}/loas/{fileId}/metadata: delete: description: Deletes the metadata previously associated with the identified file. - operationId: RemoveImportTnOrderLoasFileMetadata + operationId: RemoveImportMessagingTnOrderLoasFileMetadata parameters: - $ref: '#/components/parameters/AccountIdPathParam' - - description: Import Tn order's ID + - description: Import Messaging Tn order's ID example: 093a9f9b-1a78-4e47-b6e2-776a484596f4 in: path name: orderId @@ -26536,15 +26075,15 @@ paths: description: >- A 404 indicates that the indicated file was not found in conjunction with the order id.cd - summary: Removing Import Tn order loas file metadata + summary: Removing Import Messaging Tn order loas file metadata [NANP] tags: - Hosted Messaging get: description: Retrieves the metadata associated with the file. - operationId: ReadImportTnOrderLoasFileMetadata + operationId: ReadImportMessagingTnOrderLoasFileMetadata parameters: - $ref: '#/components/parameters/AccountIdPathParam' - - description: Import Tn order's ID + - description: Import Messaging Tn order's ID example: 093a9f9b-1a78-4e47-b6e2-776a484596f4 in: path name: orderId @@ -26577,7 +26116,7 @@ paths: description: >- a 404 indicates that the indicated file was not found in conjunction with the order id. - summary: Fetch Import Tn order loas file metadata + summary: Fetch Import Messaging Tn order loas file metadata [NANP] tags: - Hosted Messaging put: @@ -26585,10 +26124,10 @@ paths: Associate metadata with the file named in the resource path. This will describe the file, and declare the data that is contained in the file, selected from a list of [LOA | INVOICE | CSR | OTHER]. - operationId: UpdateImportTnOrderLoasFileMetadata + operationId: UpdateImportMessagingTnOrderLoasFileMetadata parameters: - $ref: '#/components/parameters/AccountIdPathParam' - - description: Import Tn order's ID + - description: Import Messaging Tn order's ID example: 093a9f9b-1a78-4e47-b6e2-776a484596f4 in: path name: orderId @@ -26626,9 +26165,412 @@ paths: file. '400': description: Some error has occured as a result of the attempt. - summary: Updating Import Tn order loas file metadata + summary: Updating Import Messaging Tn order loas file metadata [NANP] tags: - Hosted Messaging + /accounts/{accountId}/importTnOrders/voice: + get: + description: > + Retrieves the ImportVoiceTnOrder requests for the given account ID. A + maximum of 1,000 orders can be retrieved per request. If no date range + or specific query parameter (marked by * below) + is provided, the order results will be limited to the last two years. + operationId: ReadImportVoiceTnOrders + parameters: + - $ref: '#/components/parameters/AccountIdPathParam' + - $ref: '#/components/parameters/StatusQueryParam' + - $ref: '#/components/parameters/TnQueryParam' + - $ref: '#/components/parameters/CustomerOrderIdQueryParam' + - $ref: '#/components/parameters/CreatedDateFromQueryParam' + - $ref: '#/components/parameters/CreatedDateToQueryParam' + - $ref: '#/components/parameters/ModifiedDateFromQueryParam' + - $ref: '#/components/parameters/ModifiedDateToQueryParam' + responses: + '200': + content: + application/xml: + examples: + example: + value: |- + + + 2 + + 14 + 1 + CustomerOrderId + systemUser + 2019-01-24T11:08:09.770Z + 2019-01-24T11:08:09.770Z + import_voice_tn_orders + COMPLETE + 211a103c-5f9c-4117-8833-c574bdc390fd + + + 14 + 2 + CustomerOrderId + systemUser + 2019-01-24T10:43:16.934Z + 2019-01-24T10:43:16.934Z + import_voice_tn_orders + PARTIAL + 8dc32f09-2329-4c73-b702-526f46b02712 + + + schema: + $ref: '#/components/schemas/ImportVoiceTnOrdersResponseList' + description: >- + The descriptive payload for the importVoiceTnOrders query provides + information about the orders found by the query, including the data + associated with the order, the state of the order, and a list of the + successfully imported Telephone Numbers, and descriptions of any + encountered errors. + summary: List Import Voice Tn orders + tags: + - Hosted Voice + post: + description: >- + Creates an ImportVoiceTnOrders request to add numbers under the given + site ID and sipPeer ID as specified in the body. + + A successfully submitted order will have a status of "RECEIVED". A + successfully completed order will have a status of "COMPLETE" if all of + the telephone numbers were successfully imported and "PARTIAL" if some + of the telephone numbers were imported. A failed order with will have a + staus of "FAILED" and no telephone numbers would have been imported. + operationId: CreateImportVoiceTnOrder + parameters: + - $ref: '#/components/parameters/AccountIdPathParam' + requestBody: + content: + application/xml: + examples: + example: + value: |- + + + ICPA123ABC + 743 + 303716 + + +19199918388 + +14158714245 + +14352154439 + +14352154466 + + + schema: + $ref: '#/components/schemas/ImportVoiceTnOrderRequest' + responses: + '201': + content: + application/xml: + examples: + example: + value: |- + + + + SJM000001 + 2018-01-20T02:59:54.000Z + 9900012 + smckinnon + b05de7e6-0cab-4c83-81bb-9379cba8efd0 + 2018-01-20T02:59:54.000Z + 202 + 520565 + + +19199918388 + +14158714245 + +14352154439 + +14352154466 + + PROCESSING + + + + schema: + $ref: '#/components/schemas/ImportVoiceTnOrderResponse' + description: >- + The order has been created and an order ID will be specified in the + payload and in the header. + '400': + content: + application/xml: + examples: + example: + value: |- + + + FAILED + + 7309 + The site id was not supplied or is invalid. + + + 7312 + The sippeer id is invalid. + + + schema: + $ref: '#/components/schemas/ImportVoiceTnOrderError' + description: >- + The order failed; one of the input parameters is invalid. The error + text and an error code will be provided in the ErrorList + element.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +

    + ErrorCode +

    +
    +

    + Description +

    +
    +

    + 25010 +

    +
    +

    + The account does not have permission to use the endpoint requested, please contact support if you believe you should have permission. +

    +
    +

    + 5052 +

    +
    +

    + Customer order ID is invalid. Only alphanumeric values, dashes and spaces are allowed. Max length is 255 characters. +

    +

    + 1003 +

    +
    +

    + SiteId is required. +

    +
    +

    + 5073 +

    +
    +

    + Telephone number is required. +

    +
    +

    + 5095 +

    +
    +

    + The count of telephone numbers in order exceeds the maximum size of 5000. +

    +
    +

    + 1003 +

    +
    +

    + TelephoneNumbers is required. +

    +

    + 5070 +

    +
    +

    + Telephone number is invalid. +

    +

    + 5093 +

    +
    +

    + Order cannot contain duplicate telephone numbers. +

    + summary: Import Voice Tn order + tags: + - Hosted Voice + /accounts/{accountId}/importTnOrders/voice/{orderId}: + get: + description: Retrieve information about a importVoiceTnOrder with specified ID. + operationId: ReadImportVoiceTnOrder + parameters: + - $ref: '#/components/parameters/AccountIdPathParam' + - $ref: '#/components/parameters/OrderIdPathParam' + responses: + '200': + content: + application/xml: + examples: + example: + value: |- + + + 2018-01-09T02:58:04.615Z + 9900012 + sjm + bf1305b8-8998-1111-2222-51ba3ce52d4e + 2018-01-09T02:58:05.298Z + 65487 + 885544 + + +12106078250 + +12109678273 + +12109678331 + +12109678337 + +12266401468 + + PARTIAL + + + 7518 + Telephone Number Not Active. + + +12262665583 + + + + + schema: + $ref: '#/components/schemas/ImportVoiceTnOrderResponse' + description: >- + The information has been successfully retrieved and displayed in the + payload. + + + + + + + + + + + + + + + + + + +
    +

    + ErrorCode +

    +
    +

    + Description +

    +
    +

    + 19014 +

    +
    +

    + Numbers cannot be imported by this account at this time. +

    +
    +

    + 5061 +

    +
    +

    + The SiteId submitted is invalid. +

    +

    + 5023 +

    +
    +

    + SIP peer submitted is invalid. +

    +
    + summary: Fetch Import Voice Tn order status + tags: + - Hosted Voice + /accounts/{accountId}/importTnOrders/voice/{orderId}/history: + get: + description: Retrieves the history of the specified importVoiceTnOrder. + operationId: ReadImportVoiceTnOrderHistory + parameters: + - $ref: '#/components/parameters/AccountIdPathParam' + - $ref: '#/components/parameters/OrderIdPathParam' + responses: + '200': + content: + application/xml: + examples: + example: + value: |- + + + + 2015-06-16T14:03:10.225Z + Import Voice TN order is received. + admin + RECEIVED + + + 2015-06-16T14:03:10.330Z + Import TN order is processing. + admin + PROCESSING + + + 2015-06-16T14:03:10.789Z + Import Voice TN order is partial. + admin + PARTIAL + + + schema: + $ref: '#/components/schemas/OrderHistoryWrapper' + description: >- + The history has been successfully retrieved and displayed in the + payload. + summary: Fetch Import Voice Tn order history + tags: + - Hosted Voice /accounts/{accountId}/importToAccount: get: description: > @@ -32715,8 +32657,11 @@ paths: { "name": "NumberManagement", "features": [ - "ORDERING", + "Ordering", "LNP", + "HostedTNS", + "IMPORT_TNS", + "HostedVoice", "TN_ASSIGNMENT", "RESERVATION", "LSR" @@ -32731,7 +32676,7 @@ paths: "isDisabled": true }, { - "featureName": "ORDERING", + "featureName": "Ordering", "isDisabled": true } ] @@ -32741,7 +32686,19 @@ paths: "phoneNumberType": "NATIONAL", "features": [ { - "featureName": "ORDERING", + "featureName": "HostedTNS", + "isDisabled": true + }, + { + "featureName": "IMPORT_TNS", + "isDisabled": true + }, + { + "featureName": "HostedVoice", + "isDisabled": true + }, + { + "featureName": "Ordering", "isDisabled": false } ] @@ -32788,8 +32745,11 @@ paths: NumberManagement - ORDERING + Ordering LNP + HostedTNS + IMPORT_TNS + HostedVoice TN_ASSIGNMENT RESERVATION LSR @@ -32804,7 +32764,7 @@ paths: true - ORDERING + Ordering true @@ -32813,6 +32773,18 @@ paths: DEU NATIONAL + + HostedTNS + true + + + IMPORT_TNS + true + + + HostedVoice + true + Ordering true @@ -34437,11 +34409,11 @@ paths: summary: Update Realm tags: - Sip Registrar - /accounts/{accountId}/removeImportedTnOrders: + /accounts/{accountId}/removeImportedTnOrders/messaging: get: description: >- - Retrieves the Remove Imported Tn Orders requests for the given account - ID. + Retrieves the Remove Imported Messaging Tn Orders requests for the given + account ID. A maximum of 1,000 orders can be retrieved per request. If no date range or specific query parameter as required is provided, the order results @@ -34449,76 +34421,13 @@ paths: operationId: ListRemoveImportedTnOrders parameters: - $ref: '#/components/parameters/AccountIdPathParam' - - description: The status of the Remove Imported Tn Orders being searched for - example: PARTIAL - in: query - name: status - required: false - schema: - items: - enum: - - PROCESSING - - COMPLETE - - PARTIAL - - FAILED - type: string - type: array - - description: A Telephone Number (TN) that is referenced in the order - example: '+19199918388' - in: query - name: tn - required: true - schema: - type: string - - description: >- - The Customer Order Id is an Id assigned by the account owner to - provide a reference number for the Remove Imported Tn Order - example: ABCCorp12345 - in: query - name: customerOrderId - required: true - schema: - type: string - - description: >- - Checks the order's creation date against this value. Orders that - have a creation date after this date will be included. Format is - yyyy-MM-dd - example: '2022-04-19' - in: query - name: createdDateFrom - required: false - schema: - type: string - - description: >- - Checks the order's creation date against this value. Orders that - have a creation date before this date will be included. Format is - yyyy-MM-dd - example: '2022-04-19' - in: query - name: createdDateTo - required: false - schema: - type: string - - description: >- - For Date-based searches, the starting date of a date range - (inclusive) that will be used to find Remove Imported Tn Orders that - were modified within the date range. It is in the form yyyy-MM-dd - example: '2022-04-19' - in: query - name: modifiedDateFrom - required: false - schema: - type: string - - description: >- - For Date-based searches, the ending date of a date range (inclusive) - that will be used to find Remove Imported Tn Orders that were - modified within the date range. It is in the form yyyy-MM-dd - example: '2022-04-19' - in: query - name: modifiedDateTo - required: false - schema: - type: string + - $ref: '#/components/parameters/StatusQueryParam' + - $ref: '#/components/parameters/TnQueryParam' + - $ref: '#/components/parameters/CustomerOrderIdQueryParam' + - $ref: '#/components/parameters/CreatedDateFromQueryParam' + - $ref: '#/components/parameters/CreatedDateToQueryParam' + - $ref: '#/components/parameters/ModifiedDateFromQueryParam' + - $ref: '#/components/parameters/ModifiedDateToQueryParam' responses: '200': content: @@ -34555,23 +34464,24 @@ paths: schema: $ref: '#/components/schemas/RemoveImportedTnOrders' description: >- - The descriptive payload for the Remove Imported Tn Orders query - provides information about the orders found by the query, including - the data associated with the order, the state of the order, and a - list of the successfully removed Telephone Numbers, and descriptions - of any encountered errors - summary: List Remove Imported Tn Orders + The descriptive payload for the Remove Imported Messaging Tn Orders + query provides information about the orders found by the query, + including the data associated with the order, the state of the + order, and a list of the successfully removed Telephone Numbers, and + descriptions of any encountered errors + summary: List Remove Imported Messaging Tn Orders tags: - Hosted Messaging post: description: >- - Creates a Remove Imported Tn Orders request to remove imported telephone - numbers from the given site ID and sippeer ID as specified in the body. - A successfully submitted order will have a status of "PROCESSING". A - successfully completed order will have a status of "COMPLETE" if all of - the telephone numbers were successfully removed and "PARTIAL" if some - of the telephone numbers were removed. A failed order with will have a - status of "FAILED" and no telephone numbers would have been removed + Creates a Remove Imported Messaging Tn Orders request to remove imported + telephone numbers from the given site ID and sippeer ID as specified in + the body. A successfully submitted order will have a status of + "PROCESSING". A successfully completed order will have a status of + "COMPLETE" if all of the telephone numbers were successfully removed + and "PARTIAL" if some of the telephone numbers were removed. A failed + order with will have a status of "FAILED" and no telephone numbers would + have been removed operationId: CreateRemoveImportedTnOrder parameters: - $ref: '#/components/parameters/AccountIdPathParam' @@ -34641,7 +34551,136 @@ paths: description: >- The order failed. One of the input parameters is invalid. The error text and an error code will be provided in the ErrorList element - summary: Create Remove Imported Tn Order + summary: Create Remove Imported Messaging Tn Order + tags: + - Hosted Messaging + /accounts/{accountId}/removeImportedTnOrders/messaging/{orderId}: + get: + description: Retrieve information about a removeImportedTnOrder with specified ID + operationId: RetrieveRemoveImportedTnOrder + parameters: + - $ref: '#/components/parameters/AccountIdPathParam' + - $ref: '#/components/parameters/OrderIdPathParam' + responses: + '200': + content: + application/xml: + examples: + example: + value: |- + + + 2018-01-09T02:58:04.615Z + 9900012 + sjm + bf1305b8-8998-1111-2222-51ba3ce52d4e + 2018-01-09T02:58:05.298Z + + +12106078250 + +12109678273 + +12109678331 + +12109678337 + +12266401468 + + PARTIAL + + + 7518 + Telephone Number Not Active. + + +12262665583 + + + + + schema: + $ref: '#/components/schemas/RemoveImportedTnOrdersResponse' + description: >- + The information has been successfully retrieved and displayed in the + payload + '400': + content: + application/xml: + examples: + example: + value: |- + + + + The resource does not exist + + + schema: + $ref: '#/components/schemas/RemoveImportedTnOrdersHistoryResponse' + description: Order id is not valid + summary: Retrieve Remove Imported Messaging Tn Order + tags: + - Hosted Messaging + /accounts/{accountId}/removeImportedTnOrders/messaging/{orderId}/history: + get: + description: >- + Retrieves the history of the specified Remove Imported Messaging Tn + Order + operationId: RetrieveRemoveImportedTnOrderHistory + parameters: + - $ref: '#/components/parameters/AccountIdPathParam' + - description: ID of `RemoveImportedTnOrder` to retrieve history + example: bf1305b8-8998-1111-2222-51ba3ce52d4e + in: path + name: orderId + required: true + schema: + type: string + responses: + '200': + content: + application/xml: + examples: + example: + value: |- + + + + 2015-06-16T14:03:10.225Z + Remove Imported TN order is received. + admin + RECEIVED + + + 2015-06-16T14:03:10.330Z + Remove Imported TN order is processing. + admin + PROCESSING + + + 2015-06-16T14:03:10.789Z + Remove Imported TN order is partial. + admin + PARTIAL + + + schema: + $ref: '#/components/schemas/OrderHistoryWrapper' + description: >- + The history has been successfully retrieved and displayed in the + payload + '400': + content: + application/xml: + examples: + example: + value: |- + + + + 1008 + 'some_invalid_uuid' is not a valid UUID + + + schema: + $ref: '#/components/schemas/RemoveImportedTnOrdersHistoryResponse' + description: Order id is not valid + summary: Retrieve Remove Imported Messaging Tn Order history tags: - Hosted Messaging /accounts/{accountId}/removeImportedTnOrders/voice: @@ -34663,7 +34702,6 @@ paths: - $ref: '#/components/parameters/CreatedDateToQueryParam' - $ref: '#/components/parameters/ModifiedDateFromQueryParam' - $ref: '#/components/parameters/ModifiedDateToQueryParam' - - $ref: '#/components/parameters/SipPeerIdQueryParam' responses: '200': content: @@ -35006,140 +35044,6 @@ paths: summary: Retrieve Remove Imported Voice Tn Order history tags: - Hosted Voice - /accounts/{accountId}/removeImportedTnOrders/{orderId}: - get: - description: Retrieve information about a removeImportedTnOrder with specified ID - operationId: RetrieveRemoveImportedTnOrder - parameters: - - $ref: '#/components/parameters/AccountIdPathParam' - - description: ID of `RemoveImportedTnOrder` to retrieve - example: bf1305b8-8998-1111-2222-51ba3ce52d4e - in: path - name: orderId - required: true - schema: - type: string - responses: - '200': - content: - application/xml: - examples: - example: - value: |- - - - 2018-01-09T02:58:04.615Z - 9900012 - sjm - bf1305b8-8998-1111-2222-51ba3ce52d4e - 2018-01-09T02:58:05.298Z - - +12106078250 - +12109678273 - +12109678331 - +12109678337 - +12266401468 - - PARTIAL - - - 7518 - Telephone Number Not Active. - - +12262665583 - - - - - schema: - $ref: '#/components/schemas/RemoveImportedTnOrdersResponse' - description: >- - The information has been successfully retrieved and displayed in the - payload - '400': - content: - application/xml: - examples: - example: - value: |- - - - - 1008 - 'some_invalid_uuid' is not a valid UUID - - - schema: - $ref: '#/components/schemas/RemoveImportedTnOrdersHistoryResponse' - description: Order id is not valid - summary: Retrieve Remove Imported Tn Order - tags: - - Hosted Messaging - /accounts/{accountId}/removeImportedTnOrders/{orderId}/history: - get: - description: Retrieves the history of the specified Remove Imported Tn Order - operationId: RetrieveRemoveImportedTnOrderHistory - parameters: - - $ref: '#/components/parameters/AccountIdPathParam' - - description: ID of `RemoveImportedTnOrder` to retrieve history - example: bf1305b8-8998-1111-2222-51ba3ce52d4e - in: path - name: orderId - required: true - schema: - type: string - responses: - '200': - content: - application/xml: - examples: - example: - value: |- - - - - 2015-06-16T14:03:10.225Z - Remove Imported TN order is received. - admin - RECEIVED - - - 2015-06-16T14:03:10.330Z - Remove Imported TN order is processing. - admin - PROCESSING - - - 2015-06-16T14:03:10.789Z - Remove Imported TN order is partial. - admin - PARTIAL - - - schema: - $ref: '#/components/schemas/OrderHistoryWrapper' - description: >- - The history has been successfully retrieved and displayed in the - payload - '400': - content: - application/xml: - examples: - example: - value: |- - - - - 1008 - 'some_invalid_uuid' is not a valid UUID - - - schema: - $ref: '#/components/schemas/RemoveImportedTnOrdersHistoryResponse' - description: Order id is not valid - summary: Retrieve Remove Imported Tn Order history - tags: - - Hosted Messaging /accounts/{accountId}/reports: get: description: >- diff --git a/site/specs/phone-number-lookup.yml b/site/specs/phone-number-lookup.yml index 8f1ee46f9..1ce596b32 100644 --- a/site/specs/phone-number-lookup.yml +++ b/site/specs/phone-number-lookup.yml @@ -99,36 +99,34 @@ paths: } - lang: Java source: | - import com.bandwidth.BandwidthClient; - import com.bandwidth.http.response.ApiResponse; - import com.bandwidth.phonenumberlookup.models.OrderRequest; - import com.bandwidth.phonenumberlookup.models.OrderResponse; - - import java.util.concurrent.CompletableFuture; - import java.util.concurrent.ExecutionException; - import java.util.ArrayList; - import java.util.List; - - public class Sample { - public static final String USERNAME = "api-username"; - public static final String PASSWORD = "api-password"; - public static final String ACCOUNT_ID = "12345"; - + 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.PhoneNumberLookupApi; + + public class Example { public static void main(String[] args) { - BandwidthClient client = new BandwidthClient.Builder() - .phoneNumberLookupBasicAuthCredentials(USERNAME, PASSWORD) - .build(); + ApiClient defaultClient = Configuration.getDefaultApiClient(); - List numbers = new ArrayList<>(); - numbers.add("+15553334444"); - - OrderRequest request = new OrderRequest(numbers); + // Configure HTTP basic authorization: Basic + HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); + Basic.setUsername("YOUR USERNAME"); + Basic.setPassword("YOUR PASSWORD"); + PhoneNumberLookupApi apiInstance = new PhoneNumberLookupApi(defaultClient); + String accountId = "9900000"; // String | Your Bandwidth Account ID. + LookupRequest lookupRequest = new LookupRequest(); // LookupRequest | Phone number lookup request. try { - CompletableFuture> completableFuture = client.getPhoneNumberLookupClient().getAPIController().createLookupRequestAsync(ACCOUNT_ID, request); - System.out.println(completableFuture.get().getResult()); - } catch (InterruptedException | ExecutionException e) { - System.out.println(e.getMessage()); + CreateLookupResponse result = apiInstance.createLookup(accountId, lookupRequest); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling PhoneNumberLookupApi#createLookup"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } } } @@ -213,40 +211,28 @@ paths: print(e.response_code) - lang: Ruby source: > - require 'bandwidth' - - include Bandwidth - - include Bandwidth::Voice - + require 'bandwidth-sdk' - BW_USERNAME = "api-username" - - BW_PASSWORD = "api-password" - - BW_ACCOUNT_ID = "12345" - - - bandwidth_client = Bandwidth::Client.new( - phone_number_lookup_basic_auth_user_name: BW_USERNAME, - phone_number_lookup_basic_auth_password: BW_PASSWORD - ) + Bandwidth.configure do |config| + config.username = 'api-username' + config.password = 'api-password' + end - phone_number_lookup_client = - bandwidth_client.phone_number_lookup_client.client + api_instance = Bandwidth::PhoneNumberLookupApi.new - body = OrderRequest.new + account_id = '12345' - body.tns = ["+15554443333"] + lookup_request = Bandwidth::LookupRequest.new({ tns: + ['+15554443333'] }) begin - result = phone_number_lookup_client.create_lookup_request(BW_ACCOUNT_ID, body) - puts result.data.request_id - rescue APIException => e - puts e.response_code + result = api_instance.create_lookup(account_id, lookup_request) + p result.request_id + rescue Bandwidth::ApiError => e + p "Error when calling PhoneNumberLookupApi->create_lookup: #{e}" end /accounts/{accountId}/tnlookup/{requestId}: get: @@ -315,30 +301,34 @@ paths: } - lang: Java source: | - import com.bandwidth.BandwidthClient; - import com.bandwidth.http.response.ApiResponse; - import com.bandwidth.phonenumberlookup.models.OrderStatus; - - import java.util.concurrent.CompletableFuture; - import java.util.concurrent.ExecutionException; - - public class Sample { - public static final String USERNAME = "api-username"; - public static final String PASSWORD = "api-password"; - public static final String ACCOUNT_ID = "12345"; - + 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.PhoneNumberLookupApi; + + public class Example { public static void main(String[] args) { - BandwidthClient client = new BandwidthClient.Builder() - .phoneNumberLookupBasicAuthCredentials(USERNAME, PASSWORD) - .build(); + ApiClient defaultClient = Configuration.getDefaultApiClient(); - String requestId = "8a358296-e188-4a3a-b974-8e4d12001dd8"; + // Configure HTTP basic authorization: Basic + HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); + Basic.setUsername("YOUR USERNAME"); + Basic.setPassword("YOUR PASSWORD"); + PhoneNumberLookupApi apiInstance = new PhoneNumberLookupApi(defaultClient); + String accountId = "9900000"; // String | Your Bandwidth Account ID. + String requestId = "004223a0-8b17-41b1-bf81-20732adf5590"; // String | The phone number lookup request ID from Bandwidth. try { - CompletableFuture> completableFuture = client.getPhoneNumberLookupClient().getAPIController().getLookupRequestStatusAsync(ACCOUNT_ID, requestId); - System.out.println(completableFuture.get().getResult()); - } catch (InterruptedException | ExecutionException e) { - System.out.println(e.getMessage()); + LookupStatus result = apiInstance.getLookupStatus(accountId, requestId); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling PhoneNumberLookupApi#getLookupStatus"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } } } @@ -415,39 +405,23 @@ paths: except APIException as e: print(e.response_code) - lang: Ruby - source: > - require 'bandwidth' - - include Bandwidth - - include Bandwidth::Voice - - - BW_USERNAME = "api-username" - - BW_PASSWORD = "api-password" - - BW_ACCOUNT_ID = "12345" - - - bandwidth_client = Bandwidth::Client.new( - phone_number_lookup_basic_auth_user_name: BW_USERNAME, - phone_number_lookup_basic_auth_password: BW_PASSWORD - ) - - - phone_number_lookup_client = - bandwidth_client.phone_number_lookup_client.client - + source: | + require 'bandwidth-sdk' - request_id = "1234-abcd" + Bandwidth.configure do |config| + config.username = 'api-username' + config.password = 'api-password' + end + api_instance = Bandwidth::PhoneNumberLookupApi.new + account_id = '12345' + request_id = '004223a0-8b17-41b1-bf81-20732adf5590' begin - result = phone_number_lookup_client.get_lookup_request_status(BW_ACCOUNT_ID, request_id) - puts result.data.status - rescue APIException => e - puts e.response_code + result = api_instance.get_lookup_status(account_id, request_id) + p result.status + rescue Bandwidth::ApiError => e + p "Error when calling PhoneNumberLookupApi->get_lookup_status: #{e}" end components: schemas: diff --git a/site/specs/voice.yml b/site/specs/voice.yml index 7292ea8ff..3ca214da3 100644 --- a/site/specs/voice.yml +++ b/site/specs/voice.yml @@ -145,41 +145,34 @@ paths: } - lang: Java source: | - import com.bandwidth.BandwidthClient; - import com.bandwidth.http.response.ApiResponse; - import com.bandwidth.voice.models.CreateCallRequest; - import com.bandwidth.voice.models.CreateCallResponse; - - import java.util.concurrent.CompletableFuture; - import java.util.concurrent.ExecutionException; - - public class Sample { - public static final String USERNAME = "api-username"; - public static final String PASSWORD = "api-password"; - public static final String ACCOUNT_ID = "12345"; - + 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.CallsApi; + + public class Example { public static void main(String[] args) { - String voiceApplicationId = "1234-qwer"; - String to = "+15553334444"; - String from = "+15554443333"; - String baseUrl = "https://sample.com"; - String answerUrl = baseUrl.concat("/callbacks/answer"); - BandwidthClient client = new BandwidthClient.Builder() - .voiceBasicAuthCredentials(USERNAME, PASSWORD) - .build(); - CreateCallRequest request = new CreateCallRequest(); - request.setApplicationId(voiceApplicationId); - request.setTo(to); - request.setFrom(from); - request.setAnswerUrl(answerUrl); + // Configure HTTP basic authorization: Basic + HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); + Basic.setUsername("YOUR USERNAME"); + Basic.setPassword("YOUR PASSWORD"); + CallsApi apiInstance = new CallsApi(defaultClient); + String accountId = "9900000"; // String | Your Bandwidth Account ID. + CreateCall createCall = new CreateCall(); // CreateCall | JSON object containing information to create an outbound call try { - CompletableFuture> completableFuture = client.getVoiceClient().getAPIController().createCallAsync(ACCOUNT_ID, request); - System.out.println(completableFuture.get().getResult()); - } catch (InterruptedException | ExecutionException e) { - System.out.println(e.getMessage()); + CreateCallResponse result = apiInstance.createCall(accountId, createCall); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling CallsApi#createCall"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } } } @@ -310,29 +303,29 @@ paths: print(e.response_code) - lang: Ruby source: | - require 'bandwidth' + require 'bandwidth-sdk' - include Bandwidth - include Bandwidth::Voice + Bandwidth.configure do |config| + config.username = 'api-username' + config.password = 'api-password' + end - bandwidth_client = Bandwidth::Client.new( - voice_basic_auth_user_name: "api-username", - voice_basic_auth_password: "api-password" + api_instance = Bandwidth::CallsApi.new + account_id = '12345' + create_call = Bandwidth::CreateCall.new( + { + to: '+15553334444', + from: '+15554443333', + application_id: '1234-qwer', + answer_url: 'https://sample.com' + } ) - voice_client = bandwidth_client.voice_client.client - - body = CreateCallRequest.new - body.from = "+15554443333" - body.to = "+15553334444" - body.answer_url = "http://www.myapp.com/hello" - body.application_id = "7fc9698a-b04a-468b-9e8f-91238c0d0086" - begin - result = voice_client.create_call("12345", body) - puts result.data.call_id - rescue APIException => e - puts e.response_code + result = api_instance.create_call(account_id, create_call) + p result.call_id + rescue Bandwidth::ApiError => e + p "Error when calling CallsApi->create_call: #{e}" end /accounts/{accountId}/calls/{callId}: get: @@ -414,31 +407,34 @@ paths: } - lang: Java source: | - import com.bandwidth.BandwidthClient; - import com.bandwidth.http.response.ApiResponse; - import com.bandwidth.voice.models.CallState; - - import java.util.concurrent.CompletableFuture; - import java.util.concurrent.ExecutionException; - - public class Sample { - public static final String USERNAME = "api-username"; - public static final String PASSWORD = "api-password"; - public static final String ACCOUNT_ID = "12345"; - + 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.CallsApi; + + public class Example { public static void main(String[] args) { - // Call id is returned after successfully creating a call. - String callId = "c-95ac8d6e-1a31c52e-b38f-4198-93c1-51633ec68f8d"; + ApiClient defaultClient = Configuration.getDefaultApiClient(); - BandwidthClient client = new BandwidthClient.Builder() - .voiceBasicAuthCredentials(USERNAME, PASSWORD) - .build(); + // Configure HTTP basic authorization: Basic + HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); + Basic.setUsername("YOUR USERNAME"); + Basic.setPassword("YOUR PASSWORD"); + CallsApi apiInstance = new CallsApi(defaultClient); + String accountId = "9900000"; // String | Your Bandwidth Account ID. + String callId = "c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85"; // String | Programmable Voice API Call ID. try { - CompletableFuture> completableFuture = client.getVoiceClient().getAPIController().getCallAsync(ACCOUNT_ID, callId); - System.out.println(completableFuture.get().getResult()); - } catch (InterruptedException | ExecutionException e) { - System.out.println(e.getMessage()); + CallState result = apiInstance.getCallState(accountId, callId); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling CallsApi#getCallState"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } } } @@ -525,26 +521,22 @@ paths: print(e.response_code) - lang: Ruby source: | - require 'bandwidth' - - include Bandwidth - include Bandwidth::Voice - - bandwidth_client = Bandwidth::Client.new( - voice_basic_auth_user_name: "api-username", - voice_basic_auth_password: "api-password" - ) + require 'bandwidth-sdk' - voice_client = bandwidth_client.voice_client.client + Bandwidth.configure do |config| + config.username = 'api-username' + config.password = 'api-password' + end - call_id = "c-1234" + api_instance = Bandwidth::CallsApi.new + account_id = '12345' + call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' begin - #result = voice_client.get_call("12345", call_id) - #puts result.data.state - puts "Method broke" - rescue APIException => e - puts e.response_code + result = api_instance.get_call_state(account_id, call_id) + p result.state + rescue Bandwidth::ApiError => e + p "Error when calling CallsApi->get_call_state: #{e}" end post: tags: @@ -642,34 +634,34 @@ paths: } - lang: Java source: | - import com.bandwidth.BandwidthClient; - import com.bandwidth.http.response.ApiResponse; - import com.bandwidth.voice.models.ModifyCallRequest; - import com.bandwidth.voice.models.StateEnum; - - import java.util.concurrent.CompletableFuture; - import java.util.concurrent.ExecutionException; - - public class Sample { - public static final String USERNAME = "api-username"; - public static final String PASSWORD = "api-password"; - public static final String ACCOUNT_ID = "12345"; - + 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.CallsApi; + + public class Example { public static void main(String[] args) { - String callId = "c-95ac8d6e-1a31c52e-b38f-4198-93c1-51633ec68f8d"; - - BandwidthClient client = new BandwidthClient.Builder() - .voiceBasicAuthCredentials(USERNAME, PASSWORD) - .build(); + ApiClient defaultClient = Configuration.getDefaultApiClient(); - ModifyCallRequest request = new ModifyCallRequest(); - request.setState(StateEnum.COMPLETED); + // Configure HTTP basic authorization: Basic + HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); + Basic.setUsername("YOUR USERNAME"); + Basic.setPassword("YOUR PASSWORD"); + CallsApi apiInstance = new CallsApi(defaultClient); + String accountId = "9900000"; // String | Your Bandwidth Account ID. + String callId = "c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85"; // String | Programmable Voice API Call ID. + UpdateCall updateCall = new UpdateCall(); // UpdateCall | JSON object containing information to redirect an existing call to a new BXML document try { - CompletableFuture> completableFuture = client.getVoiceClient().getAPIController().modifyCallAsync(ACCOUNT_ID, callId, request); - System.out.println(completableFuture.get().getResult()); - } catch (InterruptedException | ExecutionException e) { - System.out.println(e.getMessage()); + apiInstance.updateCall(accountId, callId, updateCall); + } catch (ApiException e) { + System.err.println("Exception when calling CallsApi#updateCall"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } } } @@ -780,28 +772,22 @@ paths: print(e.response_code) - lang: Ruby source: | - require 'bandwidth' - - include Bandwidth - include Bandwidth::Voice - - bandwidth_client = Bandwidth::Client.new( - voice_basic_auth_user_name: "api-username", - voice_basic_auth_password: "api-password" - ) - - voice_client = bandwidth_client.voice_client.client + require 'bandwidth-sdk' - body = ModifyCallRequest.new - body.redirect_url = "http://www.myapp.com/new" - body.state = "active" + Bandwidth.configure do |config| + config.username = 'api-username' + config.password = 'api-password' + end - call_id = "c-1234" + api_instance = Bandwidth::CallsApi.new + account_id = '12345' + call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' + update_call = Bandwidth::UpdateCall.new begin - voice_client.modify_call("12345", call_id, body) - rescue APIException => e - puts e.response_code + api_instance.update_call(account_id, call_id, update_call) + rescue Bandwidth::ApiError => e + p "Error when calling CallsApi->update_call: #{e}" end /accounts/{accountId}/calls/{callId}/bxml: put: @@ -836,6 +822,65 @@ paths: $ref: '#/components/responses/voiceTooManyRequestsError' '500': $ref: '#/components/responses/voiceInternalServerError' + x-codeSamples: + - lang: Java + source: | + 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.CallsApi; + + public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + + // Configure HTTP basic authorization: Basic + HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); + Basic.setUsername("YOUR USERNAME"); + Basic.setPassword("YOUR PASSWORD"); + + CallsApi apiInstance = new CallsApi(defaultClient); + String accountId = "9900000"; // String | Your Bandwidth Account ID. + String callId = "c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85"; // String | Programmable Voice API Call ID. + String body = + + This is a test sentence. + ; // String | + try { + apiInstance.updateCallBxml(accountId, callId, body); + } catch (ApiException e) { + System.err.println("Exception when calling CallsApi#updateCallBxml"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } + } + - lang: Ruby + source: | + require 'bandwidth-sdk' + + Bandwidth.configure do |config| + config.username = 'api-username' + config.password = 'api-password' + end + + api_instance = Bandwidth::CallsApi.new + account_id = '12345' + call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' + body = ' + + This is a test sentence. + ' + + begin + api_instance.update_call_bxml(account_id, call_id, body) + rescue Bandwidth::ApiError => e + p "Error when calling CallsApi->update_call_bxml: #{e}" + end /accounts/{accountId}/conferences: get: tags: @@ -916,29 +961,38 @@ paths: } - lang: Java source: | - import com.bandwidth.BandwidthClient; - import com.bandwidth.http.response.ApiResponse; - import com.bandwidth.voice.models.ConferenceState; - - import java.util.concurrent.CompletableFuture; - import java.util.concurrent.ExecutionException; - import java.util.List; - - public class Sample { - public static final String USERNAME = "api-username"; - public static final String PASSWORD = "api-password"; - public static final String ACCOUNT_ID = "12345"; - + 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.ConferencesApi; + + public class Example { public static void main(String[] args) { - BandwidthClient client = new BandwidthClient.Builder() - .voiceBasicAuthCredentials(USERNAME, PASSWORD) - .build(); - + ApiClient defaultClient = Configuration.getDefaultApiClient(); + + // Configure HTTP basic authorization: Basic + HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); + Basic.setUsername("YOUR USERNAME"); + Basic.setPassword("YOUR PASSWORD"); + + ConferencesApi apiInstance = new ConferencesApi(defaultClient); + String accountId = "9900000"; // String | Your Bandwidth Account ID. + String name = "my-custom-name"; // String | Filter results by the `name` field. + String minCreatedTime = "2022-06-21T19:13:21Z"; // String | Filter results to conferences which have a `createdTime` after or at `minCreatedTime` (in ISO8601 format). + String maxCreatedTime = "2022-06-21T19:13:21Z"; // String | Filter results to conferences which have a `createdTime` before or at `maxCreatedTime` (in ISO8601 format). + Integer pageSize = 1000; // Integer | Specifies the max number of conferences that will be returned. + String pageToken = "pageToken_example"; // String | Not intended for explicit use. To use pagination, follow the links in the `Link` header of the response, as indicated in the endpoint description. try { - CompletableFuture>> completableFuture = client.getVoiceClient().getAPIController().getConferencesAsync(ACCOUNT_ID, null, null, null, null, null); - System.out.println(completableFuture.get().getResult()); - } catch (InterruptedException | ExecutionException e) { - System.out.println(e.getMessage()); + List result = apiInstance.listConferences(accountId, name, minCreatedTime, maxCreatedTime, pageSize, pageToken); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ConferencesApi#listConferences"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } } } @@ -1022,25 +1076,25 @@ paths: print(e.response_code) - lang: Ruby source: | - require 'bandwidth' - - include Bandwidth - include Bandwidth::Voice + require 'bandwidth-sdk' - bandwidth_client = Bandwidth::Client.new( - voice_basic_auth_user_name: "api-username", - voice_basic_auth_password: "api-password" - ) + Bandwidth.configure do |config| + config.username = 'api-username' + config.password = 'api-password' + end - voice_client = bandwidth_client.voice_client.client + api_instance = Bandwidth::ConferencesApi.new + account_id = '12345' + opts = { + min_created_time: '2022-06-21T19:13:21Z', + page_size: 500 + } begin - response = voice_client.get_conferences("12345") - if response.data.length > 0 - puts response.data[0].id - end - rescue APIException => e - puts e.response_code + result = api_instance.list_conferences(account_id, opts) + p result[0].id if result.length.positive? + rescue Bandwidth::ApiError => e + p "Error when calling ConferencesApi->list_conferences: #{e}" end /accounts/{accountId}/conferences/{conferenceId}: get: @@ -1113,31 +1167,34 @@ paths: } - lang: Java source: | - import com.bandwidth.BandwidthClient; - import com.bandwidth.http.response.ApiResponse; - import com.bandwidth.voice.models.ConferenceState; - - import java.util.concurrent.CompletableFuture; - import java.util.concurrent.ExecutionException; - - public class Sample { - public static final String USERNAME = "api-username"; - public static final String PASSWORD = "api-password"; - public static final String ACCOUNT_ID = "12345"; - + 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.ConferencesApi; + + public class Example { public static void main(String[] args) { - // Conference id is returned after successfully creating a conference. - String conferenceId = "conf-95ac8d8d-28e06798-2afe-434c-b0f4-666a79cd47f8"; + ApiClient defaultClient = Configuration.getDefaultApiClient(); - BandwidthClient client = new BandwidthClient.Builder() - .voiceBasicAuthCredentials(USERNAME, PASSWORD) - .build(); + // Configure HTTP basic authorization: Basic + HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); + Basic.setUsername("YOUR USERNAME"); + Basic.setPassword("YOUR PASSWORD"); + ConferencesApi apiInstance = new ConferencesApi(defaultClient); + String accountId = "9900000"; // String | Your Bandwidth Account ID. + String conferenceId = "conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9"; // String | Programmable Voice API Conference ID. try { - CompletableFuture> completableFuture = client.getVoiceClient().getAPIController().getConferenceAsync(ACCOUNT_ID, conferenceId); - System.out.println(completableFuture.get().getResult()); - } catch (InterruptedException | ExecutionException e) { - System.out.println(e.getMessage()); + Conference result = apiInstance.getConference(accountId, conferenceId); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ConferencesApi#getConference"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } } } @@ -1234,25 +1291,22 @@ paths: print(e.response_code) - lang: Ruby source: | - require 'bandwidth' - - include Bandwidth - include Bandwidth::Voice - - bandwidth_client = Bandwidth::Client.new( - voice_basic_auth_user_name: "api-username", - voice_basic_auth_password: "api-password" - ) + require 'bandwidth-sdk' - voice_client = bandwidth_client.voice_client.client + Bandwidth.configure do |config| + config.username = 'api-username' + config.password = 'api-password' + end - conference_id = "conf-1234" + api_instance = Bandwidth::ConferencesApi.new + account_id = '12345' + conference_id = 'conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9' begin - response = voice_client.get_conference("12345", conference_id) - print(response.data.name) - rescue APIException => e - puts e.response_code + result = api_instance.get_conference(account_id, conference_id) + p result.name + rescue Bandwidth::ApiError => e + p "Error when calling ConferencesApi->get_conference: #{e}" end post: tags: @@ -1343,33 +1397,35 @@ paths: } - lang: Java source: | - import com.bandwidth.BandwidthClient; - import com.bandwidth.http.response.ApiResponse; - import com.bandwidth.voice.models.*; - - import java.util.concurrent.CompletableFuture; - import java.util.concurrent.ExecutionException; - - public class Sample { - public static final String USERNAME = "api-username"; - public static final String PASSWORD = "api-password"; - public static final String ACCOUNT_ID = "12345"; - + 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.ConferencesApi; + + public class Example { public static void main(String[] args) { - String conferenceId = "conf-95ac8d8d-28e06798-2afe-434c-b0f4-666a79cd47f8"; - - BandwidthClient client = new BandwidthClient.Builder() - .voiceBasicAuthCredentials(USERNAME, PASSWORD) - .build(); - - ModifyConferenceRequest request = new ModifyConferenceRequest(); - request.setStatus(StatusEnum.COMPLETED); - + 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"); + + ConferencesApi apiInstance = new ConferencesApi(defaultClient); + String accountId = "9900000"; // String | Your Bandwidth Account ID. + String conferenceId = "conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9"; // String | Programmable Voice API Conference ID. + UpdateConference updateConference = new UpdateConference(); // UpdateConference | try { - CompletableFuture> completableFuture = client.getVoiceClient().getAPIController().modifyConferenceAsync(ACCOUNT_ID, conferenceId, request); - System.out.println(completableFuture.get().getResult()); - } catch (InterruptedException | ExecutionException e) { - System.out.println(e.getMessage()); + apiInstance.updateConference(accountId, conferenceId, updateConference); + } catch (ApiException e) { + System.err.println("Exception when calling ConferencesApi#updateConference"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } } } @@ -1489,27 +1545,22 @@ paths: print(e.response_code) - lang: Ruby source: | - require 'bandwidth' + require 'bandwidth-sdk' - include Bandwidth - include Bandwidth::Voice - - bandwidth_client = Bandwidth::Client.new( - voice_basic_auth_user_name: "api-username", - voice_basic_auth_password: "api-password" - ) - - voice_client = bandwidth_client.voice_client.client - - body = ModifyConferenceRequest.new - body.status = StatusEnum::ACTIVE + Bandwidth.configure do |config| + config.username = 'api-username' + config.password = 'api-password' + end - conference_id = "conf-1234" + api_instance = Bandwidth::ConferencesApi.new + account_id = '12345' + conference_id = 'conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9' + update_conference = Bandwidth::UpdateConference.new begin - voice_client.modify_conference("12345", conference_id, body) - rescue APIException => e - puts e.response_code + api_instance.update_conference(account_id, conference_id, update_conference) + rescue Bandwidth::ApiError => e + p "Error when calling ConferencesApi->update_conference: #{e}" end /accounts/{accountId}/conferences/{conferenceId}/bxml: put: @@ -1542,6 +1593,65 @@ paths: $ref: '#/components/responses/voiceTooManyRequestsError' '500': $ref: '#/components/responses/voiceInternalServerError' + x-codeSamples: + - lang: Java + source: | + 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.ConferencesApi; + + public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + + // Configure HTTP basic authorization: Basic + HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); + Basic.setUsername("YOUR USERNAME"); + Basic.setPassword("YOUR PASSWORD"); + + ConferencesApi apiInstance = new ConferencesApi(defaultClient); + String accountId = "9900000"; // String | Your Bandwidth Account ID. + String conferenceId = "conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9"; // String | Programmable Voice API Conference ID. + String body = + + + ; // String | + try { + apiInstance.updateConferenceBxml(accountId, conferenceId, body); + } catch (ApiException e) { + System.err.println("Exception when calling ConferencesApi#updateConferenceBxml"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } + } + - lang: Ruby + source: | + require 'bandwidth-sdk' + + Bandwidth.configure do |config| + config.username = 'api-username' + config.password = 'api-password' + end + + api_instance = Bandwidth::ConferencesApi.new + account_id = '12345' + conference_id = 'conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9' + body = ' + + + ' + + begin + api_instance.update_conference_bxml(account_id, conference_id, body) + rescue Bandwidth::ApiError => e + p "Error when calling ConferencesApi->update_conference_bxml: #{e}" + end /accounts/{accountId}/conferences/{conferenceId}/members/{memberId}: get: tags: @@ -1615,31 +1725,35 @@ paths: } - lang: Java source: | - import com.bandwidth.BandwidthClient; - import com.bandwidth.http.response.ApiResponse; - import com.bandwidth.voice.models.ConferenceMemberState; - - import java.util.concurrent.CompletableFuture; - import java.util.concurrent.ExecutionException; - - public class Sample { - public static final String USERNAME = "api-username"; - public static final String PASSWORD = "api-password"; - public static final String ACCOUNT_ID = "12345"; - + 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.ConferencesApi; + + public class Example { public static void main(String[] args) { - String conferenceId = "conf-95ac8d8d-28e06798-2afe-434c-b0f4-666a79cd47f8"; - String memberId = "c-95ac8d8d-b81437f5-4586-4d5b-9b46-29f8b3fe0aaf"; + ApiClient defaultClient = Configuration.getDefaultApiClient(); - BandwidthClient client = new BandwidthClient.Builder() - .voiceBasicAuthCredentials(USERNAME, PASSWORD) - .build(); + // Configure HTTP basic authorization: Basic + HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); + Basic.setUsername("YOUR USERNAME"); + Basic.setPassword("YOUR PASSWORD"); + ConferencesApi apiInstance = new ConferencesApi(defaultClient); + String accountId = "9900000"; // String | Your Bandwidth Account ID. + String conferenceId = "conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9"; // String | Programmable Voice API Conference ID. + String memberId = "c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85"; // String | Programmable Voice API Conference Member ID. try { - CompletableFuture> completableFuture = client.getVoiceClient().getAPIController().getConferenceMemberAsync(ACCOUNT_ID, conferenceId, memberId); - System.out.println(completableFuture.get().getResult()); - } catch (InterruptedException | ExecutionException e) { - System.out.println(e.getMessage()); + ConferenceMember result = apiInstance.getConferenceMember(accountId, conferenceId, memberId); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ConferencesApi#getConferenceMember"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } } } @@ -1740,26 +1854,23 @@ paths: print(e.response_code) - lang: Ruby source: | - require 'bandwidth' - - include Bandwidth - include Bandwidth::Voice - - bandwidth_client = Bandwidth::Client.new( - voice_basic_auth_user_name: "api-username", - voice_basic_auth_password: "api-password" - ) + require 'bandwidth-sdk' - voice_client = bandwidth_client.voice_client.client + Bandwidth.configure do |config| + config.username = 'api-username' + config.password = 'api-password' + end - conference_id = "conf-1234" - member_id = "m-1234" + api_instance = Bandwidth::ConferencesApi.new + account_id = '12345' + conference_id = 'conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9' + member_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' begin - response = voice_client.get_conference_member("12345", conference_id, member_id) - puts response.data.member_url - rescue APIException => e - puts e.response_code + result = api_instance.get_conference_member(account_id, conference_id, member_id) + p result.member_url + rescue Bandwidth::ApiError => e + p "Error when calling ConferencesApi->get_conference_member: #{e}" end put: tags: @@ -2002,28 +2113,23 @@ paths: print(e.response_code) - lang: Ruby source: | - require 'bandwidth' + require 'bandwidth-sdk' - include Bandwidth - include Bandwidth::Voice - - bandwidth_client = Bandwidth::Client.new( - voice_basic_auth_user_name: "api-username", - voice_basic_auth_password: "api-password" - ) - - voice_client = bandwidth_client.voice_client.client - - body = ConferenceMemberState.new - body.mute = true + Bandwidth.configure do |config| + config.username = 'api-username' + config.password = 'api-password' + end - conference_id = "conf-1234" - call_id = "c-1234" + api_instance = Bandwidth::ConferencesApi.new + account_id = '12345' + conference_id = 'conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9' + member_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' + update_conference_member = Bandwidth::UpdateConferenceMember.new begin - voice_client.modify_conference_member("12345", conference_id, call_id, body) - rescue APIException => e - puts e.response_code + api_instance.update_conference_member(account_id, conference_id, member_id, update_conference_member) + rescue Bandwidth::ApiError => e + p "Error when calling ConferencesApi->update_conference_member: #{e}" end /accounts/{accountId}/conferences/{conferenceId}/recordings: get: @@ -2098,31 +2204,35 @@ paths: } - lang: Java source: | - import com.bandwidth.BandwidthClient; - import com.bandwidth.http.response.ApiResponse; - import com.bandwidth.voice.models.ConferenceRecordingMetadata; - - import java.util.concurrent.CompletableFuture; - import java.util.concurrent.ExecutionException; - import java.util.List; - - public class Sample { - public static final String USERNAME = "api-username"; - public static final String PASSWORD = "api-password"; - public static final String ACCOUNT_ID = "12345"; - + 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.ConferencesApi; + + public class Example { public static void main(String[] args) { - String conferenceId = "conf-95ac8d8d-28e06798-2afe-434c-b0f4-666a79cd47f8"; + ApiClient defaultClient = Configuration.getDefaultApiClient(); - BandwidthClient client = new BandwidthClient.Builder() - .voiceBasicAuthCredentials(USERNAME, PASSWORD) - .build(); + // Configure HTTP basic authorization: Basic + HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); + Basic.setUsername("YOUR USERNAME"); + Basic.setPassword("YOUR PASSWORD"); + ConferencesApi apiInstance = new ConferencesApi(defaultClient); + String accountId = "9900000"; // String | Your Bandwidth Account ID. + String conferenceId = "conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9"; // String | Programmable Voice API Conference ID. + String recordingId = "r-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85"; // String | Programmable Voice API Recording ID. try { - CompletableFuture>> completableFuture = client.getVoiceClient().getAPIController().getConferenceRecordingsAsync(ACCOUNT_ID, conferenceId); - System.out.println(completableFuture.get().getResult()); - } catch (InterruptedException | ExecutionException e) { - System.out.println(e.getMessage()); + ConferenceRecordingMetadata result = apiInstance.getConferenceRecording(accountId, conferenceId, recordingId); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ConferencesApi#getConferenceRecording"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } } } @@ -2222,27 +2332,22 @@ paths: print(e.response_code) - lang: Ruby source: | - require 'bandwidth' - - include Bandwidth - include Bandwidth::Voice - - bandwidth_client = Bandwidth::Client.new( - voice_basic_auth_user_name: "api-username", - voice_basic_auth_password: "api-password" - ) + require 'bandwidth-sdk' - voice_client = bandwidth_client.voice_client.client + Bandwidth.configure do |config| + config.username = 'api-username' + config.password = 'api-password' + end - conference_id = "conf-1234" + api_instance = Bandwidth::ConferencesApi.new + account_id = '12345' + conference_id = 'conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9' begin - response = voice_client.get_conference_recordings("12345", conference_id) - if response.data.length > 0 - puts response.body[0].name - end - rescue APIException => e - puts e.response_code + result = api_instance.list_conference_recordings(account_id, conference_id) + p result[0].name if result.length.positive? + rescue Bandwidth::ApiError => e + p "Error when calling ConferencesApi->list_conference_recordings: #{e}" end /accounts/{accountId}/conferences/{conferenceId}/recordings/{recordingId}: get: @@ -2317,37 +2422,42 @@ paths: } - lang: Java source: | - import com.bandwidth.BandwidthClient; - import com.bandwidth.http.response.ApiResponse; - import com.bandwidth.voice.models.CallRecordingMetadata; - - import java.util.concurrent.CompletableFuture; - import java.util.concurrent.ExecutionException; - - public class Sample { - public static final String USERNAME = "api-username"; - public static final String PASSWORD = "api-password"; - public static final String ACCOUNT_ID = "12345"; - - public static void main(String[] args) { - String conferenceId = "conf-95ac8d8d-28e06798-2afe-434c-b0f4-666a79cd47f8"; - String recordingId = "r-d68201ef-d53e-4c6d-a743-1c1283909d41"; - - BandwidthClient client = new BandwidthClient.Builder() - .voiceBasicAuthCredentials(USERNAME, PASSWORD) - .build(); - - try { - CompletableFuture> completableFuture = client.getVoiceClient().getAPIController().getConferenceRecordingAsync(ACCOUNT_ID, conferenceId, recordingId); - System.out.println(completableFuture.get().getResult()); - } catch (InterruptedException | ExecutionException e) { - System.out.println(e.getMessage()); - } - } - } - - lang: Node.js - source: > - import { Client, ApiController } from '@bandwidth/voice'; + 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.ConferencesApi; + + 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"); + + ConferencesApi apiInstance = new ConferencesApi(defaultClient); + String accountId = "9900000"; // String | Your Bandwidth Account ID. + String conferenceId = "conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9"; // String | Programmable Voice API Conference ID. + String recordingId = "r-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85"; // String | Programmable Voice API Recording ID. + try { + ConferenceRecordingMetadata result = apiInstance.getConferenceRecording(accountId, conferenceId, recordingId); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ConferencesApi#getConferenceRecording"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } + } + - lang: Node.js + source: > + import { Client, ApiController } from '@bandwidth/voice'; const BW_USERNAME = "api-username"; @@ -2442,26 +2552,23 @@ paths: print(e.response_code) - lang: Ruby source: | - require 'bandwidth' + require 'bandwidth-sdk' - include Bandwidth - include Bandwidth::Voice - - bandwidth_client = Bandwidth::Client.new( - voice_basic_auth_user_name: "api-username", - voice_basic_auth_password: "api-password" - ) - - voice_client = bandwidth_client.voice_client.client + Bandwidth.configure do |config| + config.username = 'api-username' + config.password = 'api-password' + end - conference_id = "conf-1234" - recording_id = "r-1234" + api_instance = Bandwidth::ConferencesApi.new + account_id = '12345' + conference_id = 'conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9' + recording_id = 'r-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' begin - response = voice_client.get_conference_recording("12345", conference_id, recording_id) - puts response.body.application_id - rescue APIException => e - puts e.response_code + result = api_instance.get_conference_recording(account_id, conference_id, recording_id) + p result.application_id + rescue Bandwidth::ApiError => e + p "Error when calling ConferencesApi->get_conference_recording: #{e}" end /accounts/{accountId}/conferences/{conferenceId}/recordings/{recordingId}/media: get: @@ -2537,33 +2644,35 @@ paths: } - lang: Java source: | - import com.bandwidth.BandwidthClient; - import com.bandwidth.http.response.ApiResponse; - import com.bandwidth.voice.models.DynamicResponse; - - import java.util.concurrent.CompletableFuture; - import java.util.concurrent.ExecutionException; - - public class Sample { - public static final String USERNAME = "api-username"; - public static final String PASSWORD = "api-password"; - public static final String ACCOUNT_ID = "12345"; - + 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.ConferencesApi; + + public class Example { public static void main(String[] args) { - // Conference id is returned after successfully creating a conference. - String conferenceId = "conf-95ac8d8d-28e06798-2afe-434c-b0f4-666a79cd47f8"; - // Recording id is returned after retrieving a recording from the call. - String recordingId = "r-d68201ef-d53e-4c6d-a743-1c1283909d41"; + ApiClient defaultClient = Configuration.getDefaultApiClient(); - BandwidthClient client = new BandwidthClient.Builder() - .voiceBasicAuthCredentials(USERNAME, PASSWORD) - .build(); + // Configure HTTP basic authorization: Basic + HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); + Basic.setUsername("YOUR USERNAME"); + Basic.setPassword("YOUR PASSWORD"); + ConferencesApi apiInstance = new ConferencesApi(defaultClient); + String accountId = "9900000"; // String | Your Bandwidth Account ID. + String conferenceId = "conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9"; // String | Programmable Voice API Conference ID. + String recordingId = "r-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85"; // String | Programmable Voice API Recording ID. try { - CompletableFuture> completableFuture = client.getVoiceClient().getAPIController().getDownloadConferenceRecordingAsync(ACCOUNT_ID, conferenceId, recordingId); - System.out.println(completableFuture.get().getResult()); - } catch (InterruptedException | ExecutionException e) { - System.out.println(e.getMessage()); + File result = apiInstance.downloadConferenceRecording(accountId, conferenceId, recordingId); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ConferencesApi#downloadConferenceRecording"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } } } @@ -2659,30 +2768,23 @@ paths: print(e.response_code) - lang: Ruby source: | - require 'bandwidth' + require 'bandwidth-sdk' - include Bandwidth - include Bandwidth::Voice - - BW_USERNAME = "api-username" - BW_PASSWORD = "api-password" - BW_ACCOUNT_ID = "12345" - - bandwidth_client = Bandwidth::Client.new( - voice_basic_auth_user_name: BW_USERNAME, - voice_basic_auth_password: BW_PASSWORD - ) - - voice_client = bandwidth_client.voice_client.client + Bandwidth.configure do |config| + config.username = 'api-username' + config.password = 'api-password' + end - conference_id = "conf-1234" - recording_id = "r-1234" + api_instance = Bandwidth::ConferencesApi.new + account_id = '12345' + conference_id = 'conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9' + recording_id = 'r-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' begin - result = voice_client.get_download_conference_recording(BW_ACCOUNT_ID, conference_id, recording_id) - downloaded_recording = result.data - rescue APIException => e - puts e.response_code + result = api_instance.download_conference_recording(account_id, conference_id, recording_id) + p result + rescue Bandwidth::ApiError => e + p "Error when calling ConferencesApi->download_conference_recording: #{e}" end /accounts/{accountId}/recordings: get: @@ -2764,29 +2866,38 @@ paths: } - lang: Java source: | - import com.bandwidth.BandwidthClient; - import com.bandwidth.http.response.ApiResponse; - import com.bandwidth.voice.models.*; - - import java.util.concurrent.CompletableFuture; - import java.util.concurrent.ExecutionException; - import java.util.List; - - public class Sample { - public static final String USERNAME = "api-username"; - public static final String PASSWORD = "api-password"; - public static final String ACCOUNT_ID = "12345"; - + 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.RecordingsApi; + + public class Example { public static void main(String[] args) { - BandwidthClient client = new BandwidthClient.Builder() - .voiceBasicAuthCredentials(USERNAME, PASSWORD) - .build(); - + 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"); + + RecordingsApi apiInstance = new RecordingsApi(defaultClient); + String accountId = "9900000"; // String | Your Bandwidth Account ID. + String to = "%2b19195551234"; // String | Filter results by the `to` field. + String from = "%2b19195554321"; // String | Filter results by the `from` field. + String minStartTime = "2022-06-21T19:13:21Z"; // String | Filter results to recordings which have a `startTime` after or including `minStartTime` (in ISO8601 format). + String maxStartTime = "2022-06-21T19:13:21Z"; // String | Filter results to recordings which have a `startTime` before `maxStartTime` (in ISO8601 format). try { - CompletableFuture>> completableFuture = client.getVoiceClient().getAPIController().getQueryCallRecordingsAsync(ACCOUNT_ID, null, null, null, null); - System.out.println(completableFuture.get().getResult()); - } catch (InterruptedException | ExecutionException e) { - System.out.println(e.getMessage()); + List result = apiInstance.listAccountCallRecordings(accountId, to, from, minStartTime, maxStartTime); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling RecordingsApi#listAccountCallRecordings"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } } } @@ -2870,25 +2981,25 @@ paths: print(e.response_code) - lang: Ruby source: | - require 'bandwidth' - - include Bandwidth - include Bandwidth::Voice + require 'bandwidth-sdk' - bandwidth_client = Bandwidth::Client.new( - voice_basic_auth_user_name: "api-username", - voice_basic_auth_password: "api-password" - ) + Bandwidth.configure do |config| + config.username = 'api-username' + config.password = 'api-password' + end - voice_client = bandwidth_client.voice_client.client + api_instance = Bandwidth::RecordingsApi.new + account_id = '12345' + opts = { + to: '%2b19195551234', + from: '%2b19195554321' + } begin - result = voice_client.get_query_call_recordings("12345") - if result.data.length > 0 - puts result.data[0].recording_id - end - rescue APIException => e - puts e.response_code + result = api_instance.list_account_call_recordings(account_id, opts) + p result[0].recording_id if result.length.positive? + rescue Bandwidth::ApiError => e + p "Error when calling RecordingsApi->list_account_call_recordings: #{e}" end /accounts/{accountId}/calls/{callId}/recording: put: @@ -2973,33 +3084,35 @@ paths: } - lang: Java source: | - import com.bandwidth.BandwidthClient; - import com.bandwidth.http.response.ApiResponse; - import com.bandwidth.voice.models.*; - - import java.util.concurrent.CompletableFuture; - import java.util.concurrent.ExecutionException; - - public class Sample { - public static final String USERNAME = "api-username"; - public static final String PASSWORD = "api-password"; - public static final String ACCOUNT_ID = "12345"; - + 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.RecordingsApi; + + public class Example { public static void main(String[] args) { - String callId = "c-95ac8d6e-1a31c52e-b38f-4198-93c1-51633ec68f8d"; - - BandwidthClient client = new BandwidthClient.Builder() - .voiceBasicAuthCredentials(USERNAME, PASSWORD) - .build(); - - ModifyCallRecordingRequest recordingRequest = new ModifyCallRecordingRequest(); - recordingRequest.setState(State1Enum.PAUSED); - + 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"); + + RecordingsApi apiInstance = new RecordingsApi(defaultClient); + String accountId = "9900000"; // String | Your Bandwidth Account ID. + String callId = "c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85"; // String | Programmable Voice API Call ID. + UpdateCallRecording updateCallRecording = new UpdateCallRecording(); // UpdateCallRecording | try { - CompletableFuture> completableFuture = client.getVoiceClient().getAPIController().modifyCallRecordingStateAsync(ACCOUNT_ID, callId, recordingRequest); - System.out.println(completableFuture.get().getResult()); - } catch (InterruptedException | ExecutionException e) { - System.out.println(e.getMessage()); + apiInstance.updateCallRecordingState(accountId, callId, updateCallRecording); + } catch (ApiException e) { + System.err.println("Exception when calling RecordingsApi#updateCallRecordingState"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } } } @@ -3106,28 +3219,30 @@ paths: except APIException as e: print(e.response_code) - lang: Ruby - source: | - require 'bandwidth' + source: > + require 'bandwidth-sdk' - include Bandwidth - include Bandwidth::Voice - bandwidth_client = Bandwidth::Client.new( - voice_basic_auth_user_name: "api-username", - voice_basic_auth_password: "api-password" - ) + Bandwidth.configure do |config| + config.username = 'api-username' + config.password = 'api-password' + end - voice_client = bandwidth_client.voice_client.client - body = ModifyCallRecordingRequest.new - body.state = "paused" + api_instance = Bandwidth::RecordingsApi.new + + account_id = '12345' + + call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' + + update_call_recording = Bandwidth::UpdateCallRecording.new({ state: + Bandwidth::RecordingStateEnum::PAUSED }) - call_id = "c-1234" begin - voice_client.modify_call_recording_state("12345", call_id, body) - rescue APIException => e - puts e.response_code + api_instance.update_call_recording_state(account_id, call_id, update_call_recording) + rescue Bandwidth::ApiError => e + p "Error when calling RecordingsApi->update_call_recording_state: #{e}" end /accounts/{accountId}/calls/{callId}/recordings: get: @@ -3203,32 +3318,35 @@ paths: } - lang: Java source: | - import com.bandwidth.BandwidthClient; - import com.bandwidth.http.response.ApiResponse; - import com.bandwidth.voice.models.CallRecordingMetadata; - - import java.util.concurrent.CompletableFuture; - import java.util.concurrent.ExecutionException; - import java.util.List; - - public class Sample { - public static final String USERNAME = "api-username"; - public static final String PASSWORD = "api-password"; - public static final String ACCOUNT_ID = "12345"; - + 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.RecordingsApi; + + public class Example { public static void main(String[] args) { - // Call id is returned after successfully creating a call. - String callId = "c-95ac8d6e-1a31c52e-b38f-4198-93c1-51633ec68f8d"; + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); - BandwidthClient client = new BandwidthClient.Builder() - .voiceBasicAuthCredentials(USERNAME, PASSWORD) - .build(); + // Configure HTTP basic authorization: Basic + HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); + Basic.setUsername("YOUR USERNAME"); + Basic.setPassword("YOUR PASSWORD"); + RecordingsApi apiInstance = new RecordingsApi(defaultClient); + String accountId = "9900000"; // String | Your Bandwidth Account ID. + String callId = "c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85"; // String | Programmable Voice API Call ID. try { - CompletableFuture>> completableFuture = client.getVoiceClient().getAPIController().getCallRecordingsAsync(ACCOUNT_ID, callId); - System.out.println(completableFuture.get().getResult()); - } catch (InterruptedException | ExecutionException e) { - System.out.println(e.getMessage()); + List result = apiInstance.listCallRecordings(accountId, callId); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling RecordingsApi#listCallRecordings"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } } } @@ -3319,27 +3437,22 @@ paths: print(e.response_code) - lang: Ruby source: | - require 'bandwidth' - - include Bandwidth - include Bandwidth::Voice + require 'bandwidth-sdk' - bandwidth_client = Bandwidth::Client.new( - voice_basic_auth_user_name: "api-username", - voice_basic_auth_password: "api-password" - ) + Bandwidth.configure do |config| + config.username = 'api-username' + config.password = 'api-password' + end - voice_client = bandwidth_client.voice_client.client - - call_id = "c-1234" + api_instance = Bandwidth::RecordingsApi.new + account_id = '12345' + call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' begin - response = voice_client.get_call_recordings("12345", call_id) - if response.data.length > 0 - puts response.data[0].media_url - end - rescue APIException => e - puts e.response_code + result = api_instance.list_call_recordings(account_id, call_id) + p result[0].media_url if result.length.positive? + rescue Bandwidth::ApiError => e + p "Error when calling RecordingsApi->list_call_recordings: #{e}" end /accounts/{accountId}/calls/{callId}/recordings/{recordingId}: get: @@ -3416,33 +3529,35 @@ paths: } - lang: Java source: | - import com.bandwidth.BandwidthClient; - import com.bandwidth.http.response.ApiResponse; - import com.bandwidth.voice.models.CallRecordingMetadata; - - import java.util.concurrent.CompletableFuture; - import java.util.concurrent.ExecutionException; - - public class Sample { - public static final String USERNAME = "api-username"; - public static final String PASSWORD = "api-password"; - public static final String ACCOUNT_ID = "12345"; - + 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.RecordingsApi; + + public class Example { public static void main(String[] args) { - // Call id is returned after successfully creating a call. - String callId = "c-95ac8d6e-1a31c52e-b38f-4198-93c1-51633ec68f8d"; - // Recording id is returned after retrieving a recording from the call. - String recordingId = "r-d68201ef-d53e-4c6d-a743-1c1283909d41"; + ApiClient defaultClient = Configuration.getDefaultApiClient(); - BandwidthClient client = new BandwidthClient.Builder() - .voiceBasicAuthCredentials(USERNAME, PASSWORD) - .build(); + // Configure HTTP basic authorization: Basic + HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); + Basic.setUsername("YOUR USERNAME"); + Basic.setPassword("YOUR PASSWORD"); + RecordingsApi apiInstance = new RecordingsApi(defaultClient); + String accountId = "9900000"; // String | Your Bandwidth Account ID. + String callId = "c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85"; // String | Programmable Voice API Call ID. + String recordingId = "r-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85"; // String | Programmable Voice API Recording ID. try { - CompletableFuture> completableFuture = client.getVoiceClient().getAPIController().getCallRecordingAsync(ACCOUNT_ID, callId, recordingId); - System.out.println(completableFuture.get().getResult()); - } catch (InterruptedException | ExecutionException e) { - System.out.println(e.getMessage()); + CallRecordingMetadata result = apiInstance.getCallRecording(accountId, callId, recordingId); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling RecordingsApi#getCallRecording"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } } } @@ -3532,26 +3647,23 @@ paths: print(e.response_code) - lang: Ruby source: | - require 'bandwidth' - - include Bandwidth - include Bandwidth::Voice + require 'bandwidth-sdk' - bandwidth_client = Bandwidth::Client.new( - voice_basic_auth_user_name: "api-username", - voice_basic_auth_password: "api-password" - ) - - voice_client = bandwidth_client.voice_client.client + Bandwidth.configure do |config| + config.username = 'api-username' + config.password = 'api-password' + end - call_id = "c-1234" - recording_id = "r-1234" + api_instance = Bandwidth::RecordingsApi.new + account_id = '12345' + call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' + recording_id = 'r-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' begin - response = voice_client.get_call_recording("12345", call_id, recording_id) - puts response.data.application_id - rescue APIException => e - puts e.response_code + result = api_instance.get_call_recording(account_id, call_id, recording_id) + p result.application_id + rescue Bandwidth::ApiError => e + p "Error when calling RecordingsApi->get_call_recording: #{e}" end delete: tags: @@ -3635,32 +3747,34 @@ paths: } - lang: Java source: | - import com.bandwidth.BandwidthClient; - import com.bandwidth.http.response.ApiResponse; - - import java.util.concurrent.CompletableFuture; - import java.util.concurrent.ExecutionException; - - public class Sample { - public static final String USERNAME = "api-username"; - public static final String PASSWORD = "api-password"; - public static final String ACCOUNT_ID = "12345"; - + 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.RecordingsApi; + + public class Example { public static void main(String[] args) { - // Call id is returned after successfully creating a call. - String callId = "c-95ac8d6e-1a31c52e-b38f-4198-93c1-51633ec68f8d"; - // Recording id is returned after retrieving a recording from the call. - String recordingId = "r-d68201ef-d53e-4c6d-a743-1c1283909d41"; + ApiClient defaultClient = Configuration.getDefaultApiClient(); - BandwidthClient client = new BandwidthClient.Builder() - .voiceBasicAuthCredentials(USERNAME, PASSWORD) - .build(); + // Configure HTTP basic authorization: Basic + HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); + Basic.setUsername("YOUR USERNAME"); + Basic.setPassword("YOUR PASSWORD"); + RecordingsApi apiInstance = new RecordingsApi(defaultClient); + String accountId = "9900000"; // String | Your Bandwidth Account ID. + String callId = "c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85"; // String | Programmable Voice API Call ID. + String recordingId = "r-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85"; // String | Programmable Voice API Recording ID. try { - CompletableFuture> completableFuture = client.getVoiceClient().getAPIController().deleteRecordingAsync(ACCOUNT_ID, callId, recordingId); - System.out.println(completableFuture.get().getResult()); - } catch (InterruptedException | ExecutionException e) { - System.out.println(e.getMessage()); + apiInstance.deleteRecording(accountId, callId, recordingId); + } catch (ApiException e) { + System.err.println("Exception when calling RecordingsApi#deleteRecording"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } } } @@ -3749,25 +3863,22 @@ paths: print(e.response_code) - lang: Ruby source: | - require 'bandwidth' - - include Bandwidth - include Bandwidth::Voice + require 'bandwidth-sdk' - bandwidth_client = Bandwidth::Client.new( - voice_basic_auth_user_name: "api-username", - voice_basic_auth_password: "api-password" - ) - - voice_client = bandwidth_client.voice_client.client + Bandwidth.configure do |config| + config.username = 'api-username' + config.password = 'api-password' + end - call_id = "c-1234" - recording_id = "r-1234" + api_instance = Bandwidth::RecordingsApi.new + account_id = '12345' + call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' + recording_id = 'r-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' begin - voice_client.delete_recording("12345", call_id, recording_id) - rescue APIException => e - puts e.response_code + api_instance.delete_recording(account_id, call_id, recording_id) + rescue Bandwidth::ApiError => e + p "Error when calling RecordingsApi->delete_recording: #{e}" end /accounts/{accountId}/calls/{callId}/recordings/{recordingId}/media: get: @@ -3844,33 +3955,36 @@ paths: } - lang: Java source: | - import com.bandwidth.BandwidthClient; - import com.bandwidth.http.response.ApiResponse; - import com.bandwidth.voice.models.DynamicResponse; - - import java.util.concurrent.CompletableFuture; - import java.util.concurrent.ExecutionException; - - public class Sample { - public static final String USERNAME = "api-username"; - public static final String PASSWORD = "api-password"; - public static final String ACCOUNT_ID = "12345"; - + 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.RecordingsApi; + + public class Example { public static void main(String[] args) { - // Call id is returned after successfully creating a call. - String callId = "c-95ac8d6e-1a31c52e-b38f-4198-93c1-51633ec68f8d"; - // Recording id is returned after retrieving a recording from the call. - String recordingId = "r-d68201ef-d53e-4c6d-a743-1c1283909d41"; - - BandwidthClient client = new BandwidthClient.Builder() - .voiceBasicAuthCredentials(USERNAME, PASSWORD) - .build(); - + 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"); + + RecordingsApi apiInstance = new RecordingsApi(defaultClient); + String accountId = "9900000"; // String | Your Bandwidth Account ID. + String callId = "c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85"; // String | Programmable Voice API Call ID. + String recordingId = "r-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85"; // String | Programmable Voice API Recording ID. try { - CompletableFuture> completableFuture = client.getVoiceClient().getAPIController().getDownloadCallRecordingAsync(ACCOUNT_ID, callId, recordingId); - System.out.println(completableFuture.get().getResult()); - } catch (InterruptedException | ExecutionException e) { - System.out.println(e.getMessage()); + File result = apiInstance.downloadCallRecording(accountId, callId, recordingId); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling RecordingsApi#downloadCallRecording"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } } } @@ -3956,30 +4070,23 @@ paths: print(e.response_code) - lang: Ruby source: | - require 'bandwidth' - - include Bandwidth - include Bandwidth::Voice - - BW_USERNAME = "api-username" - BW_PASSWORD = "api-password" - BW_ACCOUNT_ID = "12345" + require 'bandwidth-sdk' - bandwidth_client = Bandwidth::Client.new( - voice_basic_auth_user_name: BW_USERNAME, - voice_basic_auth_password: BW_PASSWORD - ) + Bandwidth.configure do |config| + config.username = 'api-username' + config.password = 'api-password' + end - voice_client = bandwidth_client.voice_client.client - - call_id = "c-1234" - recording_id = "r-1234" + api_instance = Bandwidth::RecordingsApi.new + account_id = '12345' + call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' + recording_id = 'r-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' begin - result = voice_client.get_download_call_recording(BW_ACCOUNT_ID, call_id, recording_id) - downloaded_recording = result.data - rescue APIException => e - puts e.response_code + result = api_instance.download_call_recording(account_id, call_id, recording_id) + p result + rescue Bandwidth::ApiError => e + p "Error when calling RecordingsApi->download_call_recording: #{e}" end delete: tags: @@ -4055,32 +4162,34 @@ paths: } - lang: Java source: | - import com.bandwidth.BandwidthClient; - import com.bandwidth.http.response.ApiResponse; - - import java.util.concurrent.CompletableFuture; - import java.util.concurrent.ExecutionException; - - public class Sample { - public static final String USERNAME = "api-username"; - public static final String PASSWORD = "api-password"; - public static final String ACCOUNT_ID = "12345"; - + 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.RecordingsApi; + + public class Example { public static void main(String[] args) { - // Call id is returned after successfully creating a call. - String callId = "c-95ac8d6e-1a31c52e-b38f-4198-93c1-51633ec68f8d"; - // Recording id is returned after retrieving a recording from the call. - String recordingId = "r-d68201ef-d53e-4c6d-a743-1c1283909d41"; + ApiClient defaultClient = Configuration.getDefaultApiClient(); - BandwidthClient client = new BandwidthClient.Builder() - .voiceBasicAuthCredentials(USERNAME, PASSWORD) - .build(); + // Configure HTTP basic authorization: Basic + HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); + Basic.setUsername("YOUR USERNAME"); + Basic.setPassword("YOUR PASSWORD"); + RecordingsApi apiInstance = new RecordingsApi(defaultClient); + String accountId = "9900000"; // String | Your Bandwidth Account ID. + String callId = "c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85"; // String | Programmable Voice API Call ID. + String recordingId = "r-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85"; // String | Programmable Voice API Recording ID. try { - CompletableFuture> completableFuture = client.getVoiceClient().getAPIController().deleteRecordingMediaAsync(ACCOUNT_ID, callId, recordingId); - System.out.println(completableFuture.get().getResult()); - } catch (InterruptedException | ExecutionException e) { - System.out.println(e.getMessage()); + apiInstance.deleteRecordingMedia(accountId, callId, recordingId); + } catch (ApiException e) { + System.err.println("Exception when calling RecordingsApi#deleteRecordingMedia"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } } } @@ -4169,25 +4278,22 @@ paths: print(e.response_code) - lang: Ruby source: | - require 'bandwidth' - - include Bandwidth - include Bandwidth::Voice - - bandwidth_client = Bandwidth::Client.new( - voice_basic_auth_user_name: "api-username", - voice_basic_auth_password: "api-password" - ) + require 'bandwidth-sdk' - voice_client = bandwidth_client.voice_client.client + Bandwidth.configure do |config| + config.username = 'api-username' + config.password = 'api-password' + end - call_id = "c-1234" - recording_id = "r-1234" + api_instance = Bandwidth::RecordingsApi.new + account_id = '12345' + call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' + recording_id = 'r-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' begin - voice_client.delete_recording_media("12345", call_id, recording_id) - rescue APIException => e - print(e.response_code) + api_instance.delete_recording_media(account_id, call_id, recording_id) + rescue Bandwidth::ApiError => e + p "Error when calling RecordingsApi->delete_recording_media: #{e}" end /accounts/{accountId}/calls/{callId}/recordings/{recordingId}/transcription: get: @@ -4278,33 +4384,35 @@ paths: } - lang: Java source: | - import com.bandwidth.BandwidthClient; - import com.bandwidth.http.response.ApiResponse; - import com.bandwidth.voice.models.TranscriptionResponse; - - import java.util.concurrent.CompletableFuture; - import java.util.concurrent.ExecutionException; - - public class Sample { - public static final String USERNAME = "api-username"; - public static final String PASSWORD = "api-password"; - public static final String ACCOUNT_ID = "12345"; - + 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.RecordingsApi; + + public class Example { public static void main(String[] args) { - // Call id is returned after successfully creating a call. - String callId = "c-95ac8d6e-1a31c52e-b38f-4198-93c1-51633ec68f8d"; - // Recording id is returned after retrieving a recording from the call. - String recordingId = "r-d68201ef-d53e-4c6d-a743-1c1283909d41"; + ApiClient defaultClient = Configuration.getDefaultApiClient(); - BandwidthClient client = new BandwidthClient.Builder() - .voiceBasicAuthCredentials(USERNAME, PASSWORD) - .build(); + // Configure HTTP basic authorization: Basic + HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); + Basic.setUsername("YOUR USERNAME"); + Basic.setPassword("YOUR PASSWORD"); + RecordingsApi apiInstance = new RecordingsApi(defaultClient); + String accountId = "9900000"; // String | Your Bandwidth Account ID. + String callId = "c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85"; // String | Programmable Voice API Call ID. + String recordingId = "r-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85"; // String | Programmable Voice API Recording ID. try { - CompletableFuture> completableFuture = client.getVoiceClient().getAPIController().getCallTranscriptionAsync(ACCOUNT_ID, callId, recordingId); - System.out.println(completableFuture.get().getResult()); - } catch (InterruptedException | ExecutionException e) { - System.out.println(e.getMessage()); + TranscriptionList result = apiInstance.getCallTranscription(accountId, callId, recordingId); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling RecordingsApi#getCallTranscription"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } } } @@ -4394,26 +4502,23 @@ paths: print(e.response_code) - lang: Ruby source: | - require 'bandwidth' - - include Bandwidth - include Bandwidth::Voice + require 'bandwidth-sdk' - bandwidth_client = Bandwidth::Client.new( - voice_basic_auth_user_name: "api-username", - voice_basic_auth_password: "api-password" - ) - - voice_client = bandwidth_client.voice_client.client + Bandwidth.configure do |config| + config.username = 'api-username' + config.password = 'api-password' + end - call_id = "c-1234" - recording_id = "r-1234" + api_instance = Bandwidth::RecordingsApi.new + account_id = '12345' + call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' + recording_id = 'r-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' begin - response = voice_client.get_call_transcription("12345", call_id, recording_id) - puts response.data.transcripts - rescue APIException => e - puts e.response_code + result = api_instance.get_call_transcription(account_id, call_id, recording_id) + p result.transcripts + rescue Bandwidth::ApiError => e + p "Error when calling RecordingsApi->get_call_transcription: #{e}" end post: tags: @@ -4514,34 +4619,35 @@ paths: } - lang: Java source: | - import com.bandwidth.BandwidthClient; - import com.bandwidth.http.response.ApiResponse; - import com.bandwidth.voice.models.*; - - import java.util.concurrent.CompletableFuture; - import java.util.concurrent.ExecutionException; - - public class Sample { - public static final String USERNAME = "api-username"; - public static final String PASSWORD = "api-password"; - public static final String ACCOUNT_ID = "12345"; - + 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.RecordingsApi; + + public class Example { public static void main(String[] args) { - String callId = "c-95ac8d6e-1a31c52e-b38f-4198-93c1-51633ec68f8d"; - String recordingId = "r-d68201ef-d53e-4c6d-a743-1c1283909d41"; - - BandwidthClient client = new BandwidthClient.Builder() - .voiceBasicAuthCredentials(USERNAME, PASSWORD) - .build(); - - TranscribeRecordingRequest request = new TranscribeRecordingRequest(); - request.setCallbackUrl("https://sample.com/callbacks/transcribe"); - + ApiClient defaultClient = Configuration.getDefaultApiClient(); + + // Configure HTTP basic authorization: Basic + HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); + Basic.setUsername("YOUR USERNAME"); + Basic.setPassword("YOUR PASSWORD"); + + RecordingsApi apiInstance = new RecordingsApi(defaultClient); + String accountId = "9900000"; // String | Your Bandwidth Account ID. + String callId = "c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85"; // String | Programmable Voice API Call ID. + String recordingId = "r-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85"; // String | Programmable Voice API Recording ID. + TranscribeRecording transcribeRecording = new TranscribeRecording(); // TranscribeRecording | try { - CompletableFuture> completableFuture = client.getVoiceClient().getAPIController().createTranscribeCallRecordingAsync(ACCOUNT_ID, callId, recordingId, request); - System.out.println(completableFuture.get().getResult()); - } catch (InterruptedException | ExecutionException e) { - System.out.println(e.getMessage()); + apiInstance.transcribeCallRecording(accountId, callId, recordingId, transcribeRecording); + } catch (ApiException e) { + System.err.println("Exception when calling RecordingsApi#transcribeCallRecording"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } } } @@ -4651,31 +4757,25 @@ paths: except APIException as e: print(e.response_code) - lang: Ruby - source: |+ - require 'bandwidth' - - include Bandwidth - include Bandwidth::Voice - - bandwidth_client = Bandwidth::Client.new( - voice_basic_auth_user_name: "api-username", - voice_basic_auth_password: "api-password" - ) - - voice_client = bandwidth_client.voice_client.client + source: | + require 'bandwidth-sdk' - call_id = "c-1234" - recording_id = "r-1234" + Bandwidth.configure do |config| + config.username = 'api-username' + config.password = 'api-password' + end - body = TranscribeRecordingRequest.new - body.callback_url = "https://callback-url.com" + api_instance = Bandwidth::RecordingsApi.new + account_id = '12345' + call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' + recording_id = 'r-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' + transcribe_recording = Bandwidth::TranscribeRecording.new begin - voice_client.create_transcribe_call_recording("12345", call_id, recording_id, body) - rescue APIException => e - puts e.response_code + api_instance.transcribe_call_recording(account_id, call_id, recording_id, transcribe_recording) + rescue Bandwidth::ApiError => e + p "Error when calling RecordingsApi->transcribe_call_recording: #{e}" end - delete: tags: - Recordings @@ -4757,32 +4857,34 @@ paths: } - lang: Java source: | - import com.bandwidth.BandwidthClient; - import com.bandwidth.http.response.ApiResponse; - - import java.util.concurrent.CompletableFuture; - import java.util.concurrent.ExecutionException; - - public class Sample { - public static final String USERNAME = "api-username"; - public static final String PASSWORD = "api-password"; - public static final String ACCOUNT_ID = "12345"; - + 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.RecordingsApi; + + public class Example { public static void main(String[] args) { - // Call id is returned after successfully creating a call. - String callId = "c-95ac8d6e-1a31c52e-b38f-4198-93c1-51633ec68f8d"; - // Recording id is returned after retrieving a recording from the call. - String recordingId = "r-d68201ef-d53e-4c6d-a743-1c1283909d41"; + ApiClient defaultClient = Configuration.getDefaultApiClient(); - BandwidthClient client = new BandwidthClient.Builder() - .voiceBasicAuthCredentials(USERNAME, PASSWORD) - .build(); + // Configure HTTP basic authorization: Basic + HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic"); + Basic.setUsername("YOUR USERNAME"); + Basic.setPassword("YOUR PASSWORD"); + RecordingsApi apiInstance = new RecordingsApi(defaultClient); + String accountId = "9900000"; // String | Your Bandwidth Account ID. + String callId = "c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85"; // String | Programmable Voice API Call ID. + String recordingId = "r-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85"; // String | Programmable Voice API Recording ID. try { - CompletableFuture> completableFuture = client.getVoiceClient().getAPIController().deleteCallTranscriptionAsync(ACCOUNT_ID, callId, recordingId); - System.out.println(completableFuture.get().getResult()); - } catch (InterruptedException | ExecutionException e) { - System.out.println(e.getMessage()); + apiInstance.deleteCallTranscription(accountId, callId, recordingId); + } catch (ApiException e) { + System.err.println("Exception when calling RecordingsApi#deleteCallTranscription"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); } } } @@ -4870,25 +4972,22 @@ paths: print(e.response_code) - lang: Ruby source: | - require 'bandwidth' - - include Bandwidth - include Bandwidth::Voice - - bandwidth_client = Bandwidth::Client.new( - voice_basic_auth_user_name: "api-username", - voice_basic_auth_password: "api-password" - ) + require 'bandwidth-sdk' - voice_client = bandwidth_client.voice_client.client + Bandwidth.configure do |config| + config.username = 'api-username' + config.password = 'api-password' + end - call_id = "c-1234" - recording_id = "r-1234" + api_instance = Bandwidth::RecordingsApi.new + account_id = '12345' + call_id = 'c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' + recording_id = 'r-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85' begin - voice_client.delete_call_transcription("12345", call_id, recording_id) - rescue APIException => e - puts e.response_code + api_instance.delete_call_transcription(account_id, call_id, recording_id) + rescue Bandwidth::ApiError => e + p "Error when calling RecordingsApi->delete_call_transcription: #{e}" end /accounts/{accountId}/statistics: get: diff --git a/site/specs/webrtc.yml b/site/specs/webrtc.yml index 9be38445f..a18eb766c 100644 --- a/site/specs/webrtc.yml +++ b/site/specs/webrtc.yml @@ -39,175 +39,6 @@ paths: $ref: '#/components/responses/webrtcForbiddenError' '500': $ref: '#/components/responses/webrtcInternalServerError' - x-codeSamples: - - lang: cURL - source: > - curl - 'https://api.webrtc.bandwidth.com/v1/accounts/12345/participants' \ - -X POST \ - -H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \ - -H 'Content-Type: application/json' \ - -d '{ - "callbackUrl": "https://example.com/callback", - "publishPermissions": [ - "VIDEO", - "AUDIO" - ], - "tag": "participant1", - "deviceApiVersion": "V3" - }' - - lang: C# - source: "\uFEFFusing System;\nusing System.Collections.Generic;\nusing System.Threading.Tasks;\nusing Bandwidth.Standard;\nusing Bandwidth.Standard.Exceptions;\nusing Bandwidth.Standard.WebRtc.Models;\n\nclass Program\n{\n static async Task Main(string[] args)\n {\n var username = \"api-username\";\n var password = \"api-pasword\";\n var accountId = \"12345\";\n\n var client = new BandwidthClient.Builder()\n .WebRtcBasicAuthCredentials(username, password)\n .Build();\n\n var participant = new Participant()\n {\n PublishPermissions = new List() { PublishPermissionEnum.AUDIO, PublishPermissionEnum.VIDEO }\n };\n\n try\n {\n var response = await client.WebRtc.APIController.CreateParticipantAsync(accountId, participant);\n Console.WriteLine(response.Data);\n }\n catch (ApiException e)\n {\n Console.WriteLine(e.Message);\n }\n }\n}\n" - - lang: Java - source: | - import com.bandwidth.BandwidthClient; - import com.bandwidth.http.response.ApiResponse; - import com.bandwidth.webrtc.models.AccountsParticipantsResponse; - import com.bandwidth.webrtc.models.Participant; - import com.bandwidth.webrtc.models.PublishPermissionEnum; - - import java.util.concurrent.CompletableFuture; - import java.util.concurrent.ExecutionException; - import java.util.Arrays; - import java.util.List; - - public class Sample { - public static final String USERNAME = "api-username"; - public static final String PASSWORD = "api-password"; - public static final String ACCOUNT_ID = "12345"; - - public static void main(String[] args) { - BandwidthClient client = new BandwidthClient.Builder() - .webRtcBasicAuthCredentials(USERNAME, PASSWORD) - .build(); - - Participant participant = new Participant(); - List publishPermissions = Arrays.asList(PublishPermissionEnum.AUDIO, PublishPermissionEnum.VIDEO); - participant.setPublishPermissions(publishPermissions); - - try { - CompletableFuture> completableFuture = client.getWebRtcClient().getAPIController().createParticipantAsync(ACCOUNT_ID, participant); - } catch (Exception ex) { - System.out.println(ex.getMessage()); - } - } - } - - lang: Node.js - source: | - import { Client, ApiController } from '@bandwidth/webrtc'; - - const BW_USERNAME = "api-username"; - const BW_PASSWORD = "api-password"; - const BW_ACCOUNT_ID = "12345"; - - const client = new Client({ - basicAuthUserName: BW_USERNAME, - basicAuthPassword: BW_PASSWORD - }); - - const controller = new ApiController(client); - - const accountId = BW_ACCOUNT_ID; - - const createParticipant = async function() { - try { - const response = await controller.createParticipant(accountId, { - callbackUrl: "http://www.myapp.com/new", - publishPermissions: ["AUDIO"] - }) - console.log(response.body); - } catch(error) { - console.error(error); - } - } - - createParticipant(); - - lang: PHP - source: | - $BW_USERNAME, - 'webRtcBasicAuthPassword' => $BW_PASSWORD, - ) - ); - $client = new BandwidthLib\BandwidthClient($config); - - $webRtcClient = $client->getWebRtc()->getClient(); - - $body = new BandwidthLib\WebRtc\Models\Participant(); - $body->publishPermissions = array("AUDIO", "VIDEO"); - $body->deviceApiVersion = "V3"; - - try { - $response = $webRtcClient->createParticipant($BW_ACCOUNT_ID, $body); - print_r($response->getResult()->participant->id); - } catch (BandwidthLib\APIException $e) { - print_r($e->getResponseCode()); - } - - lang: Python - source: | - from bandwidth.bandwidth_client import BandwidthClient - from bandwidth.exceptions.api_exception import APIException - from bandwidth.webrtc.models.participant import Participant - - import os - - BW_USERNAME = "api-username" - BW_PASSWORD = "api-password" - BW_ACCOUNT_ID = "12345" - - bandwidth_client = BandwidthClient( - web_rtc_basic_auth_user_name=BW_USERNAME, - web_rtc_basic_auth_password=BW_PASSWORD - ) - - web_rtc_client = bandwidth_client.web_rtc_client.client - - body = Participant() - body.publish_permissions = ["AUDIO", "VIDEO"] - body.device_api_version = "V3" - - try: - response = web_rtc_client.create_participant(BW_ACCOUNT_ID, body) - print(response.body.participant.id) - except APIException as e: - print(e.response_code) - - lang: Ruby - source: | - require 'bandwidth' - - include Bandwidth - include Bandwidth::WebRtc - - BW_USERNAME = "api-username" - BW_PASSWORD = "api-password" - BW_ACCOUNT_ID = "12345" - - bandwidth_client = Bandwidth::Client.new( - web_rtc_basic_auth_user_name: BW_USERNAME, - web_rtc_basic_auth_password: BW_PASSWORD - ) - - web_rtc_client = bandwidth_client.web_rtc_client.client - - body = Participant.new - body.publish_permissions = ["AUDIO", "VIDEO"] - body.device_api_version = "V3" - - begin - response = web_rtc_client.create_participant(BW_ACCOUNT_ID, :body => body) - puts response.data.participant.id - rescue APIException => e - puts e.response_code - end /accounts/{accountId}/participants/{participantId}: get: tags: @@ -231,182 +62,6 @@ paths: $ref: '#/components/responses/webrtcNotFoundError' '500': $ref: '#/components/responses/webrtcInternalServerError' - x-codeSamples: - - lang: cURL - source: > - curl - 'https://api.webrtc.bandwidth.com/v1/accounts/12345/participants/320e2af6-13ec-498d-8b51-daba52c37853' - \ - -H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' - - lang: C# - source: |- - using System; - using System.Threading.Tasks; - using Bandwidth.Standard; - using Bandwidth.Standard.Exceptions; - using Bandwidth.Standard.WebRtc.Models; - - class Program - { - static async Task Main(string[] args) - { - var username = "api-username"; - var password = "api-pasword"; - var accountId = "12345"; - - var participantId = "320e2af6-13ec-498d-8b51-daba52c37853"; - - var client = new BandwidthClient.Builder() - .WebRtcBasicAuthCredentials(username, password) - .Build(); - - try - { - var response = await client.WebRtc.APIController.GetParticipantAsync(accountId, participantId); - Console.WriteLine(response.Data); - } - catch (ApiException e) - { - Console.WriteLine(e.Message); - } - } - } - - lang: Java - source: | - import com.bandwidth.BandwidthClient; - import com.bandwidth.http.response.ApiResponse; - import com.bandwidth.webrtc.models.Participant; - - import java.util.concurrent.CompletableFuture; - import java.util.concurrent.ExecutionException; - - public class Sample { - public static final String USERNAME = "api-username"; - public static final String PASSWORD = "api-password"; - public static final String ACCOUNT_ID = "12345"; - - public static void main(String[] args) { - String participantId = "568749d5-04d5-483d-adf5-deac7dd3d521"; - - BandwidthClient client = new BandwidthClient.Builder() - .webRtcBasicAuthCredentials(USERNAME, PASSWORD) - .build(); - - try { - CompletableFuture> completableFuture = client.getWebRtcClient().getAPIController().getParticipantAsync(ACCOUNT_ID, participantId); - System.out.println(completableFuture.get().getResult()); - } catch (InterruptedException | ExecutionException e) { - System.out.println(e.getMessage()); - } - } - } - - lang: Node.js - source: | - import { Client, ApiController } from '@bandwidth/webrtc'; - - const BW_USERNAME = "api-username"; - const BW_PASSWORD = "api-password"; - const BW_ACCOUNT_ID = "12345"; - - const client = new Client({ - basicAuthUserName: BW_USERNAME, - basicAuthPassword: BW_PASSWORD - }); - - const controller = new ApiController(client); - - const accountId = BW_ACCOUNT_ID; - const participantId = "320e2af6-13ec-498d-8b51-daba52c37853" - - const getParticipant = async function() { - try { - const response = await controller.getParticipant(accountId, participantId) - console.log(response.body); - } catch(error) { - console.error(error); - } - } - - getParticipant(); - - lang: PHP - source: | - $BW_USERNAME, - 'webRtcBasicAuthPassword' => $BW_PASSWORD, - ) - ); - $client = new BandwidthLib\BandwidthClient($config); - - $webRtcClient = $client->getWebRtc()->getClient(); - - $participantId = "1234-qwer"; - - try { - $response = $webRtcClient->getParticipant($BW_ACCOUNT_ID, $participantId); - print_r($response->getResult()->id); - } catch (BandwidthLib\APIException $e) { - print_r($e->getResponseCode()); - } - - lang: Python - source: | - from bandwidth.bandwidth_client import BandwidthClient - from bandwidth.exceptions.api_exception import APIException - - import os - - BW_USERNAME = "api-username" - BW_PASSWORD = "api-password" - BW_ACCOUNT_ID = "12345" - - bandwidth_client = BandwidthClient( - web_rtc_basic_auth_user_name=BW_USERNAME, - web_rtc_basic_auth_password=BW_PASSWORD - ) - - web_rtc_client = bandwidth_client.web_rtc_client.client - - participant_id = "1234-abcd" - - try: - response = web_rtc_client.get_participant(BW_ACCOUNT_ID, participant_id) - print(response.body.id) - except APIException as e: - print(e.response_code) - - lang: Ruby - source: | - require 'bandwidth' - - include Bandwidth - include Bandwidth::WebRtc - - BW_USERNAME = "api-username" - BW_PASSWORD = "api-password" - BW_ACCOUNT_ID = "12345" - - bandwidth_client = Bandwidth::Client.new( - web_rtc_basic_auth_user_name: BW_USERNAME, - web_rtc_basic_auth_password: BW_PASSWORD - ) - - web_rtc_client = bandwidth_client.web_rtc_client.client - - participant_id = "1234-abcd" - - begin - response = web_rtc_client.get_participant(BW_ACCOUNT_ID, participant_id) - puts response.data.id - rescue APIException => e - puts e.response_code - end delete: tags: - Participants @@ -429,177 +84,6 @@ paths: $ref: '#/components/responses/webrtcNotFoundError' '500': $ref: '#/components/responses/webrtcInternalServerError' - x-codeSamples: - - lang: cURL - source: > - curl - 'https://api.webrtc.bandwidth.com/v1/accounts/12345/participants/320e2af6-13ec-498d-8b51-daba52c37853' - \ - -X DELETE \ - -H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' - - lang: C# - source: | - using System; - using System.Threading.Tasks; - using Bandwidth.Standard; - using Bandwidth.Standard.Exceptions; - using Bandwidth.Standard.WebRtc.Models; - - class Program - { - static async Task Main(string[] args) - { - var username = "api-username"; - var password = "api-pasword"; - var accountId = "12345"; - - var participantId = "320e2af6-13ec-498d-8b51-daba52c37853"; - - var client = new BandwidthClient.Builder() - .WebRtcBasicAuthCredentials(username, password) - .Build(); - - try - { - await client.WebRtc.APIController.DeleteParticipantAsync(accountId, participantId); - } - catch (ApiException e) - { - Console.WriteLine(e.Message); - } - } - } - - lang: Java - source: | - import com.bandwidth.BandwidthClient; - import com.bandwidth.http.response.ApiResponse; - - import java.util.concurrent.CompletableFuture; - import java.util.concurrent.ExecutionException; - - public class Sample { - public static final String USERNAME = "api-username"; - public static final String PASSWORD = "api-password"; - public static final String ACCOUNT_ID = "12345"; - - public static void main(String[] args) { - BandwidthClient client = new BandwidthClient.Builder() - .webRtcBasicAuthCredentials(USERNAME, PASSWORD) - .build(); - - String participantId = "568749d5-04d5-483d-adf5-deac7dd3d521"; - - try { - CompletableFuture> completableFuture = client.getWebRtcClient().getAPIController().deleteParticipantAsync(ACCOUNT_ID, participantId); - System.out.println(completableFuture.get().getResult()); - } catch (InterruptedException | ExecutionException e) { - System.out.println(e.getMessage()); - } - } - } - - lang: Node.js - source: | - import { Client, ApiController } from '@bandwidth/webrtc'; - - const BW_USERNAME = "api-username"; - const BW_PASSWORD = "api-password"; - const BW_ACCOUNT_ID = "12345"; - - const client = new Client({ - basicAuthUserName: BW_USERNAME, - basicAuthPassword: BW_PASSWORD - }); - - const controller = new ApiController(client); - - const accountId = BW_ACCOUNT_ID; - const participantId = "320e2af6-13ec-498d-8b51-daba52c37853" - - const deleteParticipant = async function() { - try { - const response = await controller.deleteParticipant(accountId, participantId) - console.log(response.body); - } catch(error) { - console.error(error); - } - } - - deleteParticipant(); - - lang: PHP - source: | - $BW_USERNAME, - 'webRtcBasicAuthPassword' => $BW_PASSWORD, - ) - ); - $client = new BandwidthLib\BandwidthClient($config); - - $webRtcClient = $client->getWebRtc()->getClient(); - - $participantId = "1234-abcd"; - - try { - $webRtcClient->deleteParticipant($BW_ACCOUNT_ID, $participantId); - } catch (BandwidthLib\APIException $e) { - print_r($e->getResponseCode()); - } - - lang: Python - source: | - from bandwidth.bandwidth_client import BandwidthClient - from bandwidth.exceptions.api_exception import APIException - - import os - - BW_USERNAME = "api-username" - BW_PASSWORD = "api-password" - BW_ACCOUNT_ID = "12345" - - bandwidth_client = BandwidthClient( - web_rtc_basic_auth_user_name=BW_USERNAME, - web_rtc_basic_auth_password=BW_PASSWORD - ) - web_rtc_client = bandwidth_client.web_rtc_client.client - - participant_id = "1234-abcd" - - try: - web_rtc_client.delete_participant(BW_ACCOUNT_ID, participant_id) - except APIException as e: - print(e.response_code) - - lang: Ruby - source: | - require 'bandwidth' - - include Bandwidth - include Bandwidth::WebRtc - - BW_USERNAME = "api-username" - BW_PASSWORD = "api-password" - BW_ACCOUNT_ID = "12345" - - bandwidth_client = Bandwidth::Client.new( - web_rtc_basic_auth_user_name: BW_USERNAME, - web_rtc_basic_auth_password: BW_PASSWORD - ) - - web_rtc_client = bandwidth_client.web_rtc_client.client - - participant_id = "1234-abcd" - - begin - web_rtc_client.delete_participant(BW_ACCOUNT_ID, participant_id) - rescue APIException => e - puts e.response_code - end /accounts/{accountId}/sessions: post: tags: @@ -624,193 +108,6 @@ paths: $ref: '#/components/responses/webrtcForbiddenError' '500': $ref: '#/components/responses/webrtcInternalServerError' - x-codeSamples: - - lang: cURL - source: | - curl 'https://api.webrtc.bandwidth.com/v1/accounts/12345/sessions' \ - -X POST \ - -H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \ - -H 'Content-Type: application/json' \ - -d '{ - "tag": "session1" - }' - - lang: C# - source: |- - using System; - using System.Threading.Tasks; - using Bandwidth.Standard; - using Bandwidth.Standard.Exceptions; - using Bandwidth.Standard.WebRtc.Models; - - class Program - { - static async Task Main(string[] args) - { - var username = "api-username"; - var password = "api-pasword"; - var accountId = "12345"; - - var client = new BandwidthClient.Builder() - .WebRtcBasicAuthCredentials(username, password) - .Build(); - - var session = new Session() - { - Tag = "new-session" - }; - - try - { - var response = await client.WebRtc.APIController.CreateSessionAsync(accountId, session); - Console.WriteLine(response.Data); - } - catch (ApiException e) - { - Console.WriteLine(e.Message); - } - } - } - - lang: Java - source: | - import java.util.concurrent.CompletableFuture; - import java.util.concurrent.ExecutionException; - - import com.bandwidth.*; - import com.bandwidth.webrtc.models.*; - import com.bandwidth.http.response.ApiResponse; - - public class Sample { - public static final String USERNAME = "api-username"; - public static final String PASSWORD = "api-password"; - public static final String ACCOUNT_ID = "12345"; - - public static void main(String[] args) { - BandwidthClient client = new BandwidthClient.Builder() - .webRtcBasicAuthCredentials(USERNAME, PASSWORD) - .build(); - - Session session = new Session(); - session.setTag("new-session"); - - try { - CompletableFuture> completableFuture = client.getWebRtcClient().getAPIController().createSessionAsync(ACCOUNT_ID, session); - System.out.println(completableFuture.get().getResult()); - } catch (InterruptedException | ExecutionException e) { - System.out.println(e.getMessage()); - } - } - } - - lang: Node.js - source: | - import { Client, ApiController } from '@bandwidth/webrtc'; - - const BW_USERNAME = "api-username"; - const BW_PASSWORD = "api-password"; - const BW_ACCOUNT_ID = "12345"; - - const client = new Client({ - basicAuthUserName: BW_USERNAME, - basicAuthPassword: BW_PASSWORD - }); - - const controller = new ApiController(client); - - const accountId = BW_ACCOUNT_ID; - - const createSession = async function() { - try { - const response = await controller.createSession(accountId, { - tag: '{"SessionName": "my_session"}' - }) - console.log(response.body); - } catch(error) { - console.error(error); - } - } - - createSession(); - - lang: PHP - source: | - $BW_USERNAME, - 'webRtcBasicAuthPassword' => $BW_PASSWORD, - ) - ); - $client = new BandwidthLib\BandwidthClient($config); - - $webRtcClient = $client->getWebRtc()->getClient(); - - $body = new BandwidthLib\WebRtc\Models\Session(); - $body->tag = "tag"; - - try { - $response = $webRtcClient->createSession($BW_ACCOUNT_ID, $body); - print_r($response->getResult()->id); - } catch (BandwidthLib\APIException $e) { - print_r($e->getResponseCode()); - } - - lang: Python - source: | - from bandwidth.bandwidth_client import BandwidthClient - from bandwidth.exceptions.api_exception import APIException - from bandwidth.webrtc.models.session import Session - - import os - - BW_USERNAME = "api-username" - BW_PASSWORD = "api-password" - BW_ACCOUNT_ID = "12345" - - bandwidth_client = BandwidthClient( - web_rtc_basic_auth_user_name=BW_USERNAME, - web_rtc_basic_auth_password=BW_PASSWORD - ) - web_rtc_client = bandwidth_client.web_rtc_client.client - - body = Session() - body.tag = "tag" - - try: - response = web_rtc_client.create_session(BW_ACCOUNT_ID, body) - print(response.body.id) - except APIException as e: - print(e.response_code) - - lang: Ruby - source: | - require 'bandwidth' - - include Bandwidth - include Bandwidth::WebRtc - - BW_USERNAME = "api-username" - BW_PASSWORD = "api-password" - BW_ACCOUNT_ID = "12345" - - bandwidth_client = Bandwidth::Client.new( - web_rtc_basic_auth_user_name: BW_USERNAME, - web_rtc_basic_auth_password: BW_PASSWORD - ) - - web_rtc_client = bandwidth_client.web_rtc_client.client - - body = Session.new - body.tag = "tag" - - begin - response = web_rtc_client.create_session(BW_ACCOUNT_ID, :body => body) - puts response.data.id - rescue APIException => e - puts e.response_code - end /accounts/{accountId}/sessions/{sessionId}: get: tags: @@ -834,182 +131,6 @@ paths: $ref: '#/components/responses/webrtcNotFoundError' '500': $ref: '#/components/responses/webrtcInternalServerError' - x-codeSamples: - - lang: cURL - source: > - curl - 'https://api.webrtc.bandwidth.com/v1/accounts/12345/sessions/75c21163-e110-41bc-bd76-1bb428ec85d5' - \ - -H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' - - lang: C# - source: | - using System; - using System.Threading.Tasks; - using Bandwidth.Standard; - using Bandwidth.Standard.Exceptions; - using Bandwidth.Standard.WebRtc.Models; - - class Program - { - static async Task Main(string[] args) - { - var username = "api-username"; - var password = "api-pasword"; - var accountId = "12345"; - - var sessionId = "75c21163-e110-41bc-bd76-1bb428ec85d5"; // Returned via WebRTC's create session request. - - var client = new BandwidthClient.Builder() - .WebRtcBasicAuthCredentials(username, password) - .Build(); - - try - { - var response = await client.WebRtc.APIController.GetSessionAsync(accountId, sessionId); - Console.WriteLine(response.Data); - } - catch (ApiException e) - { - Console.WriteLine(e.Message); - } - } - } - - lang: Java - source: | - import com.bandwidth.BandwidthClient; - import com.bandwidth.http.response.ApiResponse; - import com.bandwidth.webrtc.models.Session; - - import java.util.concurrent.CompletableFuture; - import java.util.concurrent.ExecutionException; - - public class Sample { - public static final String USERNAME = "api-username"; - public static final String PASSWORD = "api-password"; - public static final String ACCOUNT_ID = "12345"; - - public static void main(String[] args) { - String sessionId = "75c21163-e110-41bc-bd76-1bb428ec85d5"; - - BandwidthClient client = new BandwidthClient.Builder() - .webRtcBasicAuthCredentials(USERNAME, PASSWORD) - .build(); - - try { - CompletableFuture> completableFuture = client.getWebRtcClient().getAPIController().getSessionAsync(ACCOUNT_ID, sessionId); - System.out.println(completableFuture.get().getResult()); - } catch (InterruptedException | ExecutionException e) { - System.out.println(e.getMessage()); - } - } - } - - lang: Node.js - source: | - import { Client, ApiController } from '@bandwidth/webrtc'; - - const BW_USERNAME = "api-username"; - const BW_PASSWORD = "api-password"; - const BW_ACCOUNT_ID = "12345"; - - const client = new Client({ - basicAuthUserName: BW_USERNAME, - basicAuthPassword: BW_PASSWORD - }); - - const controller = new ApiController(client); - - const accountId = BW_ACCOUNT_ID; - const sessionId = "75c21163-e110-41bc-bd76-1bb428ec85d5" - - const getSession = async function() { - try { - const response = await controller.getSession(accountId, sessionId) - console.log(response.body); - } catch(error) { - console.error(error); - } - } - - getSession(); - - lang: PHP - source: | - $BW_USERNAME, - 'webRtcBasicAuthPassword' => $BW_PASSWORD, - ) - ); - $client = new BandwidthLib\BandwidthClient($config); - - $webRtcClient = $client->getWebRtc()->getClient(); - - $sessionId = "1234-qwer"; - - try { - $response = $webRtcClient->getSession($BW_ACCOUNT_ID, $sessionId); - print_r($response->getResult()->id); - } catch (BandwidthLib\APIException $e) { - print_r($e->getResponseCode()); - } - - lang: Python - source: | - from bandwidth.bandwidth_client import BandwidthClient - from bandwidth.exceptions.api_exception import APIException - - import os - - BW_USERNAME = "api-username" - BW_PASSWORD = "api-password" - BW_ACCOUNT_ID = "12345" - - bandwidth_client = BandwidthClient( - web_rtc_basic_auth_user_name=BW_USERNAME, - web_rtc_basic_auth_password=BW_PASSWORD - ) - - web_rtc_client = bandwidth_client.web_rtc_client.client - - session_id = "1234-abcd" - - try: - response = web_rtc_client.get_session(BW_ACCOUNT_ID, session_id) - print(response.body.id) - except APIException as e: - print(e.response_code) - - lang: Ruby - source: | - require 'bandwidth' - - include Bandwidth - include Bandwidth::WebRtc - - BW_USERNAME = "api-username" - BW_PASSWORD = "api-password" - BW_ACCOUNT_ID = "12345" - - bandwidth_client = Bandwidth::Client.new( - web_rtc_basic_auth_user_name: BW_USERNAME, - web_rtc_basic_auth_password: BW_PASSWORD - ) - - web_rtc_client = bandwidth_client.web_rtc_client.client - - session_id = "1234-abcd" - - begin - response = web_rtc_client.get_session(BW_ACCOUNT_ID, session_id) - print(response.data.id) - rescue APIException => e - print(e.response_code) - end delete: tags: - Sessions @@ -1032,178 +153,6 @@ paths: $ref: '#/components/responses/webrtcNotFoundError' '500': $ref: '#/components/responses/webrtcInternalServerError' - x-codeSamples: - - lang: cURL - source: > - curl - 'https://api.webrtc.bandwidth.com/v1/accounts/12345/sessions/75c21163-e110-41bc-bd76-1bb428ec85d5' - \ - -X DELETE \ - -H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' - - lang: C# - source: | - using System; - using System.Threading.Tasks; - using Bandwidth.Standard; - using Bandwidth.Standard.Exceptions; - using Bandwidth.Standard.WebRtc.Models; - - class Program - { - static async Task Main(string[] args) - { - var username = "api-username"; - var password = "api-pasword"; - var accountId = "12345"; - - var sessionId = "75c21163-e110-41bc-bd76-1bb428ec85d5"; // Returned via WebRTC's create session request. - - var client = new BandwidthClient.Builder() - .WebRtcBasicAuthCredentials(username, password) - .Build(); - - try - { - await client.WebRtc.APIController.DeleteSessionAsync(accountId, sessionId); - } - catch (ApiException e) - { - Console.WriteLine(e.Message); - } - } - } - - lang: Java - source: | - import com.bandwidth.BandwidthClient; - import com.bandwidth.http.response.ApiResponse; - - import java.util.concurrent.CompletableFuture; - import java.util.concurrent.ExecutionException; - - public class Sample { - public static final String USERNAME = "api-username"; - public static final String PASSWORD = "api-password"; - public static final String ACCOUNT_ID = "12345"; - - public static void main(String[] args) { - BandwidthClient client = new BandwidthClient.Builder() - .webRtcBasicAuthCredentials(USERNAME, PASSWORD) - .build(); - - String sessionId = "75c21163-e110-41bc-bd76-1bb428ec85d5"; - - try { - CompletableFuture> completableFuture = client.getWebRtcClient().getAPIController().deleteSessionAsync(ACCOUNT_ID, sessionId); - System.out.println(completableFuture.get().getResult()); - } catch (InterruptedException | ExecutionException e) { - System.out.println(e.getMessage()); - } - } - } - - lang: Node.js - source: | - import { Client, ApiController } from '@bandwidth/webrtc'; - - const BW_USERNAME = "api-username"; - const BW_PASSWORD = "api-password"; - const BW_ACCOUNT_ID = "12345"; - - const client = new Client({ - basicAuthUserName: BW_USERNAME, - basicAuthPassword: BW_PASSWORD - }); - - const controller = new ApiController(client); - - const accountId = BW_ACCOUNT_ID; - const sessionId = "75c21163-e110-41bc-bd76-1bb428ec85d5" - - const deleteSession = async function() { - try { - const response = await controller.deleteSession(accountId, sessionId) - console.log(response.body); - } catch(error) { - console.error(error); - } - } - - deleteSession(); - - lang: PHP - source: |+ - $BW_USERNAME, - 'webRtcBasicAuthPassword' => $BW_PASSWORD, - ) - ); - $client = new BandwidthLib\BandwidthClient($config); - - $webRtcClient = $client->getWebRtc()->getClient(); - - $sessionId = "1234-qwer"; - - try { - $webRtcClient->deleteSession($BW_ACCOUNT_ID, $sessionId); - } catch (BandwidthLib\APIException $e) { - print_r($e->getResponseCode()); - } - - - lang: Python - source: | - from bandwidth.bandwidth_client import BandwidthClient - from bandwidth.exceptions.api_exception import APIException - - import os - - BW_USERNAME = "api-username" - BW_PASSWORD = "api-password" - BW_ACCOUNT_ID = "12345" - - bandwidth_client = BandwidthClient( - web_rtc_basic_auth_user_name=BW_USERNAME, - web_rtc_basic_auth_password=BW_PASSWORD - ) - web_rtc_client = bandwidth_client.web_rtc_client.client - - session_id = "1234-abcd" - - try: - web_rtc_client.delete_session(BW_ACCOUNT_ID, session_id) - except APIException as e: - print(e.response_code) - - lang: Ruby - source: | - require 'bandwidth' - - include Bandwidth - include Bandwidth::WebRtc - - BW_USERNAME = "api-username" - BW_PASSWORD = "api-password" - BW_ACCOUNT_ID = "12345" - - bandwidth_client = Bandwidth::Client.new( - web_rtc_basic_auth_user_name: BW_USERNAME, - web_rtc_basic_auth_password: BW_PASSWORD - ) - - web_rtc_client = bandwidth_client.web_rtc_client.client - - session_id = "1234-abcd" - - begin - web_rtc_client.delete_session(BW_ACCOUNT_ID, session_id) - rescue APIException => e - puts e.response_code - end /accounts/{accountId}/sessions/{sessionId}/participants: get: tags: @@ -1229,183 +178,6 @@ paths: $ref: '#/components/responses/webrtcNotFoundError' '500': $ref: '#/components/responses/webrtcInternalServerError' - x-codeSamples: - - lang: cURL - source: > - curl - 'https://api.webrtc.bandwidth.com/v1/accounts/12345/sessions/75c21163-e110-41bc-bd76-1bb428ec85d5/participants' - \ - -H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' - - lang: C# - source: | - using System; - using System.Threading.Tasks; - using Bandwidth.Standard; - using Bandwidth.Standard.Exceptions; - using Bandwidth.Standard.WebRtc.Models; - - class Program - { - static async Task Main(string[] args) - { - var username = "api-username"; - var password = "api-pasword"; - var accountId = "12345"; - - var sessionId = "75c21163-e110-41bc-bd76-1bb428ec85d5"; // Returned via WebRTC's create session request. - - var client = new BandwidthClient.Builder() - .WebRtcBasicAuthCredentials(username, password) - .Build(); - - try - { - var response = await client.WebRtc.APIController.ListSessionParticipantsAsync(accountId, sessionId); - Console.WriteLine(response.Data); - } - catch (ApiException e) - { - Console.WriteLine(e.Message); - } - } - } - - lang: Java - source: | - import com.bandwidth.BandwidthClient; - import com.bandwidth.http.response.ApiResponse; - import com.bandwidth.webrtc.models.Participant; - - import java.util.concurrent.CompletableFuture; - import java.util.concurrent.ExecutionException; - import java.util.List; - - public class Sample { - public static final String USERNAME = "api-username"; - public static final String PASSWORD = "api-password"; - public static final String ACCOUNT_ID = "12345"; - - public static void main(String[] args) { - String sessionId = "75c21163-e110-41bc-bd76-1bb428ec85d5"; - - BandwidthClient client = new BandwidthClient.Builder() - .webRtcBasicAuthCredentials(USERNAME, PASSWORD) - .build(); - - try { - CompletableFuture>> completableFuture = client.getWebRtcClient().getAPIController().listSessionParticipantsAsync(ACCOUNT_ID, sessionId); - System.out.println(completableFuture.get().getResult()); - } catch (InterruptedException | ExecutionException e) { - System.out.println(e.getMessage()); - } - } - } - - lang: Node.js - source: | - import { Client, ApiController } from '@bandwidth/webrtc'; - - const BW_USERNAME = "api-username"; - const BW_PASSWORD = "api-password"; - const BW_ACCOUNT_ID = "12345"; - - const client = new Client({ - basicAuthUserName: BW_USERNAME, - basicAuthPassword: BW_PASSWORD - }); - - const controller = new ApiController(client); - - const accountId = BW_ACCOUNT_ID; - const sessionId = "75c21163-e110-41bc-bd76-1bb428ec85d5" - - const listSessionParticipants = async function() { - try { - const response = await controller.listSessionParticipants(accountId, sessionId) - console.log(response.body); - } catch(error) { - console.error(error); - } - } - - listSessionParticipants(); - - lang: PHP - source: | - $BW_USERNAME, - 'webRtcBasicAuthPassword' => $BW_PASSWORD, - ) - ); - $client = new BandwidthLib\BandwidthClient($config); - - $webRtcClient = $client->getWebRtc()->getClient(); - - $sessionId = "1234-qwer"; - - try { - $response = $webRtcClient->listSessionParticipants($BW_ACCOUNT_ID, $sessionId); - print_r($response->getResult()); - } catch (BandwidthLib\APIException $e) { - print_r($e->getResponseCode()); - } - - lang: Python - source: | - from bandwidth.bandwidth_client import BandwidthClient - from bandwidth.exceptions.api_exception import APIException - - import os - - BW_USERNAME = "api-username" - BW_PASSWORD = "api-password" - BW_ACCOUNT_ID = "12345" - - bandwidth_client = BandwidthClient( - web_rtc_basic_auth_user_name=BW_USERNAME, - web_rtc_basic_auth_password=BW_PASSWORD - ) - - web_rtc_client = bandwidth_client.web_rtc_client.client - - session_id = "1234-abcd" - - try: - response = web_rtc_client.list_session_participants(BW_ACCOUNT_ID, session_id) - print(response.body) - except APIException as e: - print(e.response_code) - - lang: Ruby - source: | - require 'bandwidth' - - include Bandwidth - include Bandwidth::WebRtc - - BW_USERNAME = "api-username" - BW_PASSWORD = "api-password" - BW_ACCOUNT_ID = "12345" - - bandwidth_client = Bandwidth::Client.new( - web_rtc_basic_auth_user_name: BW_USERNAME, - web_rtc_basic_auth_password: BW_PASSWORD - ) - - web_rtc_client = bandwidth_client.web_rtc_client.client - - session_id = "1234-abcd" - - begin - response = web_rtc_client.list_session_participants(BW_ACCOUNT_ID, session_id) - puts response.end - rescue APIException => e - puts e.response_code - end /accounts/{accountId}/sessions/{sessionId}/participants/{participantId}: put: tags: @@ -1437,219 +209,6 @@ paths: $ref: '#/components/responses/webrtcConflictError' '500': $ref: '#/components/responses/webrtcInternalServerError' - x-codeSamples: - - lang: cURL - source: > - curl - 'https://api.webrtc.bandwidth.com/v1/accounts/12345/sessions/75c21163-e110-41bc-bd76-1bb428ec85d5/participants/568749d5-04d5-483d-adf5-deac7dd3d521' - \ - -X PUT \ - -H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \ - -H 'Content-Type: application/json' \ - -d '{ - "sessionId": "d8886aad-b956-4e1b-b2f4-d7c9f8162772", - "participants": [ - { - "participantId": "568749d5-04d5-483d-adf5-deac7dd3d521" - }, - { - "participantId": "0275e47f-dd21-4cf0-a1e1-dfdc719e73a7" - } - ] - }' - - lang: C# - source: | - using System; - using System.Threading.Tasks; - using System.Collections.Generic; - using Bandwidth.Standard; - using Bandwidth.Standard.Exceptions; - using Bandwidth.Standard.WebRtc.Models; - - class Program - { - static async Task Main(string[] args) - { - var username = "api-username"; - var password = "api-pasword"; - var accountId = "12345"; - - var sessionId = "75c21163-e110-41bc-bd76-1bb428ec85d5"; // Returned via WebRTC's create session request. - var participantId = "568749d5-04d5-483d-adf5-deac7dd3d521"; // Returned via WebRTC's create participant request. - - var client = new BandwidthClient.Builder() - .WebRtcBasicAuthCredentials(username, password) - .Build(); - - var subscriptions = new Subscriptions() - { - SessionId = sessionId - }; - - try - { - await client.WebRtc.APIController.AddParticipantToSessionAsync(accountId, sessionId, participantId, subscriptions); - } - catch (ApiException e) - { - Console.WriteLine(e.Message); - } - } - } - - lang: Java - source: | - import com.bandwidth.BandwidthClient; - import com.bandwidth.http.response.ApiResponse; - import com.bandwidth.webrtc.models.Subscriptions; - import com.bandwidth.webrtc.models.ParticipantSubscription; - - import java.util.ArrayList; - import java.util.List; - - import java.util.concurrent.CompletableFuture; - import java.util.concurrent.ExecutionException; - - public class Sample { - public static final String USERNAME = "api-username"; - public static final String PASSWORD = "api-password"; - public static final String ACCOUNT_ID = "12345"; - - public static void main(String[] args) { - String sessionId = "75c21163-e110-41bc-bd76-1bb428ec85d5"; // Returned via WebRTC's create session request. - String participantId = "568749d5-04d5-483d-adf5-deac7dd3d521"; // Returned via WebRTC's create participant request. - - BandwidthClient client = new BandwidthClient.Builder() - .webRtcBasicAuthCredentials(USERNAME, PASSWORD) - .build(); - - Subscriptions subscriptions = new Subscriptions(); - subscriptions.setSessionId(sessionId); - - try { - CompletableFuture> completableFuture = client.getWebRtcClient().getAPIController().addParticipantToSessionAsync(ACCOUNT_ID, sessionId, participantId, subscriptions); - System.out.println(completableFuture.get().getResult()); - } catch (InterruptedException | ExecutionException e) { - System.out.println(e.getMessage()); - } - } - } - - lang: Node.js - source: | - import { Client, ApiController } from '@bandwidth/webrtc'; - - const BW_USERNAME = "api-username"; - const BW_PASSWORD = "api-password"; - const BW_ACCOUNT_ID = "12345"; - - const client = new Client({ - basicAuthUserName: BW_USERNAME, - basicAuthPassword: BW_PASSWORD - }); - - const controller = new ApiController(client); - - const accountId = BW_ACCOUNT_ID; - const sessionId = "75c21163-e110-41bc-bd76-1bb428ec85d5" - const participantId = "320e2af6-13ec-498d-8b51-daba52c37853" - const subscriptions = { - sessionId: sessionId - }; - - const addParticipantToSession = async function() { - try { - const response = await controller.addParticipantToSession(accountId, sessionId, participantId, subscriptions) - console.log(response.body); - } catch(error) { - console.error(error); - } - } - - addParticipantToSession(); - - lang: PHP - source: | - $BW_USERNAME, - 'webRtcBasicAuthPassword' => $BW_PASSWORD, - ) - ); - $client = new BandwidthLib\BandwidthClient($config); - - $webRtcClient = $client->getWebRtc()->getClient(); - - $sessionId = "1234-abcd"; - $participantId = "4321-dcba"; - - $body = new BandwidthLib\WebRtc\Models\Subscriptions(); - $body->sessionId = $sessionId; - - try { - $webRtcClient->addParticipantToSession($BW_ACCOUNT_ID, $sessionId, $participantId, $body); - } catch (BandwidthLib\APIException $e) { - print_r($e->getResponseCode()); - } - - lang: Python - source: | - from bandwidth.bandwidth_client import BandwidthClient - from bandwidth.exceptions.api_exception import APIException - - import os - - BW_USERNAME = "api-username" - BW_PASSWORD = "api-password" - BW_ACCOUNT_ID = "12345" - - bandwidth_client = BandwidthClient( - web_rtc_basic_auth_user_name=BW_USERNAME, - web_rtc_basic_auth_password=BW_PASSWORD - ) - web_rtc_client = bandwidth_client.web_rtc_client.client - - session_id = "1234-abcd" - participant_id = "4321-dcba" - subscriptions = {'sessionId': session_id} - - try: - web_rtc_client.add_participant_to_session(BW_ACCOUNT_ID, session_id, participant_id, subscriptions) - except APIException as e: - print(e.response_code) - - lang: Ruby - source: | - require 'bandwidth' - - include Bandwidth - include Bandwidth::WebRtc - - BW_USERNAME = "api-username" - BW_PASSWORD = "api-password" - BW_ACCOUNT_ID = "12345" - - bandwidth_client = Bandwidth::Client.new( - web_rtc_basic_auth_user_name: BW_USERNAME, - web_rtc_basic_auth_password: BW_PASSWORD - ) - - web_rtc_client = bandwidth_client.web_rtc_client.client - - session_id = "1234-abcd" - participant_id = "4321-dcba" - - body = Subscriptions.new - body.session_id = session_id - - begin - web_rtc_client.add_participant_to_session(BW_ACCOUNT_ID, session_id, participant_id, body: body) - rescue APIException => e - puts e.response_code - end delete: tags: - Sessions @@ -1675,184 +234,6 @@ paths: $ref: '#/components/responses/webrtcNotFoundError' '500': $ref: '#/components/responses/webrtcInternalServerError' - x-codeSamples: - - lang: cURL - source: > - curl - 'https://api.webrtc.bandwidth.com/v1/accounts/12345/sessions/75c21163-e110-41bc-bd76-1bb428ec85d5/participants/568749d5-04d5-483d-adf5-deac7dd3d521' - \ - -X DELETE \ - -H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' - - lang: C# - source: |- - using System; - using System.Threading.Tasks; - using Bandwidth.Standard; - using Bandwidth.Standard.Exceptions; - using Bandwidth.Standard.WebRtc.Models; - - class Program - { - static async Task Main(string[] args) - { - var username = "api-username"; - var password = "api-pasword"; - var accountId = "12345"; - - var sessionId = "75c21163-e110-41bc-bd76-1bb428ec85d5"; // Returned via WebRTC's create session request. - var participantId = "568749d5-04d5-483d-adf5-deac7dd3d521"; // Returned via WebRTC's create participant request. - - var client = new BandwidthClient.Builder() - .WebRtcBasicAuthCredentials(username, password) - .Build(); - - try - { - await client.WebRtc.APIController.RemoveParticipantFromSessionAsync(accountId, sessionId, participantId); - } - catch (ApiException e) - { - Console.WriteLine(e.Message); - } - } - } - - lang: Java - source: | - import com.bandwidth.BandwidthClient; - import com.bandwidth.http.response.ApiResponse; - - import java.util.concurrent.CompletableFuture; - import java.util.concurrent.ExecutionException; - - public class Sample { - public static final String USERNAME = "api-username"; - public static final String PASSWORD = "api-password"; - public static final String ACCOUNT_ID = "12345"; - - public static void main(String[] args) { - String sessionId = "75c21163-e110-41bc-bd76-1bb428ec85d5"; - String participantId = "568749d5-04d5-483d-adf5-deac7dd3d521"; - - BandwidthClient client = new BandwidthClient.Builder() - .webRtcBasicAuthCredentials(USERNAME, PASSWORD) - .build(); - - try { - CompletableFuture> completableFuture = client.getWebRtcClient().getAPIController().removeParticipantFromSessionAsync(ACCOUNT_ID, sessionId, participantId); - System.out.println(completableFuture.get().getResult()); - } catch (InterruptedException | ExecutionException e) { - System.out.println(e.getMessage()); - } - } - } - - lang: Node.js - source: | - import { Client, ApiController } from '@bandwidth/webrtc'; - - const BW_USERNAME = "api-username"; - const BW_PASSWORD = "api-password"; - const BW_ACCOUNT_ID = "12345"; - - const client = new Client({ - basicAuthUserName: BW_USERNAME, - basicAuthPassword: BW_PASSWORD - }); - - const controller = new ApiController(client); - - const accountId = BW_ACCOUNT_ID; - const sessionId = "75c21163-e110-41bc-bd76-1bb428ec85d5" - const participantId = "320e2af6-13ec-498d-8b51-daba52c37853" - - const removeParticipantFromSession = async function() { - try { - const response = await controller.removeParticipantFromSession(accountId, sessionId, participantId) - console.log(response.body); - } catch(error) { - console.error(error); - } - } - - removeParticipantFromSession(); - - lang: PHP - source: | - $BW_USERNAME, - 'webRtcBasicAuthPassword' => $BW_PASSWORD, - ) - ); - $client = new BandwidthLib\BandwidthClient($config); - - $webRtcClient = $client->getWebRtc()->getClient(); - - $sessionId = "1234-abcd"; - $participantId = "4321-dcba"; - - try { - $webRtcClient->removeParticipantFromSession($BW_ACCOUNT_ID, $sessionId, $participantId); - } catch (BandwidthLib\APIException $e) { - print_r($e->getResponseCode()); - } - - lang: Python - source: | - from bandwidth.bandwidth_client import BandwidthClient - from bandwidth.exceptions.api_exception import APIException - - import os - - BW_USERNAME = "api-username" - BW_PASSWORD = "api-password" - BW_ACCOUNT_ID = "12345" - - bandwidth_client = BandwidthClient( - web_rtc_basic_auth_user_name=BW_USERNAME, - web_rtc_basic_auth_password=BW_PASSWORD - ) - - web_rtc_client = bandwidth_client.web_rtc_client.client - - session_id = "1234-abcd" - participant_id = "4312-dbca" - - try: - web_rtc_client.remove_participant_from_session(BW_ACCOUNT_ID, session_id, participant_id) - except APIException as e: - print(e.response_code) - - lang: Ruby - source: | - require 'bandwidth' - - include Bandwidth - include Bandwidth::WebRtc - - BW_USERNAME = "api-username" - BW_PASSWORD = "api-password" - BW_ACCOUNT_ID = "12345" - - bandwidth_client = Bandwidth::Client.new( - web_rtc_basic_auth_user_name: BW_USERNAME, - web_rtc_basic_auth_password: BW_PASSWORD - ) - - web_rtc_client = bandwidth_client.web_rtc_client.client - - session_id = "1234-abcd" - participant_id = "4312-dbca" - - begin - web_rtc_client.remove_participant_from_session(BW_ACCOUNT_ID, session_id, participant_id) - rescue APIException => e - puts e.response_code - end /accounts/{accountId}/sessions/{sessionId}/participants/{participantId}/subscriptions: get: tags: @@ -1879,188 +260,6 @@ paths: $ref: '#/components/responses/webrtcNotFoundError' '500': $ref: '#/components/responses/webrtcInternalServerError' - x-codeSamples: - - lang: cURL - source: > - curl - 'https://api.webrtc.bandwidth.com/v1/accounts/12345/sessions/75c21163-e110-41bc-bd76-1bb428ec85d5/participants/568749d5-04d5-483d-adf5-deac7dd3d521/subscriptions' - \ - -H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' - - lang: C# - source: | - using System; - using System.Threading.Tasks; - using Bandwidth.Standard; - using Bandwidth.Standard.Exceptions; - using Bandwidth.Standard.WebRtc.Models; - - class Program - { - static async Task Main(string[] args) - { - var username = "api-username"; - var password = "api-pasword"; - var accountId = "12345"; - - var sessionId = "75c21163-e110-41bc-bd76-1bb428ec85d5"; // Returned via WebRTC's create session request. - var participantId = "568749d5-04d5-483d-adf5-deac7dd3d521"; // Returned via WebRTC's create participant request. - - var client = new BandwidthClient.Builder() - .WebRtcBasicAuthCredentials(username, password) - .Build(); - - try - { - var response = await client.WebRtc.APIController.GetParticipantSubscriptionsAsync(accountId, sessionId, participantId); - Console.WriteLine(response.Data); - } - catch (ApiException e) - { - Console.WriteLine(e.Message); - } - } - } - - lang: Java - source: | - import com.bandwidth.BandwidthClient; - import com.bandwidth.http.response.ApiResponse; - import com.bandwidth.webrtc.models.Subscriptions; - - import java.util.concurrent.CompletableFuture; - import java.util.concurrent.ExecutionException; - - public class Sample { - public static final String USERNAME = "api-username"; - public static final String PASSWORD = "api-password"; - public static final String ACCOUNT_ID = "12345"; - - public static void main(String[] args) { - String sessionId = "75c21163-e110-41bc-bd76-1bb428ec85d5"; - String participantId = "568749d5-04d5-483d-adf5-deac7dd3d521"; - - BandwidthClient client = new BandwidthClient.Builder() - .webRtcBasicAuthCredentials(USERNAME, PASSWORD) - .build(); - - try { - CompletableFuture> completableFuture = client.getWebRtcClient().getAPIController().getParticipantSubscriptionsAsync(ACCOUNT_ID, sessionId, participantId); - System.out.println(completableFuture.get().getResult()); - } catch (InterruptedException | ExecutionException e) { - System.out.println(e.getMessage()); - } - } - } - - lang: Node.js - source: | - import { Client, ApiController } from '@bandwidth/webrtc'; - - const BW_USERNAME = "api-username"; - const BW_PASSWORD = "api-password"; - const BW_ACCOUNT_ID = "12345"; - - const client = new Client({ - basicAuthUserName: BW_USERNAME, - basicAuthPassword: BW_PASSWORD - }); - - const controller = new ApiController(client); - - const accountId = BW_ACCOUNT_ID; - const sessionId = "75c21163-e110-41bc-bd76-1bb428ec85d5" - const participantId = "320e2af6-13ec-498d-8b51-daba52c37853" - - const getParticipantSubscriptions = async function() { - try { - const response = await controller.getParticipantSubscriptions(accountId, sessionId, participantId) - console.log(response.body); - } catch(error) { - console.error(error); - } - } - - getParticipantSubscriptions(); - - lang: PHP - source: | - $BW_USERNAME, - 'webRtcBasicAuthPassword' => $BW_PASSWORD, - ) - ); - $client = new BandwidthLib\BandwidthClient($config); - - $webRtcClient = $client->getWebRtc()->getClient(); - - $participantId = "1234-abcd"; - $sessionId = "4321-dcba"; - - try { - $response = $webRtcClient->getParticipantSubscriptions($BW_ACCOUNT_ID, $sessionId, $participantId); - print_r($response->getResult()); - } catch (BandwidthLib\APIException $e) { - print_r($e->getResponseCode()); - } - - lang: Python - source: | - from bandwidth.bandwidth_client import BandwidthClient - from bandwidth.exceptions.api_exception import APIException - - import os - - BW_USERNAME = "api-username" - BW_PASSWORD = "api-password" - BW_ACCOUNT_ID = "12345" - - bandwidth_client = BandwidthClient( - web_rtc_basic_auth_user_name=BW_USERNAME, - web_rtc_basic_auth_password=BW_PASSWORD - ) - - web_rtc_client = bandwidth_client.web_rtc_client.client - - participant_id = "1234-abcd" - session_id = "4321-dcba" - - try: - response = web_rtc_client.get_participant_subscriptions(BW_ACCOUNT_ID, session_id, participant_id) - print(response.body) - except APIException as e: - print(e.response_code) - - lang: Ruby - source: | - require 'bandwidth' - - include Bandwidth - include Bandwidth::WebRtc - - BW_USERNAME = "api-username" - BW_PASSWORD = "api-password" - BW_ACCOUNT_ID = "12345" - - bandwidth_client = Bandwidth::Client.new( - web_rtc_basic_auth_user_name: BW_USERNAME, - web_rtc_basic_auth_password: BW_PASSWORD - ) - - web_rtc_client = bandwidth_client.web_rtc_client.client - - participant_id = "1234-abcd" - session_id = "4321-dcba" - - begin - response = web_rtc_client.get_participant_subscriptions(BW_ACCOUNT_ID, session_id, participant_id) - puts response.data - rescue APIException => e - puts e.response_code - end put: tags: - Sessions @@ -2096,224 +295,6 @@ paths: $ref: '#/components/responses/webrtcNotFoundError' '500': $ref: '#/components/responses/webrtcInternalServerError' - x-codeSamples: - - lang: cURL - source: > - curl - 'https://api.webrtc.bandwidth.com/v1/accounts/12345/sessions/75c21163-e110-41bc-bd76-1bb428ec85d5/participants/568749d5-04d5-483d-adf5-deac7dd3d521/subscriptions' - \ - -X PUT \ - -H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \ - -H 'Content-Type: application/json' \ - -d '{ - "sessionId": "d8886aad-b956-4e1b-b2f4-d7c9f8162772", - "participants": [ - { - "participantId": "568749d5-04d5-483d-adf5-deac7dd3d521" - }, - { - "participantId": "0275e47f-dd21-4cf0-a1e1-dfdc719e73a7" - } - ] - }' - - lang: C# - source: | - using System; - using System.Threading.Tasks; - using Bandwidth.Standard; - using Bandwidth.Standard.Exceptions; - using Bandwidth.Standard.WebRtc.Models; - - class Program - { - static async Task Main(string[] args) - { - var username = "api-username"; - var password = "api-pasword"; - var accountId = "12345"; - - var sessionId = "75c21163-e110-41bc-bd76-1bb428ec85d5"; // Returned via WebRTC's create session request. - var participantId = "568749d5-04d5-483d-adf5-deac7dd3d521"; // Returned via WebRTC's create participant request. - - var client = new BandwidthClient.Builder() - .WebRtcBasicAuthCredentials(username, password) - .Build(); - - var subscriptions = new Subscriptions() - { - SessionId = sessionId - }; - - try - { - await client.WebRtc.APIController.UpdateParticipantSubscriptionsAsync(accountId, sessionId, participantId, subscriptions); - } - catch (ApiException e) - { - Console.WriteLine(e.Message); - } - } - } - - lang: Java - source: | - import com.bandwidth.BandwidthClient; - import com.bandwidth.http.response.ApiResponse; - import com.bandwidth.webrtc.models.Subscriptions; - - import java.util.concurrent.CompletableFuture; - import java.util.concurrent.ExecutionException; - - public class Sample { - public static final String USERNAME = "api-username"; - public static final String PASSWORD = "api-password"; - public static final String ACCOUNT_ID = "12345"; - - public static void main(String[] args) { - String sessionId = "75c21163-e110-41bc-bd76-1bb428ec85d5"; - String participantId = "568749d5-04d5-483d-adf5-deac7dd3d521"; - - BandwidthClient client = new BandwidthClient.Builder() - .webRtcBasicAuthCredentials(USERNAME, PASSWORD) - .build(); - - Subscriptions subscriptions = new Subscriptions(); - subscriptions.setSessionId(sessionId); - - try { - CompletableFuture> completableFuture = client.getWebRtcClient().getAPIController().updateParticipantSubscriptionsAsync(ACCOUNT_ID, sessionId, participantId, subscriptions); - System.out.println(completableFuture.get().getResult()); - } catch (InterruptedException | ExecutionException e) { - System.out.println(e.getMessage()); - } - } - } - - lang: Node.js - source: | - import { Client, ApiController } from '@bandwidth/webrtc'; - - const BW_USERNAME = "api-username"; - const BW_PASSWORD = "api-password"; - const BW_ACCOUNT_ID = "12345"; - - const client = new Client({ - basicAuthUserName: BW_USERNAME, - basicAuthPassword: BW_PASSWORD - }); - - const controller = new ApiController(client); - - const accountId = BW_ACCOUNT_ID; - const sessionId = "75c21163-e110-41bc-bd76-1bb428ec85d5" - const participantId = "320e2af6-13ec-498d-8b51-daba52c37853" - const body = { "sessionId": "75c21163-e110-41bc-bd76-1bb428ec85d5", - "participants": [{ - "participantId": "568749d5-04d5-483d-adf5-deac7dd3d521" - }, { - "participantId": "0275e47f-dd21-4cf0-a1e1-dfdc719e73a7" - }] - } - - const updateParticipantSubscriptions = async function() { - try { - const response = await controller.updateParticipantSubscriptions(accountId, sessionId, participantId, body) - console.log(response.body); - } catch(error) { - console.error(error); - } - } - - updateParticipantSubscriptions(); - - lang: PHP - source: | - $BW_USERNAME, - 'webRtcBasicAuthPassword' => $BW_PASSWORD, - ) - ); - $client = new BandwidthLib\BandwidthClient($config); - - $webRtcClient = $client->getWebRtc()->getClient(); - - $body = new BandwidthLib\WebRtc\Models\Subscriptions(); - $body->sessionId = "1234-abcd"; - - $sessionId = "1234-abcd"; - $participantId = "4321-dcba"; - - try { - $webRtcClient->updateParticipantSubscriptions($BW_ACCOUNT_ID, $sessionId, $participantId, $body); - } catch (BandwidthLib\APIException $e) { - print_r($e->getResponseCode()); - } - - lang: Python - source: | - from bandwidth.bandwidth_client import BandwidthClient - from bandwidth.exceptions.api_exception import APIException - from bandwidth.webrtc.models.subscriptions import Subscriptions - - import os - - BW_USERNAME = "api-username" - BW_PASSWORD = "api-password" - BW_ACCOUNT_ID = "12345" - - bandwidth_client = BandwidthClient( - web_rtc_basic_auth_user_name=BW_USERNAME, - web_rtc_basic_auth_password=BW_PASSWORD - ) - - web_rtc_client = bandwidth_client.web_rtc_client.client - - body = Subscriptions() - body.session_id = "1234-abcd" - - session_id = "1234-abcd" - participant_id = "4321-dcba" - - try: - web_rtc_client.update_participant_subscriptions(BW_ACCOUNT_ID, session_id, participant_id, body) - except APIException as e: - print(e.response_code) - - lang: Ruby - source: |+ - require 'bandwidth' - - include Bandwidth - include Bandwidth::WebRtc - - BW_USERNAME = "api-username" - BW_PASSWORD = "api-password" - BW_ACCOUNT_ID = "12345" - - bandwidth_client = Bandwidth::Client.new( - web_rtc_basic_auth_user_name: BW_USERNAME, - web_rtc_basic_auth_password: BW_PASSWORD - ) - - web_rtc_client = bandwidth_client.web_rtc_client.client - - body = Subscriptions.new - body.session_id = "1234-abcd" - - session_id = "1234-abcd" - participant_id = "4321-dcba" - - begin - web_rtc_client.update_participant_subscriptions(BW_ACCOUNT_ID, session_id, participant_id, :body => body) - #NOTE: This is currently improperly defined - rescue APIException => e - puts e.response_code - end - components: schemas: publishPermissionsEnum: