Skip to content
SendinBlue's API v3 TypeScript Library
TypeScript JavaScript Shell
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.swagger-codegen
.gitignore
.swagger-codegen-ignore
README.md
VERSION
api.d.ts
api.js
api.js.map
api.ts
git_push.sh init Sep 18, 2019
package-lock.json
package.json
tsconfig.json

README.md

APIv3-typescript-library

SendinBlue's API v3 TypeScript-Node 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. It supports promises.

SendinBlue's API matches the OpenAPI v2 definition. The specification can be downloaded here.

Installation

For Node.js

npm

The following recommended installation requires npm. If you are unfamiliar with npm, see the npm docs.

Then install it via:

npm install sib-api-v3-typescript --save

Getting Started

Once you have installed the node module in your project, you can execute the following sample code JS code :

// For getAccount API

var SibApiV3Sdk = require('sib-api-v3-typescript');

var apiInstance = new SibApiV3Sdk.AccountApi()

// Configure API key authorization: api-key

var apiKey = apiInstance.authentications['apiKey'];
apiKey.apiKey = "YOUR API KEY"

// Configure API key authorization: partner-key

var partnerKey = apiInstance.authentications['partnerKey'];
partnerKey.apiKey = "YOUR API KEY"

apiInstance.getAccount().then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

//For getLists API

var SibApiV3Sdk = require('sib-api-v3-typescript');

var apiInstance = new SibApiV3Sdk.ContactsApi()

// Configure API key authorization: apiKey

var apiKey = apiInstance.authentications['apiKey'];
apiKey.apiKey = "YOUR API KEY"

// Configure API key authorization: partnerKey

var partnerKey = apiInstance.authentications['partnerKey'];
partnerKey.apiKey = "YOUR API KEY"

var opts = { 
  'limit': 10, // Number | Number of documents per page
  'offset': 0 // Number | Index of the first document of the page
};

apiInstance.getLists(opts).then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
  api.getAttributes().then(function(data) {
    console.log('API called successfully. Returned data: ' + data);
  }, function(error) {
    console.error(error);
  });

}, function(error) {
  console.error(error);
});

For more examples, refer the https://github.com/sendinblue/APIv3-nodejs-library#documentation-for-api-endpoints

You can’t perform that action at this time.