Other integration related questions

What are the available API wrappers/ Libraries for which Brevo provides official support?

Currently, we provide support for the following API Libraries

  1. PHP: https://github.com/brevo/APIv3-php-library
  2. Nodes JS: https://github.com/brevo/APIv3-nodejs-library
  3. Type Script: https://github.com/brevo/APIv3-typescript-library
  4. Ruby: https://github.com/brevo/APIv3-ruby-library
  5. Python: https://github.com/brevo/APIv3-python-library
  6. Java: https://github.com/brevo/APIv3-java-library
  7. C#: https://github.com/brevo/APIv3-csharp-library
  8. Go: https://github.com/brevo/APIv3-go-library

For further information about our repositories check out this link

What is the date format accepted by Brevo API?

Please note that for the date attribute, Brevo API accepts the date in the 'yyyy-mm-dd' format only and display as per the client's dashboard/portal setting.

For example: (DOB is a date type attribute)

"DOB": "2021-05-29"

What is the correct file body format when importing contacts to a list?

"fileBody": "EMAIL;FIRSTNAME;LASTNAME;SMS\[email protected];Mike;Doe;91XXXXXXXXXX\[email protected];John;Smith;91XXXXXXXXXX"

Note: \n is used to separate the contacts.

How does pagination work in the Brevo API?

There are a few API endpoints that return the limited records in a single request.
For example: Get all your transactional email activity (unaggregated events) returns 100 records only in a single API call.

For such endpoints, we provide an additional parameter that is offset, and using offset (Beginning point in the list to retrieve from) the client can get all records.

For example:

  1. If we pass limit=100&offset=0 then we will get the first 100 events. (1-100 events)
  2. If we pass limit=100&offset=100 then we will get the next 100 events (101-200 events)
  3. If we pass limit=100&offset=200 then we will get the next 100 events(201 to 300 events)
  4. If we pass limit=100&offset=300 then we will get the next 100 events (301 to 400 events)

Similarly, we can fetch more records by increasing the offset value.

DOI (Double-opt-in) template

How to create a DOI template?

To create a custom DOI template you will need to add an 'optin' tag in the campaign template setup.
You will also need to specify which CTA in your template design follows to the actual confirmation, for this you need to setup the {{ doubleoptin }} placeholder in your CTA link or button.

Please refer to the attached screenshot for setting up the optin tag:

How to create contact via DOI (Double-Opt-In) Flow using the API endpoint

The above-mentioned API endpoint requires an active DOI template else it returns the following error:

{ “code”: “invalid_parameter” , “message” : “An active DOI template does not exist” }

Note: You will need to replace the {{ doubleoptin }} with {{ params.DOIurl }} in your DOI template design in case you want to specify a custom redirection URL once your contact clicks the CTA. DOIurl is passed as an attribute in the API call and then embedded to the {{params.DOIurl}} placeholder.

Does API V3 support inline image (inlineImage) parameter for transactional emails as supported by API V2?

It is not supported by API V3, however, we have a workaround to achieve this functionality via params using Send a transactional email API endpoint.

For example in case you want to display a logo image in the email body.

Step 1. You must have the absolute URL of that logo image

Example url: https://img.mailinblue.com/2601503/images/rnb/original/5f8d7a79c93a8f36627df383.png

Note: if you are using Base64 encoding for your image, you will need to host the image to get an absolute URL instead of base64 encoded data of a local file.

Step2. The logo image URL can be sent as a params' variable like LOGO_IMAGE_URL.

"params": {"LOGO_IMAGE_URL": "https://img.mailinblue.com/2601503/images/rnb/original/5f8d7a79c93a8f36627df383.png"}

Step 3. LOGO_IMAGE_URL attribute needs to be defined in htmlContent:

{{ params.LOGO_IMAGE_URL}}


"htmlContent": "<html><body>Some content here<br><img src={{ params.LOGO_IMAGE_URL}} alt='logo' width='108' height='83'><br></body></html>"

Example curl command:

curl --request POST \
--url https://api.brevo.com/v3/smtp/email \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'api-key: YOUR API KEY' \
--data '{
"sender": {"name": "sender_name", "email": "[email protected]"},
"to": [{"email": "[email protected]", "name": "to_name"}],
"htmlContent": "<html><body>Some content here<br><img src={{ params.LOGO_IMAGE_URL}} alt='logo' width='108' height='83'><br></body></html>",
"subject": "This is final signature logo",
"params": {
"LOGO_IMAGE_URL": "https://img.mailinblue.com/2601503/images/rnb/original/5f8d7a79c93a8f36627df383.png"

The recipient email will looks like:

How many recipients can be added to send a single transactional email?

We can add 99 recipients including 'to', 'cc', and 'bcc' to send a transactional email.