Skip to content

Instantly share code, notes, and snippets.

@jonathasborges1
Created January 19, 2023 18:19
Show Gist options
  • Save jonathasborges1/7c9c1428a153a9b3812afbe1e564cbf7 to your computer and use it in GitHub Desktop.
Save jonathasborges1/7c9c1428a153a9b3812afbe1e564cbf7 to your computer and use it in GitHub Desktop.
const sendData = async () => {
const url = 'https://pontual.cvcrm.com.br/api/cvio/lead';
var request = new Request(url, {
method: "POST",
header: [
{
key: "email",
value: "[email protected]",
type: "text"
},
{
key: token,
value: "fe779b2fefdde6ef718f575b79449be6724721bd",
type: "text"
}
],
body: {
mode: raw,
raw: "{\r\n \"email\": \"[email protected]\",\r\n \"telefone\": \"(21) 985125660-\",\r\n \"modulo\": \"gestor\",\r\n \"nome\": \"Teste dev\",\r\n \"permitir_alteracao\": true\r\n}",
options: {
raw: {
language: "json"
}
}
},
url: {
raw: "https://pontual.cvcrm.com.br/api/cvio/lead",
protocol: "https",
host: [
"pontual",
"cvcrm",
"com",
"br"
],
path: [
"api",
"cvio",
"lead"
],
query: [
{
key: "documento",
value: "07841018509",
disabled: true
}
]
}
},
"response": []
await fetch(request)
.then(function() {
// Handle response we get from the API
console.log("Dados Enviados com sucesso")
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment