Update an SMS campaign

Log in to see full request history
timestatususer agent
Retrieving recent requests…
LoadingLoading…

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 updateSmsCampaign = new SibApiV3Sdk.UpdateSmsCampaign(); let campaignId = 1; updateSmsCampaign = { name = 'string', sender = 'string', content = 'string', recipients = { 'listIds' : [1] }, scheduledAt = new Date('YYYY-MM-DDTHH:MM:ss+00:00') } apiInstance.updateSmsCampaign(campaignId, updateSmsCampaign).then(function() { console.log('API called successfully.'); }, 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 ); $campaignId = 1; $updateSmsCampaign = new \SendinBlue\Client\Model\UpdateSmsCampaign(); $updateSmsCampaign['name'] = 'My First Campaign'; $updateSmsCampaign['sender'] = 'senderName'; $updateSmsCampaign['content'] = 'This is a transactional SMS'; $updateSmsCampaign['recipients'] = array('listIds' => array(1)); $updateSmsCampaign['scheduledAt'] = new \DateTime('2021-01-01T00:00:00+00:00'); try { $apiInstance->updateSmsCampaign($campaignId, $updateSmsCampaign); } catch (Exception $e) { echo 'Exception when calling SMSCampaignsApi->updateSmsCampaign: ', $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)) campaign_id = 1 name = "string" sender = "string" content = "string" recipients = {"listIds": [1]} scheduled_at = "YYYY-MM-DDTHH:MM:ss+00:00" update_sms_campaign = sib_api_v3_sdk.UpdateSmsCampaign(name=name, sender=sender, content=content, recipients=recipients, scheduled_at=scheduled_at) try: api_response = api_instance.update_sms_campaign(campaign_id, update_sms_campaign) pprint(api_response) except ApiException as e: print("Exception when calling SMSCampaignsApi->update_sms_campaign: %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 campaignId = 1; let updateSmsCampaign = new SibApiV3Sdk.UpdateSmsCampaign(); updateSmsCampaign.name = 'My First Campaign'; updateSmsCampaign.sender = 'senderName'; updateSmsCampaign.content = 'This is a transactional SMS'; updateSmsCampaign.recipients = {'listIds' : [1]} updateSmsCampaign.scheduledAt = new Date('2021-01-01T00:00:00+00:00'); apiInstance.updateSmsCampaign(campaignId, updateSmsCampaign).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.Collections.Generic; 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(); long? campaignId = 1; string name = "My First Campaign"; string sender = "senderName"; string content = "'This is a transactional SMS"; List<long?> listIds = new List<long?>(); listIds.Add(1); List<long?> exclusionListIds = new List<long?>(); exclusionListIds.Add(2); CreateSmsCampaignRecipients recipients = new CreateSmsCampaignRecipients(listIds, exclusionListIds); string scheduledAt = "2021-01-01T00:00:00.000+05:30"; try { var updateSmsCampaign = new UpdateSmsCampaign(name, sender, content, recipients, scheduledAt); apiInstance.UpdateSmsCampaign(campaignId, updateSmsCampaign); Console.ReadLine(); } catch (Exception e) { Debug.WriteLine(e.Message); Console.WriteLine(e.Message); Console.ReadLine(); } } } }
# load the gem require 'sib-api-v3-sdk' # setup authorization SibApiV3Sdk.configure do |config| # Configure API key authorization: api-key config.api_key['api-key'] = 'YOUR API KEY' end api_instance = SibApiV3Sdk::SMSCampaignsApi.new campaign_id = 789 # Integer | id of the SMS campaign update_sms_campaign = SibApiV3Sdk::UpdateSmsCampaign.new # UpdateSmsCampaign | Values to update an SMS Campaign update_sms_campaign = { 'name'=> 'string', 'sender'=> 'string', 'content'=> 'string', 'recipients'=> { 'listIds'=> [1] }, 'scheduledAt'=> DateTime.iso8601('2021-02-03T04:05:06+07:00') } begin #Update an SMS campaign api_instance.update_sms_campaign(campaign_id, update_sms_campaign) rescue SibApiV3Sdk::ApiError => e puts "Exception when calling SMSCampaignsApi->update_sms_campaign: #{e}" end
Path Params
int64
required

id of the SMS campaign

Body Params

Values to update an SMS Campaign

string

Name of the campaign

string
length ≤ 15

Name of the sender. The number of characters is limited to 11 for alphanumeric characters and 15 for numeric characters

string

Content of the message. The maximum characters used per SMS is 160, if used more than that, it will be counted as more than one SMS

object
string

UTC date-time on which the campaign has to run (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result.

boolean
Defaults to false

Format of the message. It indicates whether the content should be treated as unicode or not.

string

A recognizable prefix will ensure your audience knows who you are. Recommended by U.S. carriers. This will be added as your Brand Name before the message content. Prefer verifying maximum length of 160 characters including this prefix in message content to avoid multiple sending of same sms.

string

Instructions to unsubscribe from future communications. Recommended by U.S. carriers. Must include STOP keyword. This will be added as instructions after the end of message content. Prefer verifying maximum length of 160 characters including this instructions in message content to avoid multiple sending of same sms.

Responses
204

SMS campaign updated

Language
Credentials
Click Try It! to start a request and see the response here! Or choose an example:
application/json