Manage Service: Create

Descrizione

Questa API permette di creare un servizio.

Devi usare la nuova chiave manage per la gestione dei servizi.

Per utilizzare questa API è necessario richiedere un'abilitazione specifica.

Create a new service

Create a new Service with the attributes provided in the request payload

POSThttps://api.io.pagopa.it/api/v1/manage/services
Authorization
Body

A service body payload

metadata*CmsServicePayloadMetadata (all of)

A set of service metadata properties on request payload

name*string
description*string
organization*CmsOrganization (object)
require_secure_channelboolean
authorized_recipientsarray of FiscalCode (string (FiscalCode))
authorized_cidrsarray of CIDR (string)

Allowed source IPs or CIDRs for this service. When empty, every IP address it's authorized to call the IO API on behalf of the service.

max_allowed_payment_amountinteger (int32)
Response

Service created successfully

Body
idstring
statusCmsServiceLifecycleStatus (object)
last_updateTimestamp (string (UTCISODateFromString))

A date-time field in ISO-8601 format and UTC timezone.

Example: "2018-10-13T00:00:00.000Z"
metadataCmsServiceMetadata (all of)

A set of service metadata properties

name*string
description*string
organization*CmsOrganization (object)
require_secure_channelboolean
authorized_recipientsarray of FiscalCode (string (FiscalCode))
authorized_cidrsarray of CIDR (string)

Allowed source IPs or CIDRs for this service. When empty, every IP address it's authorized to call the IO API on behalf of the service.

max_allowed_payment_amountinteger (int32)
Request
const response = await fetch('https://api.io.pagopa.it/api/v1/manage/services', {
    method: 'POST',
    headers: {
      "Content-Type": "application/json"
    },
    body: JSON.stringify({
      "metadata": {
        "scope": "LOCAL",
        "topic_id": 3
      },
      "name": "text",
      "description": "text",
      "organization": {
        "name": "text",
        "fiscal_code": "12345678901"
      }
    }),
});
const data = await response.json();
Response
{
  "id": "text",
  "status": {
    "value": "draft",
    "reason": "text"
  },
  "last_update": "2018-10-13T00:00:00.000Z",
  "metadata": {
    "web_url": "text",
    "app_ios": "text",
    "app_android": "text",
    "tos_url": "text",
    "privacy_url": "text",
    "address": "text",
    "phone": "text",
    "email": "text",
    "pec": "text",
    "cta": "text",
    "token_name": "text",
    "support_url": "text",
    "scope": "LOCAL",
    "topic": {
      "id": 3,
      "name": "Benessere sociale"
    }
  },
  "name": "text",
  "description": "text",
  "organization": {
    "name": "text",
    "fiscal_code": "12345678901",
    "department_name": "text"
  },
  "require_secure_channel": false,
  "authorized_recipients": [
    "SPNDNL80R13C555X"
  ],
  "authorized_cidrs": [
    "text"
  ]
}

Esempi

Ecco un esempio con le informazioni minime per la creazione di un servizio di test:

### REQUEST
curl --location --request POST 'https://api.io.pagopa.it/api/v1/manage/services' \
--header 'Ocp-Apim-Subscription-Key: __YOUR_API_KEY__' \
--header 'Content-Type: application/json' \
--data-raw '{
  "name": "string",
  "description": "string",
  "organization": {
    "name": "string",
    "fiscal_code": "12345678901",
    "department_name": "string"
  },
  "require_secure_channel": false,
  "authorized_cidrs": [
    "85.338.5.14"
  ],
  "max_allowed_payment_amount": 0,
  "metadata": {
    "web_url": "string",
    "app_ios": "string",
    "app_android": "string",
    "tos_url": "string",
    "privacy_url": "string",
    "address": "string",
    "phone": "string",
    "email": "string",
    "pec": "string",
    "cta": "string",
    "token_name": "string",
    "support_url": "string",
    "scope": "LOCAL"
  }
}'
### RESPONSE
{
  "id": "string",
  "status": {
    "value": "draft",
    "reason": "string"
  },
  "version": 0,
  "last_update": "2018-10-13T00:00:00.000Z",
  "name": "string",
  "description": "string",
  "organization": {
    "name": "string",
    "fiscal_code": "12345678901",
    "department_name": "string"
  },
  "require_secure_channel": false,
  "authorized_recipients": [],
  "authorized_cidrs": [
    "85.338.5.14"
  ],
  "metadata": {
    "web_url": "string",
    "app_ios": "string",
    "app_android": "string",
    "tos_url": "string",
    "privacy_url": "string",
    "address": "string",
    "phone": "string",
    "email": "string",
    "pec": "string",
    "cta": "string",
    "token_name": "string",
    "support_url": "string",
    "scope": "LOCAL"
  }
}

Risorse utili

https://developer.io.italia.it/openapi.html#operation/cmsCreateService

Last updated