Git Product home page Git Product logo

apiv3-php-library's Introduction

[DEPRECATED:warning:] api-v3-sdk

SendinBlue's API v3 Php Library

SendinBlue's API exposes the entire SendinBlue 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.

SendinBlue'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 SendinBlue:

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": {
"sendinblue/api-v3-sdk": "8.x.x"
}
}

Then run below commands in the same directory

composer require sendinblue/api-v3-sdk "8.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 = SendinBlue\Client\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = SendinBlue\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
// Configure API key authorization: partner-key
$config = SendinBlue\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = SendinBlue\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');

$apiInstance = new SendinBlue\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.sendinblue.com/v3

Class Method HTTP request Description
AccountApi getAccount GET /account Get your account information, plan and credits details
CompaniesApi companiesAttributesGet GET /companies/attributes Get company attributes
CompaniesApi companiesGet GET /companies Get all companies
CompaniesApi companiesIdDelete DELETE /companies/{id} Delete a company
CompaniesApi companiesIdGet GET /companies/{id} Get a company
CompaniesApi companiesIdPatch PATCH /companies/{id} Update a company
CompaniesApi companiesLinkUnlinkIdPatch PATCH /companies/link-unlink/{id} Link and Unlink company with contacts and deals
CompaniesApi companiesPost POST /companies Create a company
AttributesApi createAttribute POST /contacts/attributes/{attributeCategory}/{attributeName} Create contact attribute
AttributesApi deleteAttribute DELETE /contacts/attributes/{attributeCategory}/{attributeName} Delete an attribute
AttributesApi getAttributes GET /contacts/attributes List all attributes
AttributesApi updateAttribute PUT /contacts/attributes/{attributeCategory}/{attributeName} Update contact attribute
CRMApi crmNotesGet GET /crm/notes Get all notes
CRMApi crmNotesIdDelete DELETE /crm/notes/{id} Delete a note
CRMApi crmNotesIdGet GET /crm/notes/{id} Get a note
CRMApi crmNotesIdPatch PATCH /crm/notes/{id} Update a note
CRMApi crmNotesPost POST /crm/notes Create a note
CRMApi crmTasksGet GET /crm/tasks Get all tasks
CRMApi crmTasksIdDelete DELETE /crm/tasks/{id} Delete a task
CRMApi crmTasksIdGet GET /crm/tasks/{id} Get a task
CRMApi crmTasksIdPatch PATCH /crm/tasks/{id} Update a task
CRMApi crmTasksPost POST /crm/tasks Create a task
CRMApi crmTasktypesGet GET /crm/tasktypes Get all task types
ContactsApi addContactToList POST /contacts/lists/{listId}/contacts/add Add existing contacts to a list
ContactsApi createAttribute POST /contacts/attributes/{attributeCategory}/{attributeName} Create contact attribute
ContactsApi createContact POST /contacts Create a contact
ContactsApi createDoiContact POST /contacts/doubleOptinConfirmation Create Contact via DOI (Double-Opt-In) Flow
ContactsApi createFolder POST /contacts/folders Create a folder
ContactsApi createList POST /contacts/lists Create a list
ContactsApi deleteAttribute DELETE /contacts/attributes/{attributeCategory}/{attributeName} Delete an attribute
ContactsApi deleteContact DELETE /contacts/{identifier} Delete a contact
ContactsApi deleteFolder DELETE /contacts/folders/{folderId} Delete a folder (and all its lists)
ContactsApi deleteList DELETE /contacts/lists/{listId} Delete a list
ContactsApi getAttributes GET /contacts/attributes List all attributes
ContactsApi getContactInfo GET /contacts/{identifier} Get a contact's details
ContactsApi getContactStats GET /contacts/{identifier}/campaignStats Get email campaigns' statistics for a contact
ContactsApi getContacts GET /contacts Get all the contacts
ContactsApi getContactsFromList GET /contacts/lists/{listId}/contacts Get contacts in a list
ContactsApi getFolder GET /contacts/folders/{folderId} Returns a folder's details
ContactsApi getFolderLists GET /contacts/folders/{folderId}/lists Get lists in a folder
ContactsApi getFolders GET /contacts/folders Get all folders
ContactsApi getList GET /contacts/lists/{listId} Get a list's details
ContactsApi getLists GET /contacts/lists Get all the lists
ContactsApi importContacts POST /contacts/import Import contacts
ContactsApi removeContactFromList POST /contacts/lists/{listId}/contacts/remove Delete a contact from a list
ContactsApi requestContactExport POST /contacts/export Export contacts
ContactsApi updateAttribute PUT /contacts/attributes/{attributeCategory}/{attributeName} Update contact attribute
ContactsApi updateBatchContacts POST /contacts/batch Update multiple contacts
ContactsApi updateContact PUT /contacts/{identifier} Update a contact
ContactsApi updateFolder PUT /contacts/folders/{folderId} Update a folder
ContactsApi updateList PUT /contacts/lists/{listId} Update a list
ConversationsApi conversationsAgentOnlinePingPost POST /conversations/agentOnlinePing Sets agent’s status to online for 2-3 minutes
ConversationsApi conversationsMessagesIdDelete DELETE /conversations/messages/{id} Delete a message sent by an agent
ConversationsApi conversationsMessagesIdGet GET /conversations/messages/{id} Get a message
ConversationsApi conversationsMessagesIdPut PUT /conversations/messages/{id} Update a message sent by an agent
ConversationsApi conversationsMessagesPost POST /conversations/messages Send a message as an agent
ConversationsApi conversationsPushedMessagesIdDelete DELETE /conversations/pushedMessages/{id} Delete an automated message
ConversationsApi conversationsPushedMessagesIdGet GET /conversations/pushedMessages/{id} Get an automated message
ConversationsApi conversationsPushedMessagesIdPut PUT /conversations/pushedMessages/{id} Update an automated message
ConversationsApi conversationsPushedMessagesPost POST /conversations/pushedMessages Send an automated message to a visitor
DealsApi crmAttributesDealsGet GET /crm/attributes/deals Get deal attributes
DealsApi crmDealsGet GET /crm/deals Get all deals
DealsApi crmDealsIdDelete DELETE /crm/deals/{id} Delete a deal
DealsApi crmDealsIdGet GET /crm/deals/{id} Get a deal
DealsApi crmDealsIdPatch PATCH /crm/deals/{id} Update a deal
DealsApi crmDealsLinkUnlinkIdPatch PATCH /crm/deals/link-unlink/{id} Link and Unlink a deal with contacts and companies
DealsApi crmDealsPost POST /crm/deals Create a deal
DealsApi crmPipelineDetailsGet GET /crm/pipeline/details Get pipeline stages
EcommerceApi createBatchOrder POST /orders/status/batch Create orders in batch
EcommerceApi createOrder POST /orders/status Managing the status of the order
EcommerceApi createUpdateBatchCategory POST /categories/batch Create categories in batch
EcommerceApi createUpdateBatchProducts POST /products/batch Create products in batch
EcommerceApi createUpdateCategory POST /categories Create/Update a category
EcommerceApi createUpdateProduct POST /products Create/Update a product
EcommerceApi ecommerceActivatePost POST /ecommerce/activate Activate the eCommerce app
EcommerceApi getCategories GET /categories Return all your categories
EcommerceApi getCategoryInfo GET /categories/{id} Get a category details
EcommerceApi getProductInfo GET /products/{id} Get a product's details
EcommerceApi getProducts GET /products Return all your products
EmailCampaignsApi createEmailCampaign POST /emailCampaigns Create an email campaign
EmailCampaignsApi deleteEmailCampaign DELETE /emailCampaigns/{campaignId} Delete an email campaign
EmailCampaignsApi emailExportRecipients POST /emailCampaigns/{campaignId}/exportRecipients Export the recipients of an email campaign
EmailCampaignsApi getAbTestCampaignResult GET /emailCampaigns/{campaignId}/abTestCampaignResult Get an A/B test email campaign results
EmailCampaignsApi getEmailCampaign GET /emailCampaigns/{campaignId} Get an email campaign report
EmailCampaignsApi getEmailCampaigns GET /emailCampaigns Return all your created email campaigns
EmailCampaignsApi getSharedTemplateUrl GET /emailCampaigns/{campaignId}/sharedUrl Get a shared template url
EmailCampaignsApi sendEmailCampaignNow POST /emailCampaigns/{campaignId}/sendNow Send an email campaign immediately, based on campaignId
EmailCampaignsApi sendReport POST /emailCampaigns/{campaignId}/sendReport Send the report of a campaign
EmailCampaignsApi sendTestEmail POST /emailCampaigns/{campaignId}/sendTest Send an email campaign to your test list
EmailCampaignsApi updateCampaignStatus PUT /emailCampaigns/{campaignId}/status Update an email campaign status
EmailCampaignsApi updateEmailCampaign PUT /emailCampaigns/{campaignId} Update an email campaign
EmailCampaignsApi uploadImageToGallery POST /emailCampaigns/images Upload an image to your account's image gallery
FoldersApi createFolder POST /contacts/folders Create a folder
FoldersApi deleteFolder DELETE /contacts/folders/{folderId} Delete a folder (and all its lists)
FoldersApi getFolder GET /contacts/folders/{folderId} Returns a folder's details
FoldersApi getFolderLists GET /contacts/folders/{folderId}/lists Get lists in a folder
FoldersApi getFolders GET /contacts/folders Get all folders
FoldersApi updateFolder PUT /contacts/folders/{folderId} Update a folder
FilesApi crmFilesGet GET /crm/files Get all files
FilesApi crmFilesIdDataGet GET /crm/files/{id}/data Get file details
FilesApi crmFilesIdDelete DELETE /crm/files/{id} Delete a file
FilesApi crmFilesIdGet GET /crm/files/{id} Download a file
FilesApi crmFilesPost POST /crm/files Upload a file
InboundParsingApi getInboundEmailAttachment GET /inbound/attachments/{downloadToken} Retrieve inbound attachment with download token.
InboundParsingApi getInboundEmailEvents GET /inbound/events Get the list of all the events for the received emails.
InboundParsingApi getInboundEmailEventsByUuid GET /inbound/events/{uuid} Fetch all events history for one particular received email.
ListsApi addContactToList POST /contacts/lists/{listId}/contacts/add Add existing contacts to a list
ListsApi createList POST /contacts/lists Create a list
ListsApi deleteList DELETE /contacts/lists/{listId} Delete a list
ListsApi getContactsFromList GET /contacts/lists/{listId}/contacts Get contacts in a list
ListsApi getFolderLists GET /contacts/folders/{folderId}/lists Get lists in a folder
ListsApi getList GET /contacts/lists/{listId} Get a list's details
ListsApi getLists GET /contacts/lists Get all the lists
ListsApi removeContactFromList POST /contacts/lists/{listId}/contacts/remove Delete a contact from a list
ListsApi updateList PUT /contacts/lists/{listId} Update a list
MasterAccountApi corporateMasterAccountGet GET /corporate/masterAccount Get the details of requested master account
MasterAccountApi corporateSubAccountGet GET /corporate/subAccount Get the list of all the sub-accounts of the master account.
MasterAccountApi corporateSubAccountIdDelete DELETE /corporate/subAccount/{id} Delete a sub-account
MasterAccountApi corporateSubAccountIdGet GET /corporate/subAccount/{id} Get sub-account details
MasterAccountApi corporateSubAccountIdPlanPut PUT /corporate/subAccount/{id}/plan Update sub-account plan
MasterAccountApi corporateSubAccountKeyPost POST /corporate/subAccount/key Create an API key for a sub-account
MasterAccountApi corporateSubAccountPost POST /corporate/subAccount Create a new sub-account under a master account.
MasterAccountApi corporateSubAccountSsoTokenPost POST /corporate/subAccount/ssoToken Generate SSO token to access Sendinblue
NotesApi crmNotesGet GET /crm/notes Get all notes
NotesApi crmNotesIdDelete DELETE /crm/notes/{id} Delete a note
NotesApi crmNotesIdGet GET /crm/notes/{id} Get a note
NotesApi crmNotesIdPatch PATCH /crm/notes/{id} Update a note
NotesApi crmNotesPost POST /crm/notes Create a note
ProcessApi getProcess GET /processes/{processId} Return the informations for a process
ProcessApi getProcesses GET /processes Return all the processes for your account
ResellerApi addCredits POST /reseller/children/{childIdentifier}/credits/add Add Email and/or SMS credits to a specific child account
ResellerApi associateIpToChild POST /reseller/children/{childIdentifier}/ips/associate Associate a dedicated IP to the child
ResellerApi createChildDomain POST /reseller/children/{childIdentifier}/domains Create a domain for a child account
ResellerApi createResellerChild POST /reseller/children Creates a reseller child
ResellerApi deleteChildDomain DELETE /reseller/children/{childIdentifier}/domains/{domainName} Delete the sender domain of the reseller child based on the childIdentifier and domainName passed
ResellerApi deleteResellerChild DELETE /reseller/children/{childIdentifier} Delete a single reseller child based on the child identifier supplied
ResellerApi dissociateIpFromChild POST /reseller/children/{childIdentifier}/ips/dissociate Dissociate a dedicated IP to the child
ResellerApi getChildAccountCreationStatus GET /reseller/children/{childIdentifier}/accountCreationStatus Get the status of a reseller's child account creation, whether it is successfully created (exists) or not based on the identifier supplied
ResellerApi getChildDomains GET /reseller/children/{childIdentifier}/domains Get all sender domains for a specific child account
ResellerApi getChildInfo GET /reseller/children/{childIdentifier} Get a child account's details
ResellerApi getResellerChilds GET /reseller/children Get the list of all children accounts
ResellerApi getSsoToken GET /reseller/children/{childIdentifier}/auth Get session token to access Sendinblue (SSO)
ResellerApi removeCredits POST /reseller/children/{childIdentifier}/credits/remove Remove Email and/or SMS credits from a specific child account
ResellerApi updateChildAccountStatus PUT /reseller/children/{childIdentifier}/accountStatus Update info of reseller's child account status based on the childIdentifier supplied
ResellerApi updateChildDomain PUT /reseller/children/{childIdentifier}/domains/{domainName} Update the sender domain of reseller's child based on the childIdentifier and domainName passed
ResellerApi updateResellerChild PUT /reseller/children/{childIdentifier} Update info of reseller's child based on the child identifier supplied
SMSCampaignsApi createSmsCampaign POST /smsCampaigns Creates an SMS campaign
SMSCampaignsApi deleteSmsCampaign DELETE /smsCampaigns/{campaignId} Delete an SMS campaign
SMSCampaignsApi getSmsCampaign GET /smsCampaigns/{campaignId} Get an SMS campaign
SMSCampaignsApi getSmsCampaigns GET /smsCampaigns Returns the information for all your created SMS campaigns
SMSCampaignsApi requestSmsRecipientExport POST /smsCampaigns/{campaignId}/exportRecipients Export an SMS campaign's recipients
SMSCampaignsApi sendSmsCampaignNow POST /smsCampaigns/{campaignId}/sendNow Send your SMS campaign immediately
SMSCampaignsApi sendSmsReport POST /smsCampaigns/{campaignId}/sendReport Send an SMS campaign's report
SMSCampaignsApi sendTestSms POST /smsCampaigns/{campaignId}/sendTest Send a test SMS campaign
SMSCampaignsApi updateSmsCampaign PUT /smsCampaigns/{campaignId} Update an SMS campaign
SMSCampaignsApi updateSmsCampaignStatus PUT /smsCampaigns/{campaignId}/status Update a campaign's status
SendersApi createSender POST /senders Create a new sender
SendersApi deleteSender DELETE /senders/{senderId} Delete a sender
SendersApi getIps GET /senders/ips Get all the dedicated IPs for your account
SendersApi getIpsFromSender GET /senders/{senderId}/ips Get all the dedicated IPs for a sender
SendersApi getSenders GET /senders Get the list of all your senders
SendersApi updateSender PUT /senders/{senderId} Update a sender
TasksApi crmTasksGet GET /crm/tasks Get all tasks
TasksApi crmTasksIdDelete DELETE /crm/tasks/{id} Delete a task
TasksApi crmTasksIdGet GET /crm/tasks/{id} Get a task
TasksApi crmTasksIdPatch PATCH /crm/tasks/{id} Update a task
TasksApi crmTasksPost POST /crm/tasks Create a task
TasksApi crmTasktypesGet GET /crm/tasktypes Get all task types
TransactionalEmailsApi blockNewDomain POST /smtp/blockedDomains Add a new domain to the list of blocked domains
TransactionalEmailsApi createSmtpTemplate POST /smtp/templates Create an email template
TransactionalEmailsApi deleteBlockedDomain DELETE /smtp/blockedDomains/{domain} Unblock an existing domain from the list of blocked domains
TransactionalEmailsApi deleteHardbounces POST /smtp/deleteHardbounces Delete hardbounces
TransactionalEmailsApi deleteScheduledEmailById DELETE /smtp/email/{identifier} Delete scheduled emails by batchId or messageId
TransactionalEmailsApi deleteSmtpTemplate DELETE /smtp/templates/{templateId} Delete an inactive email template
TransactionalEmailsApi getAggregatedSmtpReport GET /smtp/statistics/aggregatedReport Get your transactional email activity aggregated over a period of time
TransactionalEmailsApi getBlockedDomains GET /smtp/blockedDomains Get the list of blocked domains
TransactionalEmailsApi getEmailEventReport GET /smtp/statistics/events Get all your transactional email activity (unaggregated events)
TransactionalEmailsApi getScheduledEmailByBatchId GET /smtp/emailStatus/{batchId} Fetch scheduled emails by batchId
TransactionalEmailsApi getScheduledEmailById DELETE /smtp/email/{identifier} Delete scheduled emails by batchId or messageId
TransactionalEmailsApi getScheduledEmailByMessageId GET /smtp/emailStatus/{messageId} Fetch scheduled email by messageId
TransactionalEmailsApi getSmtpReport GET /smtp/statistics/reports Get your transactional email activity aggregated per day
TransactionalEmailsApi getSmtpTemplate GET /smtp/templates/{templateId} Returns the template information
TransactionalEmailsApi getSmtpTemplates GET /smtp/templates Get the list of email templates
TransactionalEmailsApi getTransacBlockedContacts GET /smtp/blockedContacts Get the list of blocked or unsubscribed transactional contacts
TransactionalEmailsApi getTransacEmailContent GET /smtp/emails/{uuid} Get the personalized content of a sent transactional email
TransactionalEmailsApi getTransacEmailsList GET /smtp/emails Get the list of transactional emails on the basis of allowed filters
TransactionalEmailsApi sendTestTemplate POST /smtp/templates/{templateId}/sendTest Send a template to your test list
TransactionalEmailsApi sendTransacEmail POST /smtp/email Send a transactional email
TransactionalEmailsApi smtpBlockedContactsEmailDelete DELETE /smtp/blockedContacts/{email} Unblock or resubscribe a transactional contact
TransactionalEmailsApi smtpLogMessageIdDelete DELETE /smtp/log/{messageId} Delete an SMTP transactional log
TransactionalEmailsApi updateSmtpTemplate PUT /smtp/templates/{templateId} Update an email template
TransactionalSMSApi getSmsEvents GET /transactionalSMS/statistics/events Get all your SMS activity (unaggregated events)
TransactionalSMSApi getTransacAggregatedSmsReport GET /transactionalSMS/statistics/aggregatedReport Get your SMS activity aggregated over a period of time
TransactionalSMSApi getTransacSmsReport GET /transactionalSMS/statistics/reports Get your SMS activity aggregated per day
TransactionalSMSApi sendTransacSms POST /transactionalSMS/sms Send SMS message to a mobile number
TransactionalWhatsAppApi getWhatsappEventReport GET /whatsapp/statistics/events Get all your WhatsApp activity (unaggregated events)
TransactionalWhatsAppApi sendWhatsappMessage POST /whatsapp/sendMessage Send a WhatsApp message
WebhooksApi createWebhook POST /webhooks Create a webhook
WebhooksApi deleteWebhook DELETE /webhooks/{webhookId} Delete a webhook
WebhooksApi getWebhook GET /webhooks/{webhookId} Get a webhook details
WebhooksApi getWebhooks GET /webhooks Get all webhooks
WebhooksApi updateWebhook PUT /webhooks/{webhookId} Update a webhook
WhatsappCampaignsApi deleteWhatsappCampaign DELETE /whatsappCampaigns/{campaignId} Delete a whatsapp campaign
WhatsappCampaignsApi getWhatsappCampaign GET /whatsappCampaigns/{campaignId} Get a whatsapp campaign

Documentation For Models

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.

apiv3-php-library's People

Contributors

bastiendonjon avatar ekta-slit avatar gmponos avatar jamalofski avatar mvdnbrk avatar preetishishodia7 avatar rajatsib avatar shubhamupadhyayinblue avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

apiv3-php-library's Issues

invalid_parameter when add Contact to List

When I use the method CreateList I get this error: [400] Client error: POST https://api.sendinblue.com/v3/contacts/lists/5/contacts/add resulted in a 400 Bad Request response: {"code":"invalid_parameter","message":"Contact already in list and/or does not exist"}

Here is my second parameter, emails:
$emails_data["emails"][] = [
'email' => '[email protected]',
'emailBlacklisted' => false,
'smsBlacklisted' => true,
'updateEnabled' => true,
'attributes' => [ 'NOMBRE' => 'Ludwig Van Beethoven' ]
];

When one of my paratemers is "NOMBRE", the main key "emails" is request on construct of class AddContactToList.

Please, can someone tell what I'm doing wrong?
Thanks!

Get api-key using username & password

Some of users don't know what is the mean of api key , so i suggest that SendInBlue will generate the api key , using the login and the password .
Thank you

Methods name differences

After the symfony bundle installation, we have a difference between the api php librairy installed and the repo version, resulting in this error for the deleteEmailCampaign method :

Attempted to call an undefined method named "deleteEmailCampaign" of class "SendinBlue\Client\Api\EmailCampaignsApi". Did you mean to call e.g. "createEmailCampaign", "deleteEmailCampaigns", "deleteEmailCampaignsWithHttpInfo", "getEmailCampaign", "getEmailCampaigns" or "updateEmailCampaigns"?

deleteEmailCampaign in the installation, deleteEmailCampaigns in the repo.
Thanks

Get with Resultlist and Count

This seems to affect all Get-Calls with a result-list in the response.

As suggested in #38 the count in the Get-Calls is useless as it is. Now we noticed this with getContacts as well. I don't know when the change occured but now countdoes not contain the amount of items in the resultlist (with modifiedsince filter) anymore. Instead it's the amount of all contacs regardless of the filtering criteria.

As stated in #38 there now is no way in knowing how many runs a cronjob needs to make or how many pages I need to display in a GUI. Instead I need to loop until the entity array is empty. (see #38 (comment) )
This does not make any sense.

Please change the count value so it accounts for the total amount of entities the filtering is matching or add a second count which does exactly this.

Get stats of campaign A/B Test

Dear,

I have implemented the function A/B Testing in my developement, but now i want get the result of the AB Test and retrieve the winner subject.

Thanks for your help

401 while sending transactional e-mail

Hi, I'm using code from your demo:

	Configuration::getDefaultConfiguration()->setApiKey('api-key', $apiKey);
	$api_instance = new SMTPApi();
	$message = new SendSmtpEmail();
	$message->setTextContent("Blabla test");

	$message->setTo('...');
	$message->setSender('..');
	$api_instance->sendTransacEmail($message);

api key is set correctly, to and sender is same address, with which I'm registered...

getEmailCampaigns returns 404 if no campaigns exist, API throws Exception

While integrating the API in our system I stumbled across this annoyance.

The API Call getEmailCampaigns as documented here:
https://github.com/sendinblue/APIv3-php-library/blob/master/docs/Api/EmailCampaignsApi.md#getemailcampaigns
is requesting
https://api.sendinblue.com/v3/emailCampaigns
which is returning HTTP Status Code 404 when there are no campaigns yet.

Additionally the response body differs from the usual body as followed:

When there is no campaign:

{
  "code": "document_not_found",
  "message": "campaign do not exist"
}

When there is at least one campaign:

{
  "count": 1,
  "campaigns": [
    {
      "id": 7,
       //shortened
    }
  ]
}

Expected behaviour:

  • Response with HTTP Satus Code 200 (because the list of campaigns exists even though it is empty)

  • Response body with content with regular structure in this case, i.e.

{
  "count": 0,
  "campaigns": [ ]
}

Because of this behaviour the API lib is throwing an ApiException instead of returning an empty list of campaigns.

I guess - but haven't checked - this is the same for every other "get Items" call against the api.

thanks

Problem with function sendTransacEmail()

Hello,

I have a problem when i want to use the function sendTransacEmail().

I obtain this error : Attempted to call an undefined method named "swaggerFormats" of class "Symfony\Component\HttpFoundation\Response".

Here my code that obtain this :

$api_instance = new \SendinBlue\Client\Api\SMTPApi(); $sendSmtpEmail = new \SendinBlue\Client\Model\SendSmtpEmail(); $sender = new \SendinBlue\Client\Model\SendSmtpEmailSender(); $sender->setName($revue->getConfig()->getLibelleExpediteur()); $sender->setName($revue->getConfig()->getEmailExpediteur()); $To = new \SendinBlue\Client\Model\SendSmtpEmailTo(); $To->setEmail($Contact->getEmail()); $sendSmtpEmail->setSubject("Merci pour votre accueil téléphonique"); $sendSmtpEmail->setHtmlContent($html); $result = $api_instance->sendTransacEmail($sendSmtpEmail);

Can you help me ?
Thanks

No fallback for importContacts

As I was trying to do an importContacts locally, I saw that you don't have a fallback when your api can't reach the fileUrl of a

new \SendinBlue\Client\Model\RequestContactImport

and thus result in a 500 error without much explanation, maybe we can implement that.

GetEmailCampaigns does include statistics, getEmailCampaign does not

When retrieving several campaigns at once via the GetEmailCampaigns call the array with all the campaign data contains all the statistics data available for each campaign (GetExtendedCampaignStats Model).

Actual behaviour:
When requesting only a single campaign via GetEmailCampaign this statistics data is missing.

Desired behaviour:
When requesting only a single campaign via GetEmailCampaign this statistics data is not missing.

API v3 Create SMS Campaign

Hello,

I have an error when i try to use the createSMSCampaign function in the API, i saw in the documentation of API V3 Sendinblue the SMS Campaign haven't been developed.

Have you got any ideas when the functionnality will be done ?

Set headers on SendSmtpEmail

Hi, I'm trying to setup the headers on SendSmtpEmail. The documentation says that headers is supposed to be of type object. However, I can't seem to make this work. Here's what I tried:

  1. $headers = "{'Content-Type':'text/html', 'charset':'iso-8859-1', 'sender.ip':'x.x.x.x'}";
  2. $headers = json_encode(['Content-Type'=>'text/html', 'charset'=>'iso-8859-1', 'sender.ip'=>'x.x.x.x']);
  3. $headers = "{'sender.ip':'x.x.x.x'}";
  4. $headers = json_encode(['sender.ip'=>'x.x.x.x']);
        $dataSmtpEmail['headers'] = $headers;
        $dataSmtpEmail['htmlContent'] = $data['htmlContent'];
        $dataSmtpEmail['subject'] = $data['subject'];
        $dataSmtpEmail['tags'] = $data['tags'];
        $dataSmtpEmail['params'] = $data['params'];
        $dataSmtpEmail['sender'] = new \SendinBlue\Client\Model\SendSmtpEmailSender([
            'name' =>$data['sender']['name'],
            'email' =>$data['sender']['email'],
        ]);
        $dataSmtpEmail['replyTo'] = new \SendinBlue\Client\Model\SendSmtpEmailReplyTo([
            'name' =>$data['sender']['name'],
            'email' =>$data['sender']['email']
        ]);
        $dataSmtpEmail['to'] = [
            new \SendinBlue\Client\Model\SendSmtpEmailTo(['email' => $data['email']])
        ];
        $sendSmtpEmail = new \SendinBlue\Client\Model\SendSmtpEmail($dataSmtpEmail);
        try {
            return $apiInstance->sendTransacEmail($sendSmtpEmail);
        } catch (Exception $e) {
            return false;
        }

All of the trials above yields the following:

[400] Client error: POST https://api.sendinblue.com/v3/smtp/email resulted in a 400 Bad Request response: {"code":"invalid_parameter","message":"Invalid headers"}

If I don't set the headers it will work, but the email will be sent through the wrong dedicated IP.

Could someone please provide a valid example to illustrate how to set this up? Thanks!

smtpBlacklistSender value is now required by Sendinblue as an empty Array

Yesteday around 2018-07-09 11:12:00 CEST Sendinblue modified the behavior of the https://api.sendinblue.com/v3/contacts end-point.

It seems that smtpBlacklistSender value cannot be assigned as "null" anymore so the following error was received by the service:

{\"code\":\"invalid_parameter\",\"message\":\"Invalid smtpBlacklistSender format\"}

I was not assigning the value for "smtpBlacklistSender", so I figure out that maybe the APIv3-php-library was doing it.

I found that CreateContact model is assigning "smtpBlacklistSender" a null value instead an empty array:

$this->container['smtpBlacklistSender'] = isset($data['smtpBlacklistSender']) ? $data['smtpBlacklistSender'] : null;

I observed that the swagger definition was correct, and in fact I was running my code during weeks using smtpBlacklistSender as null without notice any error, so I figure out that something changed in the behaviour of the https://api.sendinblue.com/v3/contacts endpoint.

Steps to reproduce:

  1. Push new contact with updateEnabled and without smtpBlacklistSender:
 $subscription_body =
        [
            'email'               => $email,
            'emailBlacklisted'    => false,
            'smsBlacklisted'      => false,
            'listIds'             => [1, 2, 3],
            'attributes'          => ['NAME' => 'Test'],
            'updateEnabled'       => true,
        ];

$contact_api->createContact(new CreateContact($subscription_body));

Expected result:

Contact should be accepted without problems even with smtpBlacklistSender as null like it was working during the last weeks.

Received result:

{\"code\":\"invalid_parameter\",\"message\":\"Invalid smtpBlacklistSender format\"}

Export contacts

Hello,

I want to use the method requestContactExport() to export contacts from a campaign, but i don't know how to create the object contactFilter ?

cc @ekta-slit

Model/CreateEmailCampaign - disable Header/Footer does not work properly #2

As stated in Ticket #39 the API functionality to set/unset header and footer of campaigns is broken and it remains broken. Worse even, it is even more broken since the change following the issue.

We were able to disable the header with a workaround/hack to include an empty div (<div></div>). This is not possible anymore. We guess this is due to the fact that now the check for [MIRROR] is ran only against the header and not against the whole mail body.
@ekta-slit even said so in #39:

setting header/footer to anything else i.e. something, then for footer default value is used ( as footer must have [UNSUBSCRIBE] ) & for header default value is used ( if it doesn't have [MIRROR])

To achieve our desired behaviour we had to change DEFAULT_HEADER and DEFAULT_FOOTER in the dashboard for the time being.

We want to use our own template which includes the MIRROR and the UNSUBSCRIBE at positions we want within the mail body. Therefore we do not need the Header and Footer and want to deactivate them. That's not possible! But it should be!

Copied from #39:

Desired behaviour:
setting to empty string via API should disable header/footer respectively
setting whitespace string via API should disable header/footer respectively
the check if header/footer are needed should run beforehand

Additionally
The check should check the whole mail body and not only those two small substrings

Error with getAttributes()

Hello,

When I request all attributes, I got this error : [400] Error connecting to the API (https://api.sendinblue.com/v3/contacts/attributes)

I don't find this method in your API documentation.

Regards,
Joël

createContact in list

Hi, does anyone have the same issue ?

i'm trying to create a Contact in a list and it's not working with the method createContact.
The Contact is added / updated but not the list IDS!

Contacts are added/edited on SendinBlue but they are not put in a list.

        $sendinBlueContact = new CreateContact([
            "listIds" => [9]
        ]);
        $sendinBlueContact->setEmail($contact->getEmail());
        $sendinBlueContact->setUpdateEnabled(true);
        $sendinBlueContact->setAttributes([
            "CIV" => $contact->getGender() == Contact::GENDER_M ? "M" : "F",
            "PRENOM" => $contact->getFirstName(),
            "NOM" => $contact->getLastName(),
            "DDNAISSANCE" => $contact->getBirthdayAt()->format("m-d-Y")
            // @todo suite
        ]);`

Dynamic Lists

Hey,

is there any intention to provide a way to create a dynamic list via API? That would be ace!

best regards!

Error: Invalid Recipients format

Exception when calling EmailCampaignsApi->createEmailCampaign
[400] Client error: POST https://api.sendinblue.com/v3/emailCampaigns resulted in a 400 Bad Request
response: {"code":"invalid_parameter","message":"Invalid Recipients format"}

This is my code:
$recipients = new SendinBlue\Client\Model\CreateEmailCampaignRecipients();
$recipients['listIds'] = 3;

(3 is the id of my list)

Model/GetEmailCampaigns count is wrong

The count value in the Model/GetEmailCampaigns model is wrong when you use the optional filtering (by i.e. status). In our example the array with campaigns contained the correct campaigns regarding the used filter but count was always the amount of campaigns available without any filtering.

see

public function getEmailCampaigns($type = null, $status = null, $limit = '500', $offset = '0')

createAttribute() always in error 400

Hello,
Either the documentation is missing something, either there is an issue.
Here is my test code:

public function createAttribute($attributeCategory, $attributeName)
    {
        $apiInstance = new SendinBlue\Client\Api\AttributesApi(
        // 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(),
            $this->_config['api-config']
        );
        $attributeCategory = "normal";
        $attributeName = "COLOR";
        $createAttribute = new \SendinBlue\Client\Model\CreateAttribute(); // \SendinBlue\Client\Model\CreateAttribute | Values to create an attribute
        try {
            $result = $apiInstance->createAttribute($attributeCategory, $attributeName, $createAttribute);

        } catch (\Exception $e) {
            $result =  $e->getMessage();
        }
        return $result;
    }

Returning the error:
[400] Client error: POST https://api.sendinblue.com/v3/contacts/attributes/normal/COLOR resulted in a 400 Bad Request response:
{"code":"missing_parameter","message":"No inputs in the body"}

Thanks for checking for an issue.
Kitcat711

Error 500 with sendTransacEmail()

Dear,
I have an error 500 without detailed when i called sendTransacEmail(). Any idea ?

[500] Server error: POST https://api.sendinblue.com/v3/smtp/email resulted in a 500 Internal Server Error response:
{}

RegEx in SendSmtpEmailAttachment::setContent fails

the RegEx in SendSmtpEmailAttachment::setContent does not evaluate to true
I tried $content = base64_encode(file_get_contents($filepath));
which evaluates to false and
$content = chunk_split(base64_encode(file_get_contents($filepath)));
returns 0
So InvalidArgumentException is thrown all the time.
Attachment is an PDF File ca. 50-60kb

Create or Update

I'm trying to write a very simple form that takes an email from user input and adds it to a list. I have it working so long as a contact with that email doesn't already exist. If the email exists, I get a (rather descriptive) fatal error.

Is there a "create or update" method of some kind that would create a contact or update the existing contact if it exists? The previous version of the API had a method for this but I can't find anything analogous here.

getContactStats()

Hello

I would like to know if it will be possible to recover the campaigns, in addition to the id campaign, with the method getContactStats ()?

Thanks

getSmtpTemplates need string `true` to work

need to set as parameter 1 or 0 instead true / false as string in GET.

WORK with templateStatus=true
https://api.sendinblue.com/v3/smtp/templates?templateStatus=true&limit=50&offset=0
DONT WORK with templateStatus=1
https://api.sendinblue.com/v3/smtp/templates?templateStatus=1&limit=50&offset=0

why caller need to provide Guzzle instance

Hey,

We noticed that you recently change your api and now it looks like:

`$apiInstance = new SendinBlue\Client\Api\SMTPApi(

new GuzzleHttp\Client(),

$config

);`

It's a pretty bad idea that caller has to provide a guzzle instance in an API. It should be done by SDK itself. Totally strange to me.

Documentation is very poor. I had to figure out options from source.

Please improve docs.
Simple stuff such as sending transnational emails should not be a problem.
When creating SendSmtpEmail for example:
new \SendinBlue\Client\Model\SendSmtpEmail()
what goes in to constructor SendSmtpEmail? i had to dig in the source code to figure that out.
At least provide defaults options in readme and not just leave it blank there.
Its also a bad idea to start changing well accepted options for emails like from to sender.
Changes like this just start confusing developers.
Lets be consistent as most email APIs use from not sender.

thanks

CreateContact returns null and not a CreateUpdateContactModel

Hello,

I am having issues with the createContact() method. It is returning null instead of a CreateUpdateContactModel as it should be.

public function addEmailToList($email, $list, $name = '')
  {
    $contact = new CreateContact();
    $contact->setEmail($email);
    $contact->setListIds([$list]);
    $contact->setUpdateEnabled(true);
    $contact->setAttributes([
      'FNAME' => $name,
    ]);

    dd($this->contactsApi->createContact($contact));
  }

On looking through the source code, it seems to either get a 204 response code if it is updated or a 201 if it is created.

Should we just assume that if it is null then it has updated the contact and if it returns an id it has added them?

getContacts -> modifiedSince changes even on "touch" only

Hey,

I'm not quite sure if this is the right place, but within the dashboard would be as false as here. 😉

It seems like the 'modifiedSince' attribute is changed everytime the contact is touched - i.e. through a dynamic list.

As we syncronize our data we noticed that everytime the dynamic lists kick in, the sync is trying to update a whole bunch of contacts even though this is not necessary. A contact thats checked for this dynamic lists and is not changed in any way should not get a new timestamp for modifiedSince.

thx

Problem with dates in getEmailEventReport()

When passing DateTime to getEmailEventReport() with startDate or endDate parameters they are converted to DateTime::ATOM format which is not supported in this API call. It probably should be just Y-m-d format.

{
  "code": "invalid_parameter",
  "message": "Start date is not valid"
}

Problem with function sendTransacEmail()

Hello,

I have a problem when i want to use the function sendTransacEmail().

I obtain this error : Attempted to call an undefined method named "swaggerFormats" of class "Symfony\Component\HttpFoundation\Response".

Here my code that obtain this :

$api_instance = new \SendinBlue\Client\Api\SMTPApi();
$sendSmtpEmail = new \SendinBlue\Client\Model\SendSmtpEmail();
$sender = new \SendinBlue\Client\Model\SendSmtpEmailSender();
$sender->setName($revue->getConfig()->getLibelleExpediteur());
$sender->setName($revue->getConfig()->getEmailExpediteur());
$To = new \SendinBlue\Client\Model\SendSmtpEmailTo();
$To->setEmail($Contact->getEmail());
$sendSmtpEmail->setSubject("Merci pour votre accueil téléphonique");
$sendSmtpEmail->setHtmlContent($html);
$result = $api_instance->sendTransacEmail($sendSmtpEmail);

@ekta-slit said me a response but i have again the error....Please help me !

Thanks

Can't delete contacts with deleteContact()

Hello,

I try to remove, from our contacts list, the people who unsubscribed to our mailing list.
I'm using this code to do so:

$apiInstance->deleteContact($email);

I often have some error messages like this:

Exception when calling ContactsApi->deleteContact: [404] Client error: DELETE https://api.sendinblue.com/v3/contacts/bill%40exmaple.com` resulted in a 404 Not Not Found response: {"code":"document_not_found","message":"Contact does not exist"}`

Except that I got the email address from this method:
$requestContactExport = new \SendinBlue\Client\Model\RequestContactExport(); $requestContactExport->setNotifyUrl(NOTIFY_URL);

With this filter:
$requestContactExport->setContactFilter(['blacklisted' => 1]);

I have tried to use rawurlencode() and urlencode() (and nothing) on the email address but this does not change anything.

Any suggestion?

Error with updateChildAccountStatus

Hello

I update the library
Updating sendinblue/api-v3-sdk (v6.1.3 => v6.1.4)

I've got this error when a request updateChildAccountStatus : Method not found

My Error ===>Call to undefined method SendinBlue\Client\Api\ResellerApi::updateChildAccountStatus()

Can you help me ?
Thanks

SendInBlue create contact error

I'm working in local to test SendInBlue create contact.

Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('api-key', env('SENDINBLUE_API_KEY'));

$api_instance = new Swagger\Client\Api\ContactsApi();
$createContact = new Swagger\Client\Model\CreateContact();

$createContact['email'] = '[email protected]';
$createContact['listIds'] = 2;

$result = $api_instance->createContact($createContact);

dd($result);

I have this error...

[400] Error connecting to the API (https://api.sendinblue.com/v3/contacts)

Error with getEmailCampaigns

Hello,

I've got this error when a request getEmailCampaigns : [404] Error connecting to the API (https://api.sendinblue.com/v3/emailCampaigns?limit=500&offset=0)

Regards,
Joël

GetEmailCampaigns : status property not always exists in response

Hy,

When a email campaign is suspended or in a draft status, there is no status property retrieve by the GetEmailCampaigns api function.

Data return for a draft email campaign :
"id": 5, "name": "Test Outlook", "subject": "Test Outlook", "type": "classic", "testSent": true, "header": "[DEFAULT_HEADER]", "footer": "[DEFAULT_FOOTER]",

Data return for a suspended email campaign :
"id": 4, "name": "Nouveau test newsletter", "subject": "Test", "type": "classic", "testSent": true, "header": "[DEFAULT_HEADER]", "footer": "[DEFAULT_FOOTER]",

Data return for a sent email campaign :
"id": 3, "name": "Campagne test 4", "subject": "Test 2", "type": "classic", "status": "sent", "testSent": true,

Why this behavior ? how could we know the status ??
This seems like a bug.

Thanks

How to send attributes ?

Hello just installer lib and i face a problem i want to send register email to a new user register on site with a template, this user is not in my contacts list on sendinblue so i do :

$sendEmail = new SendEmail();

$sendEmail->setEmailTo(["[email protected]"]);
$sendEmail
->setReplyTo("[email protected]")
->setAttributes($attributes);

But i have no idea how create attributes i try $attributes = ["WELCOME" => "test"] but not work mail is empty from attribute welcome

In my template on sendinblue i put {{ WELCOME }} i try to {{ contact.WELCOME }} but not work too

Can you help me thanks

Model/CreateEmailCampaign - disable Header/Footer does not work properly

When creating a campaign via API the setup of header and footer does not work properly. Both values are optional, so they fall back to their default_header setting configured in the gui.

Actual behaviour:

  • setting header/footer to empty string '' ends up changing nothing. The default header/footer is still used
  • setting header/footer to whitespace string ' ' ends up changing nothing. The default header/footer is still used
  • setting header/footer to anything else string i.e. something triggers a check if the [MIRRORLINK] is found in the body of the mail and deactivates those two values entirely - as seen in the settings screen in the dashboard gui. The string entered here is never rendered inside the mail body though! We circumvented this right now with a single empty div <div></div>

Desired behaviour:

  • setting to empty string via API should disable header/footer respectively
  • setting whitespace string via API should disable header/footer respectively
  • the check if header/footer are needed should run beforehand

install library with composer

i have just run added the "sendinblue/api-v3-sdk": "*@dev" inside my composer.json file to install this package and i runned composer install but the package don't download.

i runned it for both laravel and symfony project

SMTP Size of Emails and attachment

Feature Request as couldn't find the option.

We want the size of email plus attachment size in the log. This feature is available in most of the ESP and think should be a welcome addition to the API.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.