Skip to content
SendinBlue's C# library for API v3
C# Shell
Branch: master
Clone or download
Latest commit 4e0a4d6 Apr 1, 2019

README.md

SendinBlue's API v3 C# 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 C# SDK is automatically generated by the Swagger Codegen project and is reviewed and maintained by SendinBlue:

Frameworks supported

  • .NET 4.0 or later
  • Windows Phone 7.1 (Mango)

Dependencies

The DLLs included in the package may not be the latest version. We recommend using NuGet to obtain the latest version of the packages:

Install-Package RestSharp
Install-Package Newtonsoft.Json
Install-Package JsonSubTypes

NOTE: RestSharp versions greater than 105.1.0 have a bug which causes file uploads to fail. See RestSharp#742

Installation

  • Include the Dependencies (RestSharp, Json.NET and JsonSubTypes as mentioned in Dependencies section) in the C# project.

    OR

    Install the latest version of our sib_api_v3_sdk from nuget.

  • Use the namespaces:

using sib_api_v3_sdk.Api;
using sib_api_v3_sdk.Client;
using sib_api_v3_sdk.Model;

Getting Started

using System;
using System.Diagnostics;
using sib_api_v3_sdk.Api;
using sib_api_v3_sdk.Client;
using sib_api_v3_sdk.Model;

namespace Example
{
    public class Example
    {
        public void main()
        {

            // Configure API key authorization: api-key
            Configuration.Default.ApiKey.Add("api-key", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.ApiKeyPrefix.Add("api-key", "Bearer");
            // Configure API key authorization: partner-key
            Configuration.Default.ApiKey.Add("partner-key", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.ApiKeyPrefix.Add("partner-key", "Bearer");

            var apiInstance = new AccountApi();

            try
            {
                // Get your account informations, plans and credits details
                GetAccount result = apiInstance.GetAccount();
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountApi.GetAccount: " + e.Message );
            }

        }
    }
}

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 informations, plans and credits details
AttributesApi CreateAttribute POST /contacts/attributes/{attributeCategory}/{attributeName} Creates contact attribute
AttributesApi DeleteAttribute DELETE /contacts/attributes/{attributeCategory}/{attributeName} Deletes an attribute
AttributesApi GetAttributes GET /contacts/attributes Lists all attributes
AttributesApi UpdateAttribute PUT /contacts/attributes/{attributeCategory}/{attributeName} Updates contact attribute
ContactsApi AddContactToList POST /contacts/lists/{listId}/contacts/add Add existing contacts to a list
ContactsApi CreateAttribute POST /contacts/attributes/{attributeCategory}/{attributeName} Creates contact attribute
ContactsApi CreateContact POST /contacts Create a contact
ContactsApi CreateFolder POST /contacts/folders Create a folder
ContactsApi CreateList POST /contacts/lists Create a list
ContactsApi DeleteAttribute DELETE /contacts/attributes/{attributeCategory}/{attributeName} Deletes an attribute
ContactsApi DeleteContact DELETE /contacts/{email} Deletes 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 Lists all attributes
ContactsApi GetContactInfo GET /contacts/{email} Retrieves contact informations
ContactsApi GetContactStats GET /contacts/{email}/campaignStats Get the campaigns statistics for a contact
ContactsApi GetContacts GET /contacts Get all the contacts
ContactsApi GetContactsFromList GET /contacts/lists/{listId}/contacts Get the contacts in a list
ContactsApi GetFolder GET /contacts/folders/{folderId} Returns folder details
ContactsApi GetFolderLists GET /contacts/folders/{folderId}/lists Get the lists in a folder
ContactsApi GetFolders GET /contacts/folders Get all the folders
ContactsApi GetList GET /contacts/lists/{listId} Get the details of a list
ContactsApi GetLists GET /contacts/lists Get all the lists
ContactsApi ImportContacts POST /contacts/import Import contacts
ContactsApi RemoveContactFromList POST /contacts/lists/{listId}/contacts/remove Remove existing contacts from a list
ContactsApi RequestContactExport POST /contacts/export Export contacts
ContactsApi UpdateAttribute PUT /contacts/attributes/{attributeCategory}/{attributeName} Updates contact attribute
ContactsApi UpdateContact PUT /contacts/{email} Updates a contact
ContactsApi UpdateFolder PUT /contacts/folders/{folderId} Update a contact folder
ContactsApi UpdateList PUT /contacts/lists/{listId} Update a list
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 a campaign
EmailCampaignsApi GetEmailCampaign GET /emailCampaigns/{campaignId} Get campaign informations
EmailCampaignsApi GetEmailCampaigns GET /emailCampaigns Return all your created campaigns
EmailCampaignsApi SendEmailCampaignNow POST /emailCampaigns/{campaignId}/sendNow Send an email campaign id of the campaign immediately
EmailCampaignsApi SendReport POST /emailCampaigns/{campaignId}/sendReport Send the report of a campaigns
EmailCampaignsApi SendTestEmail POST /emailCampaigns/{campaignId}/sendTest Send an email campaign to your test list
EmailCampaignsApi UpdateCampaignStatus PUT /emailCampaigns/{campaignId}/status Update a campaign status
EmailCampaignsApi UpdateEmailCampaign PUT /emailCampaigns/{campaignId} Update a campaign
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 folder details
FoldersApi GetFolderLists GET /contacts/folders/{folderId}/lists Get the lists in a folder
FoldersApi GetFolders GET /contacts/folders Get all the folders
FoldersApi UpdateFolder PUT /contacts/folders/{folderId} Update a contact folder
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 the contacts in a list
ListsApi GetFolderLists GET /contacts/folders/{folderId}/lists Get the lists in a folder
ListsApi GetList GET /contacts/lists/{listId} Get the details of a list
ListsApi GetLists GET /contacts/lists Get all the lists
ListsApi RemoveContactFromList POST /contacts/lists/{listId}/contacts/remove Remove existing contacts from a list
ListsApi UpdateList PUT /contacts/lists/{listId} Update a list
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/{childAuthKey}/credits/add Add Email and/or SMS credits to a specific child account
ResellerApi AssociateIpToChild POST /reseller/children/{childAuthKey}/ips/associate Associate a dedicated IP to the child
ResellerApi CreateResellerChild POST /reseller/children Creates a reseller child
ResellerApi DeleteResellerChild DELETE /reseller/children/{childAuthKey} Deletes a single reseller child based on the childAuthKey supplied
ResellerApi DissociateIpFromChild POST /reseller/children/{childAuthKey}/ips/dissociate Dissociate a dedicated IP to the child
ResellerApi GetChildInfo GET /reseller/children/{childAuthKey} Gets the info about a specific child account
ResellerApi GetResellerChilds GET /reseller/children Gets the list of all reseller's children accounts
ResellerApi RemoveCredits POST /reseller/children/{childAuthKey}/credits/remove Remove Email and/or SMS credits from a specific child account
ResellerApi UpdateResellerChild PUT /reseller/children/{childAuthKey} Updates infos of reseller's child based on the childAuthKey supplied
SMSCampaignsApi CreateSmsCampaign POST /smsCampaigns Creates an SMS campaign
SMSCampaignsApi DeleteSmsCampaign DELETE /smsCampaigns/{campaignId} Delete the SMS campaign
SMSCampaignsApi GetSmsCampaign GET /smsCampaigns/{campaignId} Get an SMS campaign
SMSCampaignsApi GetSmsCampaigns GET /smsCampaigns Returns the informations for all your created SMS campaigns
SMSCampaignsApi RequestSmsRecipientExport POST /smsCampaigns/{campaignId}/exportRecipients Exports the recipients of the specified campaign.
SMSCampaignsApi SendSmsCampaignNow POST /smsCampaigns/{campaignId}/sendNow Send your SMS campaign immediately
SMSCampaignsApi SendSmsReport POST /smsCampaigns/{campaignId}/sendReport Send report of SMS campaigns
SMSCampaignsApi SendTestSms POST /smsCampaigns/{campaignId}/sendTest Send an SMS
SMSCampaignsApi UpdateSmsCampaign PUT /smsCampaigns/{campaignId} Updates an SMS campaign
SMSCampaignsApi UpdateSmsCampaignStatus PUT /smsCampaigns/{campaignId}/status Update the campaign status
SMTPApi CreateSmtpTemplate POST /smtp/templates Create an smtp template
SMTPApi DeleteHardbounces POST /smtp/deleteHardbounces Delete hardbounces
SMTPApi DeleteSmtpTemplate DELETE /smtp/templates/{templateId} Delete an inactive smtp template
SMTPApi GetAggregatedSmtpReport GET /smtp/statistics/aggregatedReport Get your SMTP activity aggregated over a period of time
SMTPApi GetEmailEventReport GET /smtp/statistics/events Get all your SMTP activity (unaggregated events)
SMTPApi GetSmtpReport GET /smtp/statistics/reports Get your SMTP activity aggregated per day
SMTPApi GetSmtpTemplate GET /smtp/templates/{templateId} Returns the template informations
SMTPApi GetSmtpTemplates GET /smtp/templates Get the list of SMTP templates
SMTPApi SendTemplate POST /smtp/templates/{templateId}/send Send a template
SMTPApi SendTestTemplate POST /smtp/templates/{templateId}/sendTest Send a template to your test list
SMTPApi SendTransacEmail POST /smtp/email Send a transactional email
SMTPApi UpdateSmtpTemplate PUT /smtp/templates/{templateId} Updates an smtp templates
SendersApi CreateSender POST /senders Create a new sender
SendersApi DeleteSender DELETE /senders/{senderId} Delete a sender
SendersApi GetIps GET /senders/ips Return all the dedicated IPs for your account
SendersApi GetIpsFromSender GET /senders/{senderId}/ips Return 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
TransactionalSMSApi GetSmsEvents GET /transactionalSMS/statistics/events Get all the 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 the SMS campaign to the specified mobile number
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

Documentation for Models

Documentation for Authorization

api-key

  • 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

Support and Feedback

Be sure to visit the SendinBlue official documentation website for additional information about our API.

If you find a bug, please post the issue on Github.

As always, if you need additional assistance, drop us a note here.

You can’t perform that action at this time.