Returns the information for all your created SMS campaigns

Code Examples

You can use as reference the code below to implement this call in your preferred language.
Check all our official API clients here

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

let apiKey = defaultClient.authentications['api-key'];
apiKey.apiKey = 'YOUR API KEY';

let apiInstance = new SibApiV3Sdk.SMSCampaignsApi();

let opts = { 
  'status': "string",
  'startDate': new Date("YYYY-MM-DDTHH:MM:ss+00:00"),
  'endDate': new Date("YYYY-MM-DDTHH:MM:ss+00:00"),
  'limit': 50,
  'offset': 0
};

apiInstance.getSmsCampaigns(opts).then(function(data) {
  console.log('API called successfully. Returned data: ' + JSON.stringify(data));
}, function(error) {
  console.error(error);
});
<?php
require_once(__DIR__ . '/vendor/autoload.php');

$config = SendinBlue\Client\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR API KEY');

$apiInstance = new SendinBlue\Client\Api\SMSCampaignsApi(
    new GuzzleHttp\Client(),
    $config
);
$status = 'sent';
$startDate = new \DateTime('2021-01-01T00:00:00+00:00');
$endDate = new \DateTime('2021-01-01T00:00:00+00:00');
$limit = 50;
$offset = 0;

try {
    $result = $apiInstance->getSmsCampaigns($status, $startDate, $endDate, $limit, $offset);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling SMSCampaignsApi->getSmsCampaigns: ', $e->getMessage(), PHP_EOL;
}
?>
from __future__ import print_function
import time
import sib_api_v3_sdk
from sib_api_v3_sdk.rest import ApiException
from pprint import pprint

configuration = sib_api_v3_sdk.Configuration()
configuration.api_key['api-key'] = 'YOUR API KEY'

api_instance = sib_api_v3_sdk.SMSCampaignsApi(sib_api_v3_sdk.ApiClient(configuration))
status = 'string'
start_date = 'YYYY-MM-DDTHH:MM:ss+00:00'
end_date = 'YYYY-MM-DDTHH:MM:ss+00:00'
limit = 500
offset = 0

try:
    api_response = api_instance.get_sms_campaigns(status=status, start_date=start_date, end_date=end_date, limit=limit, offset=offset)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling SMSCampaignsApi->get_sms_campaigns: %s\n" % e)
const SibApiV3Sdk = require('sib-api-v3-typescript');
 
let apiInstance = new SibApiV3Sdk.SMSCampaignsApi()

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

let status = 'sent';
let startDate = new Date('2021-01-01T00:00:00+00:00');
let endDate = new Date('2021-01-01T00:00:00+00:00');
let limit = 50;
let offset = 0;

apiInstance.getSmsCampaigns(status,startDate,endDate,limit,offset).then(function(data) {
  console.log('API called successfully. Returned data: ' + JSON.stringify(data));
}, function(error) {
  console.error(error);
});
using sib_api_v3_sdk.Api;
using sib_api_v3_sdk.Client;
using sib_api_v3_sdk.Model;
using System;
using System.Diagnostics;

namespace Sendinblue
{
    class Program
    {
        static void Main(string[] args)
        {
            Configuration.Default.ApiKey.Add("api-key", "YOUR API KEY");

            var apiInstance = new SMSCampaignsApi();
            string status = "sent";
            string startDate = "2019-01-08T14:24:45+05:30";
            string endDate = "2019-01-10T14:24:45+05:30";
            long? limit = 10;
            long? offset = 5;
            string sort = "asc";
            try
            {
                GetSmsCampaigns result = apiInstance.GetSmsCampaigns(status, startDate, endDate, limit, offset, sort);
                Debug.WriteLine(result.ToJson());
                Console.WriteLine(result.ToJson());
                Console.ReadLine();
            }
            catch (Exception e)
            {
                Debug.WriteLine(e.Message);
                Console.WriteLine(e.Message);
                Console.ReadLine();
            }
        }
    }
}
Language
Authentication
Header
Response
Click Try It! to start a request and see the response here!