Skip to content

Latest commit

 

History

History
814 lines (612 loc) · 29.1 KB

EmailCampaignsApi.md

File metadata and controls

814 lines (612 loc) · 29.1 KB

EmailCampaignsApi

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

Method HTTP request Description
createEmailCampaign POST /emailCampaigns Create an email campaign
deleteEmailCampaign DELETE /emailCampaigns/{campaignId} Delete an email campaign
emailExportRecipients POST /emailCampaigns/{campaignId}/exportRecipients Export the recipients of an email campaign
getAbTestCampaignResult GET /emailCampaigns/{campaignId}/abTestCampaignResult Get an A/B test email campaign results
getEmailCampaign GET /emailCampaigns/{campaignId} Get an email campaign report
getEmailCampaigns GET /emailCampaigns Return all your created email campaigns
getSharedTemplateUrl GET /emailCampaigns/{campaignId}/sharedUrl Get a shared template url
sendEmailCampaignNow POST /emailCampaigns/{campaignId}/sendNow Send an email campaign immediately, based on campaignId
sendReport POST /emailCampaigns/{campaignId}/sendReport Send the report of a campaign
sendTestEmail POST /emailCampaigns/{campaignId}/sendTest Send an email campaign to your test list
updateCampaignStatus PUT /emailCampaigns/{campaignId}/status Update an email campaign status
updateEmailCampaign PUT /emailCampaigns/{campaignId} Update an email campaign
uploadImageToGallery POST /emailCampaigns/images Upload an image to your account's image gallery

createEmailCampaign

CreateModel createEmailCampaign(emailCampaigns)

Create an email campaign

Example

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

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

EmailCampaignsApi apiInstance = new EmailCampaignsApi();
CreateEmailCampaign emailCampaigns = new CreateEmailCampaign(); // CreateEmailCampaign | Values to create a campaign
try {
    CreateModel result = apiInstance.createEmailCampaign(emailCampaigns);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling EmailCampaignsApi#createEmailCampaign");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
emailCampaigns CreateEmailCampaign Values to create a campaign

Return type

CreateModel

Authorization

api-key, partner-key

HTTP request headers

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

deleteEmailCampaign

deleteEmailCampaign(campaignId)

Delete an email campaign

Example

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

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

EmailCampaignsApi apiInstance = new EmailCampaignsApi();
Long campaignId = 789L; // Long | id of the campaign
try {
    apiInstance.deleteEmailCampaign(campaignId);
} catch (ApiException e) {
    System.err.println("Exception when calling EmailCampaignsApi#deleteEmailCampaign");
    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

emailExportRecipients

CreatedProcessId emailExportRecipients(campaignId, recipientExport)

Export the recipients of an email campaign

Example

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

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

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

Parameters

Name Type Description Notes
campaignId Long Id of the campaign
recipientExport EmailExportRecipients 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

getAbTestCampaignResult

AbTestCampaignResult getAbTestCampaignResult(campaignId)

Get an A/B test email campaign results

Obtain winning version of an A/B test email campaign

Example

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

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

EmailCampaignsApi apiInstance = new EmailCampaignsApi();
Long campaignId = 789L; // Long | Id of the A/B test campaign
try {
    AbTestCampaignResult result = apiInstance.getAbTestCampaignResult(campaignId);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling EmailCampaignsApi#getAbTestCampaignResult");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
campaignId Long Id of the A/B test campaign

Return type

AbTestCampaignResult

Authorization

api-key, partner-key

HTTP request headers

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

getEmailCampaign

GetEmailCampaign getEmailCampaign(campaignId, statistics)

Get an email campaign report

Example

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

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

EmailCampaignsApi apiInstance = new EmailCampaignsApi();
Long campaignId = 789L; // Long | Id of the campaign
String statistics = "statistics_example"; // String | Filter on the type of statistics required. Example **globalStats** value will only fetch globalStats info of the campaign in returned response.
try {
    GetEmailCampaign result = apiInstance.getEmailCampaign(campaignId, statistics);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling EmailCampaignsApi#getEmailCampaign");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
campaignId Long Id of the campaign
statistics String Filter on the type of statistics required. Example globalStats value will only fetch globalStats info of the campaign in returned response. [optional] [enum: globalStats, linksStats, statsByDomain, statsByDevice, statsByBrowser]

Return type

GetEmailCampaign

Authorization

api-key, partner-key

HTTP request headers

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

getEmailCampaigns

GetEmailCampaigns getEmailCampaigns(type, status, statistics, startDate, endDate, limit, offset, sort)

Return all your created email campaigns

Example

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

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

EmailCampaignsApi apiInstance = new EmailCampaignsApi();
String type = "type_example"; // String | Filter on the type of the campaigns
String status = "status_example"; // String | Filter on the status of the campaign
String statistics = "statistics_example"; // String | Filter on the type of statistics required. Example **globalStats** value will only fetch globalStats info of the campaign in returned response.
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 email 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 email 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 = 50L; // Long | Number of documents per page
Long offset = 0L; // Long | Index of the first document in the page
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 {
    GetEmailCampaigns result = apiInstance.getEmailCampaigns(type, status, statistics, startDate, endDate, limit, offset, sort);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling EmailCampaignsApi#getEmailCampaigns");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
type String Filter on the type of the campaigns [optional] [enum: classic, trigger]
status String Filter on the status of the campaign [optional] [enum: suspended, archive, sent, queued, draft, inProcess]
statistics String Filter on the type of statistics required. Example globalStats value will only fetch globalStats info of the campaign in returned response. [optional] [enum: globalStats, linksStats, statsByDomain]
startDate String Mandatory if endDate is used. Starting (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent email 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 email 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 of documents per page [optional] [default to 50]
offset Long Index of the first document in the page [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

GetEmailCampaigns

Authorization

api-key, partner-key

HTTP request headers

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

getSharedTemplateUrl

GetSharedTemplateUrl getSharedTemplateUrl(campaignId)

Get a shared template url

Get a unique URL to share & import an email template from one Sendinblue account to another.

Example

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

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

EmailCampaignsApi apiInstance = new EmailCampaignsApi();
Long campaignId = 789L; // Long | Id of the campaign or template
try {
    GetSharedTemplateUrl result = apiInstance.getSharedTemplateUrl(campaignId);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling EmailCampaignsApi#getSharedTemplateUrl");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
campaignId Long Id of the campaign or template

Return type

GetSharedTemplateUrl

Authorization

api-key, partner-key

HTTP request headers

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

sendEmailCampaignNow

sendEmailCampaignNow(campaignId)

Send an email campaign immediately, based on campaignId

Example

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

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

EmailCampaignsApi apiInstance = new EmailCampaignsApi();
Long campaignId = 789L; // Long | Id of the campaign
try {
    apiInstance.sendEmailCampaignNow(campaignId);
} catch (ApiException e) {
    System.err.println("Exception when calling EmailCampaignsApi#sendEmailCampaignNow");
    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

sendReport

sendReport(campaignId, sendReport)

Send the report of a campaign

A PDF will be sent to the specified email addresses

Example

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

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

EmailCampaignsApi apiInstance = new EmailCampaignsApi();
Long campaignId = 789L; // Long | Id of the campaign
SendReport sendReport = new SendReport(); // SendReport | Values for send a report
try {
    apiInstance.sendReport(campaignId, sendReport);
} catch (ApiException e) {
    System.err.println("Exception when calling EmailCampaignsApi#sendReport");
    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

sendTestEmail

sendTestEmail(campaignId, emailTo)

Send an email campaign to your test list

Example

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

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

EmailCampaignsApi apiInstance = new EmailCampaignsApi();
Long campaignId = 789L; // Long | Id of the campaign
SendTestEmail emailTo = new SendTestEmail(); // SendTestEmail | 
try {
    apiInstance.sendTestEmail(campaignId, emailTo);
} catch (ApiException e) {
    System.err.println("Exception when calling EmailCampaignsApi#sendTestEmail");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
campaignId Long Id of the campaign
emailTo SendTestEmail

Return type

null (empty response body)

Authorization

api-key, partner-key

HTTP request headers

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

updateCampaignStatus

updateCampaignStatus(campaignId, status)

Update an email campaign status

Example

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

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

EmailCampaignsApi apiInstance = new EmailCampaignsApi();
Long campaignId = 789L; // Long | Id of the campaign
UpdateCampaignStatus status = new UpdateCampaignStatus(); // UpdateCampaignStatus | Status of the campaign
try {
    apiInstance.updateCampaignStatus(campaignId, status);
} catch (ApiException e) {
    System.err.println("Exception when calling EmailCampaignsApi#updateCampaignStatus");
    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

updateEmailCampaign

updateEmailCampaign(campaignId, emailCampaign)

Update an email campaign

Example

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

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

EmailCampaignsApi apiInstance = new EmailCampaignsApi();
Long campaignId = 789L; // Long | Id of the campaign
UpdateEmailCampaign emailCampaign = new UpdateEmailCampaign(); // UpdateEmailCampaign | Values to update a campaign
try {
    apiInstance.updateEmailCampaign(campaignId, emailCampaign);
} catch (ApiException e) {
    System.err.println("Exception when calling EmailCampaignsApi#updateEmailCampaign");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
campaignId Long Id of the campaign
emailCampaign UpdateEmailCampaign Values to update a campaign

Return type

null (empty response body)

Authorization

api-key, partner-key

HTTP request headers

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

uploadImageToGallery

UploadImageModel uploadImageToGallery(uploadImage)

Upload an image to your account's image gallery

Example

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

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

EmailCampaignsApi apiInstance = new EmailCampaignsApi();
UploadImageToGallery uploadImage = new UploadImageToGallery(); // UploadImageToGallery | Parameters to upload an image
try {
    UploadImageModel result = apiInstance.uploadImageToGallery(uploadImage);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling EmailCampaignsApi#uploadImageToGallery");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
uploadImage UploadImageToGallery Parameters to upload an image

Return type

UploadImageModel

Authorization

api-key, partner-key

HTTP request headers

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