17 lines
545 B
PowerShell
17 lines
545 B
PowerShell
function GetContactsFromListBrevo {
|
|
$headers = @{
|
|
"accept" = "application/json"
|
|
"api-key" = "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"
|
|
}
|
|
|
|
$response = Invoke-WebRequest `
|
|
-Uri 'https://api.brevo.com/v3/contacts/lists/9/contacts?limit=50&offset=0&sort=desc' `
|
|
-Method GET `
|
|
-Headers $headers
|
|
|
|
return $response.Content | ConvertFrom-Json
|
|
}
|
|
|
|
$contacts = GetContactsFromListBrevo
|
|
$contacts.count
|
|
$contacts.contacts | ForEach-Object { $_.email } |