Skip to content

Instantly share code, notes, and snippets.

@guilhermegazzinelli
Created May 20, 2024 12:10
Show Gist options
  • Save guilhermegazzinelli/1d88c1cea25e13b53e6a6ab50e6275c9 to your computer and use it in GitHub Desktop.
Save guilhermegazzinelli/1d88c1cea25e13b53e6a6ab50e6275c9 to your computer and use it in GitHub Desktop.
Envia contato para o RD Station Marketing
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