changeInboxStatus()


Metodo per modificare lo stato di una fattura ricevuta, letta o non letta.

Endpoint

Method URI
POST https://fatture.keliweb.it/api/change-inbox-status

Request Parameters

Parameter Type Description Required
HTTP headers: Authorization string Bearer + the token to access APIs Yes
invoiceId integer ID univoco della fattura (relativo al DB locale) required_without:identificativoSdI
identificativoSdI integer ID univoco della fattura dato dal SDI required_without:invoiceId
mark_as_read boolean Imposta la fattura come letta/non letta Yes

Response Parameters

Parameter Type Description
data array dettagli della fattura ricevuta, in formato JSON

Example Request (BASH Curl)

curl --location --request POST 'https://fatture.keliweb.it/api/change-inbox-status' \
--header 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6ImY5Nzk4YTMzODMwMzNmN2I0' \
--form 'invoiceId="1"' \
--form 'mark_as_read="true"'

Example Request (PHP Curl)

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://fatture.keliweb.it/api/change-inbox-status',
  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_POSTFIELDS => array('invoiceId' => '1','mark_as_read' => 'true'),
  CURLOPT_HTTPHEADER => array(
    'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6ImY5Nzk4YTMzODMwMzNmN2I'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

Example Request (jQuery AJAX)

var form = new FormData();
form.append("invoiceId", "1");
form.append("mark_as_read", "true");

var settings = {
    url: "https://fatture.keliweb.it/api/change-inbox-status",
    method: "POST",
    timeout: 0,
    headers: {
        Authorization:
            "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6ImY5Nzk4YTMzODMwMzNmN2I0OTFk"
    },
    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/change-inbox-status"

payload={'invoiceId': '1',
'mark_as_read': 'true'}
files=[

]
headers = {
  'Authorization': 'Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6ImY5Nzk4YTMzODMwMzNmN2I0OTF'
}

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

print(response.text)

Example Response (JSON payload)

{
    "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": "2021-10-21 13:43:17",
        "idFiscaleIVA": "IT03281320782",
        "codiceFiscale": null,
        "pecDestinatario": null,
        "fornitore": "Keliweb SRL",
        "idFiscaleIVA_fornitore": "IT03281320782",
        "codiceFiscale_fornitore": null,
        "is_read": true,
        "totaleDocumento": 12.08,
        "numero": "2020A-18133",
        "tipoDocumento": "TD01",
        "dataDocumento": "14/07/2020",
        "divisa": "EUR",
        "causale": null
    },
    "version": "v2.0.0",
    "copyright": "2009-2021 - Keliweb Srl",
    "documentation": "https://fatture.keliweb.it/docs",
    "valid_as_of": "21/10/2021 (13:43)"
}