27 lines
743 B
PowerShell
27 lines
743 B
PowerShell
function GetContactsFromListBrevo {
|
|
[CmdletBinding()]
|
|
param(
|
|
[Parameter(Mandatory=$true)]
|
|
[string]$IdListe
|
|
)
|
|
|
|
$headers = @{
|
|
"accept" = "application/json"
|
|
"api-key" = "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"
|
|
}
|
|
|
|
$response = Invoke-WebRequest `
|
|
-Uri "https://api.brevo.com/v3/contacts/lists/$($IdListe)/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 }
|
|
|
|
# foreach ($email in $contacts.contacts) {
|
|
# Write-Output $email.email
|
|
# } |