Skip to content

Latest commit

 

History

History
274 lines (210 loc) · 11.3 KB

TransactionalSmsApi.md

File metadata and controls

274 lines (210 loc) · 11.3 KB

TransactionalSmsApi

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

Method HTTP request Description
getSmsEvents GET /transactionalSMS/statistics/events Get all your SMS activity (unaggregated events)
getTransacAggregatedSmsReport GET /transactionalSMS/statistics/aggregatedReport Get your SMS activity aggregated over a period of time
getTransacSmsReport GET /transactionalSMS/statistics/reports Get your SMS activity aggregated per day
sendTransacSms POST /transactionalSMS/sms Send SMS message to a mobile number

getSmsEvents

GetSmsEventReport getSmsEvents(limit, startDate, endDate, offset, days, phoneNumber, event, tags)

Get all your SMS activity (unaggregated events)

Example

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

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: partnerKey
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");

TransactionalSmsApi apiInstance = new TransactionalSmsApi();
Long limit = 50L; // Long | Number of documents per page
String startDate = "startDate_example"; // String | Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the report
String endDate = "endDate_example"; // String | Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the report
Long offset = 0L; // Long | Index of the first document of the page
Integer days = 56; // Integer | Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate'
String phoneNumber = "phoneNumber_example"; // String | Filter the report for a specific phone number
String event = "event_example"; // String | Filter the report for specific events
String tags = "tags_example"; // String | Filter the report for specific tags passed as a serialized urlencoded array
try {
    GetSmsEventReport result = apiInstance.getSmsEvents(limit, startDate, endDate, offset, days, phoneNumber, event, tags);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling TransactionalSmsApi#getSmsEvents");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
limit Long Number of documents per page [optional] [default to 50]
startDate String Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the report [optional]
endDate String Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the report [optional]
offset Long Index of the first document of the page [optional] [default to 0]
days Integer Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' [optional]
phoneNumber String Filter the report for a specific phone number [optional]
event String Filter the report for specific events [optional] [enum: bounces, hardBounces, softBounces, delivered, sent, accepted, unsubscription, replies, blocked]
tags String Filter the report for specific tags passed as a serialized urlencoded array [optional]

Return type

GetSmsEventReport

Authorization

api-key, partner-key

HTTP request headers

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

getTransacAggregatedSmsReport

GetTransacAggregatedSmsReport getTransacAggregatedSmsReport(startDate, endDate, days, tag)

Get your SMS activity aggregated over a period of time

Example

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

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: partnerKey
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");

TransactionalSmsApi apiInstance = new TransactionalSmsApi();
String startDate = "startDate_example"; // String | Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the report
String endDate = "endDate_example"; // String | Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the report
Integer days = 56; // Integer | Number of days in the past including today (positive integer). Not compatible with startDate and endDate
String tag = "tag_example"; // String | Filter on a tag
try {
    GetTransacAggregatedSmsReport result = apiInstance.getTransacAggregatedSmsReport(startDate, endDate, days, tag);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling TransactionalSmsApi#getTransacAggregatedSmsReport");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
startDate String Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the report [optional]
endDate String Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the report [optional]
days Integer Number of days in the past including today (positive integer). Not compatible with startDate and endDate [optional]
tag String Filter on a tag [optional]

Return type

GetTransacAggregatedSmsReport

Authorization

api-key, partner-key

HTTP request headers

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

getTransacSmsReport

GetTransacSmsReport getTransacSmsReport(startDate, endDate, days, tag)

Get your SMS activity aggregated per day

Example

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

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: partnerKey
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");

TransactionalSmsApi apiInstance = new TransactionalSmsApi();
String startDate = "startDate_example"; // String | Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the report
String endDate = "endDate_example"; // String | Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the report
Integer days = 56; // Integer | Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate'
String tag = "tag_example"; // String | Filter on a tag
try {
    GetTransacSmsReport result = apiInstance.getTransacSmsReport(startDate, endDate, days, tag);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling TransactionalSmsApi#getTransacSmsReport");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
startDate String Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the report [optional]
endDate String Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the report [optional]
days Integer Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' [optional]
tag String Filter on a tag [optional]

Return type

GetTransacSmsReport

Authorization

api-key, partner-key

HTTP request headers

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

sendTransacSms

SendSms sendTransacSms(sendTransacSms)

Send SMS message to a mobile number

Example

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

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: partnerKey
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");

TransactionalSmsApi apiInstance = new TransactionalSmsApi();
SendTransacSms sendTransacSms = new SendTransacSms(); // SendTransacSms | Values to send a transactional SMS
try {
    SendSms result = apiInstance.sendTransacSms(sendTransacSms);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling TransactionalSmsApi#sendTransacSms");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
sendTransacSms SendTransacSms Values to send a transactional SMS

Return type

SendSms

Authorization

api-key, partner-key

HTTP request headers

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