Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
208 changes: 33 additions & 175 deletions code/API_definitions/click-to-dial.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,12 @@ info:
(FAQs will be added in a later version of the documentation)

<!-- CAMARA:MANDATORY:additional-error-responses:BEGIN -->

# Additional CAMARA error responses

The list of error codes in this API specification is not exhaustive. Therefore the API specification MAY not document some non-mandatory error statuses as indicated in `CAMARA API Design Guide`.

Please refer to the `CAMARA_common.yaml` of the Commonalities Release associated to this API version for a complete list of error responses. The applicable Commonalities Release can be identified in the `API Readiness Checklist` document associated to this API version.
Please refer to the `CAMARA_common.yaml` of the Commonalities Release associated to this API version for a complete list of error responses. The applicable Commonalities Release can be identified from the `x-camara-commonalities` field, the changelog and the metadata of the released API version.

As a specific rule, error `501 - NOT_IMPLEMENTED` can be only a possible error response if it is explicitly documented in the API.
<!-- CAMARA:MANDATORY:additional-error-responses:END -->
Expand All @@ -47,7 +48,7 @@ info:
name: Apache 2.0
url: https://www.apache.org/licenses/LICENSE-2.0.html
version: wip
x-camara-commonalities: "0.8.0"
x-camara-commonalities: "0.9.0"

externalDocs:
description: Product documentation at CAMARA
Expand All @@ -74,6 +75,7 @@ paths:
summary: Create a new Click to Dial call session
description: |
Creates a new Click to Dial call session between the caller and the callee.
If the request includes a `sink` but the API provider does not support event notification delivery, the request is rejected with `422 EVENT_NOTIFICATIONS_NOT_SUPPORTED` and no call resource is created.
operationId: createCall
security:
- openId:
Expand All @@ -98,20 +100,22 @@ paths:
schema:
$ref: "#/components/schemas/Call"
'400':
$ref: '#/components/responses/Generic400'
$ref: '../common/CAMARA_common.yaml#/components/responses/BadRequest400'
'401':
$ref: '#/components/responses/Generic401'
$ref: '../common/CAMARA_common.yaml#/components/responses/Unauthenticated401'
'403':
$ref: '#/components/responses/Generic403'
$ref: '../common/CAMARA_common.yaml#/components/responses/PermissionDenied403'
'409':
$ref: '#/components/responses/Conflict409'
$ref: '../common/CAMARA_common.yaml#/components/responses/AlreadyExists409'
'422':
$ref: '#/components/responses/UnprocessableEntity422'
callbacks:
callStatusChanged:
'{$request.body#/sink}':
post:
summary: Call status changed event
parameters:
- $ref: "../common/CAMARA_common.yaml#/components/parameters/x-correlator"
security:
- notificationsBearerAuth: []
description: |
Expand All @@ -129,12 +133,15 @@ paths:
responses:
'2XX':
description: Event successfully received by the sink.
headers:
x-correlator:
$ref: "../common/CAMARA_common.yaml#/components/headers/x-correlator"
'400':
$ref: '#/components/responses/Generic400'
$ref: '../common/CAMARA_common.yaml#/components/responses/BadRequest400'
'401':
$ref: '#/components/responses/Generic401'
$ref: '../common/CAMARA_common.yaml#/components/responses/Unauthenticated401'
'403':
$ref: '#/components/responses/Generic403'
$ref: '../common/CAMARA_common.yaml#/components/responses/PermissionDenied403'
/calls/{callId}:
get:
tags:
Expand Down Expand Up @@ -164,13 +171,13 @@ paths:
schema:
$ref: "#/components/schemas/Call"
'400':
$ref: '#/components/responses/Generic400'
$ref: '../common/CAMARA_common.yaml#/components/responses/BadRequest400'
'401':
$ref: '#/components/responses/Generic401'
$ref: '../common/CAMARA_common.yaml#/components/responses/Unauthenticated401'
'403':
$ref: '#/components/responses/Generic403'
$ref: '../common/CAMARA_common.yaml#/components/responses/PermissionDenied403'
'404':
$ref: '#/components/responses/Generic404'
$ref: '../common/CAMARA_common.yaml#/components/responses/NotFound404'

delete:
tags:
Expand All @@ -197,15 +204,15 @@ paths:
x-correlator:
$ref: '#/components/headers/x-correlator'
'400':
$ref: '#/components/responses/Generic400'
$ref: '../common/CAMARA_common.yaml#/components/responses/BadRequest400'
'401':
$ref: '#/components/responses/Generic401'
$ref: '../common/CAMARA_common.yaml#/components/responses/Unauthenticated401'
'403':
$ref: '#/components/responses/Generic403'
$ref: '../common/CAMARA_common.yaml#/components/responses/PermissionDenied403'
'404':
$ref: '#/components/responses/Generic404'
$ref: '../common/CAMARA_common.yaml#/components/responses/NotFound404'
'409':
$ref: '#/components/responses/Conflict409'
$ref: '../common/CAMARA_common.yaml#/components/responses/AlreadyExists409'

/calls/{callId}/recording:
get:
Expand Down Expand Up @@ -239,13 +246,13 @@ paths:
schema:
$ref: "#/components/schemas/RecordingResource"
'400':
$ref: '#/components/responses/Generic400'
$ref: '../common/CAMARA_common.yaml#/components/responses/BadRequest400'
'401':
$ref: '#/components/responses/Generic401'
$ref: '../common/CAMARA_common.yaml#/components/responses/Unauthenticated401'
'403':
$ref: '#/components/responses/Generic403'
$ref: '../common/CAMARA_common.yaml#/components/responses/PermissionDenied403'
'404':
$ref: '#/components/responses/Generic404'
$ref: '../common/CAMARA_common.yaml#/components/responses/NotFound404'

components:
securitySchemes:
Expand Down Expand Up @@ -309,7 +316,7 @@ components:
callee:
$ref: '#/components/schemas/Callee'
sink:
$ref: '#/components/schemas/Sink'
$ref: '../common/CAMARA_event_common.yaml#/components/schemas/Sink'
sinkCredential:
$ref: '#/components/schemas/SinkCredential'
recordingEnabled:
Expand Down Expand Up @@ -354,13 +361,6 @@ components:
PhoneNumber:
$ref: "../common/CAMARA_common.yaml#/components/schemas/PhoneNumber"

Sink:
description: The address to which events shall be delivered, using the HTTP protocol.
type: string
format: uri
maxLength: 2048
example: "https://endpoint.example.com/sink"

SinkCredential:
$ref: "../common/CAMARA_event_common.yaml#/components/schemas/SinkCredential"

Expand Down Expand Up @@ -496,125 +496,6 @@ components:
example: '1600'

responses:
Generic400:
description: Bad Request
headers:
x-correlator:
$ref: "#/components/headers/x-correlator"
content:
application/json:
schema:
allOf:
- $ref: "../common/CAMARA_common.yaml#/components/schemas/ErrorInfo"
- type: object
properties:
status:
enum:
- 400
code:
enum:
- INVALID_ARGUMENT
- OUT_OF_RANGE
examples:
GENERIC_400_INVALID_ARGUMENT:
description: Invalid Argument. Generic Syntax Exception
value:
status: 400
code: INVALID_ARGUMENT
message: Client specified an invalid argument, request body or query param.
GENERIC_400_OUT_OF_RANGE:
description: Out of Range. Specific syntax exception used when a given field has a pre-defined range or an invalid filter criteria combination is requested.
value:
status: 400
code: OUT_OF_RANGE
message: Client specified an invalid range.

Generic401:
description: Unauthorized
headers:
x-correlator:
$ref: "#/components/headers/x-correlator"
content:
application/json:
schema:
allOf:
- $ref: "../common/CAMARA_common.yaml#/components/schemas/ErrorInfo"
- type: object
properties:
status:
enum:
- 401
code:
enum:
- UNAUTHENTICATED
examples:
GENERIC_401_UNAUTHENTICATED:
description: Request cannot be authenticated.
value:
status: 401
code: UNAUTHENTICATED
message: Request not authenticated due to missing, invalid, or expired credentials. A new authentication is required.

Generic403:
description: Forbidden
headers:
x-correlator:
$ref: "#/components/headers/x-correlator"
content:
application/json:
schema:
allOf:
- $ref: "../common/CAMARA_common.yaml#/components/schemas/ErrorInfo"
- type: object
properties:
status:
enum:
- 403
code:
enum:
- PERMISSION_DENIED
- INVALID_TOKEN_CONTEXT
examples:
GENERIC_403_PERMISSION_DENIED:
description: Permission denied. OAuth2 token access does not have the required scope or when the user fails operational security
value:
status: 403
code: PERMISSION_DENIED
message: Client does not have sufficient permissions to perform this action.
GENERIC_403_INVALID_TOKEN_CONTEXT:
description: Reflect some inconsistency between information in some field of the API and the related OAuth2 Token
value:
status: 403
code: INVALID_TOKEN_CONTEXT
message: "Request body is not consistent with access token."

Generic404:
description: Not found
headers:
x-correlator:
$ref: "#/components/headers/x-correlator"
content:
application/json:
schema:
allOf:
- $ref: "../common/CAMARA_common.yaml#/components/schemas/ErrorInfo"
- type: object
properties:
status:
enum:
- 404
code:
enum:
- NOT_FOUND
- IDENTIFIER_NOT_FOUND
examples:
GENERIC_404_NOT_FOUND:
description: Resource is not found
value:
status: 404
code: NOT_FOUND
message: The specified resource is not found.

UnprocessableEntity422:
description: Unprocessable Entity
headers:
Expand All @@ -641,6 +522,7 @@ components:
- RECORDING_NOT_SUPPORTED
- CALLER_NOT_AVAILABLE
- CALLEE_NOT_AVAILABLE
- EVENT_NOTIFICATIONS_NOT_SUPPORTED
examples:
INVALID_PHONE_NUMBER:
value:
Expand All @@ -667,32 +549,8 @@ components:
status: 422
code: CALLEE_NOT_AVAILABLE
message: Callee number is currently not reachable or not allowed to receive a call.


Conflict409:
description: Conflict
headers:
x-correlator:
$ref: "#/components/headers/x-correlator"
content:
application/json:
schema:
allOf:
- $ref: "../common/CAMARA_common.yaml#/components/schemas/ErrorInfo"
- type: object
properties:
status:
enum:
- 409
code:
enum:
- ALREADY_EXISTS
examples:
ALREADY_EXISTS:
value:
status: 409
code: ALREADY_EXISTS
message: An active call already exists for the given caller and callee.
EVENT_NOTIFICATIONS_NOT_SUPPORTED:
$ref: '../common/CAMARA_event_common.yaml#/components/examples/GENERIC_422_EVENT_NOTIFICATIONS_NOT_SUPPORTED'

examples:
CALL_STATUS_CHANGED_EXAMPLE:
Expand Down
18 changes: 16 additions & 2 deletions code/Test_definitions/click-to-dial-createCall.feature
Original file line number Diff line number Diff line change
Expand Up @@ -188,13 +188,27 @@ Feature: CAMARA Click to Dial API, vwip - Operation createCall
And the response property "$.code" is "CALLEE_NOT_AVAILABLE"

@createcall_failure_invalid_sink
Scenario: Fail to initiate call due to invalid sink URI
Scenario: Fail to initiate call due to a non-HTTPS sink URI
Given the request property "$.caller" is set to a valid caller number in E.164 format
And the request property "$.callee" is set to a valid callee number in E.164 format
And the request property "$.sink" is set to an invalid URI
And the request property "$.sink" is set to a valid HTTP URL that does not use HTTPS
When the request "createCall" is sent
Then the response status code is 400
And the response header "Content-Type" is "application/json"
And the response body complies with the OAS schema at "/components/schemas/ErrorInfo"
And the response property "$.status" is 400
And the response property "$.code" is "INVALID_ARGUMENT"

@createcall_failure_event_notifications_not_supported
Scenario: Fail to initiate call when event notifications capability is not supported
Given the request property "$.caller" is set to a valid caller number in E.164 format
And the request property "$.callee" is set to a valid callee number in E.164 format
And the request property "$.sink" is set to a valid HTTPS URL
And the API provider does not implement event notification delivery for the operation "createCall"
When the request "createCall" is sent
Then the response status code is 422
And the response header "Content-Type" is "application/json"
And the response body complies with the OAS schema at "/components/schemas/ErrorInfo"
And the response property "$.status" is 422
And the response property "$.code" is "EVENT_NOTIFICATIONS_NOT_SUPPORTED"
And no call resource is created