getInboxes()


Metodo per ottenere la lista delle fatture ricevute dal SDI.

Endpoint

Method URI
POST https://fatture.keliweb.it/api/inboxes

Request Parameters

Parameter Type Description Required
HTTP headers: Authorization string Bearer + the token to access APIs Yes
is_read boolean se presente, filtra le fatture ricevute per lette/non lette optional

Response Parameters

Parameter Type Description
data array lista delle fatture ricevute (paginate), in formato JSON

Example Request (BASH Curl)

curl --location --request POST 'https://fatture.keliweb.it/api/inboxes' \
--header 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6Ij'

Example Request (PHP Curl)

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://fatture.keliweb.it/api/inboxes',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_HTTPHEADER => array(
    'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6IjJmZTQ2NTMzZWZhMmMxZjFkN2JlY'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

Example Request (jQuery AJAX)

var form = new FormData();
var settings = {
    url: "https://fatture.keliweb.it/api/inboxes",
    method: "POST",
    timeout: 0,
    headers: {
        Authorization:
            "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6IjJmZTQ2NTMzZWZhMmMxZj"
    },
    processData: false,
    mimeType: "multipart/form-data",
    contentType: false,
    data: form
};

$.ajax(settings).done(function(response) {
    console.log(response);
});

Example Request (Python - Requests)

import requests

url = "https://fatture.keliweb.it/api/inboxes"

payload={}
files={}
headers = {
  'Authorization': 'Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6ImYxYTAzNzMzYzY5ZD'
}

response = requests.request("POST", url, headers=headers, data=payload, files=files)

print(response.text)

Example Response (JSON payload)

{
    "data": {
        "current_page": 1,
        "data": [
            {
                "id": 1,
                "identificativoSdI": "23069278",
                "nomeFile": "IT03281320782_0001f.xml",
                "file": "inbox/23069278/file/IT03281320782_0001f.xml",
                "nomeFileMetadati": "IT03281320782_0001f_MT_001.xml",
                "metadati": "inbox/23069278/metadati/IT03281320782_0001f_MT_001.xml",
                "type": "INBOX-RiceviFatture",
                "codiceDestinatario": "8MO1234",
                "formato": "FPR12",
                "tentativiInvio": 1,
                "messageId": "44307403",
                "created_at": "2020-07-20 07:34:41",
                "updated_at": "2020-07-20 07:34:41",
                "idFiscaleIVA": "IT03281320782",
                "codiceFiscale": null,
                "pecDestinatario": null,
                "fornitore": "Keliweb SRL",
                "idFiscaleIVA_fornitore": "IT03281320782",
                "codiceFiscale_fornitore": null,
                "is_read": false,
                "totaleDocumento": 12.08,
                "numero": "2020A-18133",
                "tipoDocumento": "TD01",
                "dataDocumento": "14/07/2020",
                "divisa": "EUR",
                "causale": null
            }
        ],
        "first_page_url": "https://fatture.keliweb.it/api/inboxes?page=1",
        "from": 1,
        "last_page": 1,
        "last_page_url": "https://fatture.keliweb.it/api/inboxes?page=1",
        "next_page_url": null,
        "path": "https://fatture.keliweb.it/api/inboxes",
        "per_page": 25,
        "prev_page_url": null,
        "to": 2,
        "total": 2
    },
    "version": "v2.0.0",
    "copyright": "2009-2021 - Keliweb Srl",
    "documentation": "https://fatture.keliweb.it/docs",
    "valid_as_of": "21/10/2021 (12:11)"
}