Skip to content
Merged
147 changes: 77 additions & 70 deletions code/API_definitions/call-forwarding-signal.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,85 +7,102 @@ info:
title: Call Forwarding Signal
description: |
# Overview
The Call Forwarding Signal (CFS) API provides the API Consumer with
information about the status of the Call Forwading Service on a specific
phone number. The main scope of the CFS API is "anti Fraud" to avoid
fraudsters to use the Call Forwarding Service to carry on a scam. Other use
cases are anyway supported by the CFS API that also provides additional
endpoints to detect the general Call Forwarding Service settings.
The Call Forwarding Signal API provides the API Consumer with
information about the status of the Call Forwarding Service on a specific
phone number. The main scope of the Call Forwarding Signal API is "anti
Fraud" to avoid fraudsters to use the Call Forwarding Service to carry
on a scam. Other use cases are anyway supported by the Call Forwarding
Signal API that also
provides additional endpoints to detect the general Call Forwarding
Service settings.
# Introduction
The Call Forwarding Service is provided by the Network to a phone
number. This service redirects the incoming call to that phone number
to an alternative destination such as another phone number or a voice mail
system. There are two main types of call forwarding settings:
unconditional and conditional.
The CFS API can be invoked to detect if the unconditional
call forwarding service is active. The CSF API can also be invoked to
The Call Forwarding Signal API can be invoked to detect if the unconditional
call forwarding service is active. The Call Forwarding Signal API can also
be invoked to
get the general status of the Call Forwarding Service (inactive,
conditional, unconditional). If conditional call forwarding is active,
the different type of settings are returned ('conditional_busy',
'conditional_not_reachable', 'conditional_no_answer').\
\
**Example use cases:**\
\
[**Bank Frauds**](https://github.com/camaraproject/CallForwardingSignal\
/discussions/3#discussioncomment-8694420)\
\
[**Alert Interception**](https://github.com/camaraproject/CallForwarding\
Signal/discussions/3#discussioncomment-8701847)\
\
[**Call Forwading Verification**](https://github.com/camaraproject/\
CallForwarding\Signal/discussions/3#discussioncomment-8915595)
'conditional_not_reachable', 'conditional_no_answer').

**Example use cases:**

[**Bank Frauds**](https://github.com/camaraproject/CallForwardingSignal/discussions/3#discussioncomment-8694420)

[**Alert Interception**](https://github.com/camaraproject/CallForwardingSignal/discussions/3#discussioncomment-8701847)

[**Call Forwarding Verification**](https://github.com/camaraproject/CallForwarding\Signal/discussions/3#discussioncomment-8915595)
# Quick Start
The CFS API is a REST API based on the CreateCallForwardingSignal resource.
The Call Forwarding Signal API is a REST API based on the
CreateCallForwardingSignal resource.
This resource can be used, by the API Consumer, to specify the phone number
on which the Call Forwarding Service status must be verified, in case of
two-legged authentication. If three-legged authentication is used the phone
number is instead detected, by the API Producer, from the access token.\
\
number is instead detected, by the API Producer, from the access token.

Before starting to use the Call Forwarding API, the developer needs to know
about the below specified details:\
\
about the below specified details:

**phoneNumber**
This is the end user phone number. The CFS API verifies if a call forwarding
This is the end user phone number. The Call Forwarding Signal API verifies
if a call forwarding
service is active on this phone number. Note: this parameter must be
must be valorised only in case of two-legged authentication. In case of
three-legged authentication the phone number is retrived by the access
token.
\
\
must be provided/valued only in case of two-legged authentication.
In case of three-legged authentication the phone number is retrieved by
the access token.

**CreateCallForwardingSignal**
This is the resource the API Consumer uses to define the phone number to
be verified about the status of the Network Call Forwarding service.\
\
be verified about the status of the Network Call Forwarding service.

**UnconditionalCallForwardingSignal**
This is the resource the API Consumer gets back, containing the information
about the Unconditional Call Forwarding Service status for the given phone
number (PhoneNumber).\
\
number (PhoneNumber).

**CallForwardingSignal**
This is the resource the API Consumer gets back, containing the information
about the general status of the Network Call Forwarding service for the
specified phone number.\
\
The CFS API provides two endpoints fulfilling the following intents:
specified phone number.

The Call Forwarding Signal API provides two endpoints fulfilling the
following intents:
- **unconditional-call-forwardings**: Is the unconditional call fwd service
active on a specific phone number?
- **call-forwardings**: Which is the status of the call forwarding for a
specific phone number?
# API Documentation
## Details
The Call Forwarding Signal API is invoked by an API Consumer after the
Consent Management flow.

The API Consumer can request the API Producer for the status of the
Unconditional Call Forwarding service using the
unconditional-call-forwardings POST method. A boolean, with the information
about the activation status of the call forwarding service, will be
provided back via the UnconditionalCallForwardingSignal resource.

The API Consumer can also request the API Producer for the generic status of
the Call Forwarding service using the call-forwardings POST method. An array
of strings with the information of the type of active call forwarding
services will be provided back via the CallForwardingSignal resource.
# Authorization and authentication
The "Camara Security and Interoperability Profile" provides details on how
an API consumer requests an access token. Please refer to Identify and
The "Camara Security and Interoperability Profile" provides details of how
an API consumer requests an access token. Please refer to Identity and
Consent Management
(https://github.com/camaraproject/IdentityAndConsentManagement/)
for the released version of the profile.\
\
for the released version of the profile.

The specific authorization flows to be used will be agreed upon during the
onboarding process, happening between the API consumer and the API
provider, taking into account the declared purpose for accessing the API,
whilst also being subject to the prevailing legal framework dictated by
local legislation.\
\
local legislation.

In cases where personal data is processed by the API and users can
exercise their rights through mechanisms such as opt-in and/or opt-out,
the use of three-legged access tokens is mandatory. This ensures that
Expand All @@ -105,7 +122,6 @@ info:
three-legged access token to invoke the API by relying on the
information that is associated with the access token and was
identified during the authentication process.

## Error handling:

- If the subject cannot be identified from the access token and the
Expand All @@ -119,33 +135,23 @@ info:
error code. This will be the case even if the same device is
identified by these two methods, as the server is unable to make
this comparison.
# API Documentation
## Details
The CFS API is invoked by an API Consumer after the Consent Management
flow.\
The API Consumer can request the API Producer for the status of the
Unconditional Call Forwarding service using the
unconditional-call-forwardings POST method. A boolean, with the information
about the activation status of the call forwarding service, will be
provided back via the UnconditionalCallForwardingSignal resource.\
The API Consumer can also request the API Producer for the generic status of
the Call Forwarding service using the call-forwardings POST method. An array
of strings with the information of the type of active call forwarding
services will be provided back via the CallForwardingSignal resource.\
## Additional CAMARA error responses

# 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 Guidelines`.
statuses as indicated in `CAMARA API Design Guide`.

Please refer to [CAMARA_common.yaml]({link_to_release}/CAMARA_common.yaml)
for a complete list of error responses.
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.

As a specific rule, error `501 - NOT_IMPLEMENTED` can be only a possible
error response if it is explicitly documented in the API.
# FAQ's
(FAQs will be added in a later version of the documentation)

version: 0.4.0-rc.1
version: wip
license:
name: Apache 2.0
url: https://www.apache.org/licenses/LICENSE-2.0.html
Expand All @@ -157,7 +163,7 @@ externalDocs:
# Servers #
############################################################################
servers:
- url: "{apiRoot}/call-forwarding-signal/v0.4rc1"
- url: "{apiRoot}/call-forwarding-signal/vwip"
variables:
apiRoot:
default: http://localhost:9091
Expand Down Expand Up @@ -229,9 +235,9 @@ paths:
service active on a phone number (PhoneNumber)
description: This endpoint provides information about which type of
call forwarding service is active. More than one service can be
active, e.g. conditional and unconditional. This endpoit exceeds
the main scope of the CFS API, for this reason an error code 501
can be returned.
active, e.g. conditional and unconditional. This endpoint exceeds
the main scope of the Call Forwarding Signal API, for this reason
an error code 501 can be returned.
operationId: retrieveCallForwarding
parameters:
- $ref: '#/components/parameters/x-correlator'
Expand Down Expand Up @@ -331,9 +337,10 @@ components:
############################################################################
CreateCallForwardingSignal:
description: resource containing the phone number (PhoneNumber) regarding
which the Call Forwarding Service must be checked. To be valorised only
in case of two-legged authentication. If valorised with three-legged
authentication a 422-UNNECESSARY_IDENTIFIER error code is returned.
which the Call Forwarding Service must be checked. To be provided/valued
only in case of two-legged authentication. If provided/valued with
three-legged authentication a 422-UNNECESSARY_IDENTIFIER error code is
returned.
type: object
properties:
phoneNumber:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Feature: CAMARA Call Forwarding Signal API, v0.4.0-rc.1 - Operation call-forwardings
Feature: CAMARA Call Forwarding Signal API, vwip - Operation retrieveCallForwarding
# Input to be provided by the implementation to the tester
#
# Implementation indications:
Expand All @@ -8,7 +8,7 @@ Feature: CAMARA Call Forwarding Signal API, v0.4.0-rc.1 - Operation call-forwar
# * A device object identified by a phone number for which the call forwarding service status could not be retrieved
#
Background: Common call-forwarding-signal setup
Given the path "/call-forwardings"
Given the path "/call-forwarding-signal/vwip/call-forwardings"
And the header "Content-Type" is set to "application/json"
And the header "Authorization" is set to a valid access token
And the header "x-correlator" complies with the schema at "#/components/schemas/XCorrelator"
Expand Down Expand Up @@ -76,7 +76,7 @@ Feature: CAMARA Call Forwarding Signal API, v0.4.0-rc.1 - Operation call-forwar
And the response body is an array of strings with the possible values ["unconditional", "conditional_no_answer", "conditional_not_reachable", "conditional_busy"]

#CFS active: phone number obtained from access token (3-legs authentication) and the CFS status for the phone number is known by the network. phoneNumber not set
@call_forwarding_signal_05_call_forwarding_check_active_acess_token
@call_forwarding_signal_05_call_forwarding_check_active_access_token
Scenario: retrieve the call forwarding service settings for a given phone number with call forwarding configured. The endpoint is invoked without a value for phoneNumber and access token is used to obtain the phone number.
Given the request body property "$.phoneNumber" is not set to a value
And The header "Authorization" is set to a valid access token identifying a phone number
Expand Down Expand Up @@ -202,7 +202,7 @@ Feature: CAMARA Call Forwarding Signal API, v0.4.0-rc.1 - Operation call-forwar

@call_forwarding_signal_429.2_too_many_requests
Scenario: The server is not able to handle a request because of a lack of resources
Given the number of endpoints calls from any APi Consumer is equal to the server limit
Given the number of endpoints calls from any API Consumer is equal to the server limit
And the endpoint is invoked
When the HTTP "POST" request is sent
Then the response status code is 429
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Feature: CAMARA Call Forwarding Signal API, v0.4.0-rc.1 - Operation unconditional-call-forwarding
Feature: CAMARA Call Forwarding Signal API, vwip - Operation retrieveUnconditionalCallForwarding
# Input to be provided by the implementation to the tester
#
# Implementation indications:
Expand All @@ -8,7 +8,7 @@ Feature: CAMARA Call Forwarding Signal API, v0.4.0-rc.1 - Operation uncondition
# * A device object identified by a phone number for which unconditional call forwarding service (CFS) status could not be retrieved
#
Background: Common call-forwarding-signal setup
Given the path "/unconditional-call-forwardings"
Given the path "/call-forwarding-signal/vwip/unconditional-call-forwardings"
And the header "Content-Type" is set to "application/json"
And the header "Authorization" is set to a valid access token
And the header "x-correlator" complies with the schema at "#/components/schemas/XCorrelator"
Expand Down Expand Up @@ -181,7 +181,7 @@ Feature: CAMARA Call Forwarding Signal API, v0.4.0-rc.1 - Operation uncondition

@call_forwarding_signal_429.2_too_many_requests
Scenario: The server is not able to handle a request because of a lack of resources
Given the number of endpoints calls from any APi Consumer is equal to the server limit
Given the number of endpoints calls from any API Consumer is equal to the server limit
And the endpoint is invoked
When the HTTP "POST" request is sent
Then the response status code is 429
Expand Down