Skip to content

Latest commit

 

History

History
626 lines (470 loc) · 22.2 KB

SmsCampaignsApi.md

File metadata and controls

626 lines (470 loc) · 22.2 KB

SmsCampaignsApi

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

Method HTTP request Description
createSmsCampaign POST /smsCampaigns Creates an SMS campaign
deleteSmsCampaign DELETE /smsCampaigns/{campaignId} Delete an SMS campaign
getSmsCampaign GET /smsCampaigns/{campaignId} Get an SMS campaign
getSmsCampaigns GET /smsCampaigns Returns the information for all your created SMS campaigns
requestSmsRecipientExport POST /smsCampaigns/{campaignId}/exportRecipients Export an SMS campaign's recipients
sendSmsCampaignNow POST /smsCampaigns/{campaignId}/sendNow Send your SMS campaign immediately
sendSmsReport POST /smsCampaigns/{campaignId}/sendReport Send an SMS campaign's report
sendTestSms POST /smsCampaigns/{campaignId}/sendTest Send a test SMS campaign
updateSmsCampaign PUT /smsCampaigns/{campaignId} Update an SMS campaign
updateSmsCampaignStatus PUT /smsCampaigns/{campaignId}/status Update a campaign's status

createSmsCampaign

CreateModel createSmsCampaign(createSmsCampaign)

Creates an SMS campaign

Example

// Import classes:
//import sendinblue.ApiClient;
//import sendinblue.ApiException;
//import sendinblue.Configuration;
//import sendinblue.auth.*;
//import sibApi.SmsCampaignsApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();

// Configure API key authorization: api-key
ApiKeyAuth apiKey = (ApiKeyAuth) defaultClient.getAuthentication("api-key");
apiKey.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apiKey.setApiKeyPrefix("Token");

// Configure API key authorization: partner-key
ApiKeyAuth partnerKey = (ApiKeyAuth) defaultClient.getAuthentication("partner-key");
partnerKey.setApiKey("YOUR PARTNER KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//partnerKey.setApiKeyPrefix("Token");

SmsCampaignsApi apiInstance = new SmsCampaignsApi();
CreateSmsCampaign createSmsCampaign = new CreateSmsCampaign(); // CreateSmsCampaign | Values to create an SMS Campaign
try {
    CreateModel result = apiInstance.createSmsCampaign(createSmsCampaign);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling SmsCampaignsApi#createSmsCampaign");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
createSmsCampaign CreateSmsCampaign Values to create an SMS Campaign

Return type

CreateModel

Authorization

api-key, partner-key

HTTP request headers

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

deleteSmsCampaign

deleteSmsCampaign(campaignId)

Delete an SMS campaign

Example

// Import classes:
//import sendinblue.ApiClient;
//import sendinblue.ApiException;
//import sendinblue.Configuration;
//import sendinblue.auth.*;
//import sibApi.SmsCampaignsApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();

// Configure API key authorization: api-key
ApiKeyAuth apiKey = (ApiKeyAuth) defaultClient.getAuthentication("api-key");
apiKey.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apiKey.setApiKeyPrefix("Token");

// Configure API key authorization: partner-key
ApiKeyAuth partnerKey = (ApiKeyAuth) defaultClient.getAuthentication("partner-key");
partnerKey.setApiKey("YOUR PARTNER KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//partnerKey.setApiKeyPrefix("Token");

SmsCampaignsApi apiInstance = new SmsCampaignsApi();
Long campaignId = 789L; // Long | id of the SMS campaign
try {
    apiInstance.deleteSmsCampaign(campaignId);
} catch (ApiException e) {
    System.err.println("Exception when calling SmsCampaignsApi#deleteSmsCampaign");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
campaignId Long id of the SMS campaign

Return type

null (empty response body)

Authorization

api-key, partner-key

HTTP request headers

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

getSmsCampaign

GetSmsCampaign getSmsCampaign(campaignId)

Get an SMS campaign

Example

// Import classes:
//import sendinblue.ApiClient;
//import sendinblue.ApiException;
//import sendinblue.Configuration;
//import sendinblue.auth.*;
//import sibApi.SmsCampaignsApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();

// Configure API key authorization: api-key
ApiKeyAuth apiKey = (ApiKeyAuth) defaultClient.getAuthentication("api-key");
apiKey.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apiKey.setApiKeyPrefix("Token");

// Configure API key authorization: partner-key
ApiKeyAuth partnerKey = (ApiKeyAuth) defaultClient.getAuthentication("partner-key");
partnerKey.setApiKey("YOUR PARTNER KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//partnerKey.setApiKeyPrefix("Token");

SmsCampaignsApi apiInstance = new SmsCampaignsApi();
Long campaignId = 789L; // Long | id of the SMS campaign
try {
    GetSmsCampaign result = apiInstance.getSmsCampaign(campaignId);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling SmsCampaignsApi#getSmsCampaign");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
campaignId Long id of the SMS campaign

Return type

GetSmsCampaign

Authorization

api-key, partner-key

HTTP request headers

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

getSmsCampaigns

GetSmsCampaigns getSmsCampaigns(status, startDate, endDate, limit, offset, sort)

Returns the information for all your created SMS campaigns

Example

// Import classes:
//import sendinblue.ApiClient;
//import sendinblue.ApiException;
//import sendinblue.Configuration;
//import sendinblue.auth.*;
//import sibApi.SmsCampaignsApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();

// Configure API key authorization: api-key
ApiKeyAuth apiKey = (ApiKeyAuth) defaultClient.getAuthentication("api-key");
apiKey.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apiKey.setApiKeyPrefix("Token");

// Configure API key authorization: partner-key
ApiKeyAuth partnerKey = (ApiKeyAuth) defaultClient.getAuthentication("partner-key");
partnerKey.setApiKey("YOUR PARTNER KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//partnerKey.setApiKeyPrefix("Token");

SmsCampaignsApi apiInstance = new SmsCampaignsApi();
String status = "status_example"; // String | Status of campaign.
String startDate = "startDate_example"; // String | Mandatory if endDate is used. Starting (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent sms campaigns. Prefer to pass your timezone in date-time format for accurate result ( only available if either 'status' not passed and if passed is set to 'sent' )
String endDate = "endDate_example"; // String | Mandatory if startDate is used. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent sms campaigns. Prefer to pass your timezone in date-time format for accurate result ( only available if either 'status' not passed and if passed is set to 'sent' )
Long limit = 500L; // Long | Number limitation for the result returned
Long offset = 0L; // Long | Beginning point in the list to retrieve from.
String sort = "desc"; // String | Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed
try {
    GetSmsCampaigns result = apiInstance.getSmsCampaigns(status, startDate, endDate, limit, offset, sort);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling SmsCampaignsApi#getSmsCampaigns");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
status String Status of campaign. [optional] [enum: suspended, archive, sent, queued, draft, inProcess]
startDate String Mandatory if endDate is used. Starting (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent sms campaigns. Prefer to pass your timezone in date-time format for accurate result ( only available if either 'status' not passed and if passed is set to 'sent' ) [optional]
endDate String Mandatory if startDate is used. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent sms campaigns. Prefer to pass your timezone in date-time format for accurate result ( only available if either 'status' not passed and if passed is set to 'sent' ) [optional]
limit Long Number limitation for the result returned [optional] [default to 500]
offset Long Beginning point in the list to retrieve from. [optional] [default to 0]
sort String Sort the results in the ascending/descending order of record creation. Default order is descending if `sort` is not passed [optional] [default to desc] [enum: asc, desc]

Return type

GetSmsCampaigns

Authorization

api-key, partner-key

HTTP request headers

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

requestSmsRecipientExport

CreatedProcessId requestSmsRecipientExport(campaignId, recipientExport)

Export an SMS campaign's recipients

It returns the background process ID which on completion calls the notify URL that you have set in the input.

Example

// Import classes:
//import sendinblue.ApiClient;
//import sendinblue.ApiException;
//import sendinblue.Configuration;
//import sendinblue.auth.*;
//import sibApi.SmsCampaignsApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();

// Configure API key authorization: api-key
ApiKeyAuth apiKey = (ApiKeyAuth) defaultClient.getAuthentication("api-key");
apiKey.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apiKey.setApiKeyPrefix("Token");

// Configure API key authorization: partner-key
ApiKeyAuth partnerKey = (ApiKeyAuth) defaultClient.getAuthentication("partner-key");
partnerKey.setApiKey("YOUR PARTNER KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//partnerKey.setApiKeyPrefix("Token");

SmsCampaignsApi apiInstance = new SmsCampaignsApi();
Long campaignId = 789L; // Long | id of the campaign
RequestSmsRecipientExport recipientExport = new RequestSmsRecipientExport(); // RequestSmsRecipientExport | Values to send for a recipient export request
try {
    CreatedProcessId result = apiInstance.requestSmsRecipientExport(campaignId, recipientExport);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling SmsCampaignsApi#requestSmsRecipientExport");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
campaignId Long id of the campaign
recipientExport RequestSmsRecipientExport Values to send for a recipient export request [optional]

Return type

CreatedProcessId

Authorization

api-key, partner-key

HTTP request headers

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

sendSmsCampaignNow

sendSmsCampaignNow(campaignId)

Send your SMS campaign immediately

Example

// Import classes:
//import sendinblue.ApiClient;
//import sendinblue.ApiException;
//import sendinblue.Configuration;
//import sendinblue.auth.*;
//import sibApi.SmsCampaignsApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();

// Configure API key authorization: api-key
ApiKeyAuth apiKey = (ApiKeyAuth) defaultClient.getAuthentication("api-key");
apiKey.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apiKey.setApiKeyPrefix("Token");

// Configure API key authorization: partner-key
ApiKeyAuth partnerKey = (ApiKeyAuth) defaultClient.getAuthentication("partner-key");
partnerKey.setApiKey("YOUR PARTNER KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//partnerKey.setApiKeyPrefix("Token");

SmsCampaignsApi apiInstance = new SmsCampaignsApi();
Long campaignId = 789L; // Long | id of the campaign
try {
    apiInstance.sendSmsCampaignNow(campaignId);
} catch (ApiException e) {
    System.err.println("Exception when calling SmsCampaignsApi#sendSmsCampaignNow");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
campaignId Long id of the campaign

Return type

null (empty response body)

Authorization

api-key, partner-key

HTTP request headers

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

sendSmsReport

sendSmsReport(campaignId, sendReport)

Send an SMS campaign's report

Send report of Sent and Archived campaign, to the specified email addresses, with respective data and a pdf attachment in detail.

Example

// Import classes:
//import sendinblue.ApiClient;
//import sendinblue.ApiException;
//import sendinblue.Configuration;
//import sendinblue.auth.*;
//import sibApi.SmsCampaignsApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();

// Configure API key authorization: api-key
ApiKeyAuth apiKey = (ApiKeyAuth) defaultClient.getAuthentication("api-key");
apiKey.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apiKey.setApiKeyPrefix("Token");

// Configure API key authorization: partner-key
ApiKeyAuth partnerKey = (ApiKeyAuth) defaultClient.getAuthentication("partner-key");
partnerKey.setApiKey("YOUR PARTNER KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//partnerKey.setApiKeyPrefix("Token");

SmsCampaignsApi apiInstance = new SmsCampaignsApi();
Long campaignId = 789L; // Long | id of the campaign
SendReport sendReport = new SendReport(); // SendReport | Values for send a report
try {
    apiInstance.sendSmsReport(campaignId, sendReport);
} catch (ApiException e) {
    System.err.println("Exception when calling SmsCampaignsApi#sendSmsReport");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
campaignId Long id of the campaign
sendReport SendReport Values for send a report

Return type

null (empty response body)

Authorization

api-key, partner-key

HTTP request headers

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

sendTestSms

sendTestSms(campaignId, phoneNumber)

Send a test SMS campaign

Example

// Import classes:
//import sendinblue.ApiClient;
//import sendinblue.ApiException;
//import sendinblue.Configuration;
//import sendinblue.auth.*;
//import sibApi.SmsCampaignsApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();

// Configure API key authorization: api-key
ApiKeyAuth apiKey = (ApiKeyAuth) defaultClient.getAuthentication("api-key");
apiKey.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apiKey.setApiKeyPrefix("Token");

// Configure API key authorization: partner-key
ApiKeyAuth partnerKey = (ApiKeyAuth) defaultClient.getAuthentication("partner-key");
partnerKey.setApiKey("YOUR PARTNER KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//partnerKey.setApiKeyPrefix("Token");

SmsCampaignsApi apiInstance = new SmsCampaignsApi();
Long campaignId = 789L; // Long | Id of the SMS campaign
SendTestSms phoneNumber = new SendTestSms(); // SendTestSms | Mobile number of the recipient with the country code. This number must belong to one of your contacts in SendinBlue account and must not be blacklisted
try {
    apiInstance.sendTestSms(campaignId, phoneNumber);
} catch (ApiException e) {
    System.err.println("Exception when calling SmsCampaignsApi#sendTestSms");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
campaignId Long Id of the SMS campaign
phoneNumber SendTestSms Mobile number of the recipient with the country code. This number must belong to one of your contacts in SendinBlue account and must not be blacklisted

Return type

null (empty response body)

Authorization

api-key, partner-key

HTTP request headers

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

updateSmsCampaign

updateSmsCampaign(campaignId, updateSmsCampaign)

Update an SMS campaign

Example

// Import classes:
//import sendinblue.ApiClient;
//import sendinblue.ApiException;
//import sendinblue.Configuration;
//import sendinblue.auth.*;
//import sibApi.SmsCampaignsApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();

// Configure API key authorization: api-key
ApiKeyAuth apiKey = (ApiKeyAuth) defaultClient.getAuthentication("api-key");
apiKey.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apiKey.setApiKeyPrefix("Token");

// Configure API key authorization: partner-key
ApiKeyAuth partnerKey = (ApiKeyAuth) defaultClient.getAuthentication("partner-key");
partnerKey.setApiKey("YOUR PARTNER KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//partnerKey.setApiKeyPrefix("Token");

SmsCampaignsApi apiInstance = new SmsCampaignsApi();
Long campaignId = 789L; // Long | id of the SMS campaign
UpdateSmsCampaign updateSmsCampaign = new UpdateSmsCampaign(); // UpdateSmsCampaign | Values to update an SMS Campaign
try {
    apiInstance.updateSmsCampaign(campaignId, updateSmsCampaign);
} catch (ApiException e) {
    System.err.println("Exception when calling SmsCampaignsApi#updateSmsCampaign");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
campaignId Long id of the SMS campaign
updateSmsCampaign UpdateSmsCampaign Values to update an SMS Campaign

Return type

null (empty response body)

Authorization

api-key, partner-key

HTTP request headers

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

updateSmsCampaignStatus

updateSmsCampaignStatus(campaignId, status)

Update a campaign's status

Example

// Import classes:
//import sendinblue.ApiClient;
//import sendinblue.ApiException;
//import sendinblue.Configuration;
//import sendinblue.auth.*;
//import sibApi.SmsCampaignsApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();

// Configure API key authorization: api-key
ApiKeyAuth apiKey = (ApiKeyAuth) defaultClient.getAuthentication("api-key");
apiKey.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apiKey.setApiKeyPrefix("Token");

// Configure API key authorization: partner-key
ApiKeyAuth partnerKey = (ApiKeyAuth) defaultClient.getAuthentication("partner-key");
partnerKey.setApiKey("YOUR PARTNER KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//partnerKey.setApiKeyPrefix("Token");

SmsCampaignsApi apiInstance = new SmsCampaignsApi();
Long campaignId = 789L; // Long | id of the campaign
UpdateCampaignStatus status = new UpdateCampaignStatus(); // UpdateCampaignStatus | Status of the campaign.
try {
    apiInstance.updateSmsCampaignStatus(campaignId, status);
} catch (ApiException e) {
    System.err.println("Exception when calling SmsCampaignsApi#updateSmsCampaignStatus");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
campaignId Long id of the campaign
status UpdateCampaignStatus Status of the campaign.

Return type

null (empty response body)

Authorization

api-key, partner-key

HTTP request headers

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