Created
May 20, 2024 12:10
-
-
Save guilhermegazzinelli/1d88c1cea25e13b53e6a6ab50e6275c9 to your computer and use it in GitHub Desktop.
Envia contato para o RD Station Marketing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const axios = require('axios'); | |
const apiKey = 'SUA_API_KEY'; // Substitua com sua chave de API RD Station Marketing | |
const endpoint = 'https://api.rd.services/platform/contacts'; | |
const leadData = { | |
name: 'Nome do Lead', | |
email: 'lead@example.com', | |
job_title: 'Cargo do Lead', | |
company_name: 'Nome da Empresa', | |
c_utmz: 'Origem da Lead', // Se aplicável | |
// Outros campos do lead conforme necessário | |
}; | |
const headers = { | |
'Content-Type': 'application/json', | |
'Authorization': `Bearer ${apiKey}`, | |
}; | |
axios.post(endpoint, leadData, { headers }) | |
.then(response => { | |
console.log('Lead criado com sucesso:', response.data); | |
}) | |
.catch(error => { | |
console.error('Erro ao criar lead:', error); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment