Skip to content

Instantly share code, notes, and snippets.

@ioggstream
Created October 23, 2019 18:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ioggstream/151108955637ca5465b86473dc94befe to your computer and use it in GitHub Desktop.
Save ioggstream/151108955637ca5465b86473dc94befe to your computer and use it in GitHub Desktop.
Resolved references in io-onboarding-pa-api
openapi: 3.0.0
info:
contact:
email: teamdigitale@governo.it
url: https://io.italia.it
description: |-
The backend used by the onboarding portal for public administrations of the IO project.
The website for the project is [io-website].
Privacy Policy is [privacy].
Development happens on github.
[//]: # (Riferimenti e url)
[io-website]: https://io.italia.it
[tos]: https://io.italia.it/note-legali/
[privacy]: https://io.italia.it/privacy-policy/
termsOfService: https://io.italia.it/note-legali/
title: IO onboarding PA API
version: 0.0.1
x-api-id: 49b844f5-2b1a-47a9-880a-ca480dac3736
x-project: io
x-summary: Public Administriations onboarding APIs for the IO project.
servers:
- description: Development environment
url: https://api.pa-onboarding.dev.io.italia.it/
- description: Production environment
url: https://api.pa-onboarding.io.italia.it/
paths:
/login:
get:
description: Redirects the user to the login page of the chosen SPID IdP.
parameters:
- description: |-
**IdP ID**.
The id of the SPID IdP to perform the login through.
*Note: Also a fake IdP with id `xx_tedsstenv2` is available.*
example: posteid
in: query
name: entity_id
required: true
schema:
type: string
x-extensible-enum:
- lepidaid
- infocertid
- sielteid
- namirialid
- timid
- arubaid
- posteid
- intesaid
- spiditalia
- xx_testenv2
- description: '**SPID level**. The security level of SPID authentication.'
example: SpidL2
in: query
name: auth_level
required: true
schema:
type: string
x-extensible-enum:
- SpidL2
- SpidL3
responses:
302:
description: Redirection to the login page from the chosen IdP.
/logout:
post:
description: Logs the user out
responses:
200:
description: Successful response
400:
$ref: '#/components/responses/400BadRequest'
429:
$ref: '#/components/responses/429TooManyRequests'
503:
$ref: '#/components/responses/503ServiceUnavailable'
default:
$ref: '#/components/responses/default'
security:
- bearerAuth: []
/organizations:
post:
description: |-
Creates a new organization associated with its legal responsible,
the user calling this endpoint is also associated to the organization as its delegate.
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/OrganizationRegistrationParams'
responses:
201:
content:
application/json:
schema:
$ref: '#/components/schemas/Organization'
description: The registered organization
headers:
Location:
description: URI of the created organization
schema:
type: string
400:
$ref: '#/components/responses/400BadRequest'
429:
$ref: '#/components/responses/429TooManyRequests'
503:
$ref: '#/components/responses/503ServiceUnavailable'
default:
$ref: '#/components/responses/default'
security:
- bearerAuth: []
/profile:
get:
description: Returns the user profile information.
responses:
200:
content:
application/json:
schema:
$ref: '#/components/schemas/UserProfile'
description: The user profile information
400:
$ref: '#/components/responses/400BadRequest'
429:
$ref: '#/components/responses/429TooManyRequests'
503:
$ref: '#/components/responses/503ServiceUnavailable'
default:
$ref: '#/components/responses/default'
security:
- bearerAuth: []
put:
description: Updates the user profile.
requestBody:
content:
application/json:
schema:
properties:
work_email:
$ref: '#/components/schemas/EmailAddress'
required:
- work_email
type: object
required: true
responses:
200:
content:
application/json:
schema:
$ref: '#/components/schemas/UserProfile'
description: The updated user profile information
400:
$ref: '#/components/responses/400BadRequest'
429:
$ref: '#/components/responses/429TooManyRequests'
503:
$ref: '#/components/responses/503ServiceUnavailable'
default:
$ref: '#/components/responses/default'
security:
- bearerAuth: []
/public-administrations:
get:
description: Returns a list of public administrations that match the searching
words.
parameters:
- description: |
**Public administration name**.
The API responds with a list of results that match the searching words.
in: query
name: search
required: true
schema:
$ref: '#/components/schemas/AdministrationSearchParam'
responses:
200:
content:
application/json:
schema:
$ref: '#/components/schemas/AdministrationSearchResult'
description: Public Administrations matching the search criteria.
400:
$ref: '#/components/responses/400BadRequest'
429:
$ref: '#/components/responses/429TooManyRequests'
503:
$ref: '#/components/responses/503ServiceUnavailable'
default:
$ref: '#/components/responses/default'
components:
headers:
Retry-After:
description: |-
Retry contacting the endpoint *at least* after seconds.
See https://tools.ietf.org/html/rfc7231#section-7.1.3
schema:
format: int32
type: integer
X-RateLimit-Limit:
description: The number of allowed requests in the current period
schema:
format: int32
type: integer
X-RateLimit-Remaining:
description: The number of remaining requests in the current period
schema:
format: int32
type: integer
X-RateLimit-Reset:
description: The number of seconds left in the current period
schema:
format: int32
type: integer
responses:
400BadRequest:
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
description: Bad Request
429TooManyRequests:
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
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:
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
description: Unexpected error
schemas:
AdministrationSearchParam:
example: comune gioiosa
pattern: ^[0-9A-Za-z ]{3,}$
type: string
AdministrationSearchResult:
properties:
administrations:
items:
$ref: '#/components/schemas/FoundAdministration'
type: array
required:
- administrations
type: object
EmailAddress:
format: email
type: string
FiscalCode:
description: |-
User's fiscal code.
Its format is defined by the [`FiscalCode`](https://teamdigitale.github.io/io-ts-commons/modules/_strings_.html#fiscalcode)
constant in [italia-ts-commons](https://teamdigitale.github.io/io-ts-commons) library.
*NOTE: for historical reasons the labels using this schema are not aligned
with the nomenclature defined by the [national ontologies](https://w3id.org/italia).
They will be replaced with the correct label
of [`tax_code`](https://ontopia-lodview.prod.pdnd.italia.it/onto/CPV/taxCode) at some point in time.*
example: SPNDNL80R13C555X
format: FiscalCode
type: string
x-import: italia-ts-commons/lib/strings
FoundAdministration:
oneOf:
- $ref: '#/components/schemas/FoundNotRegisteredAdministration'
- $ref: '#/components/schemas/FoundRegisteredAdministration'
FoundNotRegisteredAdministration:
example:
- fiscal_code: '86000470830'
ipa_code: c_e043
legal_representative:
family_name: Spano'
given_name: Ignazio Alfonso
links:
- href: https://api.pa-onboarding.dev.io.italia.it/public-administrations/c_e043
rel: self
name: Comune di Gioiosa Marea
pecs:
'1': indirizzo00@email.pec.it
'2': indirizzo01@email.pec.it
- fiscal_code: '81000930800'
ipa_code: c_e044
legal_representative:
family_name: ALI'
given_name: Gianfranco
links:
- href: https://api.pa-onboarding.dev.io.italia.it/public-administrations/c_e044
rel: self
name: Comune di Gioiosa Jonica
pecs:
'1': indirizzo10@email.pec.it
'2': indirizzo11@email.pec.it
'3': indirizzo12@email.pec.it
'4': indirizzo13@email.pec.it
- fiscal_code: 00282520808
ipa_code: c_e956
legal_representative:
family_name: Sergio
given_name: Mazzia
links:
- href: https://api.pa-onboarding.dev.io.italia.it/public-administrations/c_e0956
rel: self
name: Comune di Marina di Gioiosa Ionica
pecs:
'1': indirizzo20@email.pec.it
'2': indirizzo21@email.pec.it
properties:
fiscal_code:
$ref: '#/components/schemas/OrganizationFiscalCode'
ipa_code:
type: string
legal_representative:
properties:
family_name:
type: string
given_name:
type: string
required:
- family_name
- given_name
type: object
links:
$ref: '#/components/schemas/Links'
name:
type: string
pecs:
additionalProperties:
$ref: '#/components/schemas/EmailAddress'
type: object
required:
- fiscal_code
- ipa_code
- name
- legal_representative
- link
- pecs
type: object
FoundRegisteredAdministration:
example:
- fiscal_code: '86000470830'
ipa_code: c_e043
legal_representative:
family_name: Spano'
fiscal_code: BCDFGH12A21Z123D
given_name: Ignazio Alfonso
phone_number: '3331111111'
links:
- href: https://api.pa-onboarding.dev.io.italia.it/public-administrations/c_e043
rel: self
name: Comune di Gioiosa Marea
pecs:
'1': indirizzo00@email.pec.it
'2': indirizzo01@email.pec.it
scope: NATIONAL
selected_pec_label: '2'
- fiscal_code: '81000930800'
ipa_code: c_e044
legal_representative:
family_name: ALI'
fiscal_code: BCDFGH12A21Z123F
given_name: Gianfranco
phone_number: '3332222222'
links:
- href: https://api.pa-onboarding.dev.io.italia.it/public-administrations/c_e044
rel: self
name: Comune di Gioiosa Jonica
pecs:
'1': indirizzo10@email.pec.it
'2': indirizzo11@email.pec.it
'3': indirizzo12@email.pec.it
'4': indirizzo13@email.pec.it
scope: LOCAL
selected_pec_label: '3'
- fiscal_code: 00282520808
ipa_code: c_e956
legal_representative:
family_name: Sergio
fiscal_code: BCDFGH12A21Z123E
given_name: Mazzia
phone_number: '3333333333'
links:
- href: https://api.pa-onboarding.dev.io.italia.it/public-administrations/c_e0956
rel: self
name: Comune di Marina di Gioiosa Ionica
pecs:
'1': indirizzo20@email.pec.it
'2': indirizzo21@email.pec.it
scope: LOCAL
selected_pec_label: '1'
properties:
fiscal_code:
$ref: '#/components/schemas/OrganizationFiscalCode'
ipa_code:
type: string
legal_representative:
properties:
family_name:
type: string
fiscal_code:
$ref: '#/components/schemas/FiscalCode'
given_name:
type: string
phone_number:
type: string
required:
- family_name
- fiscal_code
- given_name
- phone_number
type: object
links:
$ref: '#/components/schemas/Links'
name:
type: string
pecs:
additionalProperties:
$ref: '#/components/schemas/EmailAddress'
type: object
scope:
$ref: '#/components/schemas/OrganizationScope'
selected_pec_label:
type: string
required:
- fiscal_code
- ipa_code
- name
- legal_representative
- link
- pecs
- scope
- selected_pec_label
type: object
LegalRepresentative:
example:
email: indirizzo00@email.pec.it
family_name: Spano'
fiscal_code: BCDFGH12A21Z123D
given_name: Ignazio Alfonso
phone_number: '5550000000'
role: ORG_MANAGER
properties:
email:
$ref: '#/components/schemas/EmailAddress'
family_name:
minLength: 1
type: string
fiscal_code:
$ref: '#/components/schemas/FiscalCode'
given_name:
minLength: 1
type: string
phone_number:
minLength: 1
type: string
role:
$ref: '#/components/schemas/UserRole'
required:
- email
- family_name
- fiscal_code
- given_name
- phone_number
- role
type: object
Link:
description: |-
As this API wants to drive the consumer in the workflow, we decided to
use Link Descriptor Objects defined in the current [json-schema draft](https://json-schema.org/draft/2019-09/links).
[IANA link relations](https://www.iana.org/assignments/link-relations/link-relations.xhtml)
should be used in `rel`.
externalDocs:
description: HyperSchema internet draft.
url: https://tools.ietf.org/id/draft-handrews-json-schema-hyperschema-02.html
properties:
$comment:
type: string
description:
type: string
href:
format: uri-template
type: string
rel:
type: string
title:
type: string
required:
- rel
- href
type: object
Links:
example:
- description: Agency URL
href: https://api.pa-onboarding.dev.io.italia.it/public-administrations/c_e956
rel: self
items:
$ref: '#/components/schemas/Link'
type: array
Organization:
example:
fiscal_code: '86000470830'
ipa_code: c_e043
legal_representative:
email: indirizzo00@email.pec.it
family_name: Spano'
fiscal_code: BCDFGH12A21Z123D
given_name: Ignazio Alfonso
phone_number: '5550000000'
role: ORG_MANAGER
name: Comune di Gioiosa Marea
pec: indirizzo00@email.pec.it
scope: NATIONAL
properties:
fiscal_code:
$ref: '#/components/schemas/OrganizationFiscalCode'
ipa_code:
minLength: 1
type: string
legal_representative:
$ref: '#/components/schemas/LegalRepresentative'
links:
$ref: '#/components/schemas/Links'
name:
minLength: 1
type: string
pec:
$ref: '#/components/schemas/EmailAddress'
scope:
$ref: '#/components/schemas/OrganizationScope'
required:
- fiscal_code
- ipa_code
- links
- name
- pec
- scope
type: object
OrganizationFiscalCode:
description: |-
Organization's fiscal code.
Its format is defined by the [`OrganizationFiscalCode`](https://teamdigitale.github.io/io-ts-commons/modules/_strings_.html#organizationfiscalcode)
constant in [italia-ts-commons](https://teamdigitale.github.io/io-ts-commons) library.
*NOTE: for historical reasons the labels using this schema are not aligned
with the nomenclature defined by the [national ontologies](https://w3id.org/italia).
They will be replaced with the correct label
of [`tax_code`](https://ontopia-lodview.prod.pdnd.italia.it/onto/COV/taxCode) at some point in time.*
example: 01234567890
format: OrganizationFiscalCode
type: string
x-import: italia-ts-commons/lib/strings
OrganizationRegistrationParams:
example:
ipa_code: c_e043
legal_representative:
family_name: Spano'
fiscal_code: BCDFGH12A21Z123D
given_name: Ignazio Alfonso
phone_number: '3331111111'
scope: NATIONAL
selected_pec_label: '1'
properties:
ipa_code:
minLength: 1
type: string
legal_representative:
properties:
family_name:
minLength: 1
type: string
fiscal_code:
$ref: '#/components/schemas/FiscalCode'
given_name:
minLength: 1
type: string
phone_number:
minLength: 1
type: string
required:
- family_name
- given_name
- fiscal_code
- phone_number
type: object
scope:
$ref: '#/components/schemas/OrganizationScope'
selected_pec_label:
minLength: 1
type: string
required:
- ipa_code
- legal_representative
- scope
- selected_pec_label
type: object
OrganizationScope:
type: string
x-extensible-enum:
- LOCAL
- NATIONAL
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).
example: https://tools.ietf.org/html/rfc7231#section-6.6.4
format: uri
type: string
type: object
UserProfile:
example:
email: example@email.com
family_name: Rossi
fiscal_code: RSSMRA80A01H501U
given_name: Mario
role: ORG_DELEGATE
work_email: work-email@email.com
properties:
email:
$ref: '#/components/schemas/EmailAddress'
family_name:
type: string
fiscal_code:
$ref: '#/components/schemas/FiscalCode'
given_name:
type: string
role:
$ref: '#/components/schemas/UserRole'
work_email:
$ref: '#/components/schemas/EmailAddress'
required:
- email
- family_name
- given_name
- fiscal_code
- role
type: object
UserRole:
type: string
x-extensible-enum:
- ORG_DELEGATE
- ORG_MANAGER
- DEVELOPER
- ADMIN
securitySchemes:
bearerAuth:
scheme: bearer
type: http
externalDocs:
description: IO Project website
url: https://io.italia.it
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment