New lead webhook
How to configure a New lead webhook on Cliengo.
Set up your WebHook to receive new Leads.
First start by going to Chatbot-> Integrations-> Webhook,
Now, complete your endpoint URL and click on "Generate Webhook" to saves your changes. After that, you'll receive a key, which will be used for security proposes.
This key's propose is for you to verify who is sending data to your WebHook. This key will be inside the JSON you'll receive. A good practice would be for you to check that the key received in your endpoint is the same as the one we'll send you.
If everything's correctly configured, you should start receiving new leads to your endpoint in JSON format.
Below, you can see an example of the JSON you'll receive.
{
"id":"5f22cb7be4bfbd002a100a49",
"accountId":"5b1111111111111111a91fd2",
"websiteId":"5b1111111111111111a91fd7",
"status":"new",
"name":"Pepe",
"email":"[email protected]",
"phone":"011 2233-4455",
"internationalPhoneNumber":"+541122334455",
"whatsappPhoneNumber":"5491122334455",
"creationDate":"2020-07-30T13:30:35.658Z",
"lastUpdateDate":"Jul 30, 2020 1:30:36 PM",
"lastName":"Grillo",
"age":30,
"webhookKey":"1ec2acd1-1111-0000-b3c4-ffff111183285",
"referalUrl":"Leadaki - test", //Where the lead came from. Example: www.google.com
"landingUrl":"Leadaki - test", // The first page they reached.Example: www.cliengo.com/precios
"message":"Conversation message",
"ip":"111.11.111.11",
"conversionUrl":"https://lw.cliengo.com/?companyId=5b1111111111111111a91fd2&websiteId=5b1111111111111111a91fd7", // The page where the lead was created Example: www.cliengo.com/form
"message":"cliente: tiene kiwi\nasesor: será un placer ayudarte, ¿podrías darme tu nombre completo?😄\ncliente: Pepe Grillo\nasesor: Pepe yo me encargo de ponerte en contacto con un asesor para que responda tu consulta\nasesor: podrías dejarme tu teléfono completo?\ncliente: 1122334455\nasesor: podrías dejarme tu e-mail?\ncliente: [email protected]\nasesor: ¿Cuál es el método de pago?\ncliente: Efectivo\nasesor: quieres dejarme alguna consulta adicional?\ncliente: tenes pera\nasesor: Si te interesan canastas que contengan esas frutas, te recomendamos nuestra canasta clásica. Es la más económica e incluye una variedad de manzanas, peras, naranjas y bananos. Todo 100% orgánico y de excelente calidad. Además, estamos con una promoción especial, ¡el primer envío es totalmente gratis para esta canasta!\nasesor: ¿Tienes alguna preferencia en cuanto a nuestras frutas de estación?\ncliente: Frutillas\nasesor: Pepe Perfecto! Con esta información un ejecutivo de La Frutería se estará poniendo en contacto contigo con una cotización y detalles de nuestro servicio.\n",
"assignedTo":{ //Assigned user
"name":"Kiran Jules",
"email":"[email protected]",
"creationDate":"Sep 4, 2018 3:53:55 PM",
"userId":"5b11111111111111111a91fd5",
"phone":""
},
"geoip":{
"latitude":"-34.6766",
"longitude":"-58.5606",
"country":"AR",
"state":"Buenos Aires",
"city":"San Justo",
"zipCode":"1754"
},
"duplicatedContact":false,
"notes":[
],
"logs":[
],
"calls":[
],
"medium":"referral",
"source":"Leadaki - test",
"mediumTranslate":"Referencia",
"sourceTranslate":"Leadaki - test",
"customParams":{
"ldkCompanyId":"5b1111111111111111a91fd2",
"ldkWebsiteId":"5b1111111111111111a91fd7",
"final_question":"tenes pera",
"tags[0]":"fired_new_lead",
"conversationId":"5f221111111111111118ed2f",
"firedTriggers[0]":"5bc111111111111111111a4b",
"channel":"CHATBOT",
"question_1":"Efectivo",
"question_2":"Frutillas",
"body":"question_1=Efectivo&final_question=tenes%20pera&question_2=Frutillas&phoneVerified=&contactDni=&ldkCompanyId=5b1111111111111111a91fd2&ldkWebsiteId=5b1111111111111111a91fd7&ldkUtms=&conversationId=5f221111111111111118ed2f&chatSessionId=5f221111111111111118ed2f&firedTriggers%5B0%5D=5bc111111111111111111a4b&channel=CHATBOT&chatUrl=https%3A%2F%2Flw.cliengo.com%2F%3FcompanyId%5b1111111111111111a91fd2%26websiteId%3D5b1111111111111111a91fd7&chatIp=181.44.129.23&assignedTo=5f0e060732ba35002af6aab9&chatLog=cliente%3A%20tiene%20kiwi%0Aasesor%3A%20ser%C3%A1%20un%20placer%20ayudarte%2C%20%C2%BFpodr%C3%ADas%20darme%20tu%20nombre%20completo%3F%F0%9F%98%84%0Acliente%3A%20Pepe%20Grillo%0Aasesor%3A%20Pepe%20yo%20me%20encargo%20de%20ponerte%20en%20contacto%20con%20un%20asesor%20para%20que%20responda%20tu%20consulta%0Aasesor%3A%20podr%C3%ADas%20dejarme%20tu%20tel%C3%A9fono%20completo%3F%0Acliente%3A%201122334455%0Aasesor%3A%20podr%C3%ADas%20dejarme%20tu%20e-mail%3F%0Acliente%3A%20pepe.grillo%40gmail.com%0Aasesor%3A%20%C2%BFCu%C3%A1l%20es%20el%20m%C3%A9todo%20de%20pago%3F%0Acliente%3A%20viyuya%0Aasesor%3A%20quieres%20dejarme%20alguna%20consulta%20adicional%3F%0Acliente%3A%20tenes%20pera%0Aasesor%3A%20Si%20te%20interesan%20canastas%20que%20contengan%20esas%20frutas%2C%20te%20recomendamos%20nuestra%20canasta%20cl%C3%A1sica.%20Es%20la%20m%C3%A1s%20econ%C3%B3mica%20e%20incluye%20una%20variedad%20de%20manzanas%2C%20peras%2C%20naranjas%20y%20bananos.%20Todo%20100%25%20org%C3%A1nico%20y%20de%20excelente%20calidad.%20Adem%C3%A1s%2C%20estamos%20con%20una%20promoci%C3%B3n%20especial%2C%20%C2%A1el%20primer%20env%C3%ADo%20es%20totalmente%20gratis%20para%20esta%20canasta%21%0Aasesor%3A%20%C2%BFTienes%20alguna%20preferencia%20en%20cuanto%20a%20nuestras%20frutas%20de%20estaci%C3%B3n%3F%0Acliente%3A%20frutillas%0Aasesor%3A%20Pepe%20Perfecto%21%20Con%20esta%20informaci%C3%B3n%20un%20ejecutivo%20de%20La%20Fruter%C3%ADa%20se%20estar%C3%A1%20poniendo%20en%20contacto%20contigo%20con%20una%20cotizaci%C3%B3n%20y%20detalles%20de%20nuestro%20servicio.%0A&chatName=pepe&chatEmail=pepe.grillo%40gmail.com&chatPhone=011%202233-4455&chatInternationalPhone=%2B541122334455&tags%5B0%5D=fired_new_lead",
"assignedTo":"5f0e060732ba35002af6aab9"
},
"rating":0,
"conversationId":"5f221111111111111118ed2f",
"utmSource":"Leadaki - test",
"utmMedium":"referral",
"utmCampaign":"",
"utmContent":"",
"utmTerm":"",
"accountName":"La Fruteria",
"websiteName":"La Frutería",
"websiteCategory":"",
"entryMethod":"CHATBOT",
"tags":[
"fired_new_lead"
],
"entities":[
{
"slot_id":"phone",
"values":[
"1122334455"
]
},
{
"slot_id":"email",
"values":[
"[email protected]"
]
}
],
"extraParams":{
"ldkCompanyId":"5b1111111111111111a91fd2",
"ldkWebsiteId":"5b1111111111111111a91fd7",
"final_question":"tenes pera",
"tags[0]":"fired_new_lead",
"conversationId":"5f221111111111111118ed2f",
"firedTriggers[0]":"5bc111111111111111111a4b",
"channel":"CHATBOT",
"question_1":"Efectivo",
"question_2":"Frutillas",
"body":"question_1=Efectivo&final_question=tenes%20pera&question_2=Frutillas&phoneVerified=&contactDni=&ldkCompanyId=5b1111111111111111a91fd2&ldkWebsiteId=5b1111111111111111a91fd7&ldkUtms=&conversationId=5f221111111111111118ed2f&chatSessionId=5f221111111111111118ed2f&firedTriggers%5B0%5D=5bc111111111111111111a4b&channel=CHATBOT&chatUrl=https%3A%2F%2Flw.cliengo.com%2F%3FcompanyId%5b1111111111111111a91fd2%26websiteId%3D5b1111111111111111a91fd7&chatIp=181.44.129.23&assignedTo=5f0e060732ba35002af6aab9&chatLog=cliente%3A%20tiene%20kiwi%0Aasesor%3A%20ser%C3%A1%20un%20placer%20ayudarte%2C%20%C2%BFpodr%C3%ADas%20darme%20tu%20nombre%20completo%3F%F0%9F%98%84%0Acliente%3A%20Pepe%20Grillo%0Aasesor%3A%20Pepe%20yo%20me%20encargo%20de%20ponerte%20en%20contacto%20con%20un%20asesor%20para%20que%20responda%20tu%20consulta%0Aasesor%3A%20podr%C3%ADas%20dejarme%20tu%20tel%C3%A9fono%20completo%3F%0Acliente%3A%201122334455%0Aasesor%3A%20podr%C3%ADas%20dejarme%20tu%20e-mail%3F%0Acliente%3A%20pepe.grillo%40gmail.com%0Aasesor%3A%20%C2%BFCu%C3%A1l%20es%20el%20m%C3%A9todo%20de%20pago%3F%0Acliente%3A%20viyuya%0Aasesor%3A%20quieres%20dejarme%20alguna%20consulta%20adicional%3F%0Acliente%3A%20tenes%20pera%0Aasesor%3A%20Si%20te%20interesan%20canastas%20que%20contengan%20esas%20frutas%2C%20te%20recomendamos%20nuestra%20canasta%20cl%C3%A1sica.%20Es%20la%20m%C3%A1s%20econ%C3%B3mica%20e%20incluye%20una%20variedad%20de%20manzanas%2C%20peras%2C%20naranjas%20y%20bananos.%20Todo%20100%25%20org%C3%A1nico%20y%20de%20excelente%20calidad.%20Adem%C3%A1s%2C%20estamos%20con%20una%20promoci%C3%B3n%20especial%2C%20%C2%A1el%20primer%20env%C3%ADo%20es%20totalmente%20gratis%20para%20esta%20canasta%21%0Aasesor%3A%20%C2%BFTienes%20alguna%20preferencia%20en%20cuanto%20a%20nuestras%20frutas%20de%20estaci%C3%B3n%3F%0Acliente%3A%20frutillas%0Aasesor%3A%20Pepe%20Perfecto%21%20Con%20esta%20informaci%C3%B3n%20un%20ejecutivo%20de%20La%20Fruter%C3%ADa%20se%20estar%C3%A1%20poniendo%20en%20contacto%20contigo%20con%20una%20cotizaci%C3%B3n%20y%20detalles%20de%20nuestro%20servicio.%0A&chatName=pepe&chatEmail=pepe.grillo%40gmail.com&chatPhone=011%202233-4455&chatInternationalPhone=%2B541122334455&tags%5B0%5D=fired_new_lead",
"assignedTo":"5f0e111111111111111111ab9" //UserId or TeamId(User group)
}
}
If you have multiple chatbots in your account, you must repeat this steps on each one.
Updated over 4 years ago