Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #
- # Verifica validità codice fiscale
- x-commons:
- ratelimit-headers: &ratelimit-headers
- X-RateLimit-Limit:
- $ref: '#/components/headers/X-RateLimit-Limit'
- X-RateLimit-Remaining:
- $ref: '#/components/headers/X-RateLimit-Remaining'
- X-RateLimit-Reset:
- $ref: '#/components/headers/X-RateLimit-Reset'
- common-responses: &common-responses
- '400':
- $ref: '#/components/responses/400BadRequest'
- '401':
- $ref: '#/components/responses/401Unauthorized'
- '429':
- $ref: '#/components/responses/429TooManyRequests'
- '503':
- $ref: '#/components/responses/503ServiceUnavailable'
- default:
- $ref: '#/components/responses/default'
- security:
- - IBM-Client-Secret: []
- IBM-Client-Id: []
- openapi: 3.0.0
- info:
- version: "1.0.0"
- title: |-
- Verifica validità codice fiscale.
- x-summary: >-
- Verifica validità di codice fiscale di persona fisica e persona non fisica
- description: |
- #### Documentazione
- Questo servizio ritorna la validità di una dato codice fiscale descritta da
- un campo di ritorno booleano nell oggetto json di response
- #### Note
- Poiché il servizio effettua una verifica sul dato in input una
- risposta verrà sempre ritornata con stato 200 anche se il codice fiscale
- non fosse presente negli archivi.
- Nella risposta è presente un campo messaggio che riporta la stessa dizione
- del servizio di verifica codice fiscale a libero accesso del sito istituzionale
- ##### Conformità con il modello di interoperabilità
- L'Header di Throttling X-RateLimit-Reset non viene inviato in caso di https
- status code 200, sarà presente solo in caso di 429
- #### Sicurezza
- Pur essendo questa API di pubblico accesso, è richiesto l'invio delle
- API Key che consentono all'infrastruttura di applicare le politiche di
- throttling definite nell'ambito del piano sottoscritto
- #### Informazioni tecniche ed esempi
- Esempio:
- ```
- curl --header "Content-Type: application/json" \
- --request POST \
- --data '{"codiceFiscale":"AAAZZZ00H00T000Z"}' \
- https://agenziaentrate.gov.it/entrate/api/codice-fiscale/v0/verifica
- {
- "codiceFiscale": "AAAZZZ00H00T000Z"
- "valido": false,
- "messaggio": "Codice fiscale non valido"
- }
- ```
- contact:
- name: Agenzia delle Entrate
- url: https://www.agenziaentrate.gov.it
- x-audience:
- - public
- x-api-id: 5ca54741-8f62-4aad-ab79-13ae762920e3
- license:
- name: Apache 2.0
- url: 'http://www.apache.org/licenses/LICENSE-2.0.html'
- tags:
- - name: infrastructure
- description: |-
- Endpoint non autenticato per la verifica dello stato del servizio
- - name: verifiche
- description: |-
- verifica la validità e l'esistenza della codice fiscale in input
- servers:
- - description: Produzione
- url: https://api.agenziaentrate.gov.it/entrate/api/codice-fiscale/v0
- paths:
- /status:
- get:
- summary: Ritorna lo stato dell'applicazione.
- description: |
- Ritorna lo stato dell'applicazione: 200 se funziona correttamente
- o un errore se l'applicazione è temporaneamente indisponibile
- per manutenzione o per un problema tecnico.
- operationId: get_status
- tags:
- - infrastructure
- responses:
- <<: *common-responses
- '200':
- description: |
- Il server ha ritornato lo status. In caso di problemi
- ritorna sempre un problem+json.
- headers:
- <<: *ratelimit-headers
- content:
- application/problem+json:
- schema:
- $ref: '#/components/schemas/Problem'
- /verifica:
- post:
- summary: Effettua una validazione del codice fiscale in input.
- operationId: post_verifica_codiceFiscale
- tags:
- - verifiche
- description: |
- Ritorna informazioni circa la validità del codice fiscale in input
- requestBody:
- required: true
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Richiesta'
- examples:
- codiceFiscaleAlfanumerico:
- value:
- codiceFiscale: 'AAAZZZ00H00T000Z'
- codiceFiscaleNumerico:
- value:
- codiceFiscale: '06363391001'
- responses:
- <<: *common-responses
- '200':
- description: |
- Il server è riuscito a verificare la validità del codice fiscale.
- # header di throttling sono obbligatori
- headers:
- <<: *ratelimit-headers
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/VerificaCodiceFiscale'
- examples: # Esempi per ogni casistica
- CodiceFiscaleValido:
- value:
- codiceFiscale: '06363391001'
- valido: true
- messaggio: "Codice fiscale valido"
- CodiceFiscaleValidoNonUtilizzabile:
- value:
- codiceFiscale: '***********'
- valido: true
- messaggio: "Codice fiscale valido, non più utilizzabile in quanto aggiornato in altro codice fiscale"
- CodiceFiscaleNonValidoAggiornatoInAltro:
- value:
- codiceFiscale: '***********'
- valido: false
- messaggio: "Codice fiscale non utilizzabile in quanto aggiornato in altro codice fiscale"
- CodiceFiscaleNonValido:
- value:
- codiceFiscale: 'AAAZZZ00H00T000Z'
- valido: false
- messaggio: "Codice fiscale non valido"
- components:
- schemas:
- Richiesta:
- type: object
- properties:
- codiceFiscale:
- $ref: '#/components/schemas/CodiceFiscale'
- CodiceFiscale:
- type: string
- minLength: 11
- maxLength: 16
- pattern: '^[0-9]{11}|(?:^(?:[A-Z][AEIOU][AEIOUX]|[B-DF-HJ-NP-TV-Z]{2}[A-Z]){2}(?:[\dLMNP-V]{2}(?:[A-EHLMPR-T](?:[04LQ][1-9MNP-V]|[15MR][\dLMNP-V]|[26NS][0-8LMNP-U])|[DHPS][37PT][0L]|[ACELMRT][37PT][01LM]|[AC-EHLMPR-T][26NS][9V])|(?:[02468LNQSU][048LQU]|[13579MPRTV][26NS])B[26NS][9V])(?:[A-MZ][1-9MNP-V][\dLMNP-V]{2}|[A-M][0L](?:[1-9MNP-V][\dLMNP-V]|[0L][1-9MNP-V]))[A-Z]$)'
- example: '06363391001'
- description: 'può assumere un valore alfanumerico di lunghezza 16 o numerico di lunghezza 11 (i.e. 06363391001)'
- VerificaCodiceFiscale:
- type: object
- properties:
- codiceFiscale:
- $ref: '#/components/schemas/CodiceFiscale'
- valido:
- type: boolean
- example: true
- messaggio:
- type: string
- example: "Codice fiscale valido"
- description: "messaggio congurente con il serivizio a libero accesso di verifica codice fiscale sul sito istituzionale"
- Problem:
- properties:
- detail:
- description: |
- A human readable explanation specific to this occurrence of the
- problem. You MUST NOT expose internal informations, personal
- data or implementation details through this field.
- example: Request took too long to complete.
- type: string
- instance:
- description: |
- An absolute URI that identifies the specific occurrence of the problem.
- It may or may not yield further information if dereferenced.
- format: uri
- type: string
- status:
- description: |
- The HTTP status code generated by the origin server for this occurrence
- of the problem.
- example: 503
- exclusiveMaximum: true
- format: int32
- maximum: 600
- minimum: 100
- type: integer
- title:
- description: |
- A short, summary of the problem type. Written in english and readable
- for engineers (usually not suited for non technical stakeholders and
- not localized); example: Service Unavailable
- type: string
- type:
- default: about:blank
- description: |
- An absolute URI that identifies the problem type. When dereferenced,
- it SHOULD provide human-readable documentation for the problem type
- (e.g., using HTML).
- format: uri
- type: string
- type: object
- securitySchemes:
- IBM-Client-Secret:
- type: apiKey
- description: ''
- name: X-IBM-Client-Secret
- in: header
- IBM-Client-Id:
- type: apiKey
- description: ''
- name: X-IBM-Client-Id
- in: header
- headers:
- Retry-After:
- description: |-
- Retry contacting the endpoint *at least* after seconds.
- See https://tools.ietf.org/html/rfc7231#section-7.1.3
- schema:
- type: string
- WWW-Authenticate:
- description: |-
- Auth realm=APIkey
- See https://tools.ietf.org/html/rfc7235#section-4.1
- schema:
- type: string
- X-RateLimit-Limit:
- description: The number of allowed requests in the current period
- schema:
- type: string
- X-RateLimit-Remaining:
- description: The number of remaining requests in the current period
- schema:
- type: string
- X-RateLimit-Reset:
- description: The number of seconds left in the current period
- schema:
- type: string
- responses:
- 400BadRequest:
- content:
- application/problem+json:
- schema:
- $ref: '#/components/schemas/Problem'
- description: Bad Request
- 401Unauthorized:
- content:
- application/problem+json:
- schema:
- $ref: '#/components/schemas/Problem'
- headers:
- WWW-Authenticate:
- $ref: '#/components/headers/WWW-Authenticate'
- description: Not authorized
- 403Forbidden:
- description: Forbidden
- 404NotFound:
- description: Not Found
- 429TooManyRequests:
- description: Too many requests
- headers:
- Retry-After:
- $ref: '#/components/headers/Retry-After'
- X-RateLimit-Limit:
- $ref: '#/components/headers/X-RateLimit-Limit'
- X-RateLimit-Remaining:
- $ref: '#/components/headers/X-RateLimit-Remaining'
- X-RateLimit-Reset:
- $ref: '#/components/headers/X-RateLimit-Reset'
- 503ServiceUnavailable:
- content:
- application/problem+json:
- schema:
- $ref: '#/components/schemas/Problem'
- description: Service Unavailable
- headers:
- Retry-After:
- $ref: '#/components/headers/Retry-After'
- default:
- description: Unexpected error
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement