Invoke BrevoCall - tsubotitsch/Brevo GitHub Wiki
Makes API calls to the Brevo API.
Invoke-BrevoCall -uri <String> [-method <Object>] [-body <Object>] [-limit <Object>] [-offset <Object>]
[-returnobject <Object>] [-ProgressAction <ActionPreference>] [<CommonParameters>]
This function is used to interact with the Brevo API by making RESTful API calls. It supports various HTTP methods, handles pagination, and allows for flexible API interactions.
# Example: Retrieve a list of contacts with pagination
Invoke-BrevoCall -uri "/contacts" -method "GET" -limit 50 -offset 0
# Example: Create a new contact
$body = @{
email = "[email protected]"
attributes = @{
FNAME = "John"
LNAME = "Doe"
}
listIds = @(1, 2)
}
Invoke-BrevoCall -uri "/contacts" -method "POST" -body $body
The request body for methods like POST or PUT. This should be a PowerShell object that will be converted to JSON.
Type: Object
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
The number of results returned per page. The default and maximum value may vary per API.
Type: Object
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
The HTTP method to use for the API call. Supported methods are GET, POST, PUT, DELETE, and PATCH. Default: GET.
Type: Object
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: GET
Accept pipeline input: False
Accept wildcard characters: False
The index of the first document in the page (starting with 0). For example, if the limit is 50 and you want to retrieve page 2, set offset to 50. Default: 0.
Type: Object
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: 0
Accept pipeline input: False
Accept wildcard characters: False
{{ Fill ProgressAction Description }}
Type: ActionPreference
Parameter Sets: (All)
Aliases: proga
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Specifies a specific object to return from the API response. If not specified, the full response will be returned.
Type: Object
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
The relative URI of the API endpoint. This should be relative to the base URI provided in Connect-Brevo.
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
- Requires the Connect-Brevo function to be called first to set up the base URI and API key.
- Handles pagination automatically if the API response includes a "count" property.