GSMA Camara Project Call Forwarding Signal API

Call Forwarding Signal API can be used to determine if a specific mobile Phone Number has an active call forwarding setup.

OpenAPI Specification

call-forwarding-signal-api-openapi.yml Raw ↑
openapi: 3.0.3
info:
  title: Global System for Mobile Communications GSMA Camara Project Call Forwarding Signal API
  description: >-
    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.
  version: 0.2.0
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0.html
  x-camara-commonalities: 0.4.0
externalDocs:
  description: Product documentation at CAMARA
  url: https://github.com/camaraproject/CallForwardingSignal
servers:
  - url: '{apiRoot}/call-forwarding-signal/v0.2'
    variables:
      apiRoot:
        default: http://localhost:9091
        description: >-
          API root, defined by the service provider, e.g. `api.example.com` or
          `api.example.com/somepath`
tags:
  - name: Call Forwarding Information Retrieval
    description: >-
      Provides information on Call Forwarding settings for the provided phone
      number (PhoneNumber).
  - name: Unconditional Call Forwarding Information Retrieval
    description: >-
      Provides information on Unconditional Call Forwarding settings for the
      provided phone number (PhoneNumber)
paths:
  /unconditional-call-forwardings:
    post:
      tags:
        - Unconditional Call Forwarding Information Retrieval
      security:
        - openId:
            - call-forwarding-signal:unconditional-call-forwardings:read
      summary: >-
        Global System for Mobile Communications Retrieve the information about the status of the unconditional call forwarding service on a phone number (PhoneNumber)
      description: >-
        This endpoint provides information about the status of the unconditional
        call forwarding, beeing active or not.
      operationId: retrieveUnconditionalCallForwarding
      parameters:
        - $ref: '#/components/parameters/x-correlator'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateCallForwardingSignal'
        required: true
      responses:
        '200':
          description: OK.
          headers:
            x-correlator:
              $ref: '#/components/headers/x-correlator'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnconditionalCallForwardingSignal'
        '400':
          $ref: '#/components/responses/Generic400'
        '401':
          $ref: '#/components/responses/Generic401'
        '403':
          $ref: '#/components/responses/Generic403'
        '404':
          $ref: '#/components/responses/Generic404'
        '409':
          $ref: '#/components/responses/Generic409'
        '415':
          $ref: '#/components/responses/Generic415'
        '422':
          $ref: '#/components/responses/Generic422'
        '429':
          $ref: '#/components/responses/Generic429'
        '500':
          $ref: '#/components/responses/Generic500'
        '503':
          $ref: '#/components/responses/Generic503'
        '504':
          $ref: '#/components/responses/Generic504'
  /call-forwardings:
    post:
      tags:
        - Call Forwarding Information Retrieval
      security:
        - openId:
            - call-forwarding-signal:call-forwardings:read
      summary: >-
        Global System for Mobile Communications Retrieve the information about the type of call forwarding service active on a phone number (PhoneNumber)
      description: >-
        This endpoint provides information about wich type of call forwarding
        service is active. More than one service can be active, e.g. conditional
        and unconditional. This endpoint exceeds the main scope of the CFS API,
        for this reason an error code 501 can be returned.
      operationId: retrieveCallForwarding
      parameters:
        - $ref: '#/components/parameters/x-correlator'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateCallForwardingSignal'
        required: true
      responses:
        '200':
          description: OK.
          headers:
            x-correlator:
              $ref: '#/components/headers/x-correlator'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CallForwardingSignal'
        '400':
          $ref: '#/components/responses/Generic400'
        '401':
          $ref: '#/components/responses/Generic401'
        '403':
          $ref: '#/components/responses/Generic403'
        '404':
          $ref: '#/components/responses/Generic404'
        '409':
          $ref: '#/components/responses/Generic409'
        '415':
          $ref: '#/components/responses/Generic415'
        '422':
          $ref: '#/components/responses/Generic422'
        '429':
          $ref: '#/components/responses/Generic429'
        '500':
          $ref: '#/components/responses/Generic500'
        '501':
          $ref: '#/components/responses/Generic501'
        '503':
          $ref: '#/components/responses/Generic503'
        '504':
          $ref: '#/components/responses/Generic504'
components:
  securitySchemes:
    openId:
      description: to support Consent Management
      type: openIdConnect
      openIdConnectUrl: https://example.com/.well-known/openid-configuration
  parameters:
    x-correlator:
      name: x-correlator
      in: header
      description: Correlation id for the different services
      schema:
        type: string
  headers:
    x-correlator:
      description: Correlation id for the different services
      schema:
        type: string
  schemas:
    UnconditionalCallForwardingSignal:
      description: >-
        resource containing the information about the Unconditional Call
        Forwarding Service for the given phone number (PhoneNumber)
      type: object
      properties:
        active:
          type: boolean
          description: Indicates if the unconditional call forwarding service is active.
    CallForwardingSignal:
      description: >-
        resource containing the list of the Call Forwarding Services active for
        the given phone number (PhoneNumber). The possible states are,
        'inactive' (no call forwarding service activated), 'unconditional' (call
        forwarded independently from the device status), 'conditional_busy'
        (call forwarded if the device is on an active call),
        'conditional_unavailable' (call forwarded if the device is not available
        on the network), 'conditional_no_reply' (call forwarded if the device
        doesn't answer the incoming call).
      type: array
      items:
        type: string
        enum:
          - inactive
          - unconditional
          - conditional_busy
          - conditional_unavailable
          - conditional_no_reply
      example:
        - unconditional
        - conditional_busy
        - conditional_no_reply
      minItems: 1
    CreateCallForwardingSignal:
      description: >-
        resource containing the phone number (PhoneNumber) regarding which the
        Call Forwarding Service must be checked
      type: object
      properties:
        phoneNumber:
          $ref: '#/components/schemas/PhoneNumber'
    PhoneNumber:
      description: >-
        A public identifier addressing a telephone subscription. In mobile
        networks it corresponds to the MSISDN (Mobile Station International
        Subscriber Directory Number). In order to be globally unique it has to
        be formatted in international format, according to E.164 standard,
        prefixed with '+'.
      type: string
      pattern: ^\+[1-9][0-9]{4,14}$
      example: '+123456789'
    ErrorInfo:
      description: error information
      type: object
      required:
        - status
        - code
        - message
      properties:
        status:
          type: integer
          description: HTTP status code returned along with this error response
        code:
          type: string
          description: Code given to this error
        message:
          type: string
          description: Detailed error description
  responses:
    Generic400:
      description: Problem with the client request
      headers:
        x-correlator:
          $ref: '#/components/headers/x-correlator'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorInfo'
          example:
            status: 400
            code: INVALID_ARGUMENT
            message: Client specified an invalid argument, request body or query param
    Generic401:
      description: Authentication problem with the client request
      headers:
        x-correlator:
          $ref: '#/components/headers/x-correlator'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorInfo'
          example:
            status: 401
            code: UNAUTHENTICATED
            message: >-
              Request not authenticated due to missing, invalid, or expired
              credentials
    Generic403:
      description: Client does not have sufficient permission
      headers:
        x-correlator:
          $ref: '#/components/headers/x-correlator'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorInfo'
          examples:
            PermissionDenied:
              value:
                status: 403
                code: PERMISSION_DENIED
                message: >-
                  Client does not have sufficient permissions to perform this
                  action
            InvalidTokenContext:
              value:
                status: 403
                code: INVALID_TOKEN_CONTEXT
                message: >-
                  PhoneNumber parameter doesn't match the value from the access
                  token context
    Generic404:
      description: The specified resource was not found
      headers:
        x-correlator:
          $ref: '#/components/headers/x-correlator'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorInfo'
          example:
            status: 404
            code: CALL_FORWARDING.UNKNOWN_PHONE_NUMBER
            message: >-
              Call forwarding check can't be done because the phone number is
              unknown
    Generic409:
      description: Conflict
      headers:
        x-correlator:
          $ref: '#/components/headers/x-correlator'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorInfo'
          examples:
            GENERIC_409_ABORTED:
              description: Concurrency of processes of the same nature/scope
              value:
                status: 409
                code: ABORTED
                message: Concurrency conflict.
            GENERIC_409_ALREADY_EXISTS:
              description: Trying to create an existing resource
              value:
                status: 409
                code: ALREADY_EXISTS
                message: The resource that a client tried to create already exists.
            GENERIC_409_CONFLICT:
              description: Duplication of an existing resource
              value:
                status: 409
                code: CONFLICT
                message: A specified resource duplicate entry found.
    Generic415:
      description: Unsupported Media Type
      headers:
        x-correlator:
          $ref: '#/components/headers/x-correlator'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorInfo'
          examples:
            GENERIC_415_UNSUPPORTED_MEDIA_TYPE:
              description: >-
                Payload format of the request is in an unsupported format by the
                Server.
              value:
                status: 415
                code: UNSUPPORTED_MEDIA_TYPE
                message: >-
                  The server refuses to accept the request because the payload
                  format is in an unsupported format.
    Generic422:
      description: Unprocessable Content
      headers:
        x-correlator:
          $ref: '#/components/headers/x-correlator'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorInfo'
          examples:
            GENERIC_422_DEVICE_IDENTIFIERS_MISMATCH:
              description: >-
                Inconsistency between device identifiers not pointing to the
                same device
              value:
                status: 422
                code: DEVICE_IDENTIFIERS_MISMATCH
                message: Provided device identifiers are not consistent.
            GENERIC_422_DEVICE_NOT_APPLICABLE:
              description: Service is not available for the provided device
              value:
                status: 422
                code: DEVICE_NOT_APPLICABLE
                message: The service is not available for the provided device.
            GENERIC_422_UNIDENTIFIABLE_DEVICE:
              description: >-
                phone number not available neither from "phoneNumber" or from
                the access token.
              value:
                status: 422
                code: UNIDENTIFIABLE_DEVICE
                message: phone number not defined
    Generic429:
      description: Too Many Requests
      headers:
        x-correlator:
          $ref: '#/components/headers/x-correlator'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorInfo'
          examples:
            GENERIC_429_QUOTA_EXCEEDED:
              description: Request is rejected due to exceeding a business quota limit.
              value:
                status: 429
                code: QUOTA_EXCEEDED
                message: Either out of resource quota or reaching rate limiting.
            GENERIC_429_TOO_MANY_REQUESTS:
              description: API Server request limit is overpassed
              value:
                status: 429
                code: TOO_MANY_REQUESTS
                message: Either out of resource quota or reaching rate limiting.
    Generic500:
      description: Server error
      headers:
        x-correlator:
          $ref: '#/components/headers/x-correlator'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorInfo'
          example:
            status: 500
            code: INTERNAL
            message: Server error
    Generic501:
      description: Not Implemented
      headers:
        x-correlator:
          $ref: '#/components/headers/x-correlator'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorInfo'
          examples:
            GENERIC_501_NOT_IMPLEMENTED:
              description: >-
                Service not implemented. The use of this code should be avoided
                as far as possible to get the objective to reach aligned
                implementations
              value:
                status: 501
                code: NOT_IMPLEMENTED
                message: This functionality is not implemented yet.
    Generic503:
      description: Service unavailable. Typically the server is down
      headers:
        x-correlator:
          $ref: '#/components/headers/x-correlator'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorInfo'
          example:
            status: 503
            code: UNAVAILABLE
            message: Service unavailable
    Generic504:
      description: >-
        Request time exceeded. If it happens repeatedly, consider reducing the
        request complexity
      headers:
        x-correlator:
          $ref: '#/components/headers/x-correlator'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorInfo'
          example:
            status: 504
            code: TIMEOUT
            message: Request timeout exceeded. Try later