1 | type Acumbamail = { |
2 | authToken: string |
3 | } |
4 |
|
5 | export async function main(resource: Acumbamail, subscriber_email: string) { |
6 | const queryParams = new URLSearchParams({ |
7 | auth_token: resource.authToken, |
8 | subscriber: subscriber_email |
9 | }) |
10 |
|
11 | const endpoint = `https://acumbamail.com/api/1/searchSubscriber?${queryParams}` |
12 |
|
13 | const response = await fetch(endpoint, { |
14 | method: 'GET', |
15 | headers: { |
16 | 'Cache-Control': 'no-cache' |
17 | } |
18 | }) |
19 |
|
20 | if (!response.ok) { |
21 | throw new Error(`HTTP error! status: ${response.status}`) |
22 | } |
23 |
|
24 | const data = await response.json() |
25 |
|
26 | return data |
27 | } |
28 |
|