getbrevo / brevo-php
Official Brevo provided RESTFul API V3 php library
Installs: 839 070
Dependents: 23
Suggesters: 1
Security: 0
Stars: 49
Watchers: 0
Forks: 22
Open Issues: 23
Requires
- php: >=5.6
- ext-curl: *
- ext-json: *
- ext-mbstring: *
- guzzlehttp/guzzle: ^7.4.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ~1.12
- phpunit/phpunit: ^4.8
- squizlabs/php_codesniffer: ~2.6
This package is not auto-updated.
Last update: 2024-10-31 11:01:03 UTC
README
Brevo's API exposes the entire Brevo features via a standardized programmatic interface. Please refer to the full documentation to learn more.
This is the wrapper for the API. It implements all the features of the API v3.
Brevo's API matches the OpenAPI v2 definition. The specification can be downloaded here.
This PHP package is automatically generated by the Swagger Codegen project and is reviewed and maintained by Brevo:
- API version: 3.0.0
- Build package: io.swagger.codegen.languages.PhpClientCodegen For more information, please visit https://account.brevo.com/support
Requirements
PHP 5.6 and later
Installation & Usage
Composer
To install the bindings via Composer:
Create a composer.json
file in any directory & add below code in composer.json file.
{
"require": {
"getbrevo/brevo-php": "1.x.x"
}
}
Then run below commands in the same directory
composer require getbrevo/brevo-php "1.x.x"
Further do:
- run
composer install
to get these dependencies added to your vendor directory - add the autoloader to your application with this line:
require("vendor/autoload.php")
Tests
To run the unit tests:
composer install
./vendor/bin/phpunit
Getting Started
Please follow the installation procedure and then run the following:
<?php require_once(__DIR__ . '/vendor/autoload.php'); // Configure API key authorization: api-key $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY'); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed // $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); // Configure API key authorization: partner-key $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY'); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed // $config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer'); $apiInstance = new Brevo\Client\Api\AccountApi( // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. // This is optional, `GuzzleHttp\Client` will be used as default. new GuzzleHttp\Client(), $config ); try { $result = $apiInstance->getAccount(); print_r($result); } catch (Exception $e) { echo 'Exception when calling AccountApi->getAccount: ', $e->getMessage(), PHP_EOL; } ?>
Documentation for API Endpoints
All URIs are relative to https://api.brevo.com/v3
Documentation For Models
- AbTestCampaignResult
- AbTestCampaignResultClickedLinks
- AbTestCampaignResultStatistics
- AbTestVersionClicks
- AbTestVersionClicksInner
- AbTestVersionStats
- AddChildDomain
- AddContactToList
- AddCredits
- AuthenticateDomainModel
- BlockDomain
- Body
- Body1
- Body10
- Body11
- Body12
- Body13
- Body14
- Body2
- Body3
- Body4
- Body5
- Body6
- Body7
- Body8
- Body9
- BodyVariablesItems
- CompaniesList
- Company
- CompanyAttributes
- CompanyAttributesInner
- ComponentItems
- ConversationsMessage
- ConversationsMessageFile
- ConversationsMessageFileImageInfo
- CreateApiKeyRequest
- CreateApiKeyResponse
- CreateAttribute
- CreateAttributeEnumeration
- CreateCategoryModel
- CreateChild
- CreateContact
- CreateCouponCollection
- CreateCoupons
- CreateDoiContact
- CreateDomain
- CreateDomainModel
- CreateDomainModelDnsRecords
- CreateDomainModelDnsRecordsDkimRecord
- CreateEmailCampaign
- CreateEmailCampaignRecipients
- CreateEmailCampaignSender
- CreateExternalFeed
- CreateList
- CreateModel
- CreateProductModel
- CreateReseller
- CreateSender
- CreateSenderIps
- CreateSenderModel
- CreateSmsCampaign
- CreateSmsCampaignRecipients
- CreateSmtpEmail
- CreateSmtpTemplate
- CreateSmtpTemplateSender
- CreateSubAccount
- CreateSubAccountResponse
- CreateUpdateBatchCategory
- CreateUpdateBatchCategoryModel
- CreateUpdateBatchProducts
- CreateUpdateBatchProductsModel
- CreateUpdateCategories
- CreateUpdateCategory
- CreateUpdateContactModel
- CreateUpdateFolder
- CreateUpdateProduct
- CreateUpdateProducts
- CreateWebhook
- CreateWhatsAppCampaign
- CreateWhatsAppCampaignRecipients
- CreateWhatsAppTemplate
- CreatedBatchId
- CreatedProcessId
- Deal
- DealAttributes
- DealAttributesInner
- DealsList
- DeleteHardbounces
- EmailExportRecipients
- ErrorModel
- Event
- ExportWebhooksHistory
- FileData
- FileDownloadableLink
- FileList
- GetAccount
- GetAccountActivity
- GetAccountActivityLogs
- GetAccountMarketingAutomation
- GetAccountPlan
- GetAccountRelay
- GetAccountRelayData
- GetAggregatedReport
- GetAllExternalFeeds
- GetAllExternalFeedsFeeds
- GetAttributes
- GetAttributesAttributes
- GetAttributesEnumeration
- GetBlockedDomains
- GetCampaignOverview
- GetCampaignRecipients
- GetCampaignStats
- GetCategories
- GetCategoryDetails
- GetChildAccountCreationStatus
- GetChildDomain
- GetChildDomains
- GetChildInfo
- GetChildInfoApiKeys
- GetChildInfoApiKeysV2
- GetChildInfoApiKeysV3
- GetChildInfoCredits
- GetChildInfoStatistics
- GetChildrenList
- GetClient
- GetContactCampaignStats
- GetContactCampaignStatsClicked
- GetContactCampaignStatsOpened
- GetContactCampaignStatsTransacAttributes
- GetContactCampaignStatsUnsubscriptions
- GetContactDetails
- GetContacts
- GetCorporateInvitedUsersList
- GetCorporateInvitedUsersListFeatureAccess
- GetCorporateInvitedUsersListGroups
- GetCorporateInvitedUsersListUsers
- GetCouponCollection
- GetDeviceBrowserStats
- GetDomainConfigurationModel
- GetDomainsList
- GetDomainsListDomains
- GetEmailCampaign
- GetEmailCampaigns
- GetEmailEventReport
- GetEmailEventReportEvents
- GetExtendedCampaignOverview
- GetExtendedCampaignOverviewSender
- GetExtendedCampaignStats
- GetExtendedCampaignStatsGlobalStats
- GetExtendedClient
- GetExtendedClientAddress
- GetExtendedContactDetails
- GetExtendedContactDetailsStatistics
- GetExtendedContactDetailsStatisticsClicked
- GetExtendedContactDetailsStatisticsDelivered
- GetExtendedContactDetailsStatisticsLinks
- GetExtendedContactDetailsStatisticsMessagesSent
- GetExtendedContactDetailsStatisticsOpened
- GetExtendedContactDetailsStatisticsUnsubscriptions
- GetExtendedContactDetailsStatisticsUnsubscriptionsAdminUnsubscription
- GetExtendedContactDetailsStatisticsUnsubscriptionsUserUnsubscription
- GetExtendedList
- GetExtendedListCampaignStats
- GetExternalFeedByUUID
- GetExternalFeedByUUIDHeaders
- GetFolder
- GetFolderLists
- GetFolders
- GetInboundEmailEvents
- GetInboundEmailEventsByUuid
- GetInboundEmailEventsByUuidAttachments
- GetInboundEmailEventsByUuidLogs
- GetInboundEmailEventsEvents
- GetInvitedUsersList
- GetInvitedUsersListFeatureAccess
- GetInvitedUsersListUsers
- GetIp
- GetIpFromSender
- GetIps
- GetIpsFromSender
- GetList
- GetLists
- GetOrders
- GetProcess
- GetProcesses
- GetProductDetails
- GetProducts
- GetReports
- GetReportsReports
- GetScheduledEmailByBatchId
- GetScheduledEmailByBatchIdBatches
- GetScheduledEmailByMessageId
- GetSegments
- GetSegmentsSegments
- GetSendersList
- GetSendersListIps
- GetSendersListSenders
- GetSharedTemplateUrl
- GetSmsCampaign
- GetSmsCampaignOverview
- GetSmsCampaignRecipients
- GetSmsCampaignStats
- GetSmsCampaigns
- GetSmsEventReport
- GetSmsEventReportEvents
- GetSmtpTemplateOverview
- GetSmtpTemplateOverviewSender
- GetSmtpTemplates
- GetSsoToken
- GetStatsByBrowser
- GetStatsByDevice
- GetStatsByDomain
- GetTransacAggregatedSmsReport
- GetTransacBlockedContacts
- GetTransacBlockedContactsContacts
- GetTransacBlockedContactsReason
- GetTransacEmailContent
- GetTransacEmailContentEvents
- GetTransacEmailsList
- GetTransacEmailsListTransactionalEmails
- GetTransacSmsReport
- GetTransacSmsReportReports
- GetUserPermission
- GetUserPermissionPrivileges
- GetWATemplates
- GetWATemplatesTemplates
- GetWebhook
- GetWebhookAuth
- GetWebhookHeaders
- GetWebhooks
- GetWhatsAppConfig
- GetWhatsappCampaignOverview
- GetWhatsappCampaigns
- GetWhatsappCampaignsCampaigns
- GetWhatsappEventReport
- GetWhatsappEventReportEvents
- InlineResponse200
- InlineResponse2001
- InlineResponse2002
- InlineResponse201
- InlineResponse2011
- InlineResponse2012
- InlineResponse2013
- InlineResponse2014
- InlineResponse2015
- InviteAdminUser
- InviteAdminUserPrivileges
- Inviteuser
- InviteuserPrivileges
- ManageIp
- MasterDetailsResponse
- MasterDetailsResponseBillingInfo
- MasterDetailsResponseBillingInfoAddress
- MasterDetailsResponseBillingInfoName
- MasterDetailsResponsePlanInfo
- MasterDetailsResponsePlanInfoFeatures
- Note
- NoteData
- NoteId
- NoteList
- Order
- OrderBatch
- OrderBilling
- OrderProducts
- Otp
- Pipeline
- PipelineStage
- Pipelines
- PostContactInfo
- PostContactInfoContacts
- PostSendFailed
- PostSendSmsTestFailed
- PutRevokeUserPermission
- Putresendcancelinvitation
- RemainingCreditModel
- RemainingCreditModelChild
- RemainingCreditModelReseller
- RemoveContactFromList
- RemoveCredits
- RequestContactExport
- RequestContactExportCustomContactFilter
- RequestContactImport
- RequestContactImportJsonBody
- RequestContactImportNewList
- RequestSmsRecipientExport
- ScheduleSmtpEmail
- SendReport
- SendReportEmail
- SendSms
- SendSmtpEmail
- SendSmtpEmailAttachment
- SendSmtpEmailBcc
- SendSmtpEmailCc
- SendSmtpEmailMessageVersions
- SendSmtpEmailReplyTo
- SendSmtpEmailReplyTo1
- SendSmtpEmailSender
- SendSmtpEmailTo
- SendSmtpEmailTo1
- SendTestEmail
- SendTestSms
- SendTransacSms
- SendWhatsappMessage
- SsoTokenRequest
- SubAccountAppsToggleRequest
- SubAccountDetailsResponse
- SubAccountDetailsResponsePlanInfo
- SubAccountDetailsResponsePlanInfoCredits
- SubAccountDetailsResponsePlanInfoCreditsEmails
- SubAccountDetailsResponsePlanInfoFeatures
- SubAccountDetailsResponsePlanInfoFeaturesInbox
- SubAccountDetailsResponsePlanInfoFeaturesLandingPage
- SubAccountDetailsResponsePlanInfoFeaturesUsers
- SubAccountUpdatePlanRequest
- SubAccountUpdatePlanRequestCredits
- SubAccountUpdatePlanRequestFeatures
- SubAccountsResponse
- SubAccountsResponseSubAccounts
- Task
- TaskList
- TaskReminder
- TaskTypes
- UpdateAttribute
- UpdateAttributeEnumeration
- UpdateBatchContacts
- UpdateBatchContactsContacts
- UpdateBatchContactsModel
- UpdateCampaignStatus
- UpdateChild
- UpdateChildAccountStatus
- UpdateChildDomain
- UpdateContact
- UpdateCouponCollection
- UpdateEmailCampaign
- UpdateEmailCampaignRecipients
- UpdateEmailCampaignSender
- UpdateExternalFeed
- UpdateList
- UpdateSender
- UpdateSmsCampaign
- UpdateSmtpTemplate
- UpdateSmtpTemplateSender
- UpdateWebhook
- UpdateWhatsAppCampaign
- UploadImageModel
- UploadImageToGallery
- GetChildInfo
- GetExtendedCampaignOverview
- GetExtendedClient
- GetExtendedContactDetails
- GetExtendedList
- GetSmsCampaign
- GetAccount
- GetEmailCampaign
- VariablesItems
- WhatsappCampStats
- WhatsappCampTemplate
Documentation For Authorization
api-key
The API key should be passed in the request headers as api-key
for authentication.
- Type: API key
- API key parameter name: api-key
- Location: HTTP header
partner-key
The partner key should be passed in the request headers as partner-key
along with api-key
pair for successful authentication of partner (Optional).
- Type: API key
- API key parameter name: partner-key
- Location: HTTP header
If you find a bug, please post the issue on Github.
As always, if you need additional assistance, drop us a note here.