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

Commit a3362f1

Browse files
authored
Add Code Snippets to Spec Files (#677)
1 parent 1809515 commit a3362f1

File tree

4 files changed

+112
-51
lines changed

4 files changed

+112
-51
lines changed

site/specs/global.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -531,7 +531,7 @@ info:
531531
|`NO_VALID_DID_FOUND`|`316`|The system could not find any valid did id in
532532
the request.|
533533
534-
|`CLI_PRIVACY_ACCOUNT_NOT_TRUSTED`|`317`|Your account is not authorised to
534+
|`CLI_PRIVACY_ACCOUNT_NOT_TRUSTED`|`317`|Your account is not authorized to
535535
use this option.|
536536
537537
|`CLI_PRIVACY_NOT_SUPPORTED`|`318`|Some dids do not support the cli privacy

site/specs/messaging.yml

Lines changed: 43 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1074,7 +1074,7 @@ paths:
10741074
'202':
10751075
$ref: '#/components/responses/createMessageResponse'
10761076
'400':
1077-
$ref: '#/components/responses/messagingBadRequestError'
1077+
$ref: '#/components/responses/createMessageBadRequestError'
10781078
'401':
10791079
$ref: '#/components/responses/messagingUnauthorizedError'
10801080
'403':
@@ -1432,7 +1432,7 @@ components:
14321432
required: false
14331433
description: The direction of the message. One of INBOUND OUTBOUND.
14341434
schema:
1435-
$ref: '#/components/schemas/messageDirectionEnum'
1435+
$ref: '#/components/schemas/listMessageDirectionEnum'
14361436
carrierName:
14371437
in: query
14381438
name: carrierName
@@ -1512,9 +1512,9 @@ components:
15121512
type: string
15131513
description: The priority specified by the user.
15141514
enum:
1515-
- DEFAULT
1516-
- HIGH
1517-
example: DEFAULT
1515+
- default
1516+
- high
1517+
example: default
15181518
messageStatusEnum:
15191519
type: string
15201520
description: >-
@@ -1549,6 +1549,19 @@ components:
15491549
- sms
15501550
- mms
15511551
example: sms
1552+
fieldError:
1553+
type: object
1554+
properties:
1555+
fieldName:
1556+
type: string
1557+
description: The name of the field that contains the error
1558+
example: from
1559+
description:
1560+
type: string
1561+
description: The error associated with the field
1562+
example: >-
1563+
'+invalid' must be replaced with a valid E164 formatted telephone
1564+
number
15521565
messagesList:
15531566
title: MessagesList
15541567
type: object
@@ -1610,6 +1623,7 @@ components:
16101623
messageSize:
16111624
type: integer
16121625
description: The size of the message including message content and headers.
1626+
nullable: true
16131627
example: 27
16141628
messageLength:
16151629
type: integer
@@ -1618,14 +1632,17 @@ components:
16181632
attachmentCount:
16191633
type: integer
16201634
description: The number of attachments the message has.
1635+
nullable: true
16211636
example: 1
16221637
recipientCount:
16231638
type: integer
16241639
description: The number of recipients the message has.
1640+
nullable: true
16251641
example: 1
16261642
campaignClass:
16271643
type: string
16281644
description: The campaign class of the message if it has one.
1645+
nullable: true
16291646
example: T
16301647
pageInfo:
16311648
title: PageInfo
@@ -1660,6 +1677,21 @@ components:
16601677
required:
16611678
- type
16621679
- description
1680+
createMessageRequestError:
1681+
title: CreateMessageRequestError
1682+
type: object
1683+
properties:
1684+
type:
1685+
type: string
1686+
description:
1687+
type: string
1688+
fieldErrors:
1689+
type: array
1690+
items:
1691+
$ref: '#/components/schemas/fieldError'
1692+
required:
1693+
- type
1694+
- description
16631695
media:
16641696
title: Media
16651697
type: object
@@ -1862,6 +1894,12 @@ components:
18621894
application/json:
18631895
schema:
18641896
$ref: '#/components/schemas/messagingRequestError'
1897+
createMessageBadRequestError:
1898+
description: Bad Request
1899+
content:
1900+
application/json:
1901+
schema:
1902+
$ref: '#/components/schemas/createMessageRequestError'
18651903
messagingUnauthorizedError:
18661904
description: Unauthorized
18671905
content:

site/specs/phone-number-lookup.yml

Lines changed: 47 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -480,8 +480,9 @@ components:
480480
properties:
481481
requestId:
482482
type: string
483+
description: The phone number lookup request ID from Bandwidth.
483484
status:
484-
type: string
485+
$ref: '#/components/schemas/lookupStatusEnum'
485486
lookupStatus:
486487
type: object
487488
description: >-
@@ -501,51 +502,54 @@ components:
501502
type: array
502503
description: The carrier information results for the specified telephone number.
503504
items:
504-
type: object
505-
properties:
506-
Response Code:
507-
type: integer
508-
description: Our vendor's response code.
509-
example: 0
510-
Message:
511-
type: string
512-
description: Message associated with the response code.
513-
example: NOERROR
514-
E.164 Format:
515-
type: string
516-
description: The telephone number in E.164 format.
517-
example: '+19195551234'
518-
Formatted:
519-
type: string
520-
description: The formatted version of the telephone number.
521-
example: (919) 555-1234
522-
Country:
523-
type: string
524-
description: The country of the telephone number.
525-
example: US
526-
Line Type:
527-
type: string
528-
description: The line type of the telephone number.
529-
example: Mobile
530-
Line Provider:
531-
type: string
532-
description: The messaging service provider of the telephone number.
533-
example: Verizon Wireless
534-
Mobile Country Code:
535-
type: string
536-
description: The first half of the Home Network Identity (HNI).
537-
example: '310'
538-
Mobile Network Code:
539-
type: string
540-
description: The second half of the HNI.
541-
example: '010'
505+
$ref: '#/components/schemas/lookupResult'
542506
failedTelephoneNumbers:
543507
type: array
544508
description: The telephone numbers whose lookup failed.
545509
items:
546510
type: string
547511
example:
548512
- '+191955512345'
513+
lookupResult:
514+
type: object
515+
description: Carrier information results for the specified telephone number.
516+
properties:
517+
Response Code:
518+
type: integer
519+
description: Our vendor's response code.
520+
example: 0
521+
Message:
522+
type: string
523+
description: Message associated with the response code.
524+
example: NOERROR
525+
E.164 Format:
526+
type: string
527+
description: The telephone number in E.164 format.
528+
example: '+19195551234'
529+
Formatted:
530+
type: string
531+
description: The formatted version of the telephone number.
532+
example: (919) 555-1234
533+
Country:
534+
type: string
535+
description: The country of the telephone number.
536+
example: US
537+
Line Type:
538+
type: string
539+
description: The line type of the telephone number.
540+
example: Mobile
541+
Line Provider:
542+
type: string
543+
description: The messaging service provider of the telephone number.
544+
example: Verizon Wireless
545+
Mobile Country Code:
546+
type: string
547+
description: The first half of the Home Network Identity (HNI).
548+
example: '310'
549+
Mobile Network Code:
550+
type: string
551+
description: The second half of the HNI.
552+
example: '010'
549553
tnLookupRequestError:
550554
type: object
551555
properties:
@@ -658,19 +662,20 @@ components:
658662
parameters:
659663
accountId:
660664
name: accountId
661-
description: The ID of the Bandwidth account that the user belongs to.
662665
in: path
663666
required: true
664667
schema:
665668
type: string
666-
example: '9900000'
669+
description: The ID of the Bandwidth account that the user belongs to.
670+
example: '9900000'
667671
requestId:
668672
name: requestId
669673
in: path
670674
required: true
671675
schema:
672676
type: string
673-
example: 004223a0-8b17-41b1-bf81-20732adf5590
677+
description: The phone number lookup request ID from Bandwidth.
678+
example: 004223a0-8b17-41b1-bf81-20732adf5590
674679
examples:
675680
singleNumberRequestExample:
676681
summary: Example Number Lookup Request for One Number

site/specs/voice.yml

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -572,6 +572,8 @@ paths:
572572
$ref: '#/components/responses/voiceNotFoundError'
573573
'405':
574574
$ref: '#/components/responses/voiceNotAllowedError'
575+
'409':
576+
$ref: '#/components/responses/voiceConflictError'
575577
'415':
576578
$ref: '#/components/responses/voiceUnsupportedMediaTypeError'
577579
'429':
@@ -826,6 +828,8 @@ paths:
826828
$ref: '#/components/responses/voiceNotFoundError'
827829
'405':
828830
$ref: '#/components/responses/voiceNotAllowedError'
831+
'409':
832+
$ref: '#/components/responses/voiceConflictError'
829833
'415':
830834
$ref: '#/components/responses/voiceUnsupportedMediaTypeError'
831835
'429':
@@ -2472,7 +2476,7 @@ paths:
24722476
- $ref: '#/components/parameters/recordingId'
24732477
responses:
24742478
'200':
2475-
$ref: '#/components/responses/downloadCallRecordingResponse'
2479+
$ref: '#/components/responses/downloadRecordingMediaResponse'
24762480
'400':
24772481
$ref: '#/components/responses/voiceBadRequestError'
24782482
'401':
@@ -3778,7 +3782,7 @@ paths:
37783782
- $ref: '#/components/parameters/recordingId'
37793783
responses:
37803784
'200':
3781-
$ref: '#/components/responses/downloadCallRecordingResponse'
3785+
$ref: '#/components/responses/downloadRecordingMediaResponse'
37823786
'400':
37833787
$ref: '#/components/responses/voiceBadRequestError'
37843788
'401':
@@ -7311,7 +7315,7 @@ components:
73117315
application/json:
73127316
schema:
73137317
$ref: '#/components/schemas/callRecordingMetadata'
7314-
downloadCallRecordingResponse:
7318+
downloadRecordingMediaResponse:
73157319
description: Media found
73167320
content:
73177321
audio/vnd.wave:
@@ -7410,6 +7414,15 @@ components:
74107414
examples:
74117415
notAllowedErrorExample:
74127416
$ref: '#/components/examples/voiceNotAllowedErrorExample'
7417+
voiceConflictError:
7418+
description: Conflict
7419+
content:
7420+
application/json:
7421+
schema:
7422+
$ref: '#/components/schemas/voiceApiError'
7423+
examples:
7424+
conflictErrorExample:
7425+
$ref: '#/components/examples/voiceConflictErrorExample'
74137426
voiceUnsupportedMediaTypeError:
74147427
description: Unsupported Media Type
74157428
content:
@@ -7502,6 +7515,11 @@ components:
75027515
value:
75037516
type: validation
75047517
description: 'Invalid answerUrl: only http and https are allowed'
7518+
voiceConflictErrorExample:
7519+
summary: Example of a Conflict (409) Error
7520+
value:
7521+
type: validation
7522+
description: 'Invalid answerUrl: only http and https are allowed'
75057523
voiceUnsupportedMediaTypeErrorExample:
75067524
summary: Example of an Unsupported Media Type (415) Error
75077525
value:

0 commit comments

Comments
 (0)