type Apollo = {
  apiKey: string;
};
export async function main(
  resource: Apollo,
  body: {
    first_name?: string;
    last_name?: string;
    email?: string;
    organization_name?: string;
  }
) {
  const endpoint = "https://api.apollo.io/v1/people/match";
  const response = await fetch(endpoint, {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
      "Cache-Control": "no-cache",
      "X-Api-Key": resource.apiKey,
    },
    body: JSON.stringify(body),
  });
  if (!response.ok) {
    throw new Error(`HTTP error! status: ${response.status}`);
  }
  const data = await response.json();
  return data.person;
}
 Submitted by hugo697 435 days ago
type Apollo_io = {
	apiKey: string
}
export async function main(
	resource: Apollo_io,
	body: {
		first_name?: string
		last_name?: string
		email?: string
		organization_name?: string
	}
) {
	const endpoint = 'https://api.apollo.io/v1/people/match'
	const response = await fetch(endpoint, {
		method: 'POST',
		headers: {
			'Content-Type': 'application/json',
			'Cache-Control': 'no-cache',
			'X-Api-Key': resource.apiKey
		},
		body: JSON.stringify(body)
	})
	if (!response.ok) {
		throw new Error(`HTTP error! status: ${response.status}`)
	}
	const data = await response.json()
	return data.person
}
 Submitted by hugo697 435 days ago