Inserimento Lead (Persona giuridica)¶
Metodo utile all'inserimento del LEAD giuridico
Info
Il token scade dopo un’ora di inattività, ovvero nel caso non vengono effettuate richieste http alle API di CP Lead Service per un periodo superiore a 60 minuti.
Se il token è scaduto sarà necessario ripetere il login per ottenere un nuovo token valido.
Danger
Necessario fornire il token
Informazioni da aggiungere nell'Header¶
Dettaglio API¶
/api/leads/loadLegalPersonParametri¶
| Nome | Posizione | Tipo | Obbligatorio | Descrizione |
|---|---|---|---|---|
token |
header | string | Sì |
Corpo della richiesta¶
Content-Type: application/json · Schema: ClienteLegalCP
| Campo | Tipo | Obbligatorio | Descrizione |
|---|---|---|---|
cellulare |
string · nullable | No | |
telefono |
string · nullable | No | |
email |
string · nullable | No | |
codiceFiscale |
string · nullable | No | |
provincia |
string · nullable | No | |
comune |
string · nullable | No | |
indirizzo |
string · nullable | No | |
nota |
string · nullable | No | |
idCanale |
integer (int32) | No | |
ragioneSociale |
string · nullable | No | |
partitaIva |
string · nullable | No | |
emailPec |
string · nullable | No | |
rappresentanteLegale |
ReferenteBL | No | |
titolareEffettivo |
ReferenteBL | No |
Esempio di richiesta
{
"cellulare": "string",
"telefono": "string",
"email": "string",
"codiceFiscale": "string",
"provincia": "string",
"comune": "string",
"indirizzo": "string",
"nota": "string",
"idCanale": 0,
"ragioneSociale": "string",
"partitaIva": "string",
"emailPec": "string",
"rappresentanteLegale": {
"nome": "string",
"cognome": "string",
"cellulare": "string",
"telefono": "string"
},
"titolareEffettivo": {
"nome": "string",
"cognome": "string",
"cellulare": "string",
"telefono": "string"
}
}
Risposte¶
| Codice | Descrizione |
|---|---|
200 |
Success |
Risposta 200 · WebResponseCP
Info
Qui potete trovare un codice di esempio:
const URL = URL_COLLAUDO o URL_PRODUZIONE;
async function lead(token, data) {
let leadUrl = URL + 'api/leads/load';
const response = await fetch(leadUrl, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'token': token
},
body: JSON.stringify(data)
})
return response.json()
}
if (inputData) {
output = await lead(inputData.Token, {
cellulare: inputData.Cellulare,
email: inputData.Email,
codiceFiscale: inputData.CF,
provincia: inputData.Provincia,
nota: inputData.nota,
idCanale: 1,
ragioneSociale: inputData.RagioneSociale,
partitaIva: inputData.PartitaIva,
emailPec: inputData.EmailPec,
rappresentanteLegale: {
nome: inputData.RP.Nome,
cognome: inputData.RP.Cognome,
cellulare: inputData.RP.Cellulare
},
titolareEffettivo: {
nome: inputData.TF.Nome,
cognome: inputData.TF.Cognome,
telefono: inputData.TF.Telefono
}
});
} else {
output = {
status: 'error'
};
}