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

Commit

Permalink
Add Code Snippets to Spec Files (#677)
Browse files Browse the repository at this point in the history
  • Loading branch information
DX-Bandwidth authored Aug 15, 2022
1 parent 1809515 commit a3362f1
Show file tree
Hide file tree
Showing 4 changed files with 112 additions and 51 deletions.
2 changes: 1 addition & 1 deletion site/specs/global.yml
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,7 @@ info:
|`NO_VALID_DID_FOUND`|`316`|The system could not find any valid did id in
the request.|
|`CLI_PRIVACY_ACCOUNT_NOT_TRUSTED`|`317`|Your account is not authorised to
|`CLI_PRIVACY_ACCOUNT_NOT_TRUSTED`|`317`|Your account is not authorized to
use this option.|
|`CLI_PRIVACY_NOT_SUPPORTED`|`318`|Some dids do not support the cli privacy
Expand Down
48 changes: 43 additions & 5 deletions site/specs/messaging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1074,7 +1074,7 @@ paths:
'202':
$ref: '#/components/responses/createMessageResponse'
'400':
$ref: '#/components/responses/messagingBadRequestError'
$ref: '#/components/responses/createMessageBadRequestError'
'401':
$ref: '#/components/responses/messagingUnauthorizedError'
'403':
Expand Down Expand Up @@ -1432,7 +1432,7 @@ components:
required: false
description: The direction of the message. One of INBOUND OUTBOUND.
schema:
$ref: '#/components/schemas/messageDirectionEnum'
$ref: '#/components/schemas/listMessageDirectionEnum'
carrierName:
in: query
name: carrierName
Expand Down Expand Up @@ -1512,9 +1512,9 @@ components:
type: string
description: The priority specified by the user.
enum:
- DEFAULT
- HIGH
example: DEFAULT
- default
- high
example: default
messageStatusEnum:
type: string
description: >-
Expand Down Expand Up @@ -1549,6 +1549,19 @@ components:
- sms
- mms
example: sms
fieldError:
type: object
properties:
fieldName:
type: string
description: The name of the field that contains the error
example: from
description:
type: string
description: The error associated with the field
example: >-
'+invalid' must be replaced with a valid E164 formatted telephone
number
messagesList:
title: MessagesList
type: object
Expand Down Expand Up @@ -1610,6 +1623,7 @@ components:
messageSize:
type: integer
description: The size of the message including message content and headers.
nullable: true
example: 27
messageLength:
type: integer
Expand All @@ -1618,14 +1632,17 @@ components:
attachmentCount:
type: integer
description: The number of attachments the message has.
nullable: true
example: 1
recipientCount:
type: integer
description: The number of recipients the message has.
nullable: true
example: 1
campaignClass:
type: string
description: The campaign class of the message if it has one.
nullable: true
example: T
pageInfo:
title: PageInfo
Expand Down Expand Up @@ -1660,6 +1677,21 @@ components:
required:
- type
- description
createMessageRequestError:
title: CreateMessageRequestError
type: object
properties:
type:
type: string
description:
type: string
fieldErrors:
type: array
items:
$ref: '#/components/schemas/fieldError'
required:
- type
- description
media:
title: Media
type: object
Expand Down Expand Up @@ -1862,6 +1894,12 @@ components:
application/json:
schema:
$ref: '#/components/schemas/messagingRequestError'
createMessageBadRequestError:
description: Bad Request
content:
application/json:
schema:
$ref: '#/components/schemas/createMessageRequestError'
messagingUnauthorizedError:
description: Unauthorized
content:
Expand Down
89 changes: 47 additions & 42 deletions site/specs/phone-number-lookup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -480,8 +480,9 @@ components:
properties:
requestId:
type: string
description: The phone number lookup request ID from Bandwidth.
status:
type: string
$ref: '#/components/schemas/lookupStatusEnum'
lookupStatus:
type: object
description: >-
Expand All @@ -501,51 +502,54 @@ components:
type: array
description: The carrier information results for the specified telephone number.
items:
type: object
properties:
Response Code:
type: integer
description: Our vendor's response code.
example: 0
Message:
type: string
description: Message associated with the response code.
example: NOERROR
E.164 Format:
type: string
description: The telephone number in E.164 format.
example: '+19195551234'
Formatted:
type: string
description: The formatted version of the telephone number.
example: (919) 555-1234
Country:
type: string
description: The country of the telephone number.
example: US
Line Type:
type: string
description: The line type of the telephone number.
example: Mobile
Line Provider:
type: string
description: The messaging service provider of the telephone number.
example: Verizon Wireless
Mobile Country Code:
type: string
description: The first half of the Home Network Identity (HNI).
example: '310'
Mobile Network Code:
type: string
description: The second half of the HNI.
example: '010'
$ref: '#/components/schemas/lookupResult'
failedTelephoneNumbers:
type: array
description: The telephone numbers whose lookup failed.
items:
type: string
example:
- '+191955512345'
lookupResult:
type: object
description: Carrier information results for the specified telephone number.
properties:
Response Code:
type: integer
description: Our vendor's response code.
example: 0
Message:
type: string
description: Message associated with the response code.
example: NOERROR
E.164 Format:
type: string
description: The telephone number in E.164 format.
example: '+19195551234'
Formatted:
type: string
description: The formatted version of the telephone number.
example: (919) 555-1234
Country:
type: string
description: The country of the telephone number.
example: US
Line Type:
type: string
description: The line type of the telephone number.
example: Mobile
Line Provider:
type: string
description: The messaging service provider of the telephone number.
example: Verizon Wireless
Mobile Country Code:
type: string
description: The first half of the Home Network Identity (HNI).
example: '310'
Mobile Network Code:
type: string
description: The second half of the HNI.
example: '010'
tnLookupRequestError:
type: object
properties:
Expand Down Expand Up @@ -658,19 +662,20 @@ components:
parameters:
accountId:
name: accountId
description: The ID of the Bandwidth account that the user belongs to.
in: path
required: true
schema:
type: string
example: '9900000'
description: The ID of the Bandwidth account that the user belongs to.
example: '9900000'
requestId:
name: requestId
in: path
required: true
schema:
type: string
example: 004223a0-8b17-41b1-bf81-20732adf5590
description: The phone number lookup request ID from Bandwidth.
example: 004223a0-8b17-41b1-bf81-20732adf5590
examples:
singleNumberRequestExample:
summary: Example Number Lookup Request for One Number
Expand Down
24 changes: 21 additions & 3 deletions site/specs/voice.yml
Original file line number Diff line number Diff line change
Expand Up @@ -572,6 +572,8 @@ paths:
$ref: '#/components/responses/voiceNotFoundError'
'405':
$ref: '#/components/responses/voiceNotAllowedError'
'409':
$ref: '#/components/responses/voiceConflictError'
'415':
$ref: '#/components/responses/voiceUnsupportedMediaTypeError'
'429':
Expand Down Expand Up @@ -826,6 +828,8 @@ paths:
$ref: '#/components/responses/voiceNotFoundError'
'405':
$ref: '#/components/responses/voiceNotAllowedError'
'409':
$ref: '#/components/responses/voiceConflictError'
'415':
$ref: '#/components/responses/voiceUnsupportedMediaTypeError'
'429':
Expand Down Expand Up @@ -2472,7 +2476,7 @@ paths:
- $ref: '#/components/parameters/recordingId'
responses:
'200':
$ref: '#/components/responses/downloadCallRecordingResponse'
$ref: '#/components/responses/downloadRecordingMediaResponse'
'400':
$ref: '#/components/responses/voiceBadRequestError'
'401':
Expand Down Expand Up @@ -3778,7 +3782,7 @@ paths:
- $ref: '#/components/parameters/recordingId'
responses:
'200':
$ref: '#/components/responses/downloadCallRecordingResponse'
$ref: '#/components/responses/downloadRecordingMediaResponse'
'400':
$ref: '#/components/responses/voiceBadRequestError'
'401':
Expand Down Expand Up @@ -7311,7 +7315,7 @@ components:
application/json:
schema:
$ref: '#/components/schemas/callRecordingMetadata'
downloadCallRecordingResponse:
downloadRecordingMediaResponse:
description: Media found
content:
audio/vnd.wave:
Expand Down Expand Up @@ -7410,6 +7414,15 @@ components:
examples:
notAllowedErrorExample:
$ref: '#/components/examples/voiceNotAllowedErrorExample'
voiceConflictError:
description: Conflict
content:
application/json:
schema:
$ref: '#/components/schemas/voiceApiError'
examples:
conflictErrorExample:
$ref: '#/components/examples/voiceConflictErrorExample'
voiceUnsupportedMediaTypeError:
description: Unsupported Media Type
content:
Expand Down Expand Up @@ -7502,6 +7515,11 @@ components:
value:
type: validation
description: 'Invalid answerUrl: only http and https are allowed'
voiceConflictErrorExample:
summary: Example of a Conflict (409) Error
value:
type: validation
description: 'Invalid answerUrl: only http and https are allowed'
voiceUnsupportedMediaTypeErrorExample:
summary: Example of an Unsupported Media Type (415) Error
value:
Expand Down

0 comments on commit a3362f1

Please sign in to comment.