diff --git a/.github/workflows/test-pr.yml b/.github/workflows/test-pr.yml index b85db600..cd1a2f84 100644 --- a/.github/workflows/test-pr.yml +++ b/.github/workflows/test-pr.yml @@ -11,8 +11,6 @@ concurrency: env: BW_ACCOUNT_ID: ${{ secrets.BW_ACCOUNT_ID }} - BW_USERNAME: ${{ secrets.BW_USERNAME }} - BW_PASSWORD: ${{ secrets.BW_PASSWORD }} BW_CLIENT_ID: ${{ secrets.BW_CLIENT_ID }} BW_CLIENT_SECRET: ${{ secrets.BW_CLIENT_SECRET }} BW_VOICE_APPLICATION_ID: ${{ secrets.BW_VOICE_APPLICATION_ID }} diff --git a/.github/workflows/test-smoke.yml b/.github/workflows/test-smoke.yml index c39377bb..4c3468d3 100644 --- a/.github/workflows/test-smoke.yml +++ b/.github/workflows/test-smoke.yml @@ -13,8 +13,6 @@ concurrency: cancel-in-progress: true env: - BW_USERNAME: ${{ secrets.BW_USERNAME }} - BW_PASSWORD: ${{ secrets.BW_PASSWORD }} BW_CLIENT_ID: ${{ secrets.BW_CLIENT_ID }} BW_CLIENT_SECRET: ${{ secrets.BW_CLIENT_SECRET }} USER_NUMBER: ${{ secrets.USER_NUMBER }} diff --git a/README.md b/README.md index 55a7a886..3ac4da26 100644 --- a/README.md +++ b/README.md @@ -36,15 +36,10 @@ Please follow the [installation procedure](#installation--usage) and then run th require_once(__DIR__ . '/vendor/autoload.php'); - -// Configure HTTP basic authorization: Basic +// Configure OAuth2 client credentials; access tokens are fetched and refreshed automatically $config = Bandwidth\Configuration::getDefaultConfiguration() - ->setUsername('YOUR_USERNAME') - ->setPassword('YOUR_PASSWORD'); - -// Configure OAuth2 access token for authorization: OAuth2 -$config = Bandwidth\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); - + ->setClientId('YOUR_CLIENT_ID') + ->setClientSecret('YOUR_CLIENT_SECRET'); $apiInstance = new Bandwidth\Api\CallsApi( // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. @@ -333,11 +328,6 @@ Class | Method | HTTP request | Description ## Authorization -### Basic - -- **Type**: HTTP basic authentication - - ### OAuth2 - **Type**: `OAuth` diff --git a/bandwidth.yml b/bandwidth.yml index 0df9d764..bffc6469 100644 --- a/bandwidth.yml +++ b/bandwidth.yml @@ -8,7 +8,6 @@ info: email: letstalk@bandwidth.com version: 1.0.0 security: - - Basic: [] - OAuth2: [] tags: - name: Messages @@ -2015,7 +2014,7 @@ components: type: string format: date-time description: The ISO 8601 datetime of the message. - example: 2020-04-07T14:03:07.000Z + example: '2020-04-07T14:03:07.000Z' carrierName: type: string nullable: true @@ -2095,13 +2094,11 @@ components: prevPage: type: string description: The link to the previous page for pagination. - example: >- - https://messaging.bandwidth.com/api/v2/users/accountId/messages?messageStatus=DLR_EXPIRED&nextPage=DLAPE902 + example: https://messaging.bandwidth.com/api/v2/users/accountId/messages?messageStatus=DLR_EXPIRED&nextPage=DLAPE902 nextPage: type: string description: The link to the next page for pagination. - example: >- - https://messaging.bandwidth.com/api/v2/users/accountId/messages?messageStatus=DLR_EXPIRED&prevPage=GL83PD3C + example: https://messaging.bandwidth.com/api/v2/users/accountId/messages?messageStatus=DLR_EXPIRED&prevPage=GL83PD3C prevPageToken: type: string description: The isolated pagination token for the previous page. @@ -2202,7 +2199,7 @@ components: type: string format: date-time description: The datetime stamp of the message in ISO 8601 - example: 2024-12-02T20:15:57.278Z + example: '2024-12-02T20:15:57.278201Z' segmentCount: $ref: '#/components/schemas/segmentCount' direction: @@ -2698,14 +2695,14 @@ components: description: >- The start time of the event. Must be a valid RFC-3339 value, e.g., 2021-03-14T01:59:26Z or 2021-03-13T20:59:26-05:00. - example: 2022-09-14T18:20:16.000Z + example: '2022-09-14T18:20:16.000Z' endTime: type: string format: date-time description: >- The end time of the event. Must be a valid RFC-3339 value, e.g., 2021-03-14T01:59:26Z or 2021-03-13T20:59:26-05:00. - example: 2022-09-14T18:20:16.000Z + example: '2022-09-14T18:20:16.000Z' description: type: string description: The description of the event. @@ -2877,7 +2874,7 @@ components: description: The time the message was received by the Bandwidth API. type: string format: date-time - example: 2025-01-01T18:20:16.000Z + example: '2025-01-01T18:20:16.000Z' direction: $ref: '#/components/schemas/messageDirectionEnum' to: @@ -3037,14 +3034,14 @@ components: time: type: string format: date-time - example: 2024-12-02T20:15:57.278Z + example: '2024-12-02T20:15:57.278201Z' eventTime: type: string description: >- Represents the time at which the message was read, for `message-read` callbacks. format: date-time - example: 2024-12-02T20:15:58.278Z + example: '2024-12-02T20:15:58.278205Z' type: $ref: '#/components/schemas/statusCallbackTypeEnum' to: @@ -3080,7 +3077,7 @@ components: time: type: string format: date-time - example: 2024-12-02T20:15:57.278Z + example: '2024-12-02T20:15:57.278201Z' type: $ref: '#/components/schemas/inboundCallbackTypeEnum' to: @@ -3176,7 +3173,7 @@ components: time: type: string format: date-time - example: 2024-12-02T20:15:57.666Z + example: '2024-12-02T20:15:57.666000Z' segmentCount: $ref: '#/components/schemas/segmentCount' direction: @@ -3408,8 +3405,7 @@ components: uui: nullable: true type: string - example: >- - eyJhbGciOiJIUzI1NiJ9.WyJoaSJd.-znkjYyCkgz4djmHUPSXl9YrJ6Nix_XvmlwKGFh5ERM;encoding=jwt,aGVsbG8gd29ybGQ;encoding=base64 + example: eyJhbGciOiJIUzI1NiJ9.WyJoaSJd.-znkjYyCkgz4djmHUPSXl9YrJ6Nix_XvmlwKGFh5ERM;encoding=jwt,aGVsbG8gd29ybGQ;encoding=base64 description: >- A comma-separated list of 'User-To-User' headers to be sent @@ -3619,8 +3615,7 @@ components: callUrl: type: string format: uri - example: >- - https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + example: https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 description: The URL to update this call's state. callTimeout: type: number @@ -3791,8 +3786,7 @@ components: configured to forward this header. - example: >- - eyJhbGciOiJFUzI1NiIsInBwdCI6InNoYWtlbiIsInR5cCI6InBhc3Nwb3J0IiwieDV1IjoiaHR0cHM6Ly9idy1zaGFrZW4tY2VydC1wdWIuczMuYW1hem9uYXdzLmNvbS9iYW5kd2lkdGgtc2hha2VuLWNlcnRfMjAyMzA3MTYucGVtIn0.eyJhdHRlc3QiOiJBIiwiZGVzdCI6eyJ0biI6WyIxOTg0MjgyMDI4MCJdfSwiaWF0IjoxNjU2NTM0MzM2LCJvcmlnIjp7InRuIjoiMTkxOTQ0NDI2ODMifSwib3JpZ2lkIjoiNDk0NTlhOGEtNDJmNi0zNTFjLTkzNjEtYWRmNTdhOWUwOGNhIn0.56un9sRw_uH-sbJvnUsqdevlVxbOVjn8MVlGTlBMicjaZuRRwxfiNp-C9zYCMKTTCbc-QdYPN05F61XNVN4D3w;info=;alg=ES256;ppt=shaken + example: eyJhbGciOiJFUzI1NiIsInBwdCI6InNoYWtlbiIsInR5cCI6InBhc3Nwb3J0IiwieDV1IjoiaHR0cHM6Ly9idy1zaGFrZW4tY2VydC1wdWIuczMuYW1hem9uYXdzLmNvbS9iYW5kd2lkdGgtc2hha2VuLWNlcnRfMjAyMzA3MTYucGVtIn0.eyJhdHRlc3QiOiJBIiwiZGVzdCI6eyJ0biI6WyIxOTg0MjgyMDI4MCJdfSwiaWF0IjoxNjU2NTM0MzM2LCJvcmlnIjp7InRuIjoiMTkxOTQ0NDI2ODMifSwib3JpZ2lkIjoiNDk0NTlhOGEtNDJmNi0zNTFjLTkzNjEtYWRmNTdhOWUwOGNhIn0.56un9sRw_uH-sbJvnUsqdevlVxbOVjn8MVlGTlBMicjaZuRRwxfiNp-C9zYCMKTTCbc-QdYPN05F61XNVN4D3w;info=;alg=ES256;ppt=shaken enqueuedTime: nullable: true type: string @@ -4109,8 +4103,7 @@ components: respond. Not allowed if `state` is `completed`. - example: >- - https://myFallbackServer.example/bandwidth/webhooks/conferenceRedirect + example: https://myFallbackServer.example/bandwidth/webhooks/conferenceRedirect redirectFallbackMethod: $ref: '#/components/schemas/redirectMethodEnum' fallbackUsername: @@ -4149,8 +4142,7 @@ components: Member](/apis/voice-apis/voice/#tag/Conferences/operation/updateConferenceMember) endpoint. - example: >- - https://voice.bandwidth.com/api/v2/accounts/9900000/conferences/conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9/members/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + example: https://voice.bandwidth.com/api/v2/accounts/9900000/conferences/conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9/members/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 mute: type: boolean description: >- @@ -4387,8 +4379,7 @@ components: to respond maxLength: 2048 - example: >- - https://myFallbackServer.example/bandwidth/webhooks/machineDetectionComplete + example: https://myFallbackServer.example/bandwidth/webhooks/machineDetectionComplete fallbackMethod: $ref: '#/components/schemas/callbackMethodEnum' fallbackUsername: @@ -4542,8 +4533,7 @@ components: example: - transcriptionId: t-3f758f24-c7a2fc78-7c91-401a-8b2e-e542f9c40d6b transcriptionName: live_transcription - transcriptionUrl: >- - https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-fef240ff-5cfc9091-8069-4863-a8c0-a4dcbbf1f1a4/transcriptions/t-3f758f24-c7a2fc78-7c91-401a-8b2e-e542f9c40d6b + transcriptionUrl: https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-fef240ff-5cfc9091-8069-4863-a8c0-a4dcbbf1f1a4/transcriptions/t-3f758f24-c7a2fc78-7c91-401a-8b2e-e542f9c40d6b callTranscriptionMetadata: type: object properties: @@ -4566,8 +4556,7 @@ components: [Get Call Transcription](/apis/voice-apis/voice/#tag/Transcriptions/operation/getRealTimeTranscription) endpoint. - example: >- - https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-fef240ff-5cfc9091-8069-4863-a8c0-a4dcbbf1f1a4/transcriptions/t-3f758f24-c7a2fc78-7c91-401a-8b2e-e542f9c40d6b + example: https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-fef240ff-5cfc9091-8069-4863-a8c0-a4dcbbf1f1a4/transcriptions/t-3f758f24-c7a2fc78-7c91-401a-8b2e-e542f9c40d6b callTranscriptionResponse: type: object properties: @@ -4632,8 +4621,7 @@ components: type: string format: uri description: The URL of the [transcription](#operation/getCallTranscription) - example: >- - https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85/recordings/r-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85/transcription + example: https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85/recordings/r-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85/transcription voiceApiError: type: object properties: @@ -5608,8 +5596,7 @@ components: description: >- The URL that can be used to download the recording. Only present if the recording is finished and may be downloaded. - example: >- - https://voice.bandwidth.com/api/v2/accounts/9900000/conferences/conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9/recordings/r-fbe05094-9fd2afe9-bf5b-4c68-820a-41a01c1c5833/media + example: https://voice.bandwidth.com/api/v2/accounts/9900000/conferences/conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9/recordings/r-fbe05094-9fd2afe9-bf5b-4c68-820a-41a01c1c5833/media callId: type: string description: The call id associated with the event. @@ -5622,8 +5609,7 @@ components: type: string format: uri description: The URL of the call associated with the event. - example: >- - https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + example: https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 parentCallId: type: string description: >- @@ -6869,8 +6855,7 @@ components: maxLength: 500 nullable: false example: https://www.example.com/path/to/resource - pattern: >- - ^$|(https?:\/\/)?(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,253}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#()?&//=]*) + pattern: ^$|(https?:\/\/)?(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,253}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#()?&//=]*) confirmationResponse: type: string minLength: 0 @@ -6917,8 +6902,7 @@ components: minLength: 0 maxLength: 500 nullable: false - pattern: >- - ^(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9]))\.){3}(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9])|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])$ + pattern: ^(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9]))\.){3}(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9])|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])$ example: foo@bar.com useCases: type: array @@ -7070,8 +7054,7 @@ components: maxLength: 2000 nullable: true example: https://www.example.com/path/to/resource - pattern: >- - ^$|(https?:\/\/)?(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,253}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#()?&//=]*) + pattern: ^$|(https?:\/\/)?(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,253}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#()?&//=]*) tfvError: description: A generic error object. properties: @@ -7210,8 +7193,7 @@ components: minLength: 0 maxLength: 500 nullable: true - example: >- - cv.user123|sess456|mno|tfree|read_write|X7yZ9aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVw + example: cv.user123|sess456|mno|tfree|read_write|X7yZ9aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789aBcDeFgHiJkLmNoPqRsTuVw endpointId: type: string description: The unique ID of the endpoint. @@ -7416,8 +7398,7 @@ components: href: type: string description: The full URL of the link. - example: >- - https://api.bandwidth.com/v2/accounts/5500123/endpoints/e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + example: https://api.bandwidth.com/v2/accounts/5500123/endpoints/e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 rel: type: string description: The relationship of the link to the current resource. @@ -8411,8 +8392,7 @@ components: in: header name: Continuation-Token description: Continuation token used to retrieve subsequent media. - example: >- - 1XEi2tsFtLo1JbtLwETnM1ZJ+PqAa8w6ENvC5QKvwyrCDYII663Gy5M4s40owR1tjkuWUif6qbWvFtQJR5/ipqbUnfAqL254LKNlPy6tATCzioKSuHuOqgzloDkSwRtX0LtcL2otHS69hK343m+SjdL+vlj71tT39 + example: 1XEi2tsFtLo1JbtLwETnM1ZJ+PqAa8w6ENvC5QKvwyrCDYII663Gy5M4s40owR1tjkuWUif6qbWvFtQJR5/ipqbUnfAqL254LKNlPy6tATCzioKSuHuOqgzloDkSwRtX0LtcL2otHS69hK343m+SjdL+vlj71tT39 schema: type: string messageId: @@ -8501,7 +8481,7 @@ components: description: >- 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. - example: 2022-09-14T18:20:16.000Z + example: '2022-09-14T18:20:16.000Z' schema: type: string toDateTime: @@ -8511,7 +8491,7 @@ components: description: >- 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. - example: 2022-09-14T18:20:16.000Z + example: '2022-09-14T18:20:16.000Z' schema: type: string campaignId: @@ -8979,8 +8959,7 @@ components: from: '+12345678901' text: Hey, check out the MMS! media: - - >- - https://messaging.bandwidth.com/api/v2/users/9900902/media/14762070468292kw2fuqty55yp2b2/0/bw.png + - https://messaging.bandwidth.com/api/v2/users/9900902/media/14762070468292kw2fuqty55yp2b2/0/bw.png rbmMessageReceivedSessionCallbackExample: summary: >- An example of a rbm message-received callback body for a message that is @@ -9209,8 +9188,7 @@ components: to: '+19195551234' from: '+19195554312' enqueuedTime: '2022-06-16T13:15:07.160Z' - callUrl: >- - https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + callUrl: https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 callTimeout: 30 callbackTimeout: 15 tag: My custom tag value @@ -9302,14 +9280,12 @@ components: summary: Numbers Lookup Accepted value: links: - - href: >- - /accounts/9912345/phoneNumberLookup/bulk/004223a0-8b17-41b1-bf81-20732adf5590 + - href: /accounts/9912345/phoneNumberLookup/bulk/004223a0-8b17-41b1-bf81-20732adf5590 rel: createdRequest method: GET data: requestId: 004223a0-8b17-41b1-bf81-20732adf5590 status: IN_PROGRESS - results: [] errors: [] lookupInProgressExample: summary: Numbers Lookup In Progress @@ -9482,7 +9458,8 @@ components: links: [] data: {} errors: - - type: bad-request + - code: '1234' + type: bad-request description: >- Bad Request. Ensure that you have set the requestId as a URL path parameter. @@ -9495,7 +9472,6 @@ components: - type: Unauthorized description: You are not authorized to access this resource. code: '1' - page: null forbiddenExample: summary: Forbidden Error value: @@ -9505,14 +9481,14 @@ components: - type: Forbidden description: You do not have permission to access this resource. code: '2' - page: null unsupportedMediaTypeExample: summary: Unsupported Media Type Error value: links: [] data: {} errors: - - type: invalid-content-type + - code: '1234' + type: invalid-content-type description: >- Invalid content-type. Ensure that your content-type header is set to application/json. @@ -9522,7 +9498,8 @@ components: links: [] data: {} errors: - - type: not-found + - code: '1234' + type: not-found description: >- RequestId not found. Ensure that the requestId used in the URL path is valid and maps to a previous request that was submitted. @@ -9532,7 +9509,8 @@ components: links: [] data: {} errors: - - type: rate-limiting + - code: '1234' + type: rate-limiting description: >- Rate limit exceeded. Wait for the time specified in the Retry-After header before sending another request. @@ -9552,12 +9530,10 @@ components: summary: List Endpoints Paginated Response value: links: - - href: >- - https://api.bandwidth.com/v2/accounts/5500123/endpoints?type=SIP&status=CONNECTED&limit=2 + - href: https://api.bandwidth.com/v2/accounts/5500123/endpoints?type=SIP&status=CONNECTED&limit=2 rel: self method: GET - - href: >- - https://api.bandwidth.com/v2/accounts/5500123/endpoints?type=SIP&status=CONNECTED&limit=2&afterCursor=TWF5IHRoZSBmb3JjZSBiZSB3aXRoIHlvdQ== + - href: https://api.bandwidth.com/v2/accounts/5500123/endpoints?type=SIP&status=CONNECTED&limit=2&afterCursor=TWF5IHRoZSBmb3JjZSBiZSB3aXRoIHlvdQ== rel: next method: GET page: @@ -9583,8 +9559,7 @@ components: summary: Create Endpoint Response value: links: - - href: >- - https://api.bandwidth.com/v2/accounts/5500123/endpoints/e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + - href: https://api.bandwidth.com/v2/accounts/5500123/endpoints/e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 rel: endpoint method: GET data: @@ -9601,8 +9576,7 @@ components: summary: Get Endpoint Response value: links: - - href: >- - https://api.bandwidth.com/v2/accounts/5500123/endpoints/e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 + - href: https://api.bandwidth.com/v2/accounts/5500123/endpoints/e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85 rel: self method: GET data: @@ -10128,24 +10102,6 @@ components: examples: updateEndpointBxmlRequestExample: $ref: '#/components/examples/updateEndpointBxmlRequestExample' - securitySchemes: - Basic: - type: http - scheme: basic - description: >- - Basic authentication is a simple authentication scheme built into the - HTTP protocol. To use it, send your HTTP requests with an - `Authorization` header that contains the word `Basic` followed by a - space and a Base64-encoded string `username:password`. - - - - Example: `Authorization: Basic ZGVtbZpwQDU1dzByZA==` - OAuth2: - type: oauth2 - flows: - clientCredentials: - tokenUrl: https://api.bandwidth.com/api/v1/oauth2/token - scopes: {} callbacks: inboundCallback: '{inboundCallbackUrl}': @@ -10182,8 +10138,7 @@ components: mmsMessageReceivedCallback: $ref: '#/components/examples/mmsMessageReceivedCallbackExample' rbmMessageReceivedSessionCallback: - $ref: >- - #/components/examples/rbmMessageReceivedSessionCallbackExample + $ref: '#/components/examples/rbmMessageReceivedSessionCallbackExample' responses: '200': description: OK @@ -10218,14 +10173,11 @@ components: mmsMessageDeliveredCallback: $ref: '#/components/examples/mmsMessageDeliveredCallbackExample' groupMmsMessageDeliveredCallback: - $ref: >- - #/components/examples/groupMmsMessageDeliveredCallbackExample + $ref: '#/components/examples/groupMmsMessageDeliveredCallbackExample' rbmMessageDeliveredSessionCallback: - $ref: >- - #/components/examples/rbmMessageDeliveredSessionCallbackExample + $ref: '#/components/examples/rbmMessageDeliveredSessionCallbackExample' rbmMessageDeliveredCanInitiateSessionCallback: - $ref: >- - #/components/examples/rbmMessageDeliveredCanInitiateSessionCallbackExample + $ref: '#/components/examples/rbmMessageDeliveredCanInitiateSessionCallbackExample' messageFailedCallback: $ref: '#/components/examples/messageFailedCallbackExample' sessionStartedCallback: @@ -10289,3 +10241,14 @@ components: responses: '204': description: Event was successfully received. + securitySchemes: + OAuth2: + type: oauth2 + description: >- + OAuth2 client credentials. For information on obtaining credentials, see + [Credentials + Management](https://dev.bandwidth.com/docs/account/credentials/management/). + flows: + clientCredentials: + tokenUrl: https://api.bandwidth.com/api/v1/oauth2/token + scopes: {} diff --git a/custom_templates/Configuration.mustache b/custom_templates/Configuration.mustache index 96269031..bfbec30e 100644 --- a/custom_templates/Configuration.mustache +++ b/custom_templates/Configuration.mustache @@ -102,20 +102,6 @@ class Configuration */ protected string $booleanFormatForQueryString = self::BOOLEAN_FORMAT_INT; - /** - * Username for HTTP basic authentication - * - * @var string - */ - protected string $username = ''; - - /** - * Password for HTTP basic authentication - * - * @var string - */ - protected string $password = ''; - /** * The host * @@ -390,52 +376,6 @@ class Configuration return $this->booleanFormatForQueryString; } - /** - * Sets the username for HTTP basic authentication - * - * @param string $username Username for HTTP basic authentication - * - * @return $this - */ - public function setUsername(string $username): static - { - $this->username = $username; - return $this; - } - - /** - * Gets the username for HTTP basic authentication - * - * @return string Username for HTTP basic authentication - */ - public function getUsername(): string - { - return $this->username; - } - - /** - * Sets the password for HTTP basic authentication - * - * @param string $password Password for HTTP basic authentication - * - * @return $this - */ - public function setPassword(string $password): static - { - $this->password = $password; - return $this; - } - - /** - * Gets the password for HTTP basic authentication - * - * @return string Password for HTTP basic authentication - */ - public function getPassword(): string - { - return $this->password; - } - /** * Sets the host * diff --git a/custom_templates/README.mustache b/custom_templates/README.mustache index c90c8498..d6dd5308 100644 --- a/custom_templates/README.mustache +++ b/custom_templates/README.mustache @@ -40,7 +40,10 @@ Please follow the [installation procedure](#installation--usage) and then run th require_once(__DIR__ . '/vendor/autoload.php'); {{#apiInfo}}{{#apis}}{{#-first}}{{#operations}}{{#operation}}{{#-first}} -{{> php_doc_auth_partial}} +// Configure OAuth2 client credentials; access tokens are fetched and refreshed automatically +$config = {{{invokerPackage}}}\Configuration::getDefaultConfiguration() + ->setClientId('YOUR_CLIENT_ID') + ->setClientSecret('YOUR_CLIENT_SECRET'); $apiInstance = new {{invokerPackage}}\Api\{{classname}}( // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. diff --git a/docs/Api/CallsApi.md b/docs/Api/CallsApi.md index b96b9fe6..ccf3c4fb 100644 --- a/docs/Api/CallsApi.md +++ b/docs/Api/CallsApi.md @@ -29,11 +29,6 @@ Creates an outbound phone call. All calls are initially queued. Your outbound c require_once(__DIR__ . '/vendor/autoload.php'); -// Configure HTTP basic authorization: Basic -$config = Bandwidth\Configuration::getDefaultConfiguration() - ->setUsername('YOUR_USERNAME') - ->setPassword('YOUR_PASSWORD'); - // Configure OAuth2 access token for authorization: OAuth2 $config = Bandwidth\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); @@ -74,7 +69,7 @@ try { ### Authorization -[Basic](../../README.md#Basic), [OAuth2](../../README.md#OAuth2) +[OAuth2](../../README.md#OAuth2) ### HTTP request headers @@ -103,11 +98,6 @@ Retrieve the current state of a specific call. This information is near-realtime require_once(__DIR__ . '/vendor/autoload.php'); -// Configure HTTP basic authorization: Basic -$config = Bandwidth\Configuration::getDefaultConfiguration() - ->setUsername('YOUR_USERNAME') - ->setPassword('YOUR_PASSWORD'); - // Configure OAuth2 access token for authorization: OAuth2 $config = Bandwidth\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); @@ -148,7 +138,7 @@ try { ### Authorization -[Basic](../../README.md#Basic), [OAuth2](../../README.md#OAuth2) +[OAuth2](../../README.md#OAuth2) ### HTTP request headers @@ -177,11 +167,6 @@ Returns a max of 10000 calls, sorted by `createdTime` from oldest to newest. ** require_once(__DIR__ . '/vendor/autoload.php'); -// Configure HTTP basic authorization: Basic -$config = Bandwidth\Configuration::getDefaultConfiguration() - ->setUsername('YOUR_USERNAME') - ->setPassword('YOUR_PASSWORD'); - // Configure OAuth2 access token for authorization: OAuth2 $config = Bandwidth\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); @@ -234,7 +219,7 @@ try { ### Authorization -[Basic](../../README.md#Basic), [OAuth2](../../README.md#OAuth2) +[OAuth2](../../README.md#OAuth2) ### HTTP request headers @@ -263,11 +248,6 @@ Interrupts and redirects a call to a different URL that should return a BXML doc require_once(__DIR__ . '/vendor/autoload.php'); -// Configure HTTP basic authorization: Basic -$config = Bandwidth\Configuration::getDefaultConfiguration() - ->setUsername('YOUR_USERNAME') - ->setPassword('YOUR_PASSWORD'); - // Configure OAuth2 access token for authorization: OAuth2 $config = Bandwidth\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); @@ -309,7 +289,7 @@ void (empty response body) ### Authorization -[Basic](../../README.md#Basic), [OAuth2](../../README.md#OAuth2) +[OAuth2](../../README.md#OAuth2) ### HTTP request headers @@ -338,11 +318,6 @@ Interrupts and replaces an active call's BXML document. require_once(__DIR__ . '/vendor/autoload.php'); -// Configure HTTP basic authorization: Basic -$config = Bandwidth\Configuration::getDefaultConfiguration() - ->setUsername('YOUR_USERNAME') - ->setPassword('YOUR_PASSWORD'); - // Configure OAuth2 access token for authorization: OAuth2 $config = Bandwidth\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); @@ -387,7 +362,7 @@ void (empty response body) ### Authorization -[Basic](../../README.md#Basic), [OAuth2](../../README.md#OAuth2) +[OAuth2](../../README.md#OAuth2) ### HTTP request headers diff --git a/docs/Api/ConferencesApi.md b/docs/Api/ConferencesApi.md index 1d182bdd..d97f0ed1 100644 --- a/docs/Api/ConferencesApi.md +++ b/docs/Api/ConferencesApi.md @@ -33,11 +33,6 @@ Downloads the specified recording file. require_once(__DIR__ . '/vendor/autoload.php'); -// Configure HTTP basic authorization: Basic -$config = Bandwidth\Configuration::getDefaultConfiguration() - ->setUsername('YOUR_USERNAME') - ->setPassword('YOUR_PASSWORD'); - // Configure OAuth2 access token for authorization: OAuth2 $config = Bandwidth\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); @@ -80,7 +75,7 @@ try { ### Authorization -[Basic](../../README.md#Basic), [OAuth2](../../README.md#OAuth2) +[OAuth2](../../README.md#OAuth2) ### HTTP request headers @@ -109,11 +104,6 @@ Returns information about the specified conference. require_once(__DIR__ . '/vendor/autoload.php'); -// Configure HTTP basic authorization: Basic -$config = Bandwidth\Configuration::getDefaultConfiguration() - ->setUsername('YOUR_USERNAME') - ->setPassword('YOUR_PASSWORD'); - // Configure OAuth2 access token for authorization: OAuth2 $config = Bandwidth\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); @@ -154,7 +144,7 @@ try { ### Authorization -[Basic](../../README.md#Basic), [OAuth2](../../README.md#OAuth2) +[OAuth2](../../README.md#OAuth2) ### HTTP request headers @@ -183,11 +173,6 @@ Returns information about the specified conference member. require_once(__DIR__ . '/vendor/autoload.php'); -// Configure HTTP basic authorization: Basic -$config = Bandwidth\Configuration::getDefaultConfiguration() - ->setUsername('YOUR_USERNAME') - ->setPassword('YOUR_PASSWORD'); - // Configure OAuth2 access token for authorization: OAuth2 $config = Bandwidth\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); @@ -230,7 +215,7 @@ try { ### Authorization -[Basic](../../README.md#Basic), [OAuth2](../../README.md#OAuth2) +[OAuth2](../../README.md#OAuth2) ### HTTP request headers @@ -259,11 +244,6 @@ Returns metadata for the specified recording. require_once(__DIR__ . '/vendor/autoload.php'); -// Configure HTTP basic authorization: Basic -$config = Bandwidth\Configuration::getDefaultConfiguration() - ->setUsername('YOUR_USERNAME') - ->setPassword('YOUR_PASSWORD'); - // Configure OAuth2 access token for authorization: OAuth2 $config = Bandwidth\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); @@ -306,7 +286,7 @@ try { ### Authorization -[Basic](../../README.md#Basic), [OAuth2](../../README.md#OAuth2) +[OAuth2](../../README.md#OAuth2) ### HTTP request headers @@ -335,11 +315,6 @@ Returns a (potentially empty) list of metadata for the recordings that took plac require_once(__DIR__ . '/vendor/autoload.php'); -// Configure HTTP basic authorization: Basic -$config = Bandwidth\Configuration::getDefaultConfiguration() - ->setUsername('YOUR_USERNAME') - ->setPassword('YOUR_PASSWORD'); - // Configure OAuth2 access token for authorization: OAuth2 $config = Bandwidth\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); @@ -380,7 +355,7 @@ try { ### Authorization -[Basic](../../README.md#Basic), [OAuth2](../../README.md#OAuth2) +[OAuth2](../../README.md#OAuth2) ### HTTP request headers @@ -409,11 +384,6 @@ Returns a max of 1000 conferences, sorted by `createdTime` from oldest to newest require_once(__DIR__ . '/vendor/autoload.php'); -// Configure HTTP basic authorization: Basic -$config = Bandwidth\Configuration::getDefaultConfiguration() - ->setUsername('YOUR_USERNAME') - ->setPassword('YOUR_PASSWORD'); - // Configure OAuth2 access token for authorization: OAuth2 $config = Bandwidth\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); @@ -462,7 +432,7 @@ try { ### Authorization -[Basic](../../README.md#Basic), [OAuth2](../../README.md#OAuth2) +[OAuth2](../../README.md#OAuth2) ### HTTP request headers @@ -491,11 +461,6 @@ Update the conference state. require_once(__DIR__ . '/vendor/autoload.php'); -// Configure HTTP basic authorization: Basic -$config = Bandwidth\Configuration::getDefaultConfiguration() - ->setUsername('YOUR_USERNAME') - ->setPassword('YOUR_PASSWORD'); - // Configure OAuth2 access token for authorization: OAuth2 $config = Bandwidth\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); @@ -537,7 +502,7 @@ void (empty response body) ### Authorization -[Basic](../../README.md#Basic), [OAuth2](../../README.md#OAuth2) +[OAuth2](../../README.md#OAuth2) ### HTTP request headers @@ -566,11 +531,6 @@ Update the conference BXML document. require_once(__DIR__ . '/vendor/autoload.php'); -// Configure HTTP basic authorization: Basic -$config = Bandwidth\Configuration::getDefaultConfiguration() - ->setUsername('YOUR_USERNAME') - ->setPassword('YOUR_PASSWORD'); - // Configure OAuth2 access token for authorization: OAuth2 $config = Bandwidth\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); @@ -615,7 +575,7 @@ void (empty response body) ### Authorization -[Basic](../../README.md#Basic), [OAuth2](../../README.md#OAuth2) +[OAuth2](../../README.md#OAuth2) ### HTTP request headers @@ -644,11 +604,6 @@ Updates settings for a particular conference member. require_once(__DIR__ . '/vendor/autoload.php'); -// Configure HTTP basic authorization: Basic -$config = Bandwidth\Configuration::getDefaultConfiguration() - ->setUsername('YOUR_USERNAME') - ->setPassword('YOUR_PASSWORD'); - // Configure OAuth2 access token for authorization: OAuth2 $config = Bandwidth\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); @@ -692,7 +647,7 @@ void (empty response body) ### Authorization -[Basic](../../README.md#Basic), [OAuth2](../../README.md#OAuth2) +[OAuth2](../../README.md#OAuth2) ### HTTP request headers diff --git a/docs/Api/EndpointsApi.md b/docs/Api/EndpointsApi.md index fe416f95..04cab71a 100644 --- a/docs/Api/EndpointsApi.md +++ b/docs/Api/EndpointsApi.md @@ -29,11 +29,6 @@ Creates a new Endpoint for the specified account. require_once(__DIR__ . '/vendor/autoload.php'); -// Configure HTTP basic authorization: Basic -$config = Bandwidth\Configuration::getDefaultConfiguration() - ->setUsername('YOUR_USERNAME') - ->setPassword('YOUR_PASSWORD'); - // Configure OAuth2 access token for authorization: OAuth2 $config = Bandwidth\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); @@ -74,7 +69,7 @@ try { ### Authorization -[Basic](../../README.md#Basic), [OAuth2](../../README.md#OAuth2) +[OAuth2](../../README.md#OAuth2) ### HTTP request headers @@ -103,11 +98,6 @@ Deletes the specified endpoint. If the endpoint is actively streaming media, the require_once(__DIR__ . '/vendor/autoload.php'); -// Configure HTTP basic authorization: Basic -$config = Bandwidth\Configuration::getDefaultConfiguration() - ->setUsername('YOUR_USERNAME') - ->setPassword('YOUR_PASSWORD'); - // Configure OAuth2 access token for authorization: OAuth2 $config = Bandwidth\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); @@ -147,7 +137,7 @@ void (empty response body) ### Authorization -[Basic](../../README.md#Basic), [OAuth2](../../README.md#OAuth2) +[OAuth2](../../README.md#OAuth2) ### HTTP request headers @@ -176,11 +166,6 @@ Returns information about the specified endpoint. require_once(__DIR__ . '/vendor/autoload.php'); -// Configure HTTP basic authorization: Basic -$config = Bandwidth\Configuration::getDefaultConfiguration() - ->setUsername('YOUR_USERNAME') - ->setPassword('YOUR_PASSWORD'); - // Configure OAuth2 access token for authorization: OAuth2 $config = Bandwidth\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); @@ -221,7 +206,7 @@ try { ### Authorization -[Basic](../../README.md#Basic), [OAuth2](../../README.md#OAuth2) +[OAuth2](../../README.md#OAuth2) ### HTTP request headers @@ -250,11 +235,6 @@ Returns a list of endpoints associated with the specified account. require_once(__DIR__ . '/vendor/autoload.php'); -// Configure HTTP basic authorization: Basic -$config = Bandwidth\Configuration::getDefaultConfiguration() - ->setUsername('YOUR_USERNAME') - ->setPassword('YOUR_PASSWORD'); - // Configure OAuth2 access token for authorization: OAuth2 $config = Bandwidth\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); @@ -301,7 +281,7 @@ try { ### Authorization -[Basic](../../README.md#Basic), [OAuth2](../../README.md#OAuth2) +[OAuth2](../../README.md#OAuth2) ### HTTP request headers @@ -330,11 +310,6 @@ Updates the BXML for the specified endpoint. require_once(__DIR__ . '/vendor/autoload.php'); -// Configure HTTP basic authorization: Basic -$config = Bandwidth\Configuration::getDefaultConfiguration() - ->setUsername('YOUR_USERNAME') - ->setPassword('YOUR_PASSWORD'); - // Configure OAuth2 access token for authorization: OAuth2 $config = Bandwidth\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); @@ -376,7 +351,7 @@ void (empty response body) ### Authorization -[Basic](../../README.md#Basic), [OAuth2](../../README.md#OAuth2) +[OAuth2](../../README.md#OAuth2) ### HTTP request headers diff --git a/docs/Api/MFAApi.md b/docs/Api/MFAApi.md index 1f4196c3..e64fd8da 100644 --- a/docs/Api/MFAApi.md +++ b/docs/Api/MFAApi.md @@ -27,11 +27,6 @@ Send an MFA code via text message (SMS). require_once(__DIR__ . '/vendor/autoload.php'); -// Configure HTTP basic authorization: Basic -$config = Bandwidth\Configuration::getDefaultConfiguration() - ->setUsername('YOUR_USERNAME') - ->setPassword('YOUR_PASSWORD'); - // Configure OAuth2 access token for authorization: OAuth2 $config = Bandwidth\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); @@ -72,7 +67,7 @@ try { ### Authorization -[Basic](../../README.md#Basic), [OAuth2](../../README.md#OAuth2) +[OAuth2](../../README.md#OAuth2) ### HTTP request headers @@ -101,11 +96,6 @@ Send an MFA Code via a phone call. require_once(__DIR__ . '/vendor/autoload.php'); -// Configure HTTP basic authorization: Basic -$config = Bandwidth\Configuration::getDefaultConfiguration() - ->setUsername('YOUR_USERNAME') - ->setPassword('YOUR_PASSWORD'); - // Configure OAuth2 access token for authorization: OAuth2 $config = Bandwidth\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); @@ -146,7 +136,7 @@ try { ### Authorization -[Basic](../../README.md#Basic), [OAuth2](../../README.md#OAuth2) +[OAuth2](../../README.md#OAuth2) ### HTTP request headers @@ -175,11 +165,6 @@ Verify a previously sent MFA code. require_once(__DIR__ . '/vendor/autoload.php'); -// Configure HTTP basic authorization: Basic -$config = Bandwidth\Configuration::getDefaultConfiguration() - ->setUsername('YOUR_USERNAME') - ->setPassword('YOUR_PASSWORD'); - // Configure OAuth2 access token for authorization: OAuth2 $config = Bandwidth\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); @@ -220,7 +205,7 @@ try { ### Authorization -[Basic](../../README.md#Basic), [OAuth2](../../README.md#OAuth2) +[OAuth2](../../README.md#OAuth2) ### HTTP request headers diff --git a/docs/Api/MediaApi.md b/docs/Api/MediaApi.md index af3e40f7..ef715c2d 100644 --- a/docs/Api/MediaApi.md +++ b/docs/Api/MediaApi.md @@ -28,11 +28,6 @@ Deletes a media file from Bandwidth API server. Make sure you don't have any app require_once(__DIR__ . '/vendor/autoload.php'); -// Configure HTTP basic authorization: Basic -$config = Bandwidth\Configuration::getDefaultConfiguration() - ->setUsername('YOUR_USERNAME') - ->setPassword('YOUR_PASSWORD'); - // Configure OAuth2 access token for authorization: OAuth2 $config = Bandwidth\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); @@ -72,7 +67,7 @@ void (empty response body) ### Authorization -[Basic](../../README.md#Basic), [OAuth2](../../README.md#OAuth2) +[OAuth2](../../README.md#OAuth2) ### HTTP request headers @@ -101,11 +96,6 @@ Downloads a media file you previously uploaded. require_once(__DIR__ . '/vendor/autoload.php'); -// Configure HTTP basic authorization: Basic -$config = Bandwidth\Configuration::getDefaultConfiguration() - ->setUsername('YOUR_USERNAME') - ->setPassword('YOUR_PASSWORD'); - // Configure OAuth2 access token for authorization: OAuth2 $config = Bandwidth\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); @@ -146,7 +136,7 @@ try { ### Authorization -[Basic](../../README.md#Basic), [OAuth2](../../README.md#OAuth2) +[OAuth2](../../README.md#OAuth2) ### HTTP request headers @@ -175,11 +165,6 @@ Gets a list of your media files. No query parameters are supported. require_once(__DIR__ . '/vendor/autoload.php'); -// Configure HTTP basic authorization: Basic -$config = Bandwidth\Configuration::getDefaultConfiguration() - ->setUsername('YOUR_USERNAME') - ->setPassword('YOUR_PASSWORD'); - // Configure OAuth2 access token for authorization: OAuth2 $config = Bandwidth\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); @@ -220,7 +205,7 @@ try { ### Authorization -[Basic](../../README.md#Basic), [OAuth2](../../README.md#OAuth2) +[OAuth2](../../README.md#OAuth2) ### HTTP request headers @@ -249,11 +234,6 @@ Upload a file. Filename should always be unique. Reusing filenames may result i require_once(__DIR__ . '/vendor/autoload.php'); -// Configure HTTP basic authorization: Basic -$config = Bandwidth\Configuration::getDefaultConfiguration() - ->setUsername('YOUR_USERNAME') - ->setPassword('YOUR_PASSWORD'); - // Configure OAuth2 access token for authorization: OAuth2 $config = Bandwidth\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); @@ -299,7 +279,7 @@ void (empty response body) ### Authorization -[Basic](../../README.md#Basic), [OAuth2](../../README.md#OAuth2) +[OAuth2](../../README.md#OAuth2) ### HTTP request headers diff --git a/docs/Api/MessagesApi.md b/docs/Api/MessagesApi.md index b0b0e427..a8082ea2 100644 --- a/docs/Api/MessagesApi.md +++ b/docs/Api/MessagesApi.md @@ -26,11 +26,6 @@ Endpoint for sending text messages and picture messages using V2 messaging. require_once(__DIR__ . '/vendor/autoload.php'); -// Configure HTTP basic authorization: Basic -$config = Bandwidth\Configuration::getDefaultConfiguration() - ->setUsername('YOUR_USERNAME') - ->setPassword('YOUR_PASSWORD'); - // Configure OAuth2 access token for authorization: OAuth2 $config = Bandwidth\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); @@ -71,7 +66,7 @@ try { ### Authorization -[Basic](../../README.md#Basic), [OAuth2](../../README.md#OAuth2) +[OAuth2](../../README.md#OAuth2) ### HTTP request headers @@ -100,11 +95,6 @@ Returns a list of messages based on query parameters. **Rate Limit:** This endp require_once(__DIR__ . '/vendor/autoload.php'); -// Configure HTTP basic authorization: Basic -$config = Bandwidth\Configuration::getDefaultConfiguration() - ->setUsername('YOUR_USERNAME') - ->setPassword('YOUR_PASSWORD'); - // Configure OAuth2 access token for authorization: OAuth2 $config = Bandwidth\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); @@ -197,7 +187,7 @@ try { ### Authorization -[Basic](../../README.md#Basic), [OAuth2](../../README.md#OAuth2) +[OAuth2](../../README.md#OAuth2) ### HTTP request headers diff --git a/docs/Api/MultiChannelApi.md b/docs/Api/MultiChannelApi.md index 180109b8..7db35ce9 100644 --- a/docs/Api/MultiChannelApi.md +++ b/docs/Api/MultiChannelApi.md @@ -25,11 +25,6 @@ Endpoint for sending Multi-Channel messages. require_once(__DIR__ . '/vendor/autoload.php'); -// Configure HTTP basic authorization: Basic -$config = Bandwidth\Configuration::getDefaultConfiguration() - ->setUsername('YOUR_USERNAME') - ->setPassword('YOUR_PASSWORD'); - // Configure OAuth2 access token for authorization: OAuth2 $config = Bandwidth\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); @@ -70,7 +65,7 @@ try { ### Authorization -[Basic](../../README.md#Basic), [OAuth2](../../README.md#OAuth2) +[OAuth2](../../README.md#OAuth2) ### HTTP request headers diff --git a/docs/Api/PhoneNumberLookupApi.md b/docs/Api/PhoneNumberLookupApi.md index 5eb609c1..f3b77ceb 100644 --- a/docs/Api/PhoneNumberLookupApi.md +++ b/docs/Api/PhoneNumberLookupApi.md @@ -27,11 +27,6 @@ Creates an asynchronous bulk phone number lookup request. Maximum of 15,000 tele require_once(__DIR__ . '/vendor/autoload.php'); -// Configure HTTP basic authorization: Basic -$config = Bandwidth\Configuration::getDefaultConfiguration() - ->setUsername('YOUR_USERNAME') - ->setPassword('YOUR_PASSWORD'); - // Configure OAuth2 access token for authorization: OAuth2 $config = Bandwidth\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); @@ -72,7 +67,7 @@ try { ### Authorization -[Basic](../../README.md#Basic), [OAuth2](../../README.md#OAuth2) +[OAuth2](../../README.md#OAuth2) ### HTTP request headers @@ -101,11 +96,6 @@ Creates a synchronous phone number lookup request. Maximum of 100 telephone numb require_once(__DIR__ . '/vendor/autoload.php'); -// Configure HTTP basic authorization: Basic -$config = Bandwidth\Configuration::getDefaultConfiguration() - ->setUsername('YOUR_USERNAME') - ->setPassword('YOUR_PASSWORD'); - // Configure OAuth2 access token for authorization: OAuth2 $config = Bandwidth\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); @@ -146,7 +136,7 @@ try { ### Authorization -[Basic](../../README.md#Basic), [OAuth2](../../README.md#OAuth2) +[OAuth2](../../README.md#OAuth2) ### HTTP request headers @@ -175,11 +165,6 @@ Get an existing [Asynchronous Bulk Number Lookup](#tag/Phone-Number-Lookup/opera require_once(__DIR__ . '/vendor/autoload.php'); -// Configure HTTP basic authorization: Basic -$config = Bandwidth\Configuration::getDefaultConfiguration() - ->setUsername('YOUR_USERNAME') - ->setPassword('YOUR_PASSWORD'); - // Configure OAuth2 access token for authorization: OAuth2 $config = Bandwidth\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); @@ -220,7 +205,7 @@ try { ### Authorization -[Basic](../../README.md#Basic), [OAuth2](../../README.md#OAuth2) +[OAuth2](../../README.md#OAuth2) ### HTTP request headers diff --git a/docs/Api/RecordingsApi.md b/docs/Api/RecordingsApi.md index 7a6a4b4f..1f42b5fc 100644 --- a/docs/Api/RecordingsApi.md +++ b/docs/Api/RecordingsApi.md @@ -34,11 +34,6 @@ Delete the recording information, media and transcription. Note: After the dele require_once(__DIR__ . '/vendor/autoload.php'); -// Configure HTTP basic authorization: Basic -$config = Bandwidth\Configuration::getDefaultConfiguration() - ->setUsername('YOUR_USERNAME') - ->setPassword('YOUR_PASSWORD'); - // Configure OAuth2 access token for authorization: OAuth2 $config = Bandwidth\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); @@ -80,7 +75,7 @@ void (empty response body) ### Authorization -[Basic](../../README.md#Basic), [OAuth2](../../README.md#OAuth2) +[OAuth2](../../README.md#OAuth2) ### HTTP request headers @@ -109,11 +104,6 @@ Deletes the specified recording's media. require_once(__DIR__ . '/vendor/autoload.php'); -// Configure HTTP basic authorization: Basic -$config = Bandwidth\Configuration::getDefaultConfiguration() - ->setUsername('YOUR_USERNAME') - ->setPassword('YOUR_PASSWORD'); - // Configure OAuth2 access token for authorization: OAuth2 $config = Bandwidth\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); @@ -155,7 +145,7 @@ void (empty response body) ### Authorization -[Basic](../../README.md#Basic), [OAuth2](../../README.md#OAuth2) +[OAuth2](../../README.md#OAuth2) ### HTTP request headers @@ -184,11 +174,6 @@ Deletes the specified recording's transcription. Note: After the deletion is re require_once(__DIR__ . '/vendor/autoload.php'); -// Configure HTTP basic authorization: Basic -$config = Bandwidth\Configuration::getDefaultConfiguration() - ->setUsername('YOUR_USERNAME') - ->setPassword('YOUR_PASSWORD'); - // Configure OAuth2 access token for authorization: OAuth2 $config = Bandwidth\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); @@ -230,7 +215,7 @@ void (empty response body) ### Authorization -[Basic](../../README.md#Basic), [OAuth2](../../README.md#OAuth2) +[OAuth2](../../README.md#OAuth2) ### HTTP request headers @@ -259,11 +244,6 @@ Downloads the specified recording. require_once(__DIR__ . '/vendor/autoload.php'); -// Configure HTTP basic authorization: Basic -$config = Bandwidth\Configuration::getDefaultConfiguration() - ->setUsername('YOUR_USERNAME') - ->setPassword('YOUR_PASSWORD'); - // Configure OAuth2 access token for authorization: OAuth2 $config = Bandwidth\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); @@ -306,7 +286,7 @@ try { ### Authorization -[Basic](../../README.md#Basic), [OAuth2](../../README.md#OAuth2) +[OAuth2](../../README.md#OAuth2) ### HTTP request headers @@ -335,11 +315,6 @@ Returns metadata for the specified recording. require_once(__DIR__ . '/vendor/autoload.php'); -// Configure HTTP basic authorization: Basic -$config = Bandwidth\Configuration::getDefaultConfiguration() - ->setUsername('YOUR_USERNAME') - ->setPassword('YOUR_PASSWORD'); - // Configure OAuth2 access token for authorization: OAuth2 $config = Bandwidth\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); @@ -382,7 +357,7 @@ try { ### Authorization -[Basic](../../README.md#Basic), [OAuth2](../../README.md#OAuth2) +[OAuth2](../../README.md#OAuth2) ### HTTP request headers @@ -411,11 +386,6 @@ Downloads the specified transcription. If the recording was multi-channel, then require_once(__DIR__ . '/vendor/autoload.php'); -// Configure HTTP basic authorization: Basic -$config = Bandwidth\Configuration::getDefaultConfiguration() - ->setUsername('YOUR_USERNAME') - ->setPassword('YOUR_PASSWORD'); - // Configure OAuth2 access token for authorization: OAuth2 $config = Bandwidth\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); @@ -458,7 +428,7 @@ try { ### Authorization -[Basic](../../README.md#Basic), [OAuth2](../../README.md#OAuth2) +[OAuth2](../../README.md#OAuth2) ### HTTP request headers @@ -487,11 +457,6 @@ Returns a list of metadata for the recordings associated with the specified acco require_once(__DIR__ . '/vendor/autoload.php'); -// Configure HTTP basic authorization: Basic -$config = Bandwidth\Configuration::getDefaultConfiguration() - ->setUsername('YOUR_USERNAME') - ->setPassword('YOUR_PASSWORD'); - // Configure OAuth2 access token for authorization: OAuth2 $config = Bandwidth\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); @@ -538,7 +503,7 @@ try { ### Authorization -[Basic](../../README.md#Basic), [OAuth2](../../README.md#OAuth2) +[OAuth2](../../README.md#OAuth2) ### HTTP request headers @@ -567,11 +532,6 @@ Returns a (potentially empty) list of metadata for the recordings that took plac require_once(__DIR__ . '/vendor/autoload.php'); -// Configure HTTP basic authorization: Basic -$config = Bandwidth\Configuration::getDefaultConfiguration() - ->setUsername('YOUR_USERNAME') - ->setPassword('YOUR_PASSWORD'); - // Configure OAuth2 access token for authorization: OAuth2 $config = Bandwidth\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); @@ -612,7 +572,7 @@ try { ### Authorization -[Basic](../../README.md#Basic), [OAuth2](../../README.md#OAuth2) +[OAuth2](../../README.md#OAuth2) ### HTTP request headers @@ -641,11 +601,6 @@ Generate the transcription for a specific recording. Transcription can succeed o require_once(__DIR__ . '/vendor/autoload.php'); -// Configure HTTP basic authorization: Basic -$config = Bandwidth\Configuration::getDefaultConfiguration() - ->setUsername('YOUR_USERNAME') - ->setPassword('YOUR_PASSWORD'); - // Configure OAuth2 access token for authorization: OAuth2 $config = Bandwidth\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); @@ -689,7 +644,7 @@ void (empty response body) ### Authorization -[Basic](../../README.md#Basic), [OAuth2](../../README.md#OAuth2) +[OAuth2](../../README.md#OAuth2) ### HTTP request headers @@ -718,11 +673,6 @@ Pause or resume a recording on an active phone call. require_once(__DIR__ . '/vendor/autoload.php'); -// Configure HTTP basic authorization: Basic -$config = Bandwidth\Configuration::getDefaultConfiguration() - ->setUsername('YOUR_USERNAME') - ->setPassword('YOUR_PASSWORD'); - // Configure OAuth2 access token for authorization: OAuth2 $config = Bandwidth\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); @@ -764,7 +714,7 @@ void (empty response body) ### Authorization -[Basic](../../README.md#Basic), [OAuth2](../../README.md#OAuth2) +[OAuth2](../../README.md#OAuth2) ### HTTP request headers diff --git a/docs/Api/StatisticsApi.md b/docs/Api/StatisticsApi.md index 91dab58d..23a537cd 100644 --- a/docs/Api/StatisticsApi.md +++ b/docs/Api/StatisticsApi.md @@ -25,11 +25,6 @@ Returns details about the current state of the account. require_once(__DIR__ . '/vendor/autoload.php'); -// Configure HTTP basic authorization: Basic -$config = Bandwidth\Configuration::getDefaultConfiguration() - ->setUsername('YOUR_USERNAME') - ->setPassword('YOUR_PASSWORD'); - // Configure OAuth2 access token for authorization: OAuth2 $config = Bandwidth\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); @@ -68,7 +63,7 @@ try { ### Authorization -[Basic](../../README.md#Basic), [OAuth2](../../README.md#OAuth2) +[OAuth2](../../README.md#OAuth2) ### HTTP request headers diff --git a/docs/Api/TollFreeVerificationApi.md b/docs/Api/TollFreeVerificationApi.md index f433558d..3bd9066d 100644 --- a/docs/Api/TollFreeVerificationApi.md +++ b/docs/Api/TollFreeVerificationApi.md @@ -33,11 +33,6 @@ Create a new webhook subscription (this webhook will be called for every update require_once(__DIR__ . '/vendor/autoload.php'); -// Configure HTTP basic authorization: Basic -$config = Bandwidth\Configuration::getDefaultConfiguration() - ->setUsername('YOUR_USERNAME') - ->setPassword('YOUR_PASSWORD'); - // Configure OAuth2 access token for authorization: OAuth2 $config = Bandwidth\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); @@ -78,7 +73,7 @@ try { ### Authorization -[Basic](../../README.md#Basic), [OAuth2](../../README.md#OAuth2) +[OAuth2](../../README.md#OAuth2) ### HTTP request headers @@ -107,11 +102,6 @@ Delete a toll-free verification submission for a toll-free number. **Upcoming c require_once(__DIR__ . '/vendor/autoload.php'); -// Configure HTTP basic authorization: Basic -$config = Bandwidth\Configuration::getDefaultConfiguration() - ->setUsername('YOUR_USERNAME') - ->setPassword('YOUR_PASSWORD'); - // Configure OAuth2 access token for authorization: OAuth2 $config = Bandwidth\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); @@ -151,7 +141,7 @@ void (empty response body) ### Authorization -[Basic](../../README.md#Basic), [OAuth2](../../README.md#OAuth2) +[OAuth2](../../README.md#OAuth2) ### HTTP request headers @@ -180,11 +170,6 @@ Delete a webhook subscription by ID. require_once(__DIR__ . '/vendor/autoload.php'); -// Configure HTTP basic authorization: Basic -$config = Bandwidth\Configuration::getDefaultConfiguration() - ->setUsername('YOUR_USERNAME') - ->setPassword('YOUR_PASSWORD'); - // Configure OAuth2 access token for authorization: OAuth2 $config = Bandwidth\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); @@ -224,7 +209,7 @@ void (empty response body) ### Authorization -[Basic](../../README.md#Basic), [OAuth2](../../README.md#OAuth2) +[OAuth2](../../README.md#OAuth2) ### HTTP request headers @@ -253,11 +238,6 @@ Gets the verification status for a phone number that is provisioned to your acco require_once(__DIR__ . '/vendor/autoload.php'); -// Configure HTTP basic authorization: Basic -$config = Bandwidth\Configuration::getDefaultConfiguration() - ->setUsername('YOUR_USERNAME') - ->setPassword('YOUR_PASSWORD'); - // Configure OAuth2 access token for authorization: OAuth2 $config = Bandwidth\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); @@ -298,7 +278,7 @@ try { ### Authorization -[Basic](../../README.md#Basic), [OAuth2](../../README.md#OAuth2) +[OAuth2](../../README.md#OAuth2) ### HTTP request headers @@ -327,11 +307,6 @@ Lists valid toll-free use cases. require_once(__DIR__ . '/vendor/autoload.php'); -// Configure HTTP basic authorization: Basic -$config = Bandwidth\Configuration::getDefaultConfiguration() - ->setUsername('YOUR_USERNAME') - ->setPassword('YOUR_PASSWORD'); - // Configure OAuth2 access token for authorization: OAuth2 $config = Bandwidth\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); @@ -367,7 +342,7 @@ This endpoint does not need any parameter. ### Authorization -[Basic](../../README.md#Basic), [OAuth2](../../README.md#OAuth2) +[OAuth2](../../README.md#OAuth2) ### HTTP request headers @@ -396,11 +371,6 @@ Lists all webhook subscriptions that are registered to receive status updates fo require_once(__DIR__ . '/vendor/autoload.php'); -// Configure HTTP basic authorization: Basic -$config = Bandwidth\Configuration::getDefaultConfiguration() - ->setUsername('YOUR_USERNAME') - ->setPassword('YOUR_PASSWORD'); - // Configure OAuth2 access token for authorization: OAuth2 $config = Bandwidth\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); @@ -439,7 +409,7 @@ try { ### Authorization -[Basic](../../README.md#Basic), [OAuth2](../../README.md#OAuth2) +[OAuth2](../../README.md#OAuth2) ### HTTP request headers @@ -468,11 +438,6 @@ Submit a request for verification of a toll-free phone number. **Upcoming chang require_once(__DIR__ . '/vendor/autoload.php'); -// Configure HTTP basic authorization: Basic -$config = Bandwidth\Configuration::getDefaultConfiguration() - ->setUsername('YOUR_USERNAME') - ->setPassword('YOUR_PASSWORD'); - // Configure OAuth2 access token for authorization: OAuth2 $config = Bandwidth\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); @@ -512,7 +477,7 @@ void (empty response body) ### Authorization -[Basic](../../README.md#Basic), [OAuth2](../../README.md#OAuth2) +[OAuth2](../../README.md#OAuth2) ### HTTP request headers @@ -541,11 +506,6 @@ Updates a toll-free verification request. Submissions are only eligible for resu require_once(__DIR__ . '/vendor/autoload.php'); -// Configure HTTP basic authorization: Basic -$config = Bandwidth\Configuration::getDefaultConfiguration() - ->setUsername('YOUR_USERNAME') - ->setPassword('YOUR_PASSWORD'); - // Configure OAuth2 access token for authorization: OAuth2 $config = Bandwidth\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); @@ -587,7 +547,7 @@ void (empty response body) ### Authorization -[Basic](../../README.md#Basic), [OAuth2](../../README.md#OAuth2) +[OAuth2](../../README.md#OAuth2) ### HTTP request headers @@ -616,11 +576,6 @@ Update an existing webhook subscription (`callbackUrl` and `basicAuthentication` require_once(__DIR__ . '/vendor/autoload.php'); -// Configure HTTP basic authorization: Basic -$config = Bandwidth\Configuration::getDefaultConfiguration() - ->setUsername('YOUR_USERNAME') - ->setPassword('YOUR_PASSWORD'); - // Configure OAuth2 access token for authorization: OAuth2 $config = Bandwidth\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); @@ -663,7 +618,7 @@ try { ### Authorization -[Basic](../../README.md#Basic), [OAuth2](../../README.md#OAuth2) +[OAuth2](../../README.md#OAuth2) ### HTTP request headers diff --git a/docs/Api/TranscriptionsApi.md b/docs/Api/TranscriptionsApi.md index 0f102389..ffab90f0 100644 --- a/docs/Api/TranscriptionsApi.md +++ b/docs/Api/TranscriptionsApi.md @@ -27,11 +27,6 @@ Delete the specified transcription that was created on this call via [startTrans require_once(__DIR__ . '/vendor/autoload.php'); -// Configure HTTP basic authorization: Basic -$config = Bandwidth\Configuration::getDefaultConfiguration() - ->setUsername('YOUR_USERNAME') - ->setPassword('YOUR_PASSWORD'); - // Configure OAuth2 access token for authorization: OAuth2 $config = Bandwidth\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); @@ -73,7 +68,7 @@ void (empty response body) ### Authorization -[Basic](../../README.md#Basic), [OAuth2](../../README.md#OAuth2) +[OAuth2](../../README.md#OAuth2) ### HTTP request headers @@ -102,11 +97,6 @@ Retrieve the specified transcription that was created on this call via [startTra require_once(__DIR__ . '/vendor/autoload.php'); -// Configure HTTP basic authorization: Basic -$config = Bandwidth\Configuration::getDefaultConfiguration() - ->setUsername('YOUR_USERNAME') - ->setPassword('YOUR_PASSWORD'); - // Configure OAuth2 access token for authorization: OAuth2 $config = Bandwidth\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); @@ -149,7 +139,7 @@ try { ### Authorization -[Basic](../../README.md#Basic), [OAuth2](../../README.md#OAuth2) +[OAuth2](../../README.md#OAuth2) ### HTTP request headers @@ -178,11 +168,6 @@ List the transcriptions created on this call via [startTranscription](/docs/voic require_once(__DIR__ . '/vendor/autoload.php'); -// Configure HTTP basic authorization: Basic -$config = Bandwidth\Configuration::getDefaultConfiguration() - ->setUsername('YOUR_USERNAME') - ->setPassword('YOUR_PASSWORD'); - // Configure OAuth2 access token for authorization: OAuth2 $config = Bandwidth\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); @@ -223,7 +208,7 @@ try { ### Authorization -[Basic](../../README.md#Basic), [OAuth2](../../README.md#OAuth2) +[OAuth2](../../README.md#OAuth2) ### HTTP request headers diff --git a/src/Api/CallsApi.php b/src/Api/CallsApi.php index 9931fd63..42fc7825 100644 --- a/src/Api/CallsApi.php +++ b/src/Api/CallsApi.php @@ -574,11 +574,6 @@ public function createCallRequest( } } - // this endpoint requires HTTP basic authentication - if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { - $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); - } - // this endpoint requires OAuth (access token) if (!empty($this->config->getAccessToken())) { $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); @@ -1040,11 +1035,6 @@ public function getCallStateRequest( ); - // this endpoint requires HTTP basic authentication - if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { - $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); - } - // this endpoint requires OAuth (access token) if (!empty($this->config->getAccessToken())) { $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); @@ -1621,11 +1611,6 @@ public function listCallsRequest( ); - // this endpoint requires HTTP basic authentication - if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { - $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); - } - // this endpoint requires OAuth (access token) if (!empty($this->config->getAccessToken())) { $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); @@ -2057,11 +2042,6 @@ public function updateCallRequest( } } - // this endpoint requires HTTP basic authentication - if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { - $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); - } - // this endpoint requires OAuth (access token) if (!empty($this->config->getAccessToken())) { $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); @@ -2493,11 +2473,6 @@ public function updateCallBxmlRequest( } } - // this endpoint requires HTTP basic authentication - if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { - $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); - } - // this endpoint requires OAuth (access token) if (!empty($this->config->getAccessToken())) { $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); diff --git a/src/Api/ConferencesApi.php b/src/Api/ConferencesApi.php index f0822d7d..5e0807cd 100644 --- a/src/Api/ConferencesApi.php +++ b/src/Api/ConferencesApi.php @@ -578,11 +578,6 @@ public function downloadConferenceRecordingRequest( ); - // this endpoint requires HTTP basic authentication - if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { - $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); - } - // this endpoint requires OAuth (access token) if (!empty($this->config->getAccessToken())) { $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); @@ -1044,11 +1039,6 @@ public function getConferenceRequest( ); - // this endpoint requires HTTP basic authentication - if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { - $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); - } - // this endpoint requires OAuth (access token) if (!empty($this->config->getAccessToken())) { $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); @@ -1534,11 +1524,6 @@ public function getConferenceMemberRequest( ); - // this endpoint requires HTTP basic authentication - if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { - $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); - } - // this endpoint requires OAuth (access token) if (!empty($this->config->getAccessToken())) { $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); @@ -2024,11 +2009,6 @@ public function getConferenceRecordingRequest( ); - // this endpoint requires HTTP basic authentication - if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { - $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); - } - // this endpoint requires OAuth (access token) if (!empty($this->config->getAccessToken())) { $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); @@ -2490,11 +2470,6 @@ public function listConferenceRecordingsRequest( ); - // this endpoint requires HTTP basic authentication - if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { - $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); - } - // this endpoint requires OAuth (access token) if (!empty($this->config->getAccessToken())) { $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); @@ -3033,11 +3008,6 @@ public function listConferencesRequest( ); - // this endpoint requires HTTP basic authentication - if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { - $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); - } - // this endpoint requires OAuth (access token) if (!empty($this->config->getAccessToken())) { $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); @@ -3461,11 +3431,6 @@ public function updateConferenceRequest( } } - // this endpoint requires HTTP basic authentication - if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { - $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); - } - // this endpoint requires OAuth (access token) if (!empty($this->config->getAccessToken())) { $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); @@ -3889,11 +3854,6 @@ public function updateConferenceBxmlRequest( } } - // this endpoint requires HTTP basic authentication - if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { - $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); - } - // this endpoint requires OAuth (access token) if (!empty($this->config->getAccessToken())) { $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); @@ -4341,11 +4301,6 @@ public function updateConferenceMemberRequest( } } - // this endpoint requires HTTP basic authentication - if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { - $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); - } - // this endpoint requires OAuth (access token) if (!empty($this->config->getAccessToken())) { $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); diff --git a/src/Api/EndpointsApi.php b/src/Api/EndpointsApi.php index c0a572d7..ec3bde9c 100644 --- a/src/Api/EndpointsApi.php +++ b/src/Api/EndpointsApi.php @@ -574,11 +574,6 @@ public function createEndpointRequest( } } - // this endpoint requires HTTP basic authentication - if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { - $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); - } - // this endpoint requires OAuth (access token) if (!empty($this->config->getAccessToken())) { $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); @@ -946,11 +941,6 @@ public function deleteEndpointRequest( ); - // this endpoint requires HTTP basic authentication - if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { - $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); - } - // this endpoint requires OAuth (access token) if (!empty($this->config->getAccessToken())) { $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); @@ -1412,11 +1402,6 @@ public function getEndpointRequest( ); - // this endpoint requires HTTP basic authentication - if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { - $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); - } - // this endpoint requires OAuth (access token) if (!empty($this->config->getAccessToken())) { $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); @@ -1936,11 +1921,6 @@ public function listEndpointsRequest( ); - // this endpoint requires HTTP basic authentication - if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { - $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); - } - // this endpoint requires OAuth (access token) if (!empty($this->config->getAccessToken())) { $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); @@ -2364,11 +2344,6 @@ public function updateEndpointBxmlRequest( } } - // this endpoint requires HTTP basic authentication - if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { - $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); - } - // this endpoint requires OAuth (access token) if (!empty($this->config->getAccessToken())) { $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); diff --git a/src/Api/MFAApi.php b/src/Api/MFAApi.php index 9cdefe3f..ca834905 100644 --- a/src/Api/MFAApi.php +++ b/src/Api/MFAApi.php @@ -512,11 +512,6 @@ public function generateMessagingCodeRequest( } } - // this endpoint requires HTTP basic authentication - if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { - $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); - } - // this endpoint requires OAuth (access token) if (!empty($this->config->getAccessToken())) { $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); @@ -954,11 +949,6 @@ public function generateVoiceCodeRequest( } } - // this endpoint requires HTTP basic authentication - if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { - $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); - } - // this endpoint requires OAuth (access token) if (!empty($this->config->getAccessToken())) { $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); @@ -1410,11 +1400,6 @@ public function verifyCodeRequest( } } - // this endpoint requires HTTP basic authentication - if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { - $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); - } - // this endpoint requires OAuth (access token) if (!empty($this->config->getAccessToken())) { $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); diff --git a/src/Api/MediaApi.php b/src/Api/MediaApi.php index d340797a..25860970 100644 --- a/src/Api/MediaApi.php +++ b/src/Api/MediaApi.php @@ -492,11 +492,6 @@ public function deleteMediaRequest( ); - // this endpoint requires HTTP basic authentication - if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { - $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); - } - // this endpoint requires OAuth (access token) if (!empty($this->config->getAccessToken())) { $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); @@ -958,11 +953,6 @@ public function getMediaRequest( ); - // this endpoint requires HTTP basic authentication - if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { - $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); - } - // this endpoint requires OAuth (access token) if (!empty($this->config->getAccessToken())) { $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); @@ -1414,11 +1404,6 @@ public function listMediaRequest( ); - // this endpoint requires HTTP basic authentication - if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { - $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); - } - // this endpoint requires OAuth (access token) if (!empty($this->config->getAccessToken())) { $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); @@ -1870,11 +1855,6 @@ public function uploadMediaRequest( } } - // this endpoint requires HTTP basic authentication - if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { - $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); - } - // this endpoint requires OAuth (access token) if (!empty($this->config->getAccessToken())) { $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); diff --git a/src/Api/MessagesApi.php b/src/Api/MessagesApi.php index 1c0e4bd4..57062ff0 100644 --- a/src/Api/MessagesApi.php +++ b/src/Api/MessagesApi.php @@ -579,11 +579,6 @@ public function createMessageRequest( } } - // this endpoint requires HTTP basic authentication - if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { - $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); - } - // this endpoint requires OAuth (access token) if (!empty($this->config->getAccessToken())) { $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); @@ -1534,11 +1529,6 @@ public function listMessagesRequest( ); - // this endpoint requires HTTP basic authentication - if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { - $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); - } - // this endpoint requires OAuth (access token) if (!empty($this->config->getAccessToken())) { $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); diff --git a/src/Api/MultiChannelApi.php b/src/Api/MultiChannelApi.php index b0e2b103..1b27a231 100644 --- a/src/Api/MultiChannelApi.php +++ b/src/Api/MultiChannelApi.php @@ -562,11 +562,6 @@ public function createMultiChannelMessageRequest( } } - // this endpoint requires HTTP basic authentication - if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { - $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); - } - // this endpoint requires OAuth (access token) if (!empty($this->config->getAccessToken())) { $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); diff --git a/src/Api/PhoneNumberLookupApi.php b/src/Api/PhoneNumberLookupApi.php index a7cd8be9..4ef0ad92 100644 --- a/src/Api/PhoneNumberLookupApi.php +++ b/src/Api/PhoneNumberLookupApi.php @@ -470,11 +470,6 @@ public function createAsyncBulkLookupRequest( } } - // this endpoint requires HTTP basic authentication - if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { - $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); - } - // this endpoint requires OAuth (access token) if (!empty($this->config->getAccessToken())) { $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); @@ -870,11 +865,6 @@ public function createSyncLookupRequest( } } - // this endpoint requires HTTP basic authentication - if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { - $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); - } - // this endpoint requires OAuth (access token) if (!empty($this->config->getAccessToken())) { $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); @@ -1238,11 +1228,6 @@ public function getAsyncBulkLookupRequest( ); - // this endpoint requires HTTP basic authentication - if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { - $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); - } - // this endpoint requires OAuth (access token) if (!empty($this->config->getAccessToken())) { $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); diff --git a/src/Api/RecordingsApi.php b/src/Api/RecordingsApi.php index 82bec4bd..9da7ac53 100644 --- a/src/Api/RecordingsApi.php +++ b/src/Api/RecordingsApi.php @@ -487,11 +487,6 @@ public function deleteRecordingRequest( ); - // this endpoint requires HTTP basic authentication - if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { - $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); - } - // this endpoint requires OAuth (access token) if (!empty($this->config->getAccessToken())) { $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); @@ -883,11 +878,6 @@ public function deleteRecordingMediaRequest( ); - // this endpoint requires HTTP basic authentication - if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { - $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); - } - // this endpoint requires OAuth (access token) if (!empty($this->config->getAccessToken())) { $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); @@ -1279,11 +1269,6 @@ public function deleteRecordingTranscriptionRequest( ); - // this endpoint requires HTTP basic authentication - if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { - $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); - } - // this endpoint requires OAuth (access token) if (!empty($this->config->getAccessToken())) { $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); @@ -1769,11 +1754,6 @@ public function downloadCallRecordingRequest( ); - // this endpoint requires HTTP basic authentication - if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { - $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); - } - // this endpoint requires OAuth (access token) if (!empty($this->config->getAccessToken())) { $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); @@ -2259,11 +2239,6 @@ public function getCallRecordingRequest( ); - // this endpoint requires HTTP basic authentication - if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { - $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); - } - // this endpoint requires OAuth (access token) if (!empty($this->config->getAccessToken())) { $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); @@ -2749,11 +2724,6 @@ public function getRecordingTranscriptionRequest( ); - // this endpoint requires HTTP basic authentication - if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { - $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); - } - // this endpoint requires OAuth (access token) if (!empty($this->config->getAccessToken())) { $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); @@ -3267,11 +3237,6 @@ public function listAccountCallRecordingsRequest( ); - // this endpoint requires HTTP basic authentication - if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { - $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); - } - // this endpoint requires OAuth (access token) if (!empty($this->config->getAccessToken())) { $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); @@ -3733,11 +3698,6 @@ public function listCallRecordingsRequest( ); - // this endpoint requires HTTP basic authentication - if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { - $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); - } - // this endpoint requires OAuth (access token) if (!empty($this->config->getAccessToken())) { $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); @@ -4185,11 +4145,6 @@ public function transcribeCallRecordingRequest( } } - // this endpoint requires HTTP basic authentication - if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { - $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); - } - // this endpoint requires OAuth (access token) if (!empty($this->config->getAccessToken())) { $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); @@ -4613,11 +4568,6 @@ public function updateCallRecordingStateRequest( } } - // this endpoint requires HTTP basic authentication - if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { - $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); - } - // this endpoint requires OAuth (access token) if (!empty($this->config->getAccessToken())) { $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); diff --git a/src/Api/StatisticsApi.php b/src/Api/StatisticsApi.php index 81e29c25..ab62871a 100644 --- a/src/Api/StatisticsApi.php +++ b/src/Api/StatisticsApi.php @@ -506,11 +506,6 @@ public function getStatisticsRequest( ); - // this endpoint requires HTTP basic authentication - if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { - $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); - } - // this endpoint requires OAuth (access token) if (!empty($this->config->getAccessToken())) { $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); diff --git a/src/Api/TollFreeVerificationApi.php b/src/Api/TollFreeVerificationApi.php index 990a3b22..90c8e7b3 100644 --- a/src/Api/TollFreeVerificationApi.php +++ b/src/Api/TollFreeVerificationApi.php @@ -586,11 +586,6 @@ public function createWebhookSubscriptionRequest( } } - // this endpoint requires HTTP basic authentication - if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { - $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); - } - // this endpoint requires OAuth (access token) if (!empty($this->config->getAccessToken())) { $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); @@ -967,11 +962,6 @@ public function deleteVerificationRequestRequest( ); - // this endpoint requires HTTP basic authentication - if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { - $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); - } - // this endpoint requires OAuth (access token) if (!empty($this->config->getAccessToken())) { $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); @@ -1339,11 +1329,6 @@ public function deleteWebhookSubscriptionRequest( ); - // this endpoint requires HTTP basic authentication - if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { - $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); - } - // this endpoint requires OAuth (access token) if (!empty($this->config->getAccessToken())) { $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); @@ -1814,11 +1799,6 @@ public function getTollFreeVerificationStatusRequest( ); - // this endpoint requires HTTP basic authentication - if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { - $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); - } - // this endpoint requires OAuth (access token) if (!empty($this->config->getAccessToken())) { $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); @@ -2232,11 +2212,6 @@ public function listTollFreeUseCasesRequest( ); - // this endpoint requires HTTP basic authentication - if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { - $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); - } - // this endpoint requires OAuth (access token) if (!empty($this->config->getAccessToken())) { $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); @@ -2660,11 +2635,6 @@ public function listWebhookSubscriptionsRequest( ); - // this endpoint requires HTTP basic authentication - if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { - $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); - } - // this endpoint requires OAuth (access token) if (!empty($this->config->getAccessToken())) { $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); @@ -3064,11 +3034,6 @@ public function requestTollFreeVerificationRequest( } } - // this endpoint requires HTTP basic authentication - if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { - $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); - } - // this endpoint requires OAuth (access token) if (!empty($this->config->getAccessToken())) { $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); @@ -3509,11 +3474,6 @@ public function updateTollFreeVerificationRequestRequest( } } - // this endpoint requires HTTP basic authentication - if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { - $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); - } - // this endpoint requires OAuth (access token) if (!empty($this->config->getAccessToken())) { $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); @@ -4031,11 +3991,6 @@ public function updateWebhookSubscriptionRequest( } } - // this endpoint requires HTTP basic authentication - if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { - $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); - } - // this endpoint requires OAuth (access token) if (!empty($this->config->getAccessToken())) { $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); diff --git a/src/Api/TranscriptionsApi.php b/src/Api/TranscriptionsApi.php index c9b7e8a0..9bc97111 100644 --- a/src/Api/TranscriptionsApi.php +++ b/src/Api/TranscriptionsApi.php @@ -466,11 +466,6 @@ public function deleteRealTimeTranscriptionRequest( ); - // this endpoint requires HTTP basic authentication - if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { - $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); - } - // this endpoint requires OAuth (access token) if (!empty($this->config->getAccessToken())) { $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); @@ -956,11 +951,6 @@ public function getRealTimeTranscriptionRequest( ); - // this endpoint requires HTTP basic authentication - if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { - $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); - } - // this endpoint requires OAuth (access token) if (!empty($this->config->getAccessToken())) { $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); @@ -1422,11 +1412,6 @@ public function listRealTimeTranscriptionsRequest( ); - // this endpoint requires HTTP basic authentication - if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { - $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); - } - // this endpoint requires OAuth (access token) if (!empty($this->config->getAccessToken())) { $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); diff --git a/src/Configuration.php b/src/Configuration.php index 1f721142..efccc76f 100644 --- a/src/Configuration.php +++ b/src/Configuration.php @@ -111,20 +111,6 @@ class Configuration */ protected string $booleanFormatForQueryString = self::BOOLEAN_FORMAT_INT; - /** - * Username for HTTP basic authentication - * - * @var string - */ - protected string $username = ''; - - /** - * Password for HTTP basic authentication - * - * @var string - */ - protected string $password = ''; - /** * The host * @@ -399,52 +385,6 @@ public function getBooleanFormatForQueryString(): string return $this->booleanFormatForQueryString; } - /** - * Sets the username for HTTP basic authentication - * - * @param string $username Username for HTTP basic authentication - * - * @return $this - */ - public function setUsername(string $username): static - { - $this->username = $username; - return $this; - } - - /** - * Gets the username for HTTP basic authentication - * - * @return string Username for HTTP basic authentication - */ - public function getUsername(): string - { - return $this->username; - } - - /** - * Sets the password for HTTP basic authentication - * - * @param string $password Password for HTTP basic authentication - * - * @return $this - */ - public function setPassword(string $password): static - { - $this->password = $password; - return $this; - } - - /** - * Gets the password for HTTP basic authentication - * - * @return string Password for HTTP basic authentication - */ - public function getPassword(): string - { - return $this->password; - } - /** * Sets the host * diff --git a/tests/Smoke/MFAApiTest.php b/tests/Smoke/MFAApiTest.php index 65d99dbe..77fa448c 100644 --- a/tests/Smoke/MFAApiTest.php +++ b/tests/Smoke/MFAApiTest.php @@ -59,8 +59,8 @@ class MFAApiTest extends TestCase public static function setUpBeforeClass(): void { $config = (new Configuration()) - ->setUsername(getenv("BW_USERNAME")) - ->setPassword(getenv("BW_PASSWORD")); + ->setClientId(getenv("BW_CLIENT_ID")) + ->setClientSecret(getenv("BW_CLIENT_SECRET")); self::$apiInstance = new MFAApi(config: $config); diff --git a/tests/Smoke/MediaApiTest.php b/tests/Smoke/MediaApiTest.php index 7f7ba5b3..f6a52a21 100644 --- a/tests/Smoke/MediaApiTest.php +++ b/tests/Smoke/MediaApiTest.php @@ -56,8 +56,8 @@ class MediaApiTest extends TestCase public static function setUpBeforeClass(): void { $config = (new Configuration()) - ->setUsername(getenv("BW_USERNAME")) - ->setPassword(getenv("BW_PASSWORD")); + ->setClientId(getenv("BW_CLIENT_ID")) + ->setClientSecret(getenv("BW_CLIENT_SECRET")); self::$apiInstance = new MediaApi(config: $config); diff --git a/tests/Smoke/MessagesApiTest.php b/tests/Smoke/MessagesApiTest.php index b43def32..c056c754 100644 --- a/tests/Smoke/MessagesApiTest.php +++ b/tests/Smoke/MessagesApiTest.php @@ -57,8 +57,8 @@ class MessagesApiTest extends TestCase public static function setUpBeforeClass(): void { $config = (new Configuration()) - ->setUsername(getenv("BW_USERNAME")) - ->setPassword(getenv("BW_PASSWORD")); + ->setClientId(getenv("BW_CLIENT_ID")) + ->setClientSecret(getenv("BW_CLIENT_SECRET")); self::$apiInstance = new MessagesApi(config: $config); diff --git a/tests/Smoke/MultiChannelApiTest.php b/tests/Smoke/MultiChannelApiTest.php index f1d244fe..7426f5df 100644 --- a/tests/Smoke/MultiChannelApiTest.php +++ b/tests/Smoke/MultiChannelApiTest.php @@ -81,8 +81,8 @@ class MultiChannelApiTest extends TestCase public static function setUpBeforeClass(): void { $config = (new Configuration()) - ->setUsername(getenv("BW_USERNAME")) - ->setPassword(getenv("BW_PASSWORD")); + ->setClientId(getenv("BW_CLIENT_ID")) + ->setClientSecret(getenv("BW_CLIENT_SECRET")); self::$apiInstance = new MultiChannelApi(config: $config); diff --git a/tests/Unit/Client/ConfigurationTest.php b/tests/Unit/Client/ConfigurationTest.php index f1f244bb..ec43422c 100644 --- a/tests/Unit/Client/ConfigurationTest.php +++ b/tests/Unit/Client/ConfigurationTest.php @@ -80,6 +80,19 @@ public function testNullAccessTokenGetterFallsBackToStaticToken() $this->assertEquals('static-token', $config->getAccessToken()); } + /** + * Test that the HTTP basic authentication accessors are not available. + */ + public function testBasicAuthMethodsAreRemoved() + { + foreach (['setUsername', 'getUsername', 'setPassword', 'getPassword'] as $method) { + $this->assertFalse( + method_exists(Configuration::class, $method), + "Configuration::{$method}() should not exist" + ); + } + } + /** * Test the default configuration singleton is stable and replaceable. */