export async function main(twenty_api_key: string, campaign_name: string) { const url = 'https://api.twenty.com/rest/metadata/fields'; const options = { method: 'POST', headers: { 'Accept': 'application/json', 'Authorization': `Bearer ${twenty_api_key}`, 'Content-Type': 'application/json' }, body: JSON.stringify({ "type": "TEXT", "name": "campaign_name", }) }; const response = await fetch(url, options); return await response.text()}
export async function main(twenty_api_key: string, data: Array) { const url = 'https://api.twenty.com/rest/batch/people'; const options = { method: 'POST', headers: { 'Accept': 'application/json', 'Authorization': `Bearer ${twenty_api_key}`, 'Content-Type': 'application/json' }, body: JSON.stringify(data[0]) }; const response = await fetch(url, options); return await response.text()}
data =[ { "email": "[email protected]", "jobTitle": "Angel Investor", "lastName": "Koz", "firstName": "Muenif", "linkedinLink": { "url": "http://www.linkedin.com/in/munifkoz", "label": "LinkedIn" } }]