Skip to content

Latest commit

 

History

History
340 lines (239 loc) · 9.63 KB

SendersApi.md

File metadata and controls

340 lines (239 loc) · 9.63 KB

SibApiV3Sdk.SendersApi

All URIs are relative to https://api.sendinblue.com/v3

Method HTTP request Description
createSender POST /senders Create a new sender
deleteSender DELETE /senders/{senderId} Delete a sender
getIps GET /senders/ips Get all the dedicated IPs for your account
getIpsFromSender GET /senders/{senderId}/ips Get all the dedicated IPs for a sender
getSenders GET /senders Get the list of all your senders
updateSender PUT /senders/{senderId} Update a sender

createSender

CreateSenderModel createSender(opts)

Create a new sender

Example

var SibApiV3Sdk = require('sib-api-v3-sdk');
var defaultClient = SibApiV3Sdk.ApiClient.instance;

// Configure API key authorization: api-key
var apiKey = defaultClient.authentications['api-key'];
apiKey.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apiKey.apiKeyPrefix = 'Token';

// Configure API key authorization: partner-key
var partnerKey = defaultClient.authentications['partner-key'];
partnerKey.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//partnerKey.apiKeyPrefix = 'Token';

var apiInstance = new SibApiV3Sdk.SendersApi();

var opts = { 
  'sender': new SibApiV3Sdk.CreateSender() // CreateSender | sender's name
};
apiInstance.createSender(opts).then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

Parameters

Name Type Description Notes
sender CreateSender sender's name [optional]

Return type

CreateSenderModel

Authorization

api-key, partner-key

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

deleteSender

deleteSender(senderId)

Delete a sender

Example

var SibApiV3Sdk = require('sib-api-v3-sdk');
var defaultClient = SibApiV3Sdk.ApiClient.instance;

// Configure API key authorization: api-key
var apiKey = defaultClient.authentications['api-key'];
apiKey.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apiKey.apiKeyPrefix = 'Token';

// Configure API key authorization: partner-key
var partnerKey = defaultClient.authentications['partner-key'];
partnerKey.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//partnerKey.apiKeyPrefix = 'Token';

var apiInstance = new SibApiV3Sdk.SendersApi();

var senderId = 789; // Number | Id of the sender

apiInstance.deleteSender(senderId).then(function() {
  console.log('API called successfully.');
}, function(error) {
  console.error(error);
});

Parameters

Name Type Description Notes
senderId Number Id of the sender

Return type

null (empty response body)

Authorization

api-key, partner-key

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

getIps

GetIps getIps()

Get all the dedicated IPs for your account

Example

var SibApiV3Sdk = require('sib-api-v3-sdk');
var defaultClient = SibApiV3Sdk.ApiClient.instance;

// Configure API key authorization: api-key
var apiKey = defaultClient.authentications['api-key'];
apiKey.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apiKey.apiKeyPrefix = 'Token';

// Configure API key authorization: partner-key
var partnerKey = defaultClient.authentications['partner-key'];
partnerKey.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//partnerKey.apiKeyPrefix = 'Token';

var apiInstance = new SibApiV3Sdk.SendersApi();
apiInstance.getIps().then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

Parameters

This endpoint does not need any parameter.

Return type

GetIps

Authorization

api-key, partner-key

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

getIpsFromSender

GetIpsFromSender getIpsFromSender(senderId)

Get all the dedicated IPs for a sender

Example

var SibApiV3Sdk = require('sib-api-v3-sdk');
var defaultClient = SibApiV3Sdk.ApiClient.instance;

// Configure API key authorization: api-key
var apiKey = defaultClient.authentications['api-key'];
apiKey.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apiKey.apiKeyPrefix = 'Token';

// Configure API key authorization: partner-key
var partnerKey = defaultClient.authentications['partner-key'];
partnerKey.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//partnerKey.apiKeyPrefix = 'Token';

var apiInstance = new SibApiV3Sdk.SendersApi();

var senderId = 789; // Number | Id of the sender

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

Parameters

Name Type Description Notes
senderId Number Id of the sender

Return type

GetIpsFromSender

Authorization

api-key, partner-key

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

getSenders

GetSendersList getSenders(opts)

Get the list of all your senders

Example

var SibApiV3Sdk = require('sib-api-v3-sdk');
var defaultClient = SibApiV3Sdk.ApiClient.instance;

// Configure API key authorization: api-key
var apiKey = defaultClient.authentications['api-key'];
apiKey.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apiKey.apiKeyPrefix = 'Token';

// Configure API key authorization: partner-key
var partnerKey = defaultClient.authentications['partner-key'];
partnerKey.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//partnerKey.apiKeyPrefix = 'Token';

var apiInstance = new SibApiV3Sdk.SendersApi();

var opts = { 
  'ip': "ip_example", // String | Filter your senders for a specific ip (available for dedicated IP usage only)
  'domain': "domain_example" // String | Filter your senders for a specific domain
};
apiInstance.getSenders(opts).then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

Parameters

Name Type Description Notes
ip String Filter your senders for a specific ip (available for dedicated IP usage only) [optional]
domain String Filter your senders for a specific domain [optional]

Return type

GetSendersList

Authorization

api-key, partner-key

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

updateSender

updateSender(senderId, opts)

Update a sender

Example

var SibApiV3Sdk = require('sib-api-v3-sdk');
var defaultClient = SibApiV3Sdk.ApiClient.instance;

// Configure API key authorization: api-key
var apiKey = defaultClient.authentications['api-key'];
apiKey.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apiKey.apiKeyPrefix = 'Token';

// Configure API key authorization: partner-key
var partnerKey = defaultClient.authentications['partner-key'];
partnerKey.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//partnerKey.apiKeyPrefix = 'Token';

var apiInstance = new SibApiV3Sdk.SendersApi();

var senderId = 789; // Number | Id of the sender

var opts = { 
  'sender': new SibApiV3Sdk.UpdateSender() // UpdateSender | sender's name
};
apiInstance.updateSender(senderId, opts).then(function() {
  console.log('API called successfully.');
}, function(error) {
  console.error(error);
});

Parameters

Name Type Description Notes
senderId Number Id of the sender
sender UpdateSender sender's name [optional]

Return type

null (empty response body)

Authorization

api-key, partner-key

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json