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 |
CreateModel createSmsCampaign(createSmsCampaign)
Creates an SMS campaign
// 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();
}
Name | Type | Description | Notes |
---|---|---|---|
createSmsCampaign | CreateSmsCampaign | Values to create an SMS Campaign |
- Content-Type: application/json
- Accept: application/json
deleteSmsCampaign(campaignId)
Delete an SMS campaign
// 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();
}
Name | Type | Description | Notes |
---|---|---|---|
campaignId | Long | id of the SMS campaign |
null (empty response body)
- Content-Type: application/json
- Accept: application/json
GetSmsCampaign getSmsCampaign(campaignId)
Get an SMS campaign
// 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();
}
Name | Type | Description | Notes |
---|---|---|---|
campaignId | Long | id of the SMS campaign |
- Content-Type: application/json
- Accept: application/json
GetSmsCampaigns getSmsCampaigns(status, startDate, endDate, limit, offset, sort)
Returns the information for all your created SMS campaigns
// 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();
}
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] |
- Content-Type: application/json
- Accept: application/json
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.
// 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();
}
Name | Type | Description | Notes |
---|---|---|---|
campaignId | Long | id of the campaign | |
recipientExport | RequestSmsRecipientExport | Values to send for a recipient export request | [optional] |
- Content-Type: application/json
- Accept: application/json
sendSmsCampaignNow(campaignId)
Send your SMS campaign immediately
// 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();
}
Name | Type | Description | Notes |
---|---|---|---|
campaignId | Long | id of the campaign |
null (empty response body)
- Content-Type: application/json
- Accept: application/json
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.
// 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();
}
Name | Type | Description | Notes |
---|---|---|---|
campaignId | Long | id of the campaign | |
sendReport | SendReport | Values for send a report |
null (empty response body)
- Content-Type: application/json
- Accept: application/json
sendTestSms(campaignId, phoneNumber)
Send a test SMS campaign
// 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();
}
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 |
null (empty response body)
- Content-Type: application/json
- Accept: application/json
updateSmsCampaign(campaignId, updateSmsCampaign)
Update an SMS campaign
// 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();
}
Name | Type | Description | Notes |
---|---|---|---|
campaignId | Long | id of the SMS campaign | |
updateSmsCampaign | UpdateSmsCampaign | Values to update an SMS Campaign |
null (empty response body)
- Content-Type: application/json
- Accept: application/json
updateSmsCampaignStatus(campaignId, status)
Update a campaign's status
// 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();
}
Name | Type | Description | Notes |
---|---|---|---|
campaignId | Long | id of the campaign | |
status | UpdateCampaignStatus | Status of the campaign. |
null (empty response body)
- Content-Type: application/json
- Accept: application/json