Skip to content
This repository was archived by the owner on Nov 29, 2023. It is now read-only.

Commit 235c58f

Browse files
Add Code Snippets to Spec Files (#1138)
Co-authored-by: AJ Rice <[email protected]>
1 parent bca094e commit 235c58f

File tree

1 file changed

+94
-0
lines changed

1 file changed

+94
-0
lines changed

site/specs/voice.yml

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,52 @@ paths:
334334
rescue Bandwidth::ApiError => e
335335
p "Error when calling CallsApi->create_call: #{e}"
336336
end
337+
get:
338+
tags:
339+
- Calls
340+
summary: Get Calls
341+
description: >-
342+
Returns a max of 10000 calls, sorted by `createdTime` from oldest to
343+
newest.
344+
345+
346+
**NOTE:** If the number of calls in the account is bigger than
347+
`pageSize`, a `Link` header (with format `<{url}>; rel="next"`) will be
348+
returned in the response. The url can be used to retrieve the next page
349+
of call records.
350+
351+
Also, call information is kept for 7 days after the calls are hung up.
352+
If you attempt to retrieve information for a call that is older than 7
353+
days, you will get an empty array [] in response.
354+
operationId: listCalls
355+
parameters:
356+
- $ref: '#/components/parameters/accountId'
357+
- $ref: '#/components/parameters/to'
358+
- $ref: '#/components/parameters/from'
359+
- $ref: '#/components/parameters/minStartTimeCalls'
360+
- $ref: '#/components/parameters/maxStartTimeCalls'
361+
- $ref: '#/components/parameters/disconnectCause'
362+
- $ref: '#/components/parameters/pageSizeCalls'
363+
- $ref: '#/components/parameters/pageToken'
364+
responses:
365+
'200':
366+
$ref: '#/components/responses/listCallsResponse'
367+
'400':
368+
$ref: '#/components/responses/voiceBadRequestError'
369+
'401':
370+
$ref: '#/components/responses/voiceUnauthorizedError'
371+
'403':
372+
$ref: '#/components/responses/voiceForbiddenError'
373+
'404':
374+
$ref: '#/components/responses/voiceNotFoundError'
375+
'405':
376+
$ref: '#/components/responses/voiceNotAllowedError'
377+
'415':
378+
$ref: '#/components/responses/voiceUnsupportedMediaTypeError'
379+
'429':
380+
$ref: '#/components/responses/voiceTooManyRequestsError'
381+
'500':
382+
$ref: '#/components/responses/voiceInternalServerError'
337383
/accounts/{accountId}/calls/{callId}:
338384
get:
339385
tags:
@@ -7271,6 +7317,38 @@ components:
72717317
default: 1000
72727318
description: Specifies the max number of conferences that will be returned.
72737319
example: 500
7320+
minStartTimeCalls:
7321+
name: minStartTime
7322+
in: query
7323+
required: false
7324+
schema:
7325+
type: string
7326+
description: >-
7327+
Filter results to calls which have a `startTime` after or including
7328+
`minStartTime` (in ISO8601 format).
7329+
example: '2022-06-21T19:13:21Z'
7330+
maxStartTimeCalls:
7331+
name: maxStartTime
7332+
in: query
7333+
required: false
7334+
schema:
7335+
type: string
7336+
description: >-
7337+
Filter results to calls which have a `startTime` before or including
7338+
`maxStartTime` (in ISO8601 format).
7339+
example: '2022-06-21T19:13:21Z'
7340+
pageSizeCalls:
7341+
name: pageSize
7342+
in: query
7343+
required: false
7344+
schema:
7345+
type: integer
7346+
format: int32
7347+
minimum: 1
7348+
maximum: 10000
7349+
default: 1000
7350+
description: Specifies the max number of calls that will be returned.
7351+
example: 500
72747352
pageToken:
72757353
name: pageToken
72767354
in: query
@@ -7281,6 +7359,14 @@ components:
72817359
Not intended for explicit use. To use pagination, follow the links in
72827360
the `Link` header of the response, as indicated in the endpoint
72837361
description.
7362+
disconnectCause:
7363+
name: disconnectCause
7364+
in: query
7365+
required: false
7366+
schema:
7367+
type: string
7368+
description: Filter results to calls with specified call Disconnect Cause.
7369+
example: hangup
72847370
requestBodies:
72857371
createCallRequest:
72867372
description: JSON object containing information to create an outbound call
@@ -7380,6 +7466,14 @@ components:
73807466
application/json:
73817467
schema:
73827468
$ref: '#/components/schemas/callState'
7469+
listCallsResponse:
7470+
description: Calls retrieved successfully
7471+
content:
7472+
application/json:
7473+
schema:
7474+
type: array
7475+
items:
7476+
$ref: '#/components/schemas/callState'
73837477
getStatisticsResponse:
73847478
description: Statistics Found
73857479
content:

0 commit comments

Comments
 (0)