⚙️Gestione massiva tramite API REST

Procedura per il caricamento, la modifica e l'eliminazione massiva delle posizioni debitorie su GPD

La gestione massiva può essere innescato tramite API le cui specifiche sono riportate di seguito nel documento. Mediante l'API /brokers/{broker-code}/organizations/{organization-fiscal-code}/debtpositions/file è possibile innescare il caricamento, la modifica e l'eliminazione massiva delle posizioni debitorie presenti all'interno di un file compresso come descritto in Specifiche tracciato di input. Il metodo in caso positivo risponde subito con un codice HTTP 202, una volta ottenuta una risposta positiva è possibile verificare lo stato dell'operazione massiva mediante l'utilizzo dell'API /brokers/{broker-code}/organizations/{organization-fiscal-code}/debtpositions/file/{fileId}/status. Per ottenere un report completo, comprensivo degli esiti per ogni posizioni debitoria, è necessario interrogare l'API /brokers/{broker-code}/organizations/{organization-fiscal-code}/debtpositions/file/{fileId}/report

Le URI che consentono di consultare lo status ed il report dell'operazione effettuata tramite caricamento sono accessibili inserendo come path param il fileID contenuto nel Location header delle risposte alle seguentiAPI POST /organizations/{organization-fiscal-code}/debtpositions/file

PUT /organizations/{organization-fiscal-code}/debtpositions/file

DELETE /organizations/{organization-fiscal-code}/debtpositions/file

"Location" : "brokers/{broker-code}/organizations/{ec-code}/debtpositions/file/{fileID}/status"

Specifiche API

The Organization creates the debt positions listed in the file.

post
Path parameters
broker-codestring · min: 1Required

The broker code

organization-fiscal-codestring · min: 1Required

The organization fiscal code

Body
filestring · binaryOptional

File to be uploaded

Responses
post
POST /brokers/{broker-code}/organizations/{organization-fiscal-code}/debtpositions/file HTTP/1.1
Host: 
Content-Type: multipart/form-data
Accept: */*
Content-Length: 17

{
  "file": "binary"
}

No content

The Organization updates the debt positions listed in the file.

put
Path parameters
broker-codestring · min: 1Required

The broker code

organization-fiscal-codestring · min: 1Required

The organization fiscal code

Body
filestring · binaryOptional

File to be uploaded

Responses
put
PUT /brokers/{broker-code}/organizations/{organization-fiscal-code}/debtpositions/file HTTP/1.1
Host: 
Content-Type: multipart/form-data
Accept: */*
Content-Length: 17

{
  "file": "binary"
}

No content

The Organization deletes the debt positions based on IUPD listed in the file.

delete
Path parameters
broker-codestring · min: 1Required

The broker code

organization-fiscal-codestring · min: 1Required

The organization fiscal code

Body
filestring · binaryOptional

File to be uploaded

Responses
delete
DELETE /brokers/{broker-code}/organizations/{organization-fiscal-code}/debtpositions/file HTTP/1.1
Host: 
Content-Type: multipart/form-data
Accept: */*
Content-Length: 17

{
  "file": "binary"
}

No content

Returns the debt positions upload report.

get
Path parameters
broker-codestring · min: 1Required

The broker code

organization-fiscal-codestring · min: 1Required

The organization fiscal code

file-idstring · min: 1Required

The unique identifier for file upload

Responses
get
GET /brokers/{broker-code}/organizations/{organization-fiscal-code}/debtpositions/file/{file-id}/report HTTP/1.1
Host: 
Accept: */*
{
  "uploadID": "text",
  "processedItem": 1,
  "submittedItem": 1,
  "responses": [
    {
      "statusCode": 400,
      "statusMessage": "Bad request caused by invalid email address",
      "requestIDs": [
        "text"
      ]
    }
  ],
  "startTime": "2024-10-08T14:55:16.302Z",
  "endTime": "2024-10-08T14:55:16.302Z"
}

Returns the debt positions upload status.

get
Path parameters
broker-codestring · min: 1Required

The broker code

organization-fiscal-codestring · min: 1Required

The organization fiscal code

file-idstring · min: 1Required

The unique identifier for file upload

Responses
get
GET /brokers/{broker-code}/organizations/{organization-fiscal-code}/debtpositions/file/{file-id}/status HTTP/1.1
Host: 
Accept: */*
{
  "uploadID": "text",
  "processedItem": 1,
  "submittedItem": 1,
  "startTime": "2024-10-08T14:55:16.302Z"
}