NAV
cURL PHP C# Java Node.JS Ruby Python Perl Go objc Swift

Introduction

Scroll down for code samples, example requests and responses. Select a language for code samples from the tabs above or the mobile navigation menu.

This is the official API documentation for ClickSend

Below you will find a current list of the available methods for ClickSend.

NOTE: You will need to create a free account to use the API. You can register here..

Base URLs:

Postman

If you would like to use Postman click this button to download our entire API collection for instant use.

Simply import our collection and create an environment with username and password variables to get started.

Authentication

Basic HTTP authentication should be used in the header.

username: Your API username

password: Your API key

You can get your API credentials by clicking 'API Credentials' on the top right of the dashboard.

Authorization Header

The Authorization header is constructed as follows:

  1. Username and password are combined into a string username:password
  2. The resulting string is then encoded using Base64 encoding
  3. The authorization method and a space i.e. "Basic " is then put before the encoded string.

PHP Authentication Header Example (using cURL)

curl_setopt($ch, CURLOPT_HTTPHEADER, ['Authorization: Basic ' . base64_encode("$username:$password")]);

Verbs

The API uses restful verbs.

Verb Description
GET Select one or more items. Success returns 200 status code.
POST Create a new item. Success returns 200 status code.
PUT Update an item. Success returns 200 status code.
DELETE Delete an item. Success returns 200 status code.

Status Codes

The API will respond with one of the following HTTP status codes.

Status Response Description
200 SUCCESS Request completed successfully.
201 CREATED Request has been fulfilled and has resulted in one or more new resources being created
204 NO_CONTENT the server has successfully fulfilled the request and that there is no additional content to send in the response payload body
400 BAD_REQUEST The request was invalid or cannot be otherwise served. An accompanying error message will explain further.
401 UNAUTHORIZED Authentication credentials were missing or incorrect.
403 FORBIDDEN The request is understood, but it has been refused or access is not allowed. An accompanying error message will explain why.
404 NOT_FOUND The URI requested is invalid or the resource requested does not exists.
405 METHOD_NOT_ALLOWED Method doesn't exist or is not allowed.
429 TOO_MANY_REQUESTS Rate Limit Exceeded. Returned when a request cannot be served due to the application’s rate limit having been exhausted for the resource. See Rate Limiting.
500 INTERNAL_SERVER_ERROR Something is broken

Application Status Codes

The following status codes can be returned in addition to the HTTP status code. For example, when using the Send SMS endpoint:

Response                                     Description
SUCCESS Message added to queue OK. Use delivery reports to get an update on the delivery status.
MISSING_CREDENTIALS Not enough information has been supplied for authentication. Please ensure that your Username and Unique Key are supplied in your request.
ACCOUNT_NOT_ACTIVATED Your account has not been activated.
INVALID_RECIPIENT The destination mobile number is invalid.
THROTTLED Identical message body recently sent to the same recipient. Please try again in a few seconds.
INVALID_SENDER_ID Invalid Sender ID. Please ensure Sender ID is no longer than 11 characters (if alphanumeric), and contains no spaces.
INSUFFICIENT_CREDIT You have reached the end of your message credits. You will need to purchase more message credits.
INVALID_CREDENTIALS Your Username or Unique Key is incorrect.
COUNTRY_NOT_ENABLED This country is not enabled on your account.
ALREADY_EXISTS The resource you're trying to add already exists.
EMPTY_MESSAGE Message is empty.
TOO_MANY_RECIPIENTS Too many recipients.
MISSING_REQUIRED_FIELDS Some required fields are missing.
INVALID_SCHEDULE The schedule specified is invalid. Use a unix timestamp e.g. 1429170372.
NOT_ENOUGH_PERMISSION_TO_LIST_ID Don't have enough privilege to access or send to a list_id.
INTERNAL_ERROR Internal error.
INVALID_LANG An invalid language option has been provided.
INVALID_VOICE An invalid voice (gender) option has been provided.
SUBJECT_REQUIRED Usually happens when MMS Subject is empty.
INVALID_MEDIA_FILE Usually MMS media file is invalid file.
SOMETHING_IS_WRONG Generic Error happened.
REGISTRATION_NEEDED You are sending to recipients from a country that requires a registered Sender ID. Please visit Global Sending and follow the registration steps. You may be able to send to your own number without registering a Sender ID by including it as the only recipient.

Required Headers

You'll need to send some headers when making API calls.

Header Value
Content-type application/json

Pagination

Some methods are paginated. By default, 1 page of 15 items will be returned. You can set the pagination parameters by adding ?page={page}&limit={limit} to the URL.

Request

Parameter Type Default Value
page integer 1 The page number to return in the response.
limit integer 15 The number of results per page. Min 15, Max 100.

Response

Attribute Type Value
total integer Total number of results available.
per_page integer Number of results returned per page.
current_page integer Current page number.
last_page integer Last page number.
next_page_url string A URL of the next page. null if not available.
prev_page_url string A URL of the previous page. null if not available.
from integer Number of the first result in current page.
to integer Number of the last result in current page.

Searching and Sorting

Most GET endpoints allow searching and sorting. Searches are not case-sensitive.

To perform a search, add q as a query parameter. For example:

/subaccounts?q=field:value,field2:value

Order

To perform a sort, add order_by as a query parameter. For example:

/subaccounts?order_by=field:desc/asc

AND / OR

By default, it will search using the AND operator. This can be set using operator as a query parameter. For example:

/subaccounts?q=field:value&operator=OR

Options:

Example

/subaccounts?q=first_name:john,last_name:smith&order_by=subaccount_id:asc&operator=AND

CORS

When creating your API app, specify the JavaScript (CORS) origins you'll be using. We use these origins to return the headers needed for CORS.

Date and Time

All date/timestamps will be returned in Unix time (also known as POSIX time or erroneously as Epoch time) with no leap seconds.

For example: 1435255816 (ISO 8601: 2015-06-25T18:10:16Z) More information: Wikipedia: Unix time.

There is ony one Unix time and it is created by using the UTC/GMT time zone. This means you might have convert time zones to calculate timestamps. Most programming language have libraries to help you converting time zones.

The current Unix time can be found here: Epoch Converter

Testing

Test Credentials

These API credentials can be used to test specific scenarios.

Note: you will need to create a free account to test other scenarios. Refer to introduction.

API Username API Key Description
nocredit D83DED51-9E35-4D42-9BB9-0E34B7CA85AE This account has no credit.
notactive D83DED51-9E35-4D42-9BB9-0E34B7CA85AE This account is not active.
banned D83DED51-9E35-4D42-9BB9-0E34B7CA85AE This account is banned.

Test SMS/MMS Numbers

The following numbers can be used when testing. No messages will be sent, and your account won't be charged. A success response will be returned.

Test Voice Numbers

The following numbers can be used when testing. No messages will be sent, and your account won't be charged. A success response will be returned.

Test Fax Numbers

The following numbers can be used when testing. No messages will be sent, and your account won't be charged. A success response will be returned.

Test Email Addresses

The following email addresses can be used when testing. No messages will be sent, and your account won't be charged. A success response will be returned.

Test Letter Addresses

The following Postal Codes (address_postal_code) can be used when testing. No messages will be sent when using these post codes, and your account won't be charged. A success response will be returned.

Account

Everything about Accounts

Create Account

Code samples

curl --include \
     --request POST \
     --header "Content-Type: application/json" \
     --data-binary "    {
        \"username\":\"johndoe1\",
        \"user_email\":\"johndoe1@awesome.com\",
        \"user_phone\":\"518-481-1001\",
        \"user_first_name\":\"John\",
        \"user_last_name\":\"Doe\",
        \"country\":\"US\",
        \"password\":\"pass\",
        \"account_name\":\"The Awesome Company\"
    }" \
'https://rest.clicksend.com/v3/account'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\AccountApi(new GuzzleHttp\Client(),$config);
$account = new \ClickSend\Model\Account(); // \ClickSend\Model\Account | Account model
$account->setUserName("johndoe");
$account->setPassword("pass");
$account->setUserPhone("533-481-1041");
$account->setUserEmail("johndoesdfds1@awesome.com");
$account->setUserFirstName("John");
$account->setUserLastName("Doe");
$account->setAccountName("The Awesome Company");
$account->setCountry("US");

try {
    $result = $apiInstance->accountPost($account);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AccountApi->accountPost: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var accountApi = new AccountApi(Configuration.Default);
var account = new Account(
    username: "username",
    password: "password",
    userPhone: "+1231231234",
    userEmail: "johndoe@company.com",
    userFirstName: "John",
    userLastName: "Doe",
    accountName: "Your_Account_Name",
    country: "CA"
);
var response = accountApi.AccountPost(account);
var api = require('./api.js');

var accountApi = new api.AccountApi("USERNAME", "API_KEY");

var account = new api.Account();

account.username = "username";
account.password = "pass";
account.userPhone = "xxx-xxx-xxxx";
account.userEmail = "xxx@gmail.com";
account.userFirstName = "test";
account.userLastName = "test";
account.accountName = "testing";
account.country = "country";

accountApi.accountPost(account).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::AccountApi.new

# Account | Account model
account = ClickSendClient::Account.new(
  "country": "country",
  "password": "password",
  "user_email": "user_email",
  "user_first_name": "user_first_name",
  "user_last_name": "user_last_name",
  "account_name": "account_name",
  "user_phone": "user_phone",
  "username": "username"
)

begin
  # Create a new account
  result = api_instance.account_post(account)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling AccountApi->account_post: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.AccountApi(clicksend_client.ApiClient(configuration))
account = clicksend_client.Account(
          username="username",
          user_email="xxx@gmail.com",
          user_phone="xxx-xxx-xxxx",
          user_first_name="John",
          user_last_name="Doe",
          country="US",
          password="pass",
          account_name="The Awesome Company") # Account | Account model

try:
    # Create a new account
    api_response = api_instance.account_post(account)
    print(api_response)
except ApiException as e:
    print("Exception when calling AccountApi->account_post: %s\n" % e)
use WWW::ClickSendClient::AccountApi;
use WWW::ClickSendClient::Object::Account;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::AccountApi->new(username => $username, password => $password);

my %params = (
    'username'        => 'test_username',
    'password'        => 'Test-password@123',
    'user_phone'      => '111-111-11111',
    'user_email'      => 'test1@test.com',
    'user_first_name' => 'user_first_name',
    'user_last_name'  => 'user_last_name',
    'account_name'    => 'account_name',
    'country'         => 'US'
);

my $acc_obj = WWW::ClickSendClient::Object::Account->new(%params);
my $json_output = $api->account_post('account' => $acc_obj);

print $json_output;
#import "CSDefaultConfiguration.h"
#import "CSAccountApi.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
// Configure HTTP basic authorization (authentication scheme: BasicAuth)
[apiConfig setUsername:@"USERNAME"];
[apiConfig setPassword:@"PASSWORD"];

CSAccountApi *accountAPI = [[CSAccountApi alloc] init];

CSAccount *account =  [[CSAccount alloc] init];
account.username = @"johndoe1";
account.password = @"password";
account.userPhone = @"518-481-1001";
account.userEmail = @"johndoe1@awesome.com";
account.userFirstName = @"John";
account.userLastName = @"Doe";
account.accountName = @"Awesome company name";
account.country = @"country";

[accountAPI accountPostWithAccount:account completionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"Output: %@", output);
    }
}];
import Alamofire

if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}

let account = Account(
    username: "johndoe1", 
    password: "password", 
    userPhone: "518-481-1001", 
    userEmail: "johndoe1@awesome.com", 
    userFirstName: "John", 
    userLastName: "Doe", 
    accountName: "The Awesome Company", 
    country: "userCountry"
)

AccountAPI.accountPost(account: account) { (dataString, error) in
    guard let dataString = dataString else {
        print(error!)
        return
    }

    if let data = dataString.data(using: String.Encoding.utf8) {
        do {
            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                print(dictonary)
            } else {
                print("Cannot convert the String value to JSON")
            }
        } catch let error as NSError {
            print(error)
        }
    }
}
    Coming Soon
package ClickSend;

import ClickSend.Api.AccountApi;
import ClickSend.Model.Account;

public class create_account {
  public static void main(String[] args) {
    ApiClient defaultClient = new ApiClient();
    defaultClient.setUsername("USERNAME");
    defaultClient.setPassword("API_KEY");
    AccountApi apiInstance = new AccountApi(defaultClient);
    Account account = new Account(); // Account | Account model
    account.accountName("account Name");
    account.username("username");
    account.password("pwd");
    account.country("country");
    account.userEmail("xxx@gmail.com");
    account.userPhone("000-000-0000");
    account.userFirstName("firstname");
    account.userLastName("lastname");
    try {
        String result = apiInstance.accountPost(account);
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling AccountApi#accountPost");
        e.printStackTrace();
    }
  }
}

Body parameter

{
  "country": "country",
  "password": "password",
  "user_email": "user_email",
  "user_first_name": "user_first_name",
  "user_last_name": "user_last_name",
  "account_name": "account_name",
  "user_phone": "user_phone",
  "username": "username"
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "Successfully created an account.",
  "data": {
    "user_id": 116,
    "username": "johndoe1",
    "user_email": "johndoe1@awesome.com",
    "active": 0,
    "banned": 0,
    "balance": "4.998000",
    "user_phone": "+15184811001",
    "reply_to": "originalemail",
    "delivery_to": null,
    "user_first_name": "John",
    "user_last_name": "Doe",
    "account": 0,
    "account_name": "The Awesome Company",
    "account_billing_email": "johndoe1@awesome.com",
    "account_billing_mobile": "+15184811001",
    "country": "US",
    "default_country_sms": "US",
    "auto_recharge": 0,
    "auto_recharge_amount": "20.00",
    "low_credit_amount": "0.00",
    "setting_unicode_sms": 0,
    "setting_email_sms_subject": 0,
    "setting_fix_sender_id": 0,
    "setting_sms_message_char_limit": 6,
    "old_dashboard": 0,
    "balance_commission": "0.299954",
    "timezone": "Australia/Melbourne",
    "_currency": {
      "currency_name_short": "USD",
      "currency_prefix_d": "$",
      "currency_prefix_c": "¢",
      "currency_name_long": "US Dollars"
    },
    "_subaccount": {
      "subaccount_id": 126,
      "api_username": "johndoe1",
      "email": "johndoe1@awesome.com",
      "phone_number": "+15184811001",
      "first_name": "John",
      "last_name": "Doe",
      "api_key": "F3702045-EB2C-0091-C211-7728048DCAE2",
      "access_users": 1,
      "access_billing": 1,
      "access_reporting": 1,
      "access_contacts": 1,
      "access_settings": 1,
      "access_sms": 1,
      "access_email": 1,
      "access_voice": 1,
      "access_fax": 1,
      "access_post": 1,
      "access_reseller": 1,
      "access_mms": 1,
      "share_campaigns": 0,
      "notes": null
    }
  }
}

https://rest.clicksend.com/v3/account

Create a new account

In order to create an account you will need to sign up with use the following endpoint to make an account or by using the dashboard.

After your account has been registered you will need to call the account-verify/send endpoint to send a code to the phone you registered your account with.

Finally, you will need to input that code by using the account-verify/verify endpoint.

Properties

Name Type Required Restrictions Description
username string true none Your username
password string true none Your password
user_phone string true none Your phone number in E.164 format.
user_email string true none Your email
user_first_name string true none Your first name
user_last_name string true none Your last name
account_name string true none Your delivery to value.
country string true none Your country

Refer to Status Codes for definitions of HTTP status code responses.

View Account Details

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \

'https://rest.clicksend.com/v3/account'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\AccountApi(new GuzzleHttp\Client(),$config);

try {
    $result = $apiInstance->accountGet();
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AccountApi->accountGet: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;

var configuration = new Configuration()
{
    Username = USERNAME, 
    Password = API_KEY  
};
var accountApi = new AccountApi(configuration);
var response = accountApi.AccountGet();
var api = require('./api.js');

var accountApi = new api.AccountApi("USERNAME", "API_KEY");

accountApi.accountGet().then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::AccountApi.new

begin
  # Get account information
  result = api_instance.account_get
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling AccountApi->account_get: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.AccountApi(clicksend_client.ApiClient(configuration))

try:
    # Get account information
    api_response = api_instance.account_get()
    print(api_response)
except ApiException as e:
    print("Exception when calling AccountApi->account_get: %s\n" % e)
use WWW::ClickSendClient::AccountApi;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::AccountApi->new(username => $username, password => $password);

my $json_output = $api->account_get();

print $json_output;
#import "CSDefaultConfiguration.h"
#import "CSAccountApi.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
// Configure HTTP basic authorization (authentication scheme: BasicAuth)
[apiConfig setUsername:@"USERNAME"];
[apiConfig setPassword:@"PASSWORD"];

CSAccountApi *accountAPI = [[CSAccountApi alloc] init];
[accountAPI accountGetWithCompletionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"Output: %@", output);
    }
}];
import Alamofire

if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}

AccountAPI.accountGet { (dataString, error) in
    guard let dataString = dataString else {
        print(error!)
        return
    }

    if let data = dataString.data(using: String.Encoding.utf8) {
        do {
            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                print(dictonary)
            } else {
                print("Cannot convert the String value to JSON")
            }
        } catch let error as NSError {
            print(error)
        }
    }
}
    Coming Soon
package ClickSend;

import ClickSend.Api.AccountApi;

public class view_account_detail {
  public static void main(String[] args) {
    ApiClient defaultClient = new ApiClient();
    defaultClient.setUsername("USERNAME");
    defaultClient.setPassword("API_KEY");
    AccountApi apiInstance = new AccountApi(defaultClient);
    try {
        String result = apiInstance.accountGet();
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling AccountApi#accountGet");
        e.printStackTrace();
    }
  }
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "Here's your account",
  "data": {
    "user_id": 3819,
    "username": "ULXHP",
    "user_email": "PNUMB@VAPXX.com",
    "active": 1,
    "banned": 0,
    "balance": "1117.461060",
    "user_phone": "+61433333888",
    "user_first_name": "fffff",
    "user_last_name": "llll",
    "account": 0,
    "account_name": "FTHCQ~!@#$ %^&*()XQMPO",
    "account_billing_email": "XDVXC@SJRJU.com",
    "account_billing_mobile": "+61433333888",
    "country": "AU",
    "default_country_sms": "AU",
    "auto_recharge": 0,
    "auto_recharge_amount": "20.00",
    "low_credit_amount": "0.00",
    "setting_unicode_sms": 0,
    "setting_email_sms_subject": 0,
    "setting_fix_sender_id": 0,
    "setting_sms_message_char_limit": 8,
    "old_dashboard": 0,
    "balance_commission": "2.330130",
    "timezone": "Australia/Melbourne",
    "private_uploads": 0,
    "fax_quality": 0,
    "setting_sms_hide_your_number": 0,
    "setting_sms_hide_business_name": 1,
    "_currency": {
      "currency_name_short": "AUD",
      "currency_prefix_d": "$",
      "currency_prefix_c": "c",
      "currency_name_long": "Australian Dollars"
    },
    "_subaccount": {
      "subaccount_id": 1716,
      "api_username": "KCIHOYEYGM",
      "email": "ICMGR@VBSPT.com",
      "phone_number": "+61433333333",
      "first_name": "Firstname40710",
      "last_name": "Lastname3672",
      "api_key": "IJVEGTCF-VOHU-GSVF-KNKK-XHTARJXMQTXK",
      "access_users": 1,
      "access_billing": 1,
      "access_reporting": 1,
      "access_contacts": 0,
      "access_settings": 1,
      "access_sms": 0,
      "access_email": 0,
      "access_voice": 0,
      "access_fax": 0,
      "access_post": 0,
      "access_reseller": 0,
      "access_mms": 1,
      "share_campaigns": 1,
      "notes": null
    }
  }
}

https://rest.clicksend.com/v3/account

Get account information

Get account details

Refer to Status Codes for definitions of HTTP status code responses.

View Account Usage

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \

'https://rest.clicksend.com/v3/account/usage/{year}/{month}/subaccount'
    Coming Soon
    Coming Soon
    Coming Soon
    Coming Soon
    Coming Soon
    Coming Soon
    Coming Soon
    Coming Soon
    Coming Soon
    Coming Soon

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "Here is your usage for this month.",
  "data": {
    "sms": [
      {
        "subaccount_id": 1039,
        "username": "gerald",
        "total_count": "29.00",
        "total_price": "2.1337"
      },
      {
        "subaccount_id": 1047,
        "username": "user5",
        "total_count": "4.00",
        "total_price": "0.3080"
      }
    ],
    "voice": [
      {
        "subaccount_id": 1039,
        "username": "user1",
        "total_count": "6.00",
        "total_price": "0.1980"
      },
      {
        "subaccount_id": 1047,
        "username": "user5",
        "total_count": "1.00",
        "total_price": "0.0330"
      }
    ],
    "fax": [
      {
        "subaccount_id": 1039,
        "username": "user1",
        "total_count": "3.00",
        "total_price": "0.6943"
      },
      {
        "subaccount_id": 1047,
        "username": "user5",
        "total_count": "1.00",
        "total_price": "0.2314"
      }
    ],
    "post": [
      {
        "subaccount_id": 1039,
        "username": "user1",
        "total_count": "10",
        "total_price": "8.5624"
      },
      {
        "subaccount_id": 1047,
        "username": "user5",
        "total_count": "3",
        "total_price": "2.5586"
      }
    ],
    "email": [
      {
        "subaccount_id": 1039,
        "username": "user1",
        "total_count": 3992,
        "total_price": "9.0020"
      },
      {
        "subaccount_id": 1047,
        "username": "user5",
        "total_count": 998,
        "total_price": "0.0000"
      }
    ],
    "sms_total": {
      "count": 33,
      "price": "2.4417"
    },
    "voice_total": {
      "count": 7,
      "price": "0.2310"
    },
    "fax_total": {
      "count": 4,
      "price": "0.9257"
    },
    "post_total": {
      "count": 13,
      "price": "11.1210"
    },
    "email_total": {
      "count": 4990,
      "price": "9.0020"
    }
  }
}

https://rest.clicksend.com/v3/account/usage/{year}/{month}/subaccount

Get account usage

Get account usage statistics grouped by subaccount.

Properties

Name Type Required Restrictions Description
year string true none Your account usage year. Example: 2019
month string true none Your account usage month. Example: 4

Refer to Status Codes for definitions of HTTP status code responses.

Send Account Verification

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
     --request PUT \
     --header "Content-Type: application/json" \

     --data-binary "    {
        \"user_phone\":\"352-394-4199\",
        \"type\":\"sms\",
        \"country\": \"US\"
    }" \
'https://rest.clicksend.com/v3/account-verify/send'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\AccountApi(new GuzzleHttp\Client(),$config);
// \ClickSend\Model\AccountVerify | Account details
$account_verify = new \ClickSend\Model\AccountVerify(); 
$account_verify->setCountry("US");
$account_verify->setUserPhone("352-394-4199");
$account_verify->setType("sms");

try {
    $result = $apiInstance->accountVerifySendPut($account_verify);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AccountApi->accountVerifySendPut: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME, 
    Password = API_KEY  
};
var accountApi = new AccountApi(configuration);
var response = accountApi.AccountVerifySendPut(new AccountVerify(
    country: "US",
    userPhone: "+11231231234",
    type: "sms"
));
var api = require('./api.js');

var accountApi = new api.AccountApi("USERNAME", "API_KEY");

var accountVerify = new api.AccountVerify();

accountVerify.country = "US";
accountVerify.userPhone = "xxx-xxx-xxxx";
accountVerify.type = "SMS";

accountApi.accountVerifySendPut(accountVerify).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::AccountApi.new

# AccountVerify | Account details
account_verify = ClickSendClient::AccountVerify.new(
  "country": "country",
  "user_phone": "user_phone",
  "type": "sms"
)

begin
  # Send account activation token
  result = api_instance.account_verify_send_put(account_verify)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling AccountApi->account_verify_send_put: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.AccountApi(clicksend_client.ApiClient(configuration))
account_verify = clicksend_client.AccountVerify(
                  user_phone="xxx-xxx-xxxx",
                  type="sms",
                  country="US") # AccountVerify | Account details

try:
    # Send account activation token
    api_response = api_instance.account_verify_send_put(account_verify)
    print(api_response)
except ApiException as e:
    print("Exception when calling AccountApi->account_verify_send_put: %s\n" % e)
use WWW::ClickSendClient::AccountApi;
use WWW::ClickSendClient::Object::AccountVerify;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::AccountApi->new(username => $username, password => $password);

my %params = (
    'country'    => 'US',
    'user_phone' => '+111111111111',
    'type'       => 'sms'
);

my $acc_obj = WWW::ClickSendClient::Object::AccountVerify->new(%params);
my $json_output = $api->account_verify_send_put('account_verify' => $acc_obj);

print $json_output;
#import "CSDefaultConfiguration.h"
#import "CSAccountApi.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
// Configure HTTP basic authorization (authentication scheme: BasicAuth)
[apiConfig setUsername:@"USERNAME"];
[apiConfig setPassword:@"PASSWORD"];

CSAccountApi *accountAPI = [[CSAccountApi alloc] init];

CSAccountVerify *accountVerify = [[CSAccountVerify alloc] init];
accountVerify.country = @"US";
accountVerify.userPhone = @"352-394-4199";
accountVerify.type = @"sms";

[accountAPI accountVerifySendPutWithAccountVerify:accountVerify completionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"Output: %@", output);
    }
}];
import Alamofire

if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}

let accountVerify = AccountVerify(
    country: "US", 
    userPhone: "352-394-4199", 
    type: "sms"
)

AccountAPI.accountVerifySendPut(accountVerify: accountVerify) { (dataString, error) in
    guard let dataString = dataString else {
        print(error!)
        return
    }

    if let data = dataString.data(using: String.Encoding.utf8) {
        do {
            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                print(dictonary)
            } else {
                print("Cannot convert the String value to JSON")
            }
        } catch let error as NSError {
            print(error)
        }
    }
}
    Coming Soon
package ClickSend;

import ClickSend.Api.AccountApi;
import ClickSend.Model.AccountVerify;

public class send_account_verification {
  public static void main(String[] args) {
    ApiClient defaultClient = new ApiClient();
    defaultClient.setUsername("USERNAME");
    defaultClient.setPassword("API_KEY");
    AccountApi apiInstance = new AccountApi(defaultClient);
    AccountVerify accountVerify = new AccountVerify(); // AccountVerify | Account details
    accountVerify.country("IN");
    accountVerify.type("sms");
    accountVerify.userPhone("000-000-0000");
    try {
        String result = apiInstance.accountVerifySendPut(accountVerify);
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling AccountApi#accountVerifySendPut");
        e.printStackTrace();
    }
  }
}

Body parameter

{
  "country": "country",
  "user_phone": "user_phone",
  "type": "sms"
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "Verification sent.",
  "data": {
    "user_phone": "+13523944199",
    "type": "sms",
    "country": "US"
  }
}

https://rest.clicksend.com/v3/account-verify/send

Send account activation token

Properties

Name Type Required Restrictions Description
country string true none Two-letter country code (ISO3166)
user_phone string true none User's phone number
type string true none Type of verification

Refer to Status Codes for definitions of HTTP status code responses.

Verify Account

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
     --request PUT \

'https://rest.clicksend.com/v3/account-verify/verify/{activation_token}'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\AccountApi(new GuzzleHttp\Client(),$config);
$activation_token = 56; // int | 

try {
    $result = $apiInstance->accountVerifyVerifyByActivationTokenPut($activation_token);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AccountApi->accountVerifyVerifyByActivationTokenPut: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME, 
    Password = API_KEY  
};
var accountApi = new AccountApi(configuration);
var response = accountApi.AccountVerifyVerifyByActivationTokenPut(ACTIVATION_CODE);
var api = require('./api.js');

var accountApi = new api.AccountApi("USERNAME", "API_KEY");

var activationToken = "activation_token";

accountApi.accountVerifyVerifyByActivationTokenPut(activationToken).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::AccountApi.new

activation_token = 56 # Integer |

begin
  # Verify new account
  result = api_instance.account_verify_verify_by_activation_token_put(activation_token)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling AccountApi->account_verify_verify_by_activation_token_put: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.AccountApi(clicksend_client.ApiClient(configuration))
activation_token = 56 # int | 

try:
    # Verify new account
    api_response = api_instance.account_verify_verify_by_activation_token_put(activation_token)
    print(api_response)
except ApiException as e:
    print("Exception when calling AccountApi->account_verify_verify_by_activation_token_put: %s\n" % e)
use WWW::ClickSendClient::AccountApi;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::AccountApi->new(username => $username, password => $password);
my $json_output = $api->account_verify_verify_by_activation_token_put('activation_token' => 'XXXXXX-XXXXXX-XXXX-XXXXXXX');

print $json_output;
#import "CSDefaultConfiguration.h"
#import "CSAccountApi.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
// Configure HTTP basic authorization (authentication scheme: BasicAuth)
[apiConfig setUsername:@"USERNAME"];
[apiConfig setPassword:@"PASSWORD"];

CSAccountApi *accountAPI = [[CSAccountApi alloc] init];
NSNumber *token = [NSNumber numberWithInt:123456];
[accountAPI accountVerifyVerifyByActivationTokenPutWithActivationToken:token completionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"Output: %@", output);
    }
}];
import Alamofire

if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}

let token = 123456
AccountAPI.accountVerifyVerifyByActivationTokenPut(activationToken: token) { (dataString, error) in
    guard let dataString = dataString else {
        print(error!)
        return
    }

    if let data = dataString.data(using: String.Encoding.utf8) {
        do {
            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                print(dictonary)
            } else {
                print("Cannot convert the String value to JSON")
            }
        } catch let error as NSError {
            print(error)
        }
    }
}
    Coming Soon
package ClickSend;

import ClickSend.Api.AccountApi;

public class verify_account {
  public static void main(String[] args) {
    ApiClient defaultClient = new ApiClient();
    defaultClient.setUsername("USERNAME");
    defaultClient.setPassword("API_KEY");
    AccountApi apiInstance = new AccountApi(defaultClient);
    Integer activationToken = 56; // Integer | 
    try {
        String result = apiInstance.accountVerifyVerifyByActivationTokenPut(activationToken);
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling AccountApi#accountVerifyVerifyByActivationTokenPut");
        e.printStackTrace();
    }
  }
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "You're account has been verified.",
  "data": {
    "user_id": 1,
    "username": "1",
    "user_email": "1@test.com",
    "active": 1,
    "banned": 0,
    "balance": "4.041500",
    "user_phone": "+13523944199",
    "reply_to": "1@test.com",
    "delivery_to": null,
    "user_first_name": "John",
    "user_last_name": "Doe",
    "account": 1,
    "account_name": null,
    "account_billing_email": "1@test.com",
    "account_billing_mobile": null,
    "country": "US",
    "default_country_sms": "US",
    "unsubscribe_mail": 0,
    "auto_recharge": 0,
    "auto_recharge_amount": "20.00",
    "low_credit_amount": "1.50",
    "setting_unicode_sms": 0,
    "setting_beta": 0,
    "setting_email_sms_subject": 0,
    "setting_fix_sender_id": 1,
    "_currency": {
      "currency_name_short": "USD",
      "currency_prefix_d": "$",
      "currency_prefix_c": "¢",
      "currency_name_long": "US Dollars"
    },
    "_subaccount": {
      "subaccount_id": 1,
      "api_username": "1",
      "email": "1@test.com",
      "mobile": "+639171234501",
      "first_name": "John",
      "last_name": "Doe",
      "api_key": "FD3259F9D0A35548682ACEA84A6FF26A",
      "user_id": 1,
      "sms_deidentify_message": 0,
      "access_smpp": 0,
      "access_users": 1,
      "access_billing": 1,
      "access_reporting": 1,
      "access_contacts": 0,
      "access_settings": 1
    }
  }
}

https://rest.clicksend.com/v3/account-verify/verify/{activation_token}

Verify new account

Parameters

Parameter In Type Required Description
activation_token path integer(int32) true none

Refer to Status Codes for definitions of HTTP status code responses.

Forgot Username

Code samples

curl --include \
     --request PUT \
     --header "Content-Type: application/json" \
     --data-binary "    {
        \"phone_number\": \"3108147982\",
        \"email\": \"test@email.com\"
    }" \
'https://rest.clicksend.com/v3/forgot-username'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

$apiInstance = new ClickSend\Api\AccountApi(new GuzzleHttp\Client());
$forgot_username = new \ClickSend\Model\ForgotUsername(); // \ClickSend\Model\ForgotUsername | 
$forgot_username->setEmail("xxx@gmail.com");

try {
    $result = $apiInstance->forgotUsernamePut($forgot_username);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AccountApi->forgotUsernamePut: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;

var accountApi = new AccountApi(Configuration.Default);
var response = accountApi.ForgotUsernamePut(new ForgotUsername(
    email: "john@doe.com"
));
var api = require('./api.js');

var accountApi = new api.AccountApi("USERNAME", "API_KEY");

var forgotUsername = new  api.ForgotUsername();

forgotUsername.email = "xxx@gmail.com";
forgotUsername.phoneNumber = "xxx-xxx-xxxx";

accountApi.forgotUsernamePut(forgotUsername).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

api_instance = ClickSendClient::AccountApi.new

opts = {
  forgot_username: ClickSendClient::ForgotUsername.new( # ForgotUsername | ForgotUsername model
    "email": "test@email.com"
  )
}

begin
  # Forgot username
  result = api_instance.forgot_username_put(opts)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling AccountApi->forgot_username_put: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# create an instance of the API class
api_instance = clicksend_client.AccountApi()
forgot_username = clicksend_client.ForgotUsername(
                  email='xxx@gmail.com',
                  phone_number= '000-000-0000') # ForgotUsername |  (optional)

try:
    # Forgot username
    api_response = api_instance.forgot_username_put(forgot_username=forgot_username)
    print(api_response)
except ApiException as e:
    print("Exception when calling AccountApi->forgot_username_put: %s\n" % e)

use WWW::ClickSendClient::AccountApi;

my $api         = WWW::ClickSendClient::AccountApi->new();
my $email       = 'YOUR_EMAIL';

my $json_output = $api->forgot_username_put('email' => $email);

print $json_output;
#import "CSDefaultConfiguration.h"
#import "CSAccountApi.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
// Configure HTTP basic authorization (authentication scheme: BasicAuth)
[apiConfig setUsername:@"USERNAME"];
[apiConfig setPassword:@"PASSWORD"];

CSAccountApi *accountAPI = [[CSAccountApi alloc] init];
CSForgotUsername *forgotUserName = [[CSForgotUsername alloc] init];
forgotUserName.email = @"johndoe1@gmail.com";
forgotUserName.phoneNumber = @"3108147982";

[accountAPI forgotUsernamePutWithForgotUsername:forgotUserName completionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire

if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}

let forgotUserName = ForgotUsername(
    email: "johndoe1@gmail.com", 
    phoneNumber: "3108147982"
)

AccountAPI.forgotUsernamePut(forgotUsername: forgotUserName) { (dataString, error) in
    guard let dataString = dataString else {
        print(error!)
        return
    }

    if let data = dataString.data(using: String.Encoding.utf8) {
        do {
            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                print(dictonary)
            } else {
                print("Cannot convert the String value to JSON")
            }
        } catch let error as NSError {
            print(error)
        }
    }
}
    Coming Soon
package ClickSend;

import ClickSend.Api.AccountApi;
import ClickSend.Model.ForgotUsername;

public class forgot_username {
  public static void main(String[] args) {
    ApiClient defaultClient = new ApiClient();
    defaultClient.setUsername("USERNAME");
    defaultClient.setPassword("API_KEY");
    AccountApi apiInstance = new AccountApi(defaultClient);
    ForgotUsername forgotUsername = new ForgotUsername(); // ForgotUsername | 
    forgotUsername.email("xxx@gmail.com");
    forgotUsername.phoneNumber("xxx-xxx-xxxx");
    try {
        String result = apiInstance.forgotUsernamePut(forgotUsername);
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling AccountApi#forgotUsernamePut");
        e.printStackTrace();
    }
  }
}

Body parameter

{
  "phone_number": "3108147982",
  "email": "test@email.com"
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "An email notification has been sent.",
  "data": []
}

https://rest.clicksend.com/v3/forgot-username

Forgot username

Requires the user to pass either the email registered to an account or the phone number, not both.

Properties

Name Type Required Restrictions Description
email string true none Email belonging to account
phone_number string true none Phone belonging to account

Refer to Status Codes for definitions of HTTP status code responses.

Forgot Password

Code samples

curl --include \
     --request PUT \
     --header "Content-Type: application/json" \
     --data-binary "    {
        \"username\": \"0F6pKiiuca\"
    }" \
'https://rest.clicksend.com/v3/forgot-password'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\AccountApi(new GuzzleHttp\Client(),$config);
$forgot_password = new \ClickSend\Model\ForgotPassword(); // \ClickSend\Model\ForgotPassword | 
$forgot_password->username="username";

try {
    $result = $apiInstance->forgotPasswordPut($forgot_password);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AccountApi->forgotPasswordPut: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;

var accountApi = new AccountApi(Configuration.Default);
var response = accountApi.ForgotPasswordPut(USERNAME);
var api = require('./api.js');

var accountApi = new api.AccountApi("USERNAME", "API_KEY");

var forgotPassword = new  api.ForgotPassword();

forgotPassword.username = "xxx@gmail.com";

accountApi.forgotPasswordPut(forgotPassword).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::AccountApi.new

# ForgotPassword |
opts = {
  forgot_password: ClickSendClient::ForgotPassword.new(
    "username": "0F6pKiiuca"
  )
}

begin
  # Forgot password
  result = api_instance.forgot_password_put(opts)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling AccountApi->forgot_password_put: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.AccountApi(clicksend_client.ApiClient(configuration))
forgot_password = clicksend_client.ForgotPassword(username='USERNAME') # ForgotPassword |  (optional)

try:
    # Forgot password
    api_response = api_instance.forgot_password_put(forgot_password=forgot_password)
    print(api_response)
except ApiException as e:
    print("Exception when calling AccountApi->forgot_password_put: %s\n" % e)
use WWW::ClickSendClient::AccountApi;

my $api = WWW::ClickSendClient::AccountApi->new();

my $username = 'YOUR_USER_NAME';

my $json_output = $api->forgot_password_put('username' => $username);
print $json_output;
#import "CSDefaultConfiguration.h"
#import "CSAccountApi.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
// Configure HTTP basic authorization (authentication scheme: BasicAuth)
[apiConfig setUsername:@"USERNAME"];
[apiConfig setPassword:@"PASSWORD"];

CSAccountApi *accountAPI = [[CSAccountApi alloc] init];

CSForgotPassword *forgotPassword = [[CSForgotPassword alloc] init];
forgotPassword.username = @"USERNAME";

[accountAPI forgotPasswordPutWithForgotPassword:forgotPassword completionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire

if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}

let forgotPassword = ForgotPassword(username: "USERNAME")

AccountAPI.forgotPasswordPut(forgotPassword: forgotPassword) { (dataString, error) in
    guard let dataString = dataString else {
        print(error!)
        return
    }

    if let data = dataString.data(using: String.Encoding.utf8) {
        do {
            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                print(dictonary)
            } else {
                print("Cannot convert the String value to JSON")
            }
        } catch let error as NSError {
            print(error)
        }
    }
}
    Coming Soon
package ClickSend;

import ClickSend.Api.AccountApi;
import ClickSend.Model.ForgotPassword;

public class forgot_password {
  public static void main(String[] args) {
    ApiClient defaultClient = new ApiClient();
    defaultClient.setUsername("USERNAME");
    defaultClient.setPassword("API_KEY");
    AccountApi apiInstance = new AccountApi(defaultClient);
    ForgotPassword forgotPassword = new ForgotPassword(); // ForgotPassword | 
    forgotPassword.username("USERNAME");
    try {
        String result = apiInstance.forgotPasswordPut(forgotPassword);
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling AccountApi#forgotPasswordPut");
        e.printStackTrace();
    }
  }
}

Body parameter

{
  "username": "0F6pKiiuca"
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "An email notification has been sent.",
  "data": []
}

https://rest.clicksend.com/v3/forgot-password

Forgot password

A user can send their username to this endpoint to be sent an email with their registered email address that will have a verification code.

Once you have this verification email containing the code you can send it to the forgotten-password/verify endpoint along with a new password and the ID of that subaccount.

Ask your administrator if you do not know your subaccount id.

Properties

Name Type Required Restrictions Description
username string true none Username belonging to account

Refer to Status Codes for definitions of HTTP status code responses.

Verify Forgot Password

Code samples

curl --include \
     --request PUT \
     --header "Content-Type: application/json" \
     --data-binary "    {
        \"subaccount_id\": 54,
        \"activation_token\": \"9C648BAD-EB7F-4E7E-96BC-B433140C4F1F\",
        \"password\": \"0F6pKiiuca\"
    }" \
'https://rest.clicksend.com/v3/forgot-password/verify'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\AccountApi(new GuzzleHttp\Client(),$config);
// \ClickSend\Model\AccountForgotPasswordVerify | verifyPassword data
$verify_password = new \ClickSend\Model\AccountForgotPasswordVerify(); 
$verify_password->setSubaccountId("82267");
$verify_password->setActivationToken("67B187C4-FD56-42E3-AE22-60A2E23F6593");
$verify_password->setPassword("123");

try {
    $result = $apiInstance->forgotPasswordVerifyPut($verify_password);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AccountApi->forgotPasswordVerifyPut: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var accountApi = new AccountApi(Configuration.Default);
var response = accountApi.ForgotPasswordVerifyPut(new AccountForgotPasswordVerify() {
    SubaccountId = 1234,
    ActivationToken = "activation_token",
    Password = "password"
});
var api = require('./api.js');

var accountApi = new api.AccountApi("USERNAME", "API_KEY");

var verifyPassword = new  api.AccountForgotPasswordVerify();

verifyPassword.subaccountId = 1392;
verifyPassword.acctivationToken = "7A7616E8-1FC3-4918-975F-D303B65B1523";
verifyPassword.password = "123";

accountApi.forgotPasswordVerifyPut(verifyPassword).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::AccountApi.new

# AccountForgotPasswordVerify | verifyPassword data
verify_password = ClickSendClient::AccountForgotPasswordVerify.new(
  "activation_token": "activation_token",
  "password": "password",
  "subaccount_id": 0
)

begin
  # Verify forgot password
  result = api_instance.forgot_password_verify_put(verify_password)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling AccountApi->forgot_password_verify_put: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.AccountApi(clicksend_client.ApiClient(configuration))
verify_password = clicksend_client.AccountForgotPasswordVerify(
                  subaccount_id= '74275',
                  activation_token='67B187C4-FD56-42E3-AE22-60A2E23F6593',
                  password='123') # AccountForgotPasswordVerify | verifyPassword data

try:
    # Verify forgot password
    api_response = api_instance.forgot_password_verify_put(verify_password)
    print(api_response)
except ApiException as e:
    print("Exception when calling AccountApi->forgot_password_verify_put: %s\n" % e)

use WWW::ClickSendClient::AccountApi;
use WWW::ClickSendClient::Object::AccountForgotPasswordVerify;

my $api = WWW::ClickSendClient::AccountApi->new();

my %params = (
    'subaccount_id'    => 1234,
    'activation_token' => 'XXXXXXXX-XXXXXXXX-XXXXXXXX-XXXXXXXX-XXXXXXXX',
    'password'         => 'XXXXXXXX',
);

my $verify_password_obj = WWW::ClickSendClient::Object::AccountForgotPasswordVerify->new(%params);

my $json_output = $api->forgot_password_verify_put('verify_password' => $verify_password_obj);

print $json_output;
#import "CSDefaultConfiguration.h"
#import "CSAccountApi.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
// Configure HTTP basic authorization (authentication scheme: BasicAuth)
[apiConfig setUsername:@"USERNAME"];
[apiConfig setPassword:@"PASSWORD"];

CSAccountForgotPasswordVerify *accountForgotPasswordVerify = [[CSAccountForgotPasswordVerify alloc] init];
accountForgotPasswordVerify.subaccountId = 0;
accountForgotPasswordVerify.activationToken = @"activation";
accountForgotPasswordVerify.password = @"password";

CSAccountApi *accountApiInstance = [[CSAccountApi alloc] init];

[accountApiInstance forgotPasswordVerifyPutWithVerifyPassword:accountForgotPasswordVerify completionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire

if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}


let  verifyPassword = AccountForgotPasswordVerify(subaccountId: 1,
                                                  activationToken: "activation_token",
                                                  password: "pasword"
                                                  )
AccountAPI.forgotPasswordVerifyPut(verifyPassword: verifyPassword) { (dataString, error) in
    guard let dataString = dataString else {
        print(error!)
        return
    }

    if let data = dataString.data(using: String.Encoding.utf8) {
        do {
            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                print(dictonary)
            } else {
                print("Cannot convert the String value to JSON")
            }
        } catch let error as NSError {
            print(error)
        }
    }
}
    Coming Soon
package ClickSend;

import ClickSend.Api.AccountApi;
import ClickSend.Model.AccountForgotPasswordVerify;

public class verify_forgot_password {
  public static void main(String[] args) {
    ApiClient defaultClient = new ApiClient();
    defaultClient.setUsername("USERNAME");
    defaultClient.setPassword("API_KEY");
    AccountApi apiInstance = new AccountApi(defaultClient);
    // AccountForgotPasswordVerify | verifyPassword data
    AccountForgotPasswordVerify verifyPassword = new AccountForgotPasswordVerify(); 
    verifyPassword.activationToken("8ED1EF5E-6B40-41C1-8992-7A5A22D261F8");
    verifyPassword.subaccountId(new Integer(74275));
    verifyPassword.password("abc");
    try {
        String result = apiInstance.forgotPasswordVerifyPut(verifyPassword);
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling AccountApi#forgotPasswordVerifyPut");
        e.printStackTrace();
    }
  }
}

Body parameter

{
  "activation_token": "activation_token",
  "password": "password",
  "subaccount_id": 0
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "Your password has been updated.",
  "data": []
}

https://rest.clicksend.com/v3/forgot-password/verify

Verify forgotten password

Properties

Name Type Required Restrictions Description
subaccount_id integer(int32) true none ID of subaccount
activation_token string true none Activation token
password string true none Password

Refer to Status Codes for definitions of HTTP status code responses.

Account Recharge

Everything about recharging accounts with credit

Current Payment Info

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
'https://rest.clicksend.com/v3/recharge/credit-card'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\AccountRechargeApi(new GuzzleHttp\Client(),$config);

try {
    $result = $apiInstance->rechargeCreditCardGet();
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AccountRechargeApi->rechargeCreditCardGet: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;

var configuration = new Configuration()
{
    Username = USERNAME, 
    Password = API_KEY  
};
var accountRechargeApi = new AccountRechargeApi(configuration);
var response = accountRechargeApi.RechargeCreditCardGet();
var api = require('./api.js');

var accountRechargeApi = new api.AccountRechargeApi("USERNAME", "API_KEY");

accountRechargeApi.rechargeCreditCardGet().then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::AccountRechargeApi.new

begin
  # Get Credit Card info
  result = api_instance.recharge_credit_card_get
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling AccountRechargeApi->recharge_credit_card_get: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.AccountRechargeApi(clicksend_client.ApiClient(configuration))

try:
    # Get Credit Card info
    api_response = api_instance.recharge_credit_card_get()
    print(api_response)
except ApiException as e:
    print("Exception when calling AccountRechargeApi->recharge_credit_card_get: %s\n" % e)
use WWW::ClickSendClient::AccountRechargeApi;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::AccountRechargeApi->new(username => $username, password => $password);

my $json_output = $api->recharge_credit_card_get();

print $json_output;
#import "CSAccountRechargeApi.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
[apiConfig setUsername:@"USERNAME"];
[apiConfig setPassword:@"PASSWORD"];

CSAccountRechargeApi *accountRechargeApiInstance = [[CSAccountRechargeApi alloc] init];
[accountRechargeApiInstance rechargeCreditCardGetWithCompletionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire

if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}

AccountRechargeAPI.rechargeCreditCardGet { (dataString, error) in
    guard let dataString = dataString else {
        print(error!)
        return
    }
    if let data = dataString.data(using: String.Encoding.utf8) {
        do {
        if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                print(dictonary)
            } else {
                print("Cannot convert the String value to JSON")
            }
        } catch let error as NSError {
            print(error)
        }
    }
}
    Coming Soon
package ClickSend;

import ClickSend.Api.AccountRechargeApi;

public class current_payment_info {
  public static void main(String[] args) {
    ApiClient defaultClient = new ApiClient();
    defaultClient.setUsername("USERNAME");
    defaultClient.setPassword("API_KEY");
    AccountRechargeApi apiInstance = new AccountRechargeApi(defaultClient);
    try {
        String result = apiInstance.rechargeCreditCardGet();
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling AccountRechargeApi#rechargeCreditCardGet");
        e.printStackTrace();
    }
  }
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "Customer payment info.",
  "data": {
    "display_number": "XXXX-XXXX-XXXX-0000",
    "expiry_month": 5,
    "expiry_year": 2016,
    "name": "Roland Robot"
  }
}

https://rest.clicksend.com/v3/recharge/credit-card

Get current payment info

This endpoint returns your current payment info, we do not store credit card numbers, only a card token for security reasons.

Refer to Status Codes for definitions of HTTP status code responses.

Update Payment Info

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
     --request PUT \
     --header "Content-Type: application/json" \

     --data-binary "    {
        \"number\":\"5520000000000000\",
        \"expiry_month\":\"05\",
        \"expiry_year\":\"2016\",
        \"cvc\":\"123\",
        \"name\":\"Roland Robot\",
        \"bank_name\": \"Robotic Banking\"
    }" \
'https://rest.clicksend.com/v3/recharge/credit-card'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\AccountRechargeApi(new GuzzleHttp\Client(),$config);
// \ClickSend\Model\CreditCard | CreditCard model
$credit_card = new \ClickSend\Model\CreditCard(); 
$credit_card->setNumber("5520000000000000");
$credit_card->setExpiryMonth("05");
$credit_card->setExpiryYear("2019");
$credit_card->setCvc("123");
$credit_card->setName("Roland Robot");
$credit_card->setBankName("Robotic Banking");

try {
    $result = $apiInstance->rechargeCreditCardPut($credit_card);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AccountRechargeApi->rechargeCreditCardPut: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME, 
    Password = API_KEY  
};
var accountRechargeApi = new AccountRechargeApi(configuration);
var response = accountRechargeApi.RechargeCreditCardPut(new CreditCard(
    number: "123123123123123",
    expiryMonth: 2,
    expiryYear: 2020,
    cvc: 123,
    name: "My Card",
    bankName: "BankName"
));
var api = require('./api.js');

var accountRechargeApi = new api.AccountRechargeApi("USERNAME", "API_KEY");

var creditCard = new api.CreditCard();

creditCard.number = "5520000000000000";
creditCard.expiryMonth = 11;
creditCard.expiryYear = 2019;
creditCard.cvc = 123;
creditCard.name = "abc";
creditCard.bankName = "bank_name";

accountRechargeApi.rechargeCreditCardPut(creditCard).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::AccountRechargeApi.new

# CreditCard | CreditCard model
credit_card = ClickSendClient::CreditCard.new(
  "number": "number",
  "expiry_month": 0,
  "cvc": 1,
  "name": "name",
  "bank_name": "bank_name",
  "expiry_year": 6
)

begin
  # Update credit card info
  result = api_instance.recharge_credit_card_put(credit_card)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling AccountRechargeApi->recharge_credit_card_put: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.AccountRechargeApi(clicksend_client.ApiClient(configuration))
credit_card = clicksend_client.CreditCard(
              number="0000-0000-0000-0000",
              expiry_month="05",
              expiry_year="2025",
              cvc="123",
              name="Roland Robot",
              bank_name="Robotic Banking") # CreditCard | CreditCard model

try:
    # Update credit card info
    api_response = api_instance.recharge_credit_card_put(credit_card)
    print(api_response)
except ApiException as e:
    print("Exception when calling AccountRechargeApi->recharge_credit_card_put: %s\n" % e)
use WWW::ClickSendClient::AccountRechargeApi;
use WWW::ClickSendClient::Object::CreditCard;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::AccountRechargeApi->new(username => $username, password => $password);

my %params = (
    'number'       => '12345678901234567',
    'expiry_month' => '05',
    'expiry_year'  => '2099',
    'cvc'          => '123',
    'name'         => 'Roland Robot',
    'bank_name'    => 'Robotic Banking'
);

my $credit_card_obj = WWW::ClickSendClient::Object::CreditCard->new(%params);

my $json_output = $api->recharge_credit_card_put('credit_card' => $credit_card_obj);

print $json_output;
#import "CSAccountRechargeApi.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
[apiConfig setUsername:@"USERNAME"];
[apiConfig setPassword:@"PASSWORD"];

CSCreditCard *creditCard = [[CSCreditCard alloc] init];
CSAccountRechargeApi *accountRechargeApiInstance = [[CSAccountRechargeApi alloc] init];
[accountRechargeApiInstance rechargeCreditCardPutWithCreditCard:creditCard completionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire

if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}

let creditCard = CreditCard(
        number: "number", 
        expiryMonth: 2, 
        expiryYear: 4, 
        cvc: 1, 
        name: "name", 
        bankName: "bankname"
)

AccountRechargeAPI.rechargeCreditCardPut(creditCard: creditCard) { (dataString, error) in
    guard let dataString = dataString else {
        print(error!)
        return
    }
    if let data = dataString.data(using: String.Encoding.utf8) {
        do {
            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                print(dictonary)
            } else {
                print("Cannot convert the String value to JSON")
            }
        } catch let error as NSError {
            print(error)
        }
    }
}
    Coming Soon
package ClickSend;

import ClickSend.Api.AccountRechargeApi;
import ClickSend.Model.CreditCard;

public class update_payment_info {
  public static void main(String[] args) {
    ApiClient defaultClient = new ApiClient();
    defaultClient.setUsername("USERNAME");
    defaultClient.setPassword("API_KEY");
    AccountRechargeApi apiInstance = new AccountRechargeApi(defaultClient);
    CreditCard creditCard = new CreditCard(); // CreditCard | CreditCard model
    creditCard.number("5520000000000000");
    creditCard.expiryMonth(new Integer(05));
    creditCard.bankName("Robotic Banking");
    creditCard.expiryYear(new Integer(2019));
    creditCard.name("Roland Robot");
    creditCard.cvc(new Integer(123));
    try {
        String result = apiInstance.rechargeCreditCardPut(creditCard);
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling AccountRechargeApi#rechargeCreditCardPut");
        e.printStackTrace();
    }
  }
}

Body parameter

{
  "number": "number",
  "expiry_month": 0,
  "cvc": 1,
  "name": "name",
  "bank_name": "bank_name",
  "expiry_year": 6
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "Your payment info has been updated.",
  "data": {
    "token": "cus_6Z3mHM9QvQQoJ28WsIWuLA"
  }
}

https://rest.clicksend.com/v3/recharge/credit-card

Update credit card info

Properties

Name Type Required Restrictions Description
number string true none Credit card number
expiry_month integer(int32) true none Expiry month of credit card
expiry_year integer(int32) true none Expiry year of credit card
cvc integer(int32) true none CVC number of credit card
name string true none Name printed on credit card
bank_name string true none Name of bank that credit card belongs to

Refer to Status Codes for definitions of HTTP status code responses.

View Recharge Packages

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \

'https://rest.clicksend.com/v3/recharge/packages?country={country}'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\AccountRechargeApi(new GuzzleHttp\Client(),$config);
$country = "country_code"; // string | Country code

try {
    $result = $apiInstance->rechargePackagesGet($country);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AccountRechargeApi->rechargePackagesGet: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;

var configuration = new Configuration()
{
    Username = USERNAME, 
    Password = API_KEY  
};
var accountRechargeApi = new AccountRechargeApi(configuration);
var response = accountRechargeApi.RechargePackagesGet("US");
var api = require('./api.js');

var accountRechargeApi = new api.AccountRechargeApi("USERNAME", "API_KEY");

var country = "US";

accountRechargeApi.rechargePackagesGet(country).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::AccountRechargeApi.new

opts = {
  "country": "US" # String | Country code
}

begin
  # Get list of all packages
  result = api_instance.recharge_packages_get(opts)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling AccountRechargeApi->recharge_packages_get: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.AccountRechargeApi(clicksend_client.ApiClient(configuration))
country = 'country_code' # str | Country code (optional)

try:
    # Get list of all packages
    api_response = api_instance.recharge_packages_get(country=country)
    print(api_response)
except ApiException as e:
    print("Exception when calling AccountRechargeApi->recharge_packages_get: %s\n" % e)
use WWW::ClickSendClient::AccountRechargeApi;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::AccountRechargeApi->new(username => $username, password => $password);

my $json_output = $api->recharge_packages_get('country' => 'IN');

print $json_output;
#import "CSAccountRechargeApi.h"

CSAccountRechargeApi *accountRechargeApiInstance = [[CSAccountRechargeApi alloc] init];
[accountRechargeApiInstance rechargePackagesGetWithCountry: @"country" completionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire

if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}

AccountRechargeAPI.rechargePackagesGet { (dataString, error) in
    guard let dataString = dataString else {
        print(error!)
        return
    }
    if let data = dataString.data(using: String.Encoding.utf8) {
        do {
            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                print(dictonary)
            } else {
                print("Cannot convert the String value to JSON")
            }
        } catch let error as NSError {
            print(error)
        }
    }
}
    Coming Soon
package ClickSend;

import ClickSend.Api.AccountRechargeApi;

public class view_recharge_package {
  public static void main(String[] args) {
    ApiClient defaultClient = new ApiClient();
    defaultClient.setUsername("USERNAME");
    defaultClient.setPassword("API_KEY");
    AccountRechargeApi apiInstance = new AccountRechargeApi(defaultClient);
    String country = "country"; // String | Country code
    try {
        String result = apiInstance.rechargePackagesGet(country);
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling AccountRechargeApi#rechargePackagesGet");
        e.printStackTrace();
    }
  }
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "List of Packages.",
  "data": {
    "packages": [
      {
        "package_id": 1,
        "package_price": "20.00",
        "sms_price": 0.099,
        "sms_quantity": 202,
        "voice_mobile_price": 0.099,
        "voice_mobile_quantity": 202,
        "voice_landline_price": 0.0583,
        "voice_landline_quantity": 343,
        "fax_price": 0.198,
        "fax_quantity": 101,
        "email_price": 0.033,
        "email_quantity": 606,
        "post_letter_black_price": 1.397,
        "post_letter_colour_price": 1.617,
        "post_page_black_price": 0.11,
        "post_page_colour_price": 0.264,
        "post_letter_black_quantity": 13,
        "post_letter_colour_quantity": 10,
        "post_direct_mail_dl_price": 0.44,
        "post_direct_mail_a5_price": 0.66,
        "post_direct_mail_min_quantity": 5000,
        "postcard_price": 11,
        "postcard_quantity": 1
      }
    ],
    "_currency": {
      "currency_name_short": "AUD",
      "currency_prefix_d": "$",
      "currency_prefix_c": "c",
      "currency_name_long": "Australian Dollars"
    }
  }
}

https://rest.clicksend.com/v3/recharge/packages

Get list of all packages

Parameters

Parameter In Type Required Description
country query string false Two-letter country code (ISO3166)

Refer to Status Codes for definitions of HTTP status code responses.

Purchase Recharge Package

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
     --request PUT \

'https://rest.clicksend.com/v3/recharge/purchase/{package_id}'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\AccountRechargeApi(new GuzzleHttp\Client(),$config);
$package_id = 132; // int | ID of package to purchase

try {
    $result = $apiInstance->rechargePurchaseByPackageIdPut($package_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AccountRechargeApi->rechargePurchaseByPackageIdPut: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;

var configuration = new Configuration()
{
    Username = USERNAME, 
    Password = API_KEY  
};
var accountRechargeApi = new AccountRechargeApi(configuration);
var response = accountRechargeApi.RechargePurchaseByPackageIdPut(PACKAGE_ID);
var api = require('./api.js');

var accountRechargeApi = new api.AccountRechargeApi("USERNAME", "API_KEY");

var packageId = 135;

accountRechargeApi.rechargePurchaseByPackageIdPut(packageId).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::AccountRechargeApi.new

package_id = 11 # Integer | ID of package to purchase

begin
  # Purchase a package
  result = api_instance.recharge_purchase_by_package_id_put(package_id)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling AccountRechargeApi->recharge_purchase_by_package_id_put: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.AccountRechargeApi(clicksend_client.ApiClient(configuration))
package_id = 137 # int | ID of package to purchase

try:
    # Purchase a package
    api_response = api_instance.recharge_purchase_by_package_id_put(package_id)
    print(api_response)
except ApiException as e:
    print("Exception when calling AccountRechargeApi->recharge_purchase_by_package_id_put: %s\n" % e)
use WWW::ClickSendClient::AccountRechargeApi;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::AccountRechargeApi->new(username => $username, password => $password);

my $json_output = $api->recharge_purchase_by_package_id_put('package_id' => '1234');

print $json_output;
#import "CSAccountRechargeApi.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
[apiConfig setUsername:@"USERNAME"];
[apiConfig setPassword:@"PASSWORD"];

NSNumber *packageId = [[NSNumber alloc] initWithInt:1];

CSAccountRechargeApi *accountRechargeApiInstance = [[CSAccountRechargeApi alloc] init];
[accountRechargeApiInstance rechargePurchaseByPackageIdPutWithPackageId:packageId completionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire

if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}
AccountRechargeAPI.rechargePurchaseByPackageIdPut(packageId: 1) { (dataString, error) in
    guard let dataString = dataString else {
        print(error!)
        return
    }
    if let data = dataString.data(using: String.Encoding.utf8) {
        do {
            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                print(dictonary)
            } else {
                print("Cannot convert the String value to JSON")
            }
        } catch let error as NSError {
            print(error)
        }
    }
}
    Coming Soon
package ClickSend;

import ClickSend.Api.AccountRechargeApi;

public class purchase_recharge_package {
  public static void main(String[] args) {
    ApiClient defaultClient = new ApiClient();
    defaultClient.setUsername("USERNAME");
    defaultClient.setPassword("API_KEY");
    AccountRechargeApi apiInstance = new AccountRechargeApi(defaultClient);
    Integer packageId = 132; // Integer | ID of package to purchase
    try {
        String result = apiInstance.rechargePurchaseByPackageIdPut(packageId);
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling AccountRechargeApi#rechargePurchaseByPackageIdPut");
        e.printStackTrace();
    }
  }
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "Successfully purchased a package #1",
  "data": {
    "user_id": 1,
    "amount": "50.00",
    "currency": "USD",
    "amount_aud": "61.86",
    "date": 1442216451
  }
}

https://rest.clicksend.com/v3/recharge/purchase/{package_id}

Purchase a package

Parameters

Parameter In Type Required Description
package_id path integer(int32) true ID of package to purchase

Refer to Status Codes for definitions of HTTP status code responses.

View All Transactions

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \

'https://rest.clicksend.com/v3/recharge/transactions'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\AccountRechargeApi(new GuzzleHttp\Client(),$config);
$page = 1; // int | Page number
$limit = 10; // int | Number of records per page

try {
    $result = $apiInstance->rechargeTransactionsGet($page, $limit);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AccountRechargeApi->rechargeTransactionsGet: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;

var configuration = new Configuration()
{
    Username = USERNAME, 
    Password = API_KEY  
};
var accountRechargeApi = new AccountRechargeApi(configuration);
var response = accountRechargeApi.RechargeTransactionsGet();
var api = require('./api.js');

var accountRechargeApi = new api.AccountRechargeApi("USERNAME", "API_KEY");

var page = 1;
var limit = 10;

accountRechargeApi.rechargeTransactionsGet(page, limit).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::AccountRechargeApi.new

opts = {
  page: 1,  # Integer | Page number
  limit: 10 # Integer | Number of records per page
}

begin
  # Purchase a package
  result = api_instance.recharge_transactions_get(opts)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling AccountRechargeApi->recharge_transactions_get: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.AccountRechargeApi(clicksend_client.ApiClient(configuration))
page = 1 # int | Page number (optional) (default to 1)
limit = 10 # int | Number of records per page (optional) (default to 10)

try:
    # Purchase a package
    api_response = api_instance.recharge_transactions_get(page=page, limit=limit)
    print(api_response)
except ApiException as e:
    print("Exception when calling AccountRechargeApi->recharge_transactions_get: %s\n" % e)
use WWW::ClickSendClient::AccountRechargeApi;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::AccountRechargeApi->new(username => $username, password => $password);

my $json_output = $api->recharge_transactions_get('page' => '1', 'limit'=> '10');

print $json_output;
#import "CSAccountRechargeApi.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
[apiConfig setUsername:@"USERNAME"];
[apiConfig setPassword:@"PASSWORD"];

NSNumber *page = [[NSNumber alloc] initWithInt:1];
NSNumber *limit = [[NSNumber alloc] initWithInt:15];
CSAccountRechargeApi *accountRechargeApiInstance = [[CSAccountRechargeApi alloc] init];
[accountRechargeApiInstance rechargeTransactionsGetWithPage:page limit:limit completionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire

if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}
AccountRechargeAPI.rechargeTransactionsGet { (dataString, error) in
    guard let dataString = dataString else {
        print(error!)
        return
    }
    if let data = dataString.data(using: String.Encoding.utf8) {
        do {
            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                print(dictonary)
            } else {
                print("Cannot convert the String value to JSON")
            }
        } catch let error as NSError {
        print(error)
        }
    }
}
    Coming Soon
package ClickSend;

import ClickSend.Api.AccountRechargeApi;

public class view_all_transaction {
  public static void main(String[] args) {
    ApiClient defaultClient = new ApiClient();
    defaultClient.setUsername("USERNAME");
    defaultClient.setPassword("API_KEY");
    AccountRechargeApi apiInstance = new AccountRechargeApi(defaultClient);
    Integer page = 1; // Integer | Page number
    Integer limit = 10; // Integer | Number of records per page
    try {
        String result = apiInstance.rechargeTransactionsGet(page, limit);
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling AccountRechargeApi#rechargeTransactionsGet");
        e.printStackTrace();
    }
  }
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "Here are your transactions.",
  "data": {
    "total": 16,
    "per_page": 15,
    "current_page": 1,
    "last_page": 2,
    "next_page_url": "https://rest.clicksend.com/v3/recharge/transactions/?page=2",
    "prev_page_url": null,
    "from": 1,
    "to": 15,
    "data": [
      {
        "invoice_number": "cb726c65-1c65-47fa-aea2-3ded9ed57557",
        "amount": "20.00",
        "currency": "AUD",
        "date": 1443420196
      },
      {
        "invoice_number": "13d35606-5f10-4d31-9de4-065b025aa5b8",
        "amount": "20.00",
        "currency": "AUD",
        "date": 1443420094
      }
    ]
  }
}

https://rest.clicksend.com/v3/recharge/transactions

Purchase a package

Get all transactions

Parameters

Parameter In Type Required Description
page query integer(int32) false Page number
limit query integer(int32) false Number of records per page

Refer to Status Codes for definitions of HTTP status code responses.

View Specific Transaction

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \

'https://rest.clicksend.com/v3/recharge/transactions/{transaction_id}'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\AccountRechargeApi(new GuzzleHttp\Client(),$config);
$transaction_id = "transaction_id_example"; // string | ID of transaction to retrieve

try {
    $result = $apiInstance->rechargeTransactionsByTransactionIdGet($transaction_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AccountRechargeApi->rechargeTransactionsByTransactionIdGet: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;

var configuration = new Configuration()
{
    Username = USERNAME, 
    Password = API_KEY  
};
var accountRechargeApi = new AccountRechargeApi(configuration);
var response = accountRechargeApi.RechargeTransactionsByTransactionIdGet("TRANSACTION_ID");
var api = require('./api.js');

var accountRechargeApi = new api.AccountRechargeApi("USERNAME", "API_KEY");

var transactionId = "transaction_id";

accountRechargeApi.rechargeTransactionsByTransactionIdGet(transactionId).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::AccountRechargeApi.new

transaction_id = "transaction_id" # String | ID of transaction to retrieve

begin
  # Get specific Transaction
  result = api_instance.recharge_transactions_by_transaction_id_get(transaction_id)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling AccountRechargeApi->recharge_transactions_by_transaction_id_get: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.AccountRechargeApi(clicksend_client.ApiClient(configuration))
transaction_id = 'transaction_id_example' # str | ID of transaction to retrieve

try:
    # Get specific Transaction
    api_response = api_instance.recharge_transactions_by_transaction_id_get(transaction_id)
    print(api_response)
except ApiException as e:
    print("Exception when calling AccountRechargeApi->recharge_transactions_by_transaction_id_get: %s\n" % e)
use WWW::ClickSendClient::AccountRechargeApi;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::AccountRechargeApi->new(username => $username, password => $password);

my $json_output = $api->recharge_transactions_by_transaction_id_get('transaction_id' => '1234567890');

print $json_output;
#import "CSAccountRechargeApi.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
[apiConfig setUsername:@"USERNAME"];
[apiConfig setPassword:@"PASSWORD"];

CSAccountRechargeApi *accountRechargeApiInstance = [[CSAccountRechargeApi alloc] init];
[accountRechargeApiInstance rechargeTransactionsByTransactionIdGetWithTransactionId:@"transactionID" completionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire

if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}
AccountRechargeAPI.rechargeTransactionsByTransactionIdGet(transactionId: "string") { (dataString, error) in
    guard let dataString = dataString else {
        print(error!)
        return
        }
        if let data = dataString.data(using: String.Encoding.utf8) {
            do {
            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                print(dictonary)
            } else {
                print("Cannot convert the String value to JSON")
            }
        } catch let error as NSError {
            print(error)
        }
    }
}
    Coming Soon
package ClickSend;

import ClickSend.Api.AccountRechargeApi;

public class view_specific_transaction {
  public static void main(String[] args) {
    ApiClient defaultClient = new ApiClient();
    defaultClient.setUsername("USERNAME");
    defaultClient.setPassword("API_KEY");
    AccountRechargeApi apiInstance = new AccountRechargeApi(defaultClient);
    // String | ID of transaction to retrieve
    String transactionId = "transactionId_example"; 
    try {
        String result = apiInstance.rechargeTransactionsByTransactionIdGet(transactionId);
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling AccountRechargeApi#rechargeTransactionsByTransactionIdGet");
        e.printStackTrace();
    }
  }
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "Here is your transaction.",
  "data": {
        "invoice_number": "cb726c65-1c65-47fa-aea2-3ded9ed57557",
        "amount": "20.00",
        "currency": "AUD",
        "date": 1443420196
  }
}

https://rest.clicksend.com/v3/recharge/transactions/{transaction_id}

Get specific Transaction

Parameters

Parameter In Type Required Description
transaction_id path string true ID of transaction to retrieve

Refer to Status Codes for definitions of HTTP status code responses.

Contact

Everything about creating moving and deleting contacts

Note that the fields phone_number, fax_number and email are all optional; however at least one of them must be specified, otherwise the API call will fail.

View List Contacts

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \

'https://rest.clicksend.com/v3/lists/{list_id}/contacts'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\ContactApi(new GuzzleHttp\Client(),$config);
$list_id = 185161; // int | Contact list ID
$page = 1; // int | Page number
$limit = 10; // int | Number of records per page

try {
    $result = $apiInstance->listsContactsByListIdGet($list_id, $page, $limit);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ContactApi->listsContactsByListIdGet: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;

var configuration = new Configuration()
{
    Username = USERNAME, 
    Password = API_KEY  
};
var contactApi = new ContactApi(configuration);
var response = contactApi.ListsContactsByListIdGet(LIST_ID);
var api = require('./api.js');

var contactApi = new api.ContactApi("USERNAME", "API_KEY");

var listId = 185161;
var page = 1;
var limit = 10;

contactApi.listsContactsByListIdGet(listId, page, limit).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::ContactApi.new

list_id = 56 # Integer | Contact list ID

opts = {
  page: 1,  # Integer | Page number
  limit: 10 # Integer | Number of records per page
}

begin
  # Get all contacts in a list
  result = api_instance.lists_contacts_by_list_id_get(list_id, opts)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling ContactApi->lists_contacts_by_list_id_get: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.ContactApi(clicksend_client.ApiClient(configuration))
list_id = 185161 # int | Contact list ID
page = 1 # int | Page number (optional) (default to 1)
limit = 10 # int | Number of records per page (optional) (default to 10)

try:
    # Get all contacts in a list
    api_response = api_instance.lists_contacts_by_list_id_get(list_id, page=page, limit=limit)
    print(api_response)
except ApiException as e:
    print("Exception when calling ContactApi->lists_contacts_by_list_id_get: %s\n" % e)
use WWW::ClickSendClient::ContactApi;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::ContactApi->new(username => $username, password => $password);

my $json_output = $api->lists_contacts_by_list_id_get('list_id' => '1234', page => '1', limit => '1');

print $json_output;
#import "CSContactApi.h"
#import "CSDefaultConfiguration.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
// Configure HTTP basic authorization (authentication scheme: BasicAuth)
[apiConfig setUsername:@"USERNAME"];
[apiConfig setPassword:@"PASSWORD"];

NSNumber *listId = [NSNumber numberWithInt:11];
NSNumber *page = [NSNumber numberWithInt:1];
NSNumber *limit = [NSNumber numberWithInt:15];

CSContactApi *contactApi = [[CSContactApi alloc] init];
[contactApi listsContactsByListIdGetWithListId:listId page:page limit:limit completionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire

ContactAPI.listsContactsByListIdGet(listId: 1) { (dataString, error) in
    guard let dataString = dataString else {
        print(error!)
        return
    }

    if let data = dataString.data(using: String.Encoding.utf8) {
        do {
            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                print(dictonary)
            } else {
                print("Cannot convert the String value to JSON")
            }
        } catch let error as NSError {
            print(error)
        }
    }
}
    Coming Soon
package ClickSend;

import ClickSend.Api.ContactApi;

public class view_list_contacts {
  public static void main(String[] args) {
    ApiClient defaultClient = new ApiClient();
    defaultClient.setUsername("USERNAME");
    defaultClient.setPassword("API_KEY");
    ContactApi apiInstance = new ContactApi(defaultClient);
    Integer listId = 185161; // Integer | Contact list ID
    Integer page = 1; // Integer | Page number
    Integer limit = 10; // Integer | Number of records per page
    try {
        String result = apiInstance.listsContactsByListIdGet(listId, page, limit);
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling ContactApi#listsContactsByListIdGet");
        e.printStackTrace();
    }
  }
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "Here are your data.",
  "data": {
    "total": 6,
    "per_page": 15,
    "current_page": 1,
    "last_page": 1,
    "next_page_url": null,
    "prev_page_url": null,
    "from": 1,
    "to": 6,
    "data": [
      {
        "contact_id": 552786,
        "list_id": 428,
        "phone_number": "+16783270696",
        "first_name": "Ellen",
        "last_name": "Diaz",
        "custom_1": "",
        "custom_2": "",
        "custom_3": "",
        "custom_4": "",
        "date_added": "1436157486",
        "date_updated": "1436157486",
        "fax_number": null,
        "organization_name": null,
        "email": null,
        "address_line_1": null,
        "address_line_2": null,
        "address_city": null,
        "address_state": null,
        "address_postal_code": null,
        "address_country": null,
        "_list_name": "List6eaG4lGIc9"
      },
      {
        "contact_id": 552787,
        "list_id": 428,
        "phone_number": "+16783270697",
        "first_name": "Ellen",
        "last_name": "Diaz",
        "custom_1": "",
        "custom_2": "",
        "custom_3": "",
        "custom_4": "",
        "date_added": "1436157925",
        "date_updated": "1436157925",
        "fax_number": null,
        "organization_name": null,
        "email": null,
        "address_line_1": null,
        "address_line_2": null,
        "address_city": null,
        "address_state": null,
        "address_postal_code": null,
        "address_country": null,
        "_list_name": "List6eaG4lGIc9"
      }
    ]
  }
}

https://rest.clicksend.com/v3/lists/{list_id}/contacts

Get all contacts in a list

Parameters

Parameter In Type Required Description
list_id path integer(int32) true Contact list ID
page query integer(int32) false Page number
limit query integer(int32) false Number of records per page
updated_after query integer(int32) false Get all contacts updated after a given timestamp.

Refer to Status Codes for definitions of HTTP status code responses.

Create New Contact

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
     --request POST \
     --header "Content-Type: application/json" \

     --data-binary "    {
        \"phone_number\":\"+16783270696\",
        \"first_name\":\"Ellen\",
        \"last_name\":\"Diaz\",
        \"custom_1\":\"Custom 1\",
        \"custom_2\":\"Custom 2\",
        \"custom_3\":\"Custom 3\",
        \"custom_4\":\"Custom 4\",
        \"fax_number\":\"+16783270696\",
        \"organization_name\":\"Awesome Organization\",
        \"email\":\"ellen@diaz.com\",
        \"address_line_1\":\"Block 2\",
        \"address_line_2\":\"Cool Bldg.\",
        \"address_city\":\"Nevada\",
        \"address_state\":\"Las Vegas\",
        \"address_postal_code\":\"36063\",
        \"address_country\":\"US\"
    }" \
'https://rest.clicksend.com/v3/lists/{list_id}/contacts'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\ContactApi(new GuzzleHttp\Client(),$config);
$contact = new \ClickSend\Model\Contact(); // \ClickSend\Model\Contact | Contact model
$contact->setPhoneNumber("+919876543210");
$contact->setFirstName("Ellen");
$contact->setLastName("Diaz");
$contact->setCustom1("Custom 1");
$contact->setCustom2("Custom 2");
$contact->setCustom3("Custom 3");
$contact->setCustom4("Custom 4");
$contact->setFaxNumber("+16783270696");
$contact->setOrganizationName("Awesome Organization");
$contact->setEmail("ellen@diaz.com");
$contact->setAddressLine1("Block 2");
$contact->setAddressLine2("Cool Bldg");
$contact->setAddressCity("Nevada");
$contact->setAddressState("Las Vegas");
$contact->setAddressPostalCode("36063");
$contact->setAddressCountry("US");

$list_id = 185161; // int | List id

try {
    $result = $apiInstance->listsContactsByListIdPost($contact, $list_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ContactApi->listsContactsByListIdPost: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;

var configuration = new Configuration()
{
    Username = USERNAME, 
    Password = API_KEY  
};
var contactApi = new ContactApi(configuration);
var contact = new Contact(
    phoneNumber: "+11231231234",
    email: "contact@email.com",
    faxNumber: "FAX_NUMBER",
    firstName: "John",
    lastName: "Doe",
    addressLine1: "Address Line 1",
    addressLine2: "Address Line 2",
    addressCity: "City",
    addressState: "State",
    addressPostalCode: "Postal Code",
    addressCountry: "CA",
    organizationName: "My COMPANY",
    custom1: "Custom 1",
    custom2: "Custom 2",
    custom3: "Custom 3",
    custom4: "Custom 4"
);
var response = contactApi.ListsContactsByListIdPost(contact, LIST_ID);
var api = require('./api.js');

var contactApi = new api.ContactApi("USERNAME", "API_KEY");

var contact = new api.Contact();

contact.phoneNumber = "xxx-xxx-xxxx";
contact.custom1 = "custom1";
contact.email = "xxx@gmail.com";
contact.faxNumber = "+16783270696";
contact.firstName = "firstName";
contact.addressLine1 = "addressLine1";
contact.addressLine2 = "addressLine2";
contact.addressCity = "addressCity";
contact.addressState = "addressState";
contact.addressPostalCode = "addressPostalCode";
contact.addressCountry = "country";
contact.organizationName = "organizationName";
contact.custom2 = "custom2";
contact.custom3 = "custom3";
contact.custom4 = "custom4";
contact.lastname = "lastname";

var listId = 185161;

contactApi.listsContactsByListIdPost(contact, listId).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::ContactApi.new

# Contact | Contact model
contact = ClickSendClient::Contact.new(
  "custom_1": "custom_1",
  "custom_3": "custom_3",
  "address_postal_code": "address_postal_code",
  "custom_2": "custom_2",
  "address_country": "US",
  "custom_4": "custom_4",
  "address_state": "address_state",
  "last_name": "last_name",
  "organization_name": "organization_name",
  "fax_number": "fax_number",
  "address_city": "address_city",
  "address_line_1": "address_line_1",
  "phone_number": "phone_number",
  "address_line_2": "address_line_2",
  "first_name": "first_name",
  "email": "email"
)

list_id = 56 # Integer | List id

opts = {
  page: 1,  # Integer | Page number
  limit: 10 # Integer | Number of records per page
}

begin
  # Create new contact
  result = api_instance.lists_contacts_by_list_id_post(contact, list_id, opts)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling ContactApi->lists_contacts_by_list_id_post: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.ContactApi(clicksend_client.ApiClient(configuration))
contact = clicksend_client.Contact(
          phone_number="+16783270696",
          first_name="Ellen",
          last_name="Diaz",
          custom_1="Custom 1",
          custom_2="Custom 2",
          custom_3="Custom 3",
          custom_4="Custom 4",
          fax_number="+16783270696",
          organization_name="Awesome Organization",
          email="ellen@diaz.com",
          address_line_1="Block 2",
          address_line_2="Cool Bldg.",
          address_city="Nevada",
          address_state="Las Vegas",
          address_postal_code="36063",
          address_country="US") # Contact | Contact model
list_id = 185161 # int | List id
page = 1 # int | Page number (optional) (default to 1)
limit = 10 # int | Number of records per page (optional) (default to 10)

try:
    # Create new contact
    api_response = api_instance.lists_contacts_by_list_id_post(contact, list_id, page=page, limit=limit)
    print(api_response)
except ApiException as e:
    print("Exception when calling ContactApi->lists_contacts_by_list_id_post: %s\n" % e)
use WWW::ClickSendClient::ContactApi;
use WWW::ClickSendClient::Object::Contact;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::ContactApi->new(username => $username, password => $password);

my %params = (
    'phone_number'        => '+14055555666',
    'custom_1'            => 'custom_1',
    'email'               => 'test1@test.com',
    'fax_number'          => '+61261111111',
    'first_name'          => 'first_name',
    'address_line_1'      => 'address_line_1',
    'address_line_2'      => 'address_line_2',
    'address_city'        => 'address_city',
    'address_state'       => 'address_state',
    'address_postal_code' => 'address_postal_code',
    'address_country'     => 'US',
    'organization_name'   => 'organization_name',
    'custom_2'            => 'custom_2',
    'custom_3'            => 'custom_3',
    'custom_4'            => 'custom_4',
    'last_name'           => 'last_name'
);

my $contact_obj = WWW::ClickSendClient::Object::Contact->new(%params);

my $json_output = $api->lists_contacts_by_list_id_post('contact' => $contact_obj, 'list_id' => '1234');

print $json_output;
#import "CSContactApi.h"
#import "CSDefaultConfiguration.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
// Configure HTTP basic authorization (authentication scheme: BasicAuth)
[apiConfig setUsername:@"USERNAME"];
[apiConfig setPassword:@"PASSWORD"];

NSNumber *listId = [NSNumber numberWithInt:11];
CSContact *contact = [[CSContact alloc] init];
contact.custom1 = @"custom 1";
contact.custom2 = @"custom 2";
contact.custom3 = @"custom 3";
contact.custom4 = @"custom 4";
contact.addressPostalCode = @"address_postal_code";
contact.addressCountry = @"address_country";
contact.addressState = @"address_state";
contact.lastName = @"Doe";
contact.firstName = @"John";
contact.organizationName = @"organization_name";
contact.faxNumber = @"fax_number";
contact.addressLine1 = @"address_line1";
contact.addressLine2 = @"address_line2";
contact.phoneNumber = @"phone_numner";
contact.email = @"email";

CSContactApi *contactApi = [[CSContactApi alloc] init];
[contactApi listsContactsByListIdPostWithContact:contact listId:listId completionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire

let contact = Contact(
                phoneNumber: "phone_number", 
                custom1: "custom_1", 
                email: "johndoe@gmail.com", 
                faxNumber: "fax_number", 
                firstName: "John", 
                addressLine1: "address_line1", 
                addressLine2: "address_line2", 
                addressCity: "city", 
                addressState: "state", 
                addressPostalCode: "postal_code", 
                addressCountry: "country", 
                organizationName: "org_name", 
                custom2: "custom_2", 
                custom3: "custom_3", 
                custom4: "custom_4", 
                lastName: "Doe"
            )
ContactAPI.listsContactsByListIdPost(contact: contact, listId: 11) { (dataString, error) in
    guard let dataString = dataString else {
        print(error!)
        return
    }

    if let data = dataString.data(using: String.Encoding.utf8) {
        do {
            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                print(dictonary)
            } else {
                print("Cannot convert the String value to JSON")
            }
        } catch let error as NSError {
            print(error)
        }
    }
}
    Coming Soon
package ClickSend;

import ClickSend.Api.ContactApi;
import ClickSend.Model.Contact;

public class create_new_contact {
  public static void main(String[] args) {
    ApiClient defaultClient = new ApiClient();
    defaultClient.setUsername("USERNAME");
    defaultClient.setPassword("API_KEY");
    ContactApi apiInstance = new ContactApi(defaultClient);
    Contact contact = new Contact(); // Contact | Contact model
    contact.phoneNumber("+16783270696");
    contact.custom1("custom1");
    contact.email("ellen@diaz.com");
    contact.faxNumber("+16783270696");
    contact.firstName("Ellen");
    contact.addressLine1("Block 2");
    contact.addressLine2("Cool Bldg.");
    contact.addressCity("Nevada");
    contact.addressState("Las Vegas");
    contact.addressPostalCode("36063");
    contact.addressCountry("US");
    contact.organizationName("Awesome Organization");
    contact.custom2("custom2");
    contact.custom3("custom3");
    contact.custom4("custom4");
    contact.lastName("Diaz");
    Integer listId = 185161; // Integer | List id
    try {
      String result = apiInstance.listsContactsByListIdPost(contact, listId);
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling ContactApi#listsContactsByListIdPost");
        e.printStackTrace();
    }
  }
}

Body parameter

{
  "custom_1": "custom_1",
  "custom_3": "custom_3",
  "address_postal_code": "address_postal_code",
  "custom_2": "custom_2",
  "address_country": "address_country",
  "custom_4": "custom_4",
  "address_state": "address_state",
  "last_name": "last_name",
  "organization_name": "organization_name",
  "fax_number": "fax_number",
  "address_city": "address_city",
  "address_line_1": "address_line_1",
  "phone_number": "phone_number",
  "address_line_2": "address_line_2",
  "first_name": "first_name",
  "email": "email"
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "New contact has been created.",
  "data": {
    "contact_id": 552802,
    "list_id": 428,
    "phone_number": "+16783270696",
    "first_name": "Ellen",
    "last_name": "Diaz",
    "custom_1": "Custom 1",
    "custom_2": "Custom 2",
    "custom_3": "Custom 3",
    "custom_4": "Custom 4",
    "date_added": "1436160803",
    "fax_number": "+16783270696",
    "organization_name": "Awesome Organization",
    "email": "ellen@diaz.com",
    "address_line_1": "Block 2",
    "address_line_2": "Cool Bldg.",
    "address_city": "Nevada",
    "address_state": "Las Vegas",
    "address_postal_code": "36063",
    "address_country": "US",
    "_list_name": "List6eaG4lGIc9"
  }
}

https://rest.clicksend.com/v3/lists/{list_id}/contacts

Create new contact

Parameters

Parameter In Type Required Description
list_id path integer(int32) true List id
page query integer(int32) false Page number
limit query integer(int32) false Number of records per page

Properties

Name Type Required Restrictions Description
phone_number string true none Your phone number in E.164 format. Must be provided if no fax number or email.
email string false none Your email. Must be provided if no phone number or fax number.
fax_number string false none Your fax number. Must be provided if no phone number or email.
first_name string false none Your first name.
address_line_1 string false none Your street address
address_line_2 string false none none
address_city string false none Your nearest city
address_state string false none Your current state
address_postal_code string false none Your current postcode
address_country string false none Your current country
organization_name string false none Your organisation name
custom_1 string true none none
custom_2 string false none none
custom_3 string false none none
custom_4 string false none none
last_name string false none Your last name

Refer to Status Codes for definitions of HTTP status code responses.

Get Specific Contact

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \

'https://rest.clicksend.com/v3/lists/{list_id}/contacts/{contact_id}'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\ContactApi(new GuzzleHttp\Client(),$config);
$list_id = 185161; // int | Your contact list id you want to access.
$contact_id = 57774740; // int | Your contact id you want to access.

try {
    $result = $apiInstance->listsContactsByListIdAndContactIdGet($list_id, $contact_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ContactApi->listsContactsByListIdAndContactIdGet: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;

var configuration = new Configuration()
{
    Username = USERNAME, 
    Password = API_KEY  
};
var contactApi = new ContactApi(configuration);
var response = contactApi.ListsContactsByListIdAndContactIdGet(LIST_ID, CONTACT_ID);
var api = require('./api.js');

var contactApi = new api.ContactApi("USERNAME", "API_KEY");

var listId = 185161;
var contactId = 55802886;

contactApi.listsContactsByListIdAndContactIdGet(listId, contactId).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::ContactApi.new

list_id = 56 # Integer | Your contact list id you want to access.

contact_id = 50545654 # Integer | Your contact id you want to access.

begin
  # Get a specific contact
  result = api_instance.lists_contacts_by_list_id_and_contact_id_get(list_id, contact_id)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling ContactApi->lists_contacts_by_list_id_and_contact_id_get: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.ContactApi(clicksend_client.ApiClient(configuration))
list_id = 185161 # int | Your contact list id you want to access.
contact_id = 49469760 # int | Your contact id you want to access.

try:
    # Get a specific contact
    api_response = api_instance.lists_contacts_by_list_id_and_contact_id_get(list_id, contact_id)
    print(api_response)
except ApiException as e:
    print("Exception when calling ContactApi->lists_contacts_by_list_id_and_contact_id_get: %s\n" % e)
use WWW::ClickSendClient::ContactApi;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::ContactApi->new(username => $username, password => $password);

my $json_output = $api->lists_contacts_by_list_id_and_contact_id_get('list_id' => '1234', 'contact_id' => '1');

print $json_output;
#import "CSContactApi.h"
#import "CSDefaultConfiguration.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
// Configure HTTP basic authorization (authentication scheme: BasicAuth)
[apiConfig setUsername:@"USERNAME"];
[apiConfig setPassword:@"PASSWORD"];


NSNumber *listId = [NSNumber numberWithInt:11];
NSNumber *page = [NSNumber numberWithInt:1];
NSNumber *limit = [NSNumber numberWithInt:15];

CSContactApi *contactApi = [[CSContactApi alloc] init];
[contactApi listsContactsByListIdGetWithListId:listId page:page limit:limit completionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire

ContactAPI.listsContactsByListIdGet(listId: 11, page: 1, limit: 15) { (dataString, error) in
    guard let dataString = dataString else {
        print(error!)
        return
    }

    if let data = dataString.data(using: String.Encoding.utf8) {
        do {
            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                print(dictonary)
            } else {
                print("Cannot convert the String value to JSON")
            }
        } catch let error as NSError {
            print(error)
        }
    }
}
    Coming Soon
package ClickSend;

import ClickSend.Api.ContactApi;

public class view_specific_contact {
  public static void main(String[] args) {
    ApiClient defaultClient = new ApiClient();
    defaultClient.setUsername("USERNAME");
    defaultClient.setPassword("API_KEY");
    ContactApi apiInstance = new ContactApi(defaultClient);
    Integer listId = 185161; // Integer | Your contact list id you want to access.
    Integer contactId = 52426120; // Integer | Your contact id you want to access.
    try {
        String result = apiInstance.listsContactsByListIdAndContactIdGet(listId, contactId);
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling ContactApi#listsContactsByListIdAndContactIdGet");
        e.printStackTrace();
    }
  }
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "Here are your data.",
  "data": {
    "contact_id": 552802,
    "list_id": 428,
    "phone_number": "+16783270696",
    "first_name": "Ellen",
    "last_name": "Diaz",
    "custom_1": "Custom 1",
    "custom_2": "Custom 2",
    "custom_3": "Custom 3",
    "custom_4": "Custom 4",
    "date_added": "1436160803",
    "fax_number": "+16783270696",
    "organization_name": "Awesome Organization",
    "email": "ellen@diaz.com",
    "address_line_1": "Block 2",
    "address_line_2": "Cool Bldg.",
    "address_city": "Nevada",
    "address_state": "Las Vegas",
    "address_postal_code": "36063",
    "address_country": "US",
    "_list_name": "List6eaG4lGIc9"
  }
}

https://rest.clicksend.com/v3/lists/{list_id}/contacts/{contact_id}

Get a specific contact

Parameters

Parameter In Type Required Description
list_id path integer(int32) true Your contact list id you want to access.
contact_id path integer(int32) true Your contact id you want to access.

Refer to Status Codes for definitions of HTTP status code responses.

Update Contact

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
     --request PUT \
     --header "Content-Type: application/json" \

     --data-binary "{
        \"phone_number\":\"+16783275492\",
        \"first_name\":\"Ellen\",
        \"last_name\":\"Diaz\",
        \"custom_1\":\"Custom S72oJ9Teba\",
        \"custom_2\":\"Custom NvrRJrKWeq\",
        \"custom_3\":\"Custom 2ws94p1Dop\",
        \"custom_4\":\"Custom Ku0AaIS5xb\",
        \"fax_number\":\"+16783276356\",
        \"organization_name\":\"Awesome Organization\",
        \"email\":\"ellen@diaz.com\",
        \"address_line_1\":\"Block 6\",
        \"address_line_2\":\"Cool Bldg.\",
        \"address_city\":\"Nevada\",
        \"address_state\":\"Las Vegas\",
        \"address_postal_code\":\"36063\",
        \"address_country\":\"US\"
    }" \
'https://rest.clicksend.com/v3/lists/{list_id}/contacts/{contact_id}'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\ContactApi(new GuzzleHttp\Client(),$config);
$list_id = 185161; // int | Contact list id
$contact_id = 57774740; // int | Contact ID
$contact = new \ClickSend\Model\Contact(); // \ClickSend\Model\Contact | Contact model
$contact->setPhoneNumber("+919876543210");
$contact->setFirstName("Ellen");
$contact->setLastName("Diaz");
$contact->setCustom1("Custom 1");
$contact->setCustom2("Custom 2");
$contact->setCustom3("Custom 3");
$contact->setCustom4("Custom 4");
$contact->setFaxNumber("+16783270696");
$contact->setOrganizationName("Awesome Organization");
$contact->setEmail("ellen@diaz.com");
$contact->setAddressLine1("Block 2");
$contact->setAddressLine2("Cool Bldg");
$contact->setAddressCity("Nevada");
$contact->setAddressState("Las Vegas");
$contact->setAddressPostalCode("36063");
$contact->setAddressCountry("US");

try {
    $result = $apiInstance->listsContactsByListIdAndContactIdPut($list_id, $contact_id, $contact);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ContactApi->listsContactsByListIdAndContactIdPut: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME, 
    Password = API_KEY  
};
var contactApi = new ContactApi(configuration);
var contact = new Contact(
    phoneNumber: "+11231231234",
    email: "contact@email.com",
    faxNumber: "FAX_NUMBER",
    firstName: "John",
    lastName: "Doe",
    addressLine1: "Address Line 1",
    addressLine2: "Address Line 2",
    addressCity: "City",
    addressState: "State",
    addressPostalCode: "Postal Code",
    addressCountry: "CA",
    organizationName: "My COMPANY",
    custom1: "Custom 1",
    custom2: "Custom 2",
    custom3: "Custom 3",
    custom4: "Custom 4"
);
var response = contactApi.ListsContactsByListIdAndContactIdPut(LIST_ID, CONTACT_ID, contact);
var api = require('./api.js');

var contactApi = new api.ContactApi("USERNAME", "API_KEY");

var contact = new api.Contact();

contact.phoneNumber = "+919874132560";
contact.custom1 = "custom1";
contact.email = "xxx@gmail.com";
contact.faxNumber = "+16783270696";
contact.firstName = "firstName";
contact.addressLine1 = "addressLine1";
contact.addressLine2 = "addressLine2";
contact.addressCity = "addressCity";
contact.addressState = "addressState";
contact.addressPostalCode = "addressPostalCode";
contact.addressCountry = "US";
contact.organizationName = "organizationName";
contact.custom2 = "custom2";
contact.custom3 = "custom3";
contact.custom4 = "custom4";
contact.lastname = "lastname";

var listId = 185161;
var contactId = 55802886;

contactApi.listsContactsByListIdAndContactIdPut(listId, contactId, contact).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::ContactApi.new

list_id = 56 # Integer | Your contact list id you want to access.

contact_id = 50545654 # Integer | Your contact id you want to access.

# Contact | Contact model
contact = ClickSendClient::Contact.new(
  "custom_1": "custom_1",
  "custom_3": "custom_3",
  "address_postal_code": "address_postal_code",
  "custom_2": "custom_2",
  "address_country": "US",
  "custom_4": "custom_4",
  "address_state": "address_state",
  "last_name": "last_name",
  "organization_name": "organization_name",
  "fax_number": "fax_number",
  "address_city": "address_city",
  "address_line_1": "address_line_1",
  "phone_number": "phone_number",
  "address_line_2": "address_line_2",
  "first_name": "first_name",
  "email": "email"
)

begin
  # Update specific contact
  result = api_instance.lists_contacts_by_list_id_and_contact_id_put(list_id, contact_id, contact)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling ContactApi->lists_contacts_by_list_id_and_contact_id_put: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.ContactApi(clicksend_client.ApiClient(configuration))
list_id = 185161 # int | Contact list id
contact_id = 49469760 # int | Contact ID
contact = clicksend_client.Contact(
          phone_number="+16783270696",
          first_name="Ellen updated",
          last_name="Diaz",
          custom_1="Custom 1",
          custom_2="Custom 2",
          custom_3="Custom 3",
          custom_4="Custom 4",
          fax_number="+16783270696",
          organization_name="Awesome Organization",
          email="ellen@diaz.com",
          address_line_1="Block 2",
          address_line_2="Cool Bldg.",
          address_city="Nevada",
          address_state="Las Vegas",
          address_postal_code="36063",
          address_country="US") # Contact | Contact model

try:
    # Update specific contact
    api_response = api_instance.lists_contacts_by_list_id_and_contact_id_put(list_id, contact_id, contact)
    print(api_response)
except ApiException as e:
    print("Exception when calling ContactApi->lists_contacts_by_list_id_and_contact_id_put: %s\n" % e)
use WWW::ClickSendClient::ContactApi;
use WWW::ClickSendClient::Object::Contact;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::ContactApi->new(username => $username, password => $password);

my %params = (
    'phone_number'        => '+14055555666',
    'custom_1'            => 'custom_1',
    'email'               => 'test1@test.com',
    'fax_number'          => '+61261111111',
    'first_name'          => 'first_name',
    'address_line_1'      => 'address_line_1',
    'address_line_2'      => 'address_line_2',
    'address_city'        => 'address_city',
    'address_state'       => 'address_state',
    'address_postal_code' => 'address_postal_code',
    'address_country'     => 'US',
    'organization_name'   => 'organization_name',
    'custom_2'            => 'custom_2',
    'custom_3'            => 'custom_3',
    'custom_4'            => 'custom_4',
    'last_name'           => 'last_name'
);

my $contact_obj = WWW::ClickSendClient::Object::Contact->new(%params);

my $json_output = $api->lists_contacts_by_list_id_and_contact_id_put('contact' => $contact_obj , 'list_id' => '1234', 'contact_id' => '123'); #contact_list_id

print $json_output;
#import "CSContactApi.h"
#import "CSDefaultConfiguration.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
// Configure HTTP basic authorization (authentication scheme: BasicAuth)
[apiConfig setUsername:@"USERNAME"];
[apiConfig setPassword:@"PASSWORD"];



CSContact *contact = [[CSContact alloc] init];

contact.custom1 = @"custom 1";
contact.custom2 = @"custom 2";
contact.custom3 = @"custom 3";
contact.custom4 = @"custom 4";
contact.addressPostalCode = @"address_postal_code";
contact.addressCountry = @"address_country";
contact.addressState = @"address_state";
contact.lastName = @"Doe";
contact.firstName = @"John";
contact.organizationName = @"organization_name";
contact.faxNumber = @"fax_number";
contact.addressLine1 = @"address_line1";
contact.addressLine2 = @"address_line2";
contact.phoneNumber = @"phone_numner";
contact.email = @"email";


NSNumber *listId = [NSNumber numberWithInt:11];
NSNumber *contactId = [NSNumber numberWithInt:1];

CSContactApi *contactApi = [[CSContactApi alloc] init];
[contactApi listsContactsByListIdAndContactIdPutWithListId:listId contactId:contactId contact:contact completionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire
if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}

let contact = Contact(
                phoneNumber: "phone_number", 
                custom1: "custom_1", 
                email: "johndoe@gmail.com", 
                faxNumber: "fax_number", 
                firstName: "John", 
                addressLine1: "address_line1", 
                addressLine2: "address_line2", 
                addressCity: "city", 
                addressState: "state", 
                addressPostalCode: "postal_code", 
                addressCountry: "country",
                organizationName: "org_name", 
                custom2: "custom_2", 
                custom3: "custom_3",
                custom4: "custom_4", 
                lastName: "Doe"
            )


ContactAPI.listsContactsByListIdAndContactIdPut(listId: 11, contactId: 1, contact: contact) { (dataString, error) in
    guard let dataString = dataString else {
        print(error!)
        return
    }

    if let data = dataString.data(using: String.Encoding.utf8) {
        do {
            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                print(dictonary)
            } else {
                print("Cannot convert the String value to JSON")
            }
        } catch let error as NSError {
            print(error)
        }
    }
}
    Coming Soon
package ClickSend;

import ClickSend.Api.ContactApi;
import ClickSend.Model.Contact;

public class update_contact {
  public static void main(String[] args) {
    ApiClient defaultClient = new ApiClient();
    defaultClient.setUsername("USERNAME");
    defaultClient.setPassword("API_KEY");
    ContactApi apiInstance = new ContactApi(defaultClient);
    Integer listId = 185161; // Integer | Contact list id
    Integer contactId = 53185800; // Integer | Contact ID
    Contact contact = new Contact(); // Contact | Contact model
    contact.phoneNumber("+16783270696");
    contact.custom1("custom1");
    contact.email("ellen@diaz.com");
    contact.faxNumber("+16783270696");
    contact.firstName("Ellen");
    contact.addressLine1("Block 2");
    contact.addressLine2("Cool Bldg.");
    contact.addressCity("Nevada");
    contact.addressState("Las Vegas");
    contact.addressPostalCode("36063");
    contact.addressCountry("US");
    contact.organizationName("Awesome Organization");
    contact.custom2("custom2");
    contact.custom3("custom3");
    contact.custom4("custom4");
    contact.lastName("Diaz");
    try {
        String result = apiInstance.listsContactsByListIdAndContactIdPut(listId, contactId, contact);
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling ContactApi#listsContactsByListIdAndContactIdPut");
        e.printStackTrace();
    }
  }
}

Body parameter

{
  "custom_1": "custom_1",
  "custom_3": "custom_3",
  "address_postal_code": "address_postal_code",
  "custom_2": "custom_2",
  "address_country": "address_country",
  "custom_4": "custom_4",
  "address_state": "address_state",
  "last_name": "last_name",
  "organization_name": "organization_name",
  "fax_number": "fax_number",
  "address_city": "address_city",
  "address_line_1": "address_line_1",
  "phone_number": "phone_number",
  "address_line_2": "address_line_2",
  "first_name": "first_name",
  "email": "email"
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "Contact #552807 has been updated.",
  "data": {
    "contact_id": 552807,
    "list_id": 428,
    "phone_number": "+16783275492",
    "first_name": "Ellen",
    "last_name": "Diaz",
    "custom_1": "Custom S72oJ9Teba",
    "custom_2": "Custom NvrRJrKWeq",
    "custom_3": "Custom 2ws94p1Dop",
    "custom_4": "Custom Ku0AaIS5xb",
    "date_added": "1436161955",
    "fax_number": "+16783276356",
    "organization_name": "Awesome Organization",
    "email": "ellen@diaz.com",
    "address_line_1": "Block 6",
    "address_line_2": "Cool Bldg.",
    "address_city": "Nevada",
    "address_state": "Las Vegas",
    "address_postal_code": "36063",
    "address_country": "US",
    "_list_name": "List6eaG4lGIc9"
  }
}

https://rest.clicksend.com/v3/lists/{list_id}/contacts/{contact_id}

Update specific contact

Parameters

Parameter In Type Required Description
list_id path integer(int32) true Contact list id
contact_id path integer(int32) true Contact ID

Properties

Name Type Required Restrictions Description
phone_number string true none Your phone number in E.164 format. Must be provided if no fax number or email.
email string false none Your email. Must be provided if no phone number or fax number.
fax_number string false none Your fax number. Must be provided if no phone number or email.
first_name string false none Your first name.
address_line_1 string false none Your street address
address_line_2 string false none none
address_city string false none Your nearest city
address_state string false none Your current state
address_postal_code string false none Your current postcode
address_country string false none Your current country
organization_name string false none Your organisation name
custom_1 string true none none
custom_2 string false none none
custom_3 string false none none
custom_4 string false none none
last_name string false none Your last name

Refer to Status Codes for definitions of HTTP status code responses.

Copy Contact to List

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
     --request PUT \
'https://rest.clicksend.com/v3/lists/{from_list_id}/contacts/{contact_id}/copy/{to_list_id}'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\ContactApi(new GuzzleHttp\Client(),$config);
$from_list_id = 185161; // int | List ID for list that contains contact.
$contact_id = 57775238; // int | Contact ID
$to_list_id = 204805; // int | List ID for list you want to copy contact to.

try {
    $result = $apiInstance->listsCopyContactPut($from_list_id, $contact_id, $to_list_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ContactApi->listsCopyContactPut: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME, 
    Password = API_KEY  
};
var contactApi = new ContactApi(configuration);
var response = contactApi.ListsCopyContactPut(FROM_LIST_ID, CONTACT_ID, TO_LIST_ID);
var api = require('./api.js');

var contactApi = new api.ContactApi("USERNAME", "API_KEY");

var fromListId = 185161;
var contactId = 56049576;
var toListId = 204805;

contactApi.listsCopyContactPut(fromListId, contactId, toListId).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::ContactApi.new

from_list_id = 812418 # Integer | List ID for list that contains contact.

contact_id = 52817364 # Integer | Contact ID

to_list_id = 418208   # Integer | List ID for list you want to copy contact to.

begin
  # Copy contact to another list
  result = api_instance.lists_copy_contact_put(from_list_id, contact_id, to_list_id)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling ContactApi->lists_copy_contact_put: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.ContactApi(clicksend_client.ApiClient(configuration))
from_list_id = 185161 # int | List ID for list that contains contact.
contact_id = 53207376 # int | Contact ID
to_list_id = 192668 # int | List ID for list you want to copy contact to.

try:
    # Copy contact to another list
    api_response = api_instance.lists_copy_contact_put(from_list_id, contact_id, to_list_id)
    print(api_response)
except ApiException as e:
    print("Exception when calling ContactApi->lists_copy_contact_put: %s\n" % e)
use WWW::ClickSendClient::ContactApi;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::ContactApi->new(username => $username, password => $password);

my $json_output = api->lists_copy_contact_put('from_list_id' => '1234', 'contact_id' => '123',to_list_id => '1236');

print $json_output;
CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
[apiConfig setUsername:@"USERNAME"];
[apiConfig setPassword:@"PASSWORD"];

NSNumber *fromListId = [[NSNumber alloc] initWithInt:1];
NSNumber *contactId = [[NSNumber alloc] initWithInt:1];
NSNumber *toListId = [[NSNumber alloc] initWithInt:1];

CSContactApi *contactApiInstance = [[CSContactApi alloc] init];
[contactApiInstance listsCopyContactPutWithFromListId:fromListId contactId:contactId toListId:toListId completionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}

ContactAPI.listsCopyContactPut(fromListId: 1, contactId: 1, toListId: 1) { (dataString, error) in
    guard let dataString = dataString else {
        print(error!)
        return
    }
    if let data = dataString.data(using: String.Encoding.utf8) {
        do {
            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                print(dictonary)
            } else {
                print("Cannot convert the String value to JSON")
            }
        } catch let error as NSError {
            print(error)
        }
    }
}
    Coming Soon
package ClickSend;

import ClickSend.Api.ContactApi;

public class copy_contact_to_list {
  public static void main(String[] args) {
    ApiClient defaultClient = new ApiClient();
    defaultClient.setUsername("USERNAME");
    defaultClient.setPassword("API_KEY");
    ContactApi apiInstance = new ContactApi(defaultClient);
    Integer fromListId = 185161; // Integer | List ID for list that contains contact.
    Integer contactId = 53394157; // Integer | Contact ID
    Integer toListId = 192668; // Integer | List ID for list you want to copy contact to.
    try {
        String result = apiInstance.listsCopyContactPut(fromListId, contactId, toListId);
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling ContactApi#listsCopyContactPut");
        e.printStackTrace();
    }
  }
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "Contact #1 has been copied to List #429",
  "data": {
    "contact_id": 1,
    "list_id": 429,
    "phone_number": "+61477141888",
    "first_name": "John",
    "last_name": "Doe",
    "custom_1": "Custom 1",
    "custom_2": "Custom 2",
    "custom_3": "Custom 3",
    "custom_4": "Custom 4",
    "date_added": "1456721694",
    "fax_number": "+61477141888",
    "organization_name": "Awesome Company",
    "email": "john@doe.com",
    "address_line_1": "1554 Buffalo Creek Road",
    "address_line_2": null,
    "address_city": "Nashville",
    "address_state": "TN",
    "address_postal_code": "37214",
    "address_country": "US",
    "_list_name": "List6eaG4lGIc9"
  }
}

https://rest.clicksend.com/v3/lists/{from_list_id}/contacts/{contact_id}/copy/{to_list_id}

Copy contact to another list

Copy contact to another list

Parameters

Parameter In Type Required Description
from_list_id path integer(int32) true List ID for list that contains contact.
contact_id path integer(int32) true Contact ID
to_list_id path integer(int32) true List ID for list you want to copy contact to.

Refer to Status Codes for definitions of HTTP status code responses.

Transfer Contact to List

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
     --request PUT \
'https://rest.clicksend.com/v3/lists/{from_list_id}/contacts/{contact_id}/transfer/{to_list_id}'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\ContactApi(new GuzzleHttp\Client(),$config);
$from_list_id = 185161; // int | List ID for list that contains contact.
$contact_id = 57775238; // int | Contact ID
$to_list_id = 204805; // int | List ID for list you want to transfer contact to.

try {
    $result = $apiInstance->listsTransferContactPut($from_list_id, $contact_id, $to_list_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ContactApi->listsTransferContactPut: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME, 
    Password = API_KEY  
};
var contactApi = new ContactApi(configuration);
var response = contactApi.ListsTransferContactPut(FROM_LIST_ID, CONTACT_ID, TO_LIST_ID);
var api = require('./api.js');

var contactApi = new api.ContactApi("USERNAME", "API_KEY");

var fromListId = 185161;
var contactId = 56049576;
var toListId = 204805;

contactApi.listsTransferContactPut(fromListId, contactId, toListId).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::ContactApi.new

from_list_id = 812418 # Integer | List ID for list that contains contact.

contact_id = 52817364 # Integer | Contact ID

to_list_id = 418208   # Integer | List ID for list you want to transfer contact to.

begin
  # Transfer contact to another list
  result = api_instance.lists_transfer_contact_put(from_list_id, contact_id, to_list_id)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling ContactApi->lists_transfer_contact_put: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.ContactApi(clicksend_client.ApiClient(configuration))
from_list_id = 185161 # int | List ID for list that contains contact.
contact_id = 53207376 # int | Contact ID
to_list_id = 192668 # int | List ID for list you want to transfer contact to.

try:
    # Transfer contact to another list
    api_response = api_instance.lists_transfer_contact_put(from_list_id, contact_id, to_list_id)
    print(api_response)
except ApiException as e:
    print("Exception when calling ContactApi->lists_transfer_contact_put: %s\n" % e)
use WWW::ClickSendClient::ContactApi;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::ContactApi->new(username => $username, password => $password);

my $json_output = api->lists_transfer_contact_put('from_list_id' => '1234', 'contact_id' => '123',to_list_id => '1236');

print $json_output;
CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
[apiConfig setUsername:@"USERNAME"];
[apiConfig setPassword:@"PASSWORD"];

NSNumber *fromListId = [[NSNumber alloc] initWithInt:1];
NSNumber *contactId = [[NSNumber alloc] initWithInt:1];
NSNumber *toListId = [[NSNumber alloc] initWithInt:1];

CSContactApi *contactApiInstance = [[CSContactApi alloc] init];
[contactApiInstance listsTransferContactPutWithFromListId:fromListId contactId:contactId toListId:toListId completionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}

ContactAPI.listsTransferContactPut(fromListId: 1, contactId: 1, toListId: 1) { (dataString, error) in
    guard let dataString = dataString else {
        print(error!)
        return
    }
    if let data = dataString.data(using: String.Encoding.utf8) {
        do {
            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                print(dictonary)
            } else {
                print("Cannot convert the String value to JSON")
            }
        } catch let error as NSError {
            print(error)
        }
    }
}
    Coming Soon
package ClickSend;

import ClickSend.Api.ContactApi;

public class transfer_contact_to_list {
  public static void main(String[] args) {
    ApiClient defaultClient = new ApiClient();
    defaultClient.setUsername("USERNAME");
    defaultClient.setPassword("API_KEY");
    ContactApi apiInstance = new ContactApi(defaultClient);
    Integer fromListId = 185161; // Integer | List ID for list that contains contact.
    Integer contactId = 53394157; // Integer | Contact ID
    Integer toListId = 192668; // Integer | List ID for list you want to transfer contact to.
    try {
        String result = apiInstance.listsTransferContactPut(fromListId, contactId, toListId);
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling ContactApi#listsTransferContactPut");
        e.printStackTrace();
    }
  }
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "Contact #1 has been transferred to List #429",
  "data": {
    "contact_id": 1,
    "list_id": 429,
    "phone_number": "+61477141888",
    "first_name": "John",
    "last_name": "Doe",
    "custom_1": "Custom 1",
    "custom_2": "Custom 2",
    "custom_3": "Custom 3",
    "custom_4": "Custom 4",
    "date_added": "1456721694",
    "fax_number": "+61477141888",
    "organization_name": "Awesome Company",
    "email": "john@doe.com",
    "address_line_1": "1554 Buffalo Creek Road",
    "address_line_2": null,
    "address_city": "Nashville",
    "address_state": "TN",
    "address_postal_code": "37214",
    "address_country": "US",
    "_list_name": "List6eaG4lGIc9"
  }
}

https://rest.clicksend.com/v3/lists/{from_list_id}/contacts/{contact_id}/transfer/{to_list_id}

Transfer contact to another list

Transfer contact to another list

Parameters

Parameter In Type Required Description
from_list_id path integer(int32) true List ID for list that contains contact.
contact_id path integer(int32) true Contact ID
to_list_id path integer(int32) true List ID for list you want to transfer contact to.

Refer to Status Codes for definitions of HTTP status code responses.

Delete Contact

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
     --request DELETE \

'https://rest.clicksend.com/v3/lists/{list_id}/contacts/{contact_id}'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\ContactApi(new GuzzleHttp\Client(),$config);
$list_id = 185161; // int | List ID
$contact_id = 57774740; // int | Contact ID

try {
    $result = $apiInstance->listsContactsByListIdAndContactIdDelete($list_id, $contact_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ContactApi->listsContactsByListIdAndContactIdDelete: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME, 
    Password = API_KEY  
};
var contactApi = new ContactApi(configuration);
var response = contactApi.ListsContactsByListIdAndContactIdDelete(LIST_ID, CONTACT_ID);
var api = require('./api.js');

var contactApi = new api.ContactApi("USERNAME", "API_KEY");

var listId = 185161;
var contactId = 55802886;

contactApi.listsContactsByListIdAndContactIdDelete(listId, contactId).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::ContactApi.new

list_id = 56 # Integer | Contact list id

contact_id = 50545654 # Integer | Contact ID

begin
  # Delete a contact
  result = api_instance.lists_contacts_by_list_id_and_contact_id_delete(list_id, contact_id)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling ContactApi->lists_contacts_by_list_id_and_contact_id_delete: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.ContactApi(clicksend_client.ApiClient(configuration))
list_id = 185161 # int | List ID
contact_id = 50965958 # int | Contact ID

try:
    # Delete a contact
    api_response = api_instance.lists_contacts_by_list_id_and_contact_id_delete(list_id, contact_id)
    print(api_response)
except ApiException as e:
    print("Exception when calling ContactApi->lists_contacts_by_list_id_and_contact_id_delete: %s\n" % e)
use WWW::ClickSendClient::ContactApi;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::ContactApi->new(username => $username, password => $password);

my $json_output = $api->lists_contacts_by_list_id_and_contact_id_delete('list_id' => '1234', 'contact_id' => '123');

print $json_output;
#import "CSContactApi.h"
#import "CSDefaultConfiguration.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
// Configure HTTP basic authorization (authentication scheme: BasicAuth)
[apiConfig setUsername:@"USERNAME"];
[apiConfig setPassword:@"PASSWORD"];


NSNumber *listId = [NSNumber numberWithInt:11];
NSNumber *contactId = [NSNumber numberWithInt:1];

CSContactApi *contactApi = [[CSContactApi alloc] init];
[contactApi listsContactsByListIdAndContactIdDeleteWithListId:listId contactId:contactId completionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire
if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}

ContactAPI.listsContactsByListIdAndContactIdDelete(listId: 1, contactId: 11) { (dataString, error) in
    guard let dataString = dataString else {
        print(error!)
        return
    }

    if let data = dataString.data(using: String.Encoding.utf8) {
        do {
            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                print(dictonary)
            } else {
                print("Cannot convert the String value to JSON")
            }
        } catch let error as NSError {
            print(error)
        }
    }
}
    Coming Soon
package ClickSend;

import ClickSend.Api.ContactApi;

public class delete_contact {
  public static void main(String[] args) {
    ApiClient defaultClient = new ApiClient();
    defaultClient.setUsername("USERNAME");
    defaultClient.setPassword("API_KEY");
    ContactApi apiInstance = new ContactApi(defaultClient);
    Integer listId = 185161; // Integer | List ID
    Integer contactId = 52649412; // Integer | Contact ID
    try {
        String result = apiInstance.listsContactsByListIdAndContactIdDelete(listId, contactId);
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling ContactApi#listsContactsByListIdAndContactIdDelete");
        e.printStackTrace();
    }
  }
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "Contact #552807 has been deleted.",
  "data": []
}

https://rest.clicksend.com/v3/lists/{list_id}/contacts/{contact_id}

Delete a contact

Parameters

Parameter In Type Required Description
list_id path integer(int32) true List ID
contact_id path integer(int32) true Contact ID

Refer to Status Codes for definitions of HTTP status code responses.

Remove Opted Out Contacts

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
     --request PUT \

'https://rest.clicksend.com/v3/lists/{list_id}/remove-opted-out-contacts/{opt_out_list_id}'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\ContactApi(new GuzzleHttp\Client(),$config);
$list_id = 201745; // int | Your list id
$opt_out_list_id = 185161; // int | Your opt out list id

try {
    $result = $apiInstance->listsRemoveOptedOutContactsByListIdAndOptOutListIdPut($list_id, $opt_out_list_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ContactApi->listsRemoveOptedOutContactsByListIdAndOptOutListIdPut: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME, 
    Password = API_KEY  
};
var contactApi = new ContactApi(configuration);
var response = contactApi.ListsRemoveOptedOutContactsByListIdAndOptOutListIdPut(LIST_ID,OPT_OUT_LIST_ID);
var api = require('./api.js');

var contactApi = new api.ContactApi("USERNAME", "API_KEY");

var listId = 196826;
var optOutListId = 185161;

contactApi.listsRemoveOptedOutContactsByListIdAndOptOutListIdPut(listId, optOutListId).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::ContactApi.new

list_id = 56 # Integer | Your list id

opt_out_list_id = 55 # Integer | Your opt out list id

begin
  # Remove all opted out contacts
  result = api_instance.lists_remove_opted_out_contacts_by_list_id_and_opt_out_list_id_put(list_id, opt_out_list_id)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling ContactApi->lists_remove_opted_out_contacts_by_list_id_and_opt_out_list_id_put: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.ContactApi(clicksend_client.ApiClient(configuration))
list_id = 185161 # int | Your list id
opt_out_list_id = 185162 # int | Your opt out list id

try:
    # Remove all opted out contacts
    api_response = api_instance.lists_remove_opted_out_contacts_by_list_id_and_opt_out_list_id_put(list_id, opt_out_list_id)
    print(api_response)
except ApiException as e:
    print("Exception when calling ContactApi->lists_remove_opted_out_contacts_by_list_id_and_opt_out_list_id_put: %s\n" % e)
use WWW::ClickSendClient::ContactApi;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::ContactApi->new(username => $username, password => $password);

my $json_output = api->lists_remove_opted_out_contacts_by_list_id_and_opt_out_list_id_put('list_id' => '1234', 'opt_out_list_id' => '123');

print $json_output;
#import "CSContactApi.h"
#import "CSDefaultConfiguration.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
// Configure HTTP basic authorization (authentication scheme: BasicAuth)
[apiConfig setUsername:@"USERNAME"];
[apiConfig setPassword:@"PASSWORD"];


NSNumber *listId = [NSNumber numberWithInt:11];
NSNumber *optOutListId = [NSNumber numberWithInt:1];

CSContactApi *contactApi = [[CSContactApi alloc] init];
[contactApi listsRemoveOptedOutContactsByListIdAndOptOutListIdPutWithListId:listId optOutListId:optOutListId completionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire
if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}

ContactAPI.listsRemoveOptedOutContactsByListIdAndOptOutListIdPut(listId: 1, optOutListId: 11) { (dataString, error) in
    guard let dataString = dataString else {
        print(error!)
        return
    }

    if let data = dataString.data(using: String.Encoding.utf8) {
        do {
            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                print(dictonary)
            } else {
                print("Cannot convert the String value to JSON")
            }
        } catch let error as NSError {
            print(error)
        }
    }
}
    Coming Soon
package ClickSend;

import ClickSend.Api.ContactApi;

public class remove_opted_contact {
  public static void main(String[] args) {
    ApiClient defaultClient = new ApiClient();
    defaultClient.setUsername("USERNAME");
    defaultClient.setPassword("API_KEY");
    ContactApi apiInstance = new ContactApi(defaultClient);
    Integer listId = 185161; // Integer | Your list id
    Integer optOutListId = 192668; // Integer | Your opt out list id
    try {
        String result = apiInstance.listsRemoveOptedOutContactsByListIdAndOptOutListIdPut(listId, optOutListId);
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling ContactApi#listsRemoveOptedOutContactsByListIdAndOptOutListIdPut");
        e.printStackTrace();
    }
  }
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "Optout contacts has been deleted.",
  "data": {
    "deleted": 6
  }
}

https://rest.clicksend.com/v3/lists/{list_id}/remove-opted-out-contacts/{opt_out_list_id}

Remove all opted out contacts

Parameters

Parameter In Type Required Description
list_id path integer(int32) true Your list id
opt_out_list_id path integer(int32) true Your opt out list id

Refer to Status Codes for definitions of HTTP status code responses.

Contact List

Everything about creating and manipulating contact lists

View Lists

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \

'https://rest.clicksend.com/v3/lists'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\ContactListApi(new GuzzleHttp\Client(),$config);
$page = 1; // int | Page number
$limit = 10; // int | Number of records per page

try {
    $result = $apiInstance->listsGet($page, $limit);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ContactListApi->listsGet: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME, 
    Password = API_KEY  
};
var contactListApi = new ContactListApi(configuration);
var response = contactListApi.ListsGet();
var api = require('./api.js');

var contactListApi = new api.ContactListApi("USERNAME", "API_KEY");

var page = 1;
var limit = 10;

contactListApi.listsGet(page, limit).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::ContactListApi.new

opts = {
  page: 1,  # Integer | Page number
  limit: 10 # Integer | Number of records per page
}

begin
  # Get all contact lists
  result = api_instance.lists_get(opts)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling ContactListApi->lists_get: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.ContactListApi(clicksend_client.ApiClient(configuration))
page = 1 # int | Page number (optional) (default to 1)
limit = 10 # int | Number of records per page (optional) (default to 10)

try:
    # Get all contact lists
    api_response = api_instance.lists_get(page=page, limit=limit)
    print(api_response)
except ApiException as e:
    print("Exception when calling ContactListApi->lists_get: %s\n" % e)
use WWW::ClickSendClient::ContactListApi;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::ContactListApi->new(username => $username, password => $password);

my $json_output = $api->lists_get('page' => '1', 'limit' => '10');

print $json_output;
#import "CSContactListApi.h"
#import "CSDefaultConfiguration.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
[apiConfig setUsername:@"USERNAME"];
[apiConfig setPassword:@"PASSWORD"];

NSNumber *page = [[NSNumber alloc] initWithInt:1];
NSNumber *limit = [[NSNumber alloc] initWithInt:1];

CSContactListApi *contactListApiInstance = [[CSContactListApi alloc] init];
[contactListApiInstance listsGetWithPage:page limit:limit completionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire

if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}

ContactListAPI.listsGet(page: 1, limit: 15) { (dataString, error) in
    guard let dataString = dataString else {
        print(error!)
        return
    }
    if let data = dataString.data(using: String.Encoding.utf8) {
        do {
            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                print(dictonary)
            } else {
                print("Cannot convert the String value to JSON")
            }
        } catch let error as NSError {
            print(error)
        }
    }
}
    Coming Soon
package ClickSend;

import ClickSend.Api.ContactListApi;

public class view_lists {
  public static void main(String[] args) {
    ApiClient defaultClient = new ApiClient();
    defaultClient.setUsername("USERNAME");
    defaultClient.setPassword("API_KEY");
    ContactListApi apiInstance = new ContactListApi(defaultClient);
    Integer page = 1; // Integer | Page number
    Integer limit = 10; // Integer | Number of records per page
    try {
        String result = apiInstance.listsGet(page, limit);
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling ContactListApi#listsGet");
        e.printStackTrace();
    }
  }
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "Here are your data.",
  "data": {
    "total": 9,
    "per_page": 15,
    "current_page": 1,
    "last_page": 1,
    "next_page_url": null,
    "prev_page_url": null,
    "from": 1,
    "to": 9,
    "data": [
      {
        "list_id": 428,
        "list_name": "List-reFSsJkvRC",
        "list_email_id": "GHPAJCCVGMTD9BLA",
        "_contacts_count": 0
      },
      {
        "list_id": 429,
        "list_name": "List6eaG4lGIc9",
        "list_email_id": "IIEXAR72O9UAZ7WW",
        "_contacts_count": 0
      }
    ]
  }
}

https://rest.clicksend.com/v3/lists

Get all contact lists

Parameters

Parameter In Type Required Description
page query integer(int32) false Page number
limit query integer(int32) false Number of records per page

Refer to Status Codes for definitions of HTTP status code responses.

Create List

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
     --request POST \
     --header "Content-Type: application/json" \

     --data-binary "    {
        \"list_name\":\"ListCT3QrVL4od\"
    }" \
'https://rest.clicksend.com/v3/lists'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\ContactListApi(new GuzzleHttp\Client(),$config);
$contact_list = new \ClickSend\Model\ContactList(); // \ClickSend\Model\ContactList | Contact list model
$contact_list->setListName("new contact list");

try {
    $result = $apiInstance->listsPost($contact_list);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ContactListApi->listsPost: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME, 
    Password = API_KEY  
};
var contactListApi = new ContactListApi(configuration);
var response = contactListApi.ListsPost(new List() { ListName = "Name" });
var api = require('./api.js');

var contactListApi = new api.ContactListApi("USERNAME", "API_KEY");

var contactList = new api.ContactList();

contactList.listName = "list_name";

contactListApi.listsPost(contactList).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::ContactListApi.new

# List | List model
list = ClickSendClient::List.new("list_name": "ListCT3QrVL4od")

begin
  # Create new contact list
  result = api_instance.lists_post(list)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling ContactListApi->lists_post: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.ContactListApi(clicksend_client.ApiClient(configuration))
list = clicksend_client.List(list_name="new list") # List | List model

try:
    # Create new contact list
    api_response = api_instance.lists_post(list)
    print(api_response)
except ApiException as e:
    print("Exception when calling ContactListApi->lists_post: %s\n" % e)
use WWW::ClickSendClient::ContactListApi;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::ContactListApi->new(username => $username, password => $password);

my $json_output = $api->lists_post('list_name' => 'test_list');

print $json_output;
#import "CSContactListApi.h"
#import "CSDefaultConfiguration.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
// Configure HTTP basic authorization (authentication scheme: BasicAuth)
[apiConfig setUsername:@"USERNAME"];
[apiConfig setPassword:@"PASSWORD"];


CSContactList *contactList = [[CSContactList alloc] init];
contactList.listName = @"list_name";

CSContactListApi *contactListApi = [[CSContactListApi alloc] init];
[contactListApi listsPostWithContactList:contactList completionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire

if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}

let contactList = ContactList(listName: "list_name")
ContactListAPI.listsPost(contactList: contactList) { (dataString, error) in
    guard let dataString = dataString else {
        print(error!)
        return
    }

    if let data = dataString.data(using: String.Encoding.utf8) {
        do {
            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                print(dictonary)
            } else {
                print("Cannot convert the String value to JSON")
            }
        } catch let error as NSError {
            print(error)
        }
    }
}
    Coming Soon
package ClickSend;

import ClickSend.Api.ContactListApi;
import ClickSend.Model.ContactList;

public class create_list {
  public static void main(String[] args) {
    ApiClient defaultClient = new ApiClient();
    defaultClient.setUsername("USERNAME");
    defaultClient.setPassword("API_KEY");
    ContactListApi apiInstance = new ContactListApi(defaultClient);
    ContactList contactList = new ContactList(); // ContactList | Contact list model
    contactList.listName("new_list");
    try {
        String result = apiInstance.listsPost(contactList);
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling ContactListApi#listsPost");
        e.printStackTrace();
    }
  }
}

Body parameter

{
  "list_name":"ListCT3QrVL4od"
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "New list has been created.",
  "data": {
    "list_id": 437,
    "list_name": "ListCT3QrVL4od",
    "list_email_id": "KB0LHD6WXFVHZWTR",
    "_contacts_count": 0
  }
}

https://rest.clicksend.com/v3/lists

Create new contact list

Parameters

Parameter In Type Required Description
list_name body string true Your contact list name

Refer to Status Codes for definitions of HTTP status code responses.

View Specific List

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \

'https://rest.clicksend.com/v3/lists/{list_id}'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\ContactListApi(new GuzzleHttp\Client(),$config);
$list_id = 185161; // int | List ID

try {
    $result = $apiInstance->listsByListIdGet($list_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ContactListApi->listsByListIdGet: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME, 
    Password = API_KEY  
};
var contactListApi = new ContactListApi(configuration);
var response = contactListApi.ListsByListIdGet(LIST_ID);
var api = require('./api.js');

var contactListApi = new api.ContactListApi("USERNAME", "API_KEY");

var listId = 185161;

contactListApi.listsByListIdGet(listId).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::ContactListApi.new

list_id = 56 # Integer | List ID

begin
  # Get specific contact list
  result = api_instance.lists_by_list_id_get(list_id)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling ContactListApi->lists_by_list_id_get: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.ContactListApi(clicksend_client.ApiClient(configuration))
list_id = 185160 # int | List ID

try:
    # Get specific contact list
    api_response = api_instance.lists_by_list_id_get(list_id)
    print(api_response)
except ApiException as e:
    print("Exception when calling ContactListApi->lists_by_list_id_get: %s\n" % e)
use WWW::ClickSendClient::ContactListApi;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::ContactListApi->new(username => $username, password => $password);

my $json_output = $api->lists_by_list_id_get('list_id' => '12345');

print $json_output;
#import "CSContactListApi.h"
#import "CSDefaultConfiguration.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
// Configure HTTP basic authorization (authentication scheme: BasicAuth)
[apiConfig setUsername:@"USERNAME"];
[apiConfig setPassword:@"PASSWORD"];

NSNumber *listId = [NSNumber numberWithInt:1];
CSContactListApi *contactListApi = [[CSContactListApi alloc] init];

[contactListApi listsByListIdGetWithListId:listId completionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire
if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}

ContactListAPI.listsByListIdGet(listId: 1) { (dataString, error) in
    guard let dataString = dataString else {
        print(error!)
        return
    }

    if let data = dataString.data(using: String.Encoding.utf8) {
        do {
            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                print(dictonary)
            } else {
                print("Cannot convert the String value to JSON")
            }
        } catch let error as NSError {
            print(error)
        }
    }
}
    Coming Soon
package ClickSend;

import ClickSend.Api.ContactListApi;

public class view_specific_list {
  public static void main(String[] args) {
    ApiClient defaultClient = new ApiClient();
    defaultClient.setUsername("USERNAME");
    defaultClient.setPassword("API_KEY");
    ContactListApi apiInstance = new ContactListApi(defaultClient);
    Integer listId = 185161; // Integer | List ID
    try {
        String result = apiInstance.listsByListIdGet(listId);
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling ContactListApi#listsByListIdGet");
        e.printStackTrace();
    }
  }
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "Here are your data.",
  "data": {
    "list_id": 437,
    "list_name": "ListCT3QrVL4od",
    "list_email_id": "KB0LHD6WXFVHZWTR",
    "_contacts_count": 0
  }
}

https://rest.clicksend.com/v3/lists/{list_id}

Get specific contact list

Parameters

Parameter In Type Required Description
list_id path integer(int32) true List ID

Refer to Status Codes for definitions of HTTP status code responses.

Update List

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
     --request PUT \
     --header "Content-Type: application/json" \

     --data-binary "    {
        \"list_name\":\"ListlPJf33ksjP\"
    }" \
'https://rest.clicksend.com/v3/lists/{list_id}'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\ContactListApi(new GuzzleHttp\Client(),$config);
$list_id = 185161; // int | Your list id
$contact_list = new \ClickSend\Model\ContactList(); // \ClickSend\Model\ContactList | Contact list model
$contact_list->setListName("new contact list");

try {
    $result = $apiInstance->listsByListIdPut($list_id, $contact_list);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ContactListApi->listsByListIdPut: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME, 
    Password = API_KEY  
};
var contactListApi = new ContactListApi(configuration);
var response = contactListApi.ListsByListIdPut(LIST_ID, new List() { ListName = "Name" });
var api = require('./api.js');

var contactListApi = new api.ContactListApi("USERNAME", "API_KEY");

var contactList = new api.ContactList();

contactList.listName = "list";

var listId = 185161;

contactListApi.listsByListIdPut(listId, contactList).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::ContactListApi.new

list_id = 56 # Integer | Your list id

# List | List model
list = ClickSendClient::List.new("list_name": "ListlPJf33ksjP")

begin
  # Update specific contact list
  result = api_instance.lists_by_list_id_put(list_id, list)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling ContactListApi->lists_by_list_id_put: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.ContactListApi(clicksend_client.ApiClient(configuration))
list_id = 185160 # int | Your list id
list_name = 'updated_list' # str | Your new list name

try:
    # Update specific contact list
    api_response = api_instance.lists_by_list_id_put(list_id, list_name)
    print(api_response)
except ApiException as e:
    print("Exception when calling ContactListApi->lists_by_list_id_put: %s\n" % e)
use WWW::ClickSendClient::ContactListApi;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::ContactListApi->new(username => $username, password => $password);

my $json_output = $api->lists_by_list_id_put('list_id' => '12345', 'list_name' => 'test list name');

print $json_output;
#import "CSContactListApi.h"
#import "CSDefaultConfiguration.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
// Configure HTTP basic authorization (authentication scheme: BasicAuth)
[apiConfig setUsername:@"USERNAME"];
[apiConfig setPassword:@"PASSWORD"];

NSNumber *listId = [NSNumber numberWithInt:1];
CSContactList *contactList =  [[CSContactList alloc] init];
contactList.listName = @"list_name";

CSContactListApi *contactListApi = [[CSContactListApi alloc] init];

[contactListApi listsByListIdPutWithListId:listId contactList:contactList completionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire
if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}

let contactList = ContactList(listName: "list_name")
ContactListAPI.listsByListIdPut(listId: 1, contactList: contactList) { (dataString, error) in
    guard let dataString = dataString else {
        print(error!)
        return
    }

    if let data = dataString.data(using: String.Encoding.utf8) {
        do {
            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                print(dictonary)
            } else {
                print("Cannot convert the String value to JSON")
            }
        } catch let error as NSError {
            print(error)
        }
    }
}
    Coming Soon
package ClickSend;

import ClickSend.Api.ContactListApi;
import ClickSend.Model.ContactList;

public class update_list {
  public static void main(String[] args) {
    ApiClient defaultClient = new ApiClient();
    defaultClient.setUsername("USERNAME");
    defaultClient.setPassword("API_KEY");
    ContactListApi apiInstance = new ContactListApi(defaultClient);
    Integer listId = 199237; // Integer | Your list id
    ContactList contactList = new ContactList(); // ContactList | Contact list model
    contactList.listName("updated_list");
    try {
        String result = apiInstance.listsByListIdPut(listId, contactList);
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling ContactListApi#listsByListIdPut");
        e.printStackTrace();
    }
  }
}

Body parameter

{
  "list_name":"ListlPJf33ksjP"
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "List #439 has been updated.",
  "data": {
    "list_id": 439,
    "list_name": "ListlPJf33ksjP",
    "list_email_id": "LINDW2NHNPKHEJB6",
    "_contacts_count": 0
  }
}

https://rest.clicksend.com/v3/lists/{list_id}

Update specific contact list

Parameters

Parameter In Type Required Description
list_id path integer(int32) true Your list id
list_name body string true Your new list name

Refer to Status Codes for definitions of HTTP status code responses.

Delete List

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
     --request DELETE \

'https://rest.clicksend.com/v3/lists/{list_id}'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\ContactListApi(new GuzzleHttp\Client(),$config);
$list_id = 204805; // int | List ID

try {
    $result = $apiInstance->listsByListIdDelete($list_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ContactListApi->listsByListIdDelete: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME, 
    Password = API_KEY  
};
var contactListApi = new ContactListApi(configuration);
var response = contactListApi.ListsByListIdDelete(LIST_ID);
var api = require('./api.js');

var contactListApi = new api.ContactListApi("USERNAME", "API_KEY");

var listId = 196826;

contactListApi.listsByListIdDelete(listId).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::ContactListApi.new

list_id = 56 # Integer | List ID

begin
  # ListsByListIdDelete
  result = api_instance.lists_by_list_id_delete(list_id)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling ContactListApi->lists_by_list_id_delete: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.ContactListApi(clicksend_client.ApiClient(configuration))
list_id = 185160 # int | List ID

try:
    # ListsByListIdDelete
    api_response = api_instance.lists_by_list_id_delete(list_id)
    print(api_response)
except ApiException as e:
    print("Exception when calling ContactListApi->lists_by_list_id_delete: %s\n" % e)
use WWW::ClickSendClient::ContactListApi;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::ContactListApi->new(username => $username, password => $password);

my $json_output = $api->lists_by_list_id_delete('list_id' => '12345');

print $json_output;
#import "CSContactListApi.h"
#import "CSDefaultConfiguration.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
// Configure HTTP basic authorization (authentication scheme: BasicAuth)
[apiConfig setUsername:@"USERNAME"];
[apiConfig setPassword:@"PASSWORD"];

NSNumber *listId = [NSNumber numberWithInt:1];

CSContactListApi *contactListApi = [[CSContactListApi alloc] init];

[contactListApi listsByListIdDeleteWithListId:listId completionHandler:^(NSString *output, NSError *error) {
NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire
if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}

ContactListAPI.listsByListIdDelete(listId: 1) { (dataString, error) in
    guard let dataString = dataString else {
        print(error!)
        return
    }

    if let data = dataString.data(using: String.Encoding.utf8) {
        do {
            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                print(dictonary)
            } else {
                print("Cannot convert the String value to JSON")
            }
        } catch let error as NSError {
            print(error)
        }
    }
}
    Coming Soon
package ClickSend;

import ClickSend.Api.ContactListApi;

public class delete_list {
  public static void main(String[] args) {
    ApiClient defaultClient = new ApiClient();
    defaultClient.setUsername("USERNAME");
    defaultClient.setPassword("API_KEY");
    ContactListApi apiInstance = new ContactListApi(defaultClient);
    Integer listId = 192668; // Integer | List ID
    try {
        String result = apiInstance.listsByListIdDelete(listId);
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling ContactListApi#listsByListIdDelete");
        e.printStackTrace();
    }
  }
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "List #442 has been deleted.",
  "data": []
}

https://rest.clicksend.com/v3/lists/{list_id}

ListsByListIdDelete

Delete a specific contact list

Parameters

Parameter In Type Required Description
list_id path integer(int32) true List ID

Refer to Status Codes for definitions of HTTP status code responses.

Remove Duplicate Contacts

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
     --request PUT \

     --header "Content-Type: application/json" \
     --data-binary "{
    \"fields\":[
        \"phone_number\",
        \"first_name\",
        \"last_name\",
        \"fax_number\",
        \"address_country\"
    ]
}" \
'https://rest.clicksend.com/v3/lists/{list_id}/remove-duplicates'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\ContactListApi(new GuzzleHttp\Client(),$config);
$list_id = 185161; // int | Your list id
$field= new \ClickSend\Model\FieldsFields();
$field->setPhoneNumber("phone_number");
$fields = new \ClickSend\Model\Fields(); // \ClickSend\Model\Fields | Fields model
$fields->setFields($field);

try {
    $result = $apiInstance->listsRemoveDuplicatesByListIdPut($list_id, $fields);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ContactListApi->listsRemoveDuplicatesByListIdPut: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME, 
    Password = API_KEY  
};
var contactListApi = new ContactListApi(configuration);
var response = contactListApi.ListsRemoveDuplicatesByListIdPut(76467, new Fields(
    new FieldsFields(
        phoneNumber: "+11231231234",
        email: "contact@email.com",
        faxNumber: "FAX_NUMBER",
        firstName: "John",
        lastName: "Doe",
        addressLine1: "Address Line 1",
        addressLine2: "Address Line 2",
        addressCity: "City",
        addressState: "State",
        addressPostalCode: "Postal Code",
        addressCountry: "CA",
        organizationName: "My COMPANY",
        custom1: "Custom 1",
        custom2: "Custom 2",
        custom3: "Custom 3",
        custom4: "Custom 4"
    ))
);
var api = require('./api.js');

var contactListApi = new api.ContactListApi("USERNAME", "API_KEY");

var listId = 185161;

var fieldList = new api.FieldsFields();

fieldList.phoneNumber = "phone_number";
fieldList.city = "city";

var fields = new api.Fields();

fields.fields = fieldList

contactListApi.listsRemoveDuplicatesByListIdPut(listId, fields).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::ContactListApi.new

list_id = 56 # Integer | Your list id

# Fields | Fields model
fields = ClickSendClient::Fields.new(
  fields: ClickSendClient::FieldsFields.new(
    "phone_number": "phone_number",
    "custom_1": "custom_1",
    "email": "email",
    "fax_number": "fax_number",
    "first_name": "first_name",
    "address_line_1": "address_line_1",
    "address_line_2": "address_line_2",
    "address_city": "address_city",
    "address_state": "address_state",
    "address_postal_code": "address_postal_code",
    "address_country": "address_country",
    "organization_name": "organization_name",
    "custom_2": "custom2",
    "custom_3": "custom3",
    "custom_4": "custom4",
    "last_name": "last_name"
  )
)

begin
  # Remove duplicate contacts
  result = api_instance.lists_remove_duplicates_by_list_id_put(list_id, fields)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling ContactListApi->lists_remove_duplicates_by_list_id_put: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.ContactListApi(clicksend_client.ApiClient(configuration))
list_id = 185161 # int | Your list id
fields = clicksend_client.Fields(fields=['phone_number', 'first_name'])
try:
    # Remove duplicate contacts
    api_response = api_instance.lists_remove_duplicates_by_list_id_put(list_id,fields)
    print(api_response)
except ApiException as e:
    print("Exception when calling ContactListApi->lists_remove_duplicates_by_list_id_put: %s\n" % e)
use WWW::ClickSendClient::ContactListApi;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::ContactListApi->new(username => $username, password => $password);

my $json_output =
  $api->lists_remove_duplicates_by_list_id_put('list_id' => '12345', 'fields' => [ 'phone_number', 'first_name' ]);

print $json_output;
#import "CSContactListApi.h"
#import "CSDefaultConfiguration.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
// Configure HTTP basic authorization (authentication scheme: BasicAuth)
[apiConfig setUsername:@"USERNAME"];
[apiConfig setPassword:@"PASSWORD"];

NSNumber *listId = [NSNumber numberWithInt:1];

CSFieldsFields *fieldsFields = [[CSFieldsFields alloc] init];
fieldsFields.phoneNumber = @"phone_number";
fieldsFields.firstName = @"first_name";
fieldsFields.lastName = @"last_name";
fieldsFields.faxNumber = @"fax";
fieldsFields.addressCountry = @"address_coiuntry";

CSFields *fields = [[CSFields alloc] init];
fields.fields = fieldsFields;

CSContactListApi *contactListApi = [[CSContactListApi alloc] init];

[contactListApi listsRemoveDuplicatesByListIdPutWithListId:listId fields:fields completionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire

if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}

let fieldsFields = FieldsFields(
                        phoneNumber: "phone_number", 
                        custom1: nil, 
                        email: "email", 
                        faxNumber: "fax_number", 
                        firstName: "first_name", 
                        addressLine1: "address_line1", 
                        addressLine2: nil, 
                        addressCity: "address_city", 
                        addressState: "state", 
                        addressPostalCode: "postal", 
                        addressCountry: "cpountry", 
                        organizationName: "organization", 
                        custom2: nil, 
                        custom3: nil, 
                        custom4: nil, 
                        lastName: "last_name"
                    )

let fields = Fields(fields: fieldsFields)
ContactListAPI.listsRemoveDuplicatesByListIdPut(listId: 1, fields: fields) { (dataString, error) in
    guard let dataString = dataString else {
        print(error!)
        return
    }

    if let data = dataString.data(using: String.Encoding.utf8) {
        do {
            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                print(dictonary)
            } else {
                print("Cannot convert the String value to JSON")
            }
        } catch let error as NSError {
            print(error)
        }
    }
}
    Coming Soon
package ClickSend;

import ClickSend.Api.ContactListApi;
import ClickSend.Model.Fields;
import ClickSend.Model.FieldsFields;

public class remove_duplicate_contact {
  public static void main(String[] args) {
    ApiClient defaultClient = new ApiClient();
    defaultClient.setUsername("USERNAME");
    defaultClient.setPassword("API_KEY");
    ContactListApi apiInstance = new ContactListApi(defaultClient);
    Integer listId = 185161; // Integer | Your list id
    FieldsFields field=new  FieldsFields();
    field.phoneNumber("phone_number");
    field.addressCity("city");
    Fields fields = new Fields(); // Fields | Fields model
    fields.fields(field);
    try {
        String result = apiInstance.listsRemoveDuplicatesByListIdPut(listId, fields);
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling ContactListApi#listsRemoveDuplicatesByListIdPut");
        e.printStackTrace();
    }
  }
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "Your list duplicate contacts has been deleted.",
  "data": {
    "deleted": 6
  }
}

https://rest.clicksend.com/v3/lists/{list_id}/remove-duplicates

Remove duplicate contacts

Parameters

Parameter In Type Required Description
list_id path integer(int32) true Your list id

Refer to Status Codes for definitions of HTTP status code responses.

Import Contacts

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
     --request POST \

     --header "Content-Type: application/json" \
     --data-binary "{
    \"file_url\":\"http://yourdomain.com/import.csv\",
    \"field_order\":[
        \"phone\",
        \"first_name\",
        \"last_name\",
        \"custom1\",
        \"custom2\",
        \"custom3\",
        \"custom4\",
        \"fax_number\",
        \"organization_name\",
        \"email\",
        \"address_line_1\",
        \"address_line_2\",
        \"address_city\",
        \"address_state\",
        \"address_postal_code\",
        \"address_country\"
    ]
}" \
'https://rest.clicksend.com/v3/lists/{list_id}/import'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\ContactListApi(new GuzzleHttp\Client(),$config);
$list_id = 185161; // int | Your contact list id you want to access.
$file = new \ClickSend\Model\ContactListImport(); // \ClickSend\Model\ContactListImport | ContactListImport model
$file->setFileUrl("https://rest.clicksend.com//files/15A3C0E9-F6A5-49CE-907F-1AD49F75A2AE.csv");
$file->setFieldOrder(["phone","first_name","last_name","custom1","custom2","custom3","custom4","fax_number","organization_name","email","address_line_1","address_line_2","address_city","address_state","address_postal_code","address_country"]);

try {
    $result = $apiInstance->listsImportByListIdPost($list_id, $file);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ContactListApi->listsImportByListIdPost: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME, 
    Password = API_KEY  
};
var contactListApi = new ContactListApi(configuration);
var fieldsOrder = new List<string>() {
    "phone",
    "first_name",
    "last_name",
    "custom1",
    "custom2",
    "custom3",
    "custom4",
    "fax_number",
    "organization_name",
    "email",
    "address_line_1",
    "address_line_2",
    "address_city",
    "address_state",
    "address_postal_code",
    "address_country"
};
var contactListImport = new ContactListImport("https://yourdomain.com/import.csv", fieldsOrder);
var response = contactListApi.ListsImportByListIdPost(LIST_ID, contactListImport);
var api = require('./api.js');

var contactListApi = new api.ContactListApi("USERNAME", "API_KEY");

var listId = 185161;

var file = new api.ContactListImport();

file.fileUrl = "https://rest.clicksend.com/files/6D1801BB-9E03-42B8-A69F-5A5222D95C9F.csv";
file.fieldOrder = [
    "phone",
    "first_name",
    "last_name",
    "custom1",
    "custom2",
    "custom3",
    "custom4",
    "fax_number",
    "organization_name",
    "email",
    "address_line_1",
    "address_line_2",
    "address_city",
    "address_state",
    "address_postal_code",
    "address_country"
]

contactListApi.listsImportByListIdPost(listId, file).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::ContactListApi.new

list_id = 56 # Integer | Your contact list id you want to access.

# ContactListImport | ContactListImport model
file = ClickSendClient::ContactListImport.new(
  "file_url": "file_url",
  "field_order": %w[field_order field_order field_order]
)

begin
  # Import contacts to list
  result = api_instance.lists_import_by_list_id_post(list_id, file)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling ContactListApi->lists_import_by_list_id_post: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.ContactListApi(clicksend_client.ApiClient(configuration))
list_id = 185161 # int | Your contact list id you want to access.
field_order=["phone","first_name","last_name",
"custom1","custom2","custom3","custom4",
"fax_number","organization_name","email",
"address_line_1","address_line_2","address_city",
"address_state","address_postal_code","address_country"]

# ContactListImport | ContactListImport model
file = clicksend_client.ContactListImport(file_url="https://rest.clicksend.com/files/973181E1-7D1C-4DB4-A374-8407A45CD1B7.txt",field_order=[field_order]) 

try:
    # Import contacts to list
    api_response = api_instance.lists_import_by_list_id_post(list_id, file)
    print(api_response)
except ApiException as e:
    print("Exception when calling ContactListApi->lists_import_by_list_id_post: %s\n" % e)
use WWW::ClickSendClient::ContactListApi;
use WWW::ClickSendClient::Object::ContactListImport;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::ContactListApi->new(username => $username, password => $password);

my %params = (
    'file_url'    => 'http://yourdomain.com/import.csv',
    'field_order' => [ 'phone_number', 'first_name' ]
);

my $contact_list_obj = WWW::ClickSendClient::Object::ContactListImport->new(%params);

my $json_output = $api->lists_import_by_list_id_post('list_id' => '185530', 'file' => $contact_list_obj);

print $json_output;
#import "CSContactListApi.h"
#import "CSDefaultConfiguration.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
// Configure HTTP basic authorization (authentication scheme: BasicAuth)
[apiConfig setUsername:@"USERNAME"];
[apiConfig setPassword:@"PASSWORD"];

NSNumber *listId = [NSNumber numberWithInt:1];

CSContactListImport *contactListImport = [[CSContactListImport alloc] init];
contactListImport.fileUrl = @"file_url";
contactListImport.fieldOrder = @[@"field_order", @"field_order"];

CSContactListApi *contactListApi = [[CSContactListApi alloc] init];

[contactListApi listsImportByListIdPostWithListId:listId file:contactListImport completionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire
if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}

let contactListImport = ContactListImport(
                            fileUrl: "file_url", 
                            fieldOrder: ["field_order",
                                         "field_order"]
                        )

ContactListAPI.listsImportByListIdPost(listId: 1, file: contactListImport) { (dataString, error) in
    guard let dataString = dataString else {
        print(error!)
        return
    }

    if let data = dataString.data(using: String.Encoding.utf8) {
        do {
            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                print(dictonary)
            } else {
                print("Cannot convert the String value to JSON")
            }
        } catch let error as NSError {
            print(error)
        }
    }
}
    Coming Soon
package ClickSend;

import java.util.Arrays;
import java.util.List;

import ClickSend.Api.ContactListApi;
import ClickSend.Model.ContactListImport;

public class import_contacts {
  public static void main(String[] args) {
    ApiClient defaultClient = new ApiClient();
    defaultClient.setUsername("USERNAME");
    defaultClient.setPassword("API_KEY");
    ContactListApi apiInstance = new ContactListApi(defaultClient);
    Integer listId = 185161; // Integer | Your contact list id you want to access.
    List<String> fieldList = Arrays.asList(
    "phone", "first_name", "last_name", 
    "custom1", "custom2", "custom3", "custom4",
    "fax_number", "organization_name", "email", 
    "address_line_1", "address_line_2", "address_city",
    "address_state", "address_postal_code", "address_country");

    // ContactListImport | ContactListImport model
    ContactListImport file = new ContactListImport(); 
    file.fileUrl("https://rest.clicksend.com/files/973181E1-7D1C-4DB4-A374-8407A45CD1B7.txt");
    file.fieldOrder(fieldList);
    try {
        String result = apiInstance.listsImportByListIdPost(listId, file);
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling ContactListApi#listsImportByListIdPost");
        e.printStackTrace();
    }
  }
}

Body parameter

{
  "file_url": "file_url",
  "field_order": [
    "field_order",
    "field_order"
  ]
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "Your file is now queued.",
  "data": {
    "msg": "Messages put on queue.",
    "ids": [
      "6254358460638066203"
    ],
    "id": "6254358460638066203"
  }
}

https://rest.clicksend.com/v3/lists/{list_id}/import

Import contacts to list

Parameters

Parameter In Type Required Description
list_id path integer(int32) true Your contact list id you want to access.

Properties

Name Type Required Restrictions Description
file_url string true none URL of file to process
field_order [string] true none Order of fields in file

Refer to Status Codes for definitions of HTTP status code responses.

Countries

Everything about viewing country code mapping

View Countries

Code samples

curl --include \
'https://rest.clicksend.com/v3/countries'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

$apiInstance = new ClickSend\Api\CountriesApi(new GuzzleHttp\Client());

try {
    $result = $apiInstance->countriesGet();
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling CountriesApi->countriesGet: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var countriesApi = new CountriesApi(Configuration.Default);
var response = countriesApi.CountriesGet();
var api = require('./api.js');

var countriesApi = new api.CountriesApi();

countriesApi.countriesGet().then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

api_instance = ClickSendClient::CountriesApi.new

begin
  # Get all country codes
  result = api_instance.countries_get
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling CountriesApi->countries_get: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# create an instance of the API class
api_instance = clicksend_client.CountriesApi()

try:
    # Get all country codes
    api_response = api_instance.countries_get()
    print(api_response)
except ApiException as e:
    print("Exception when calling CountriesApi->countries_get: %s\n" % e)
use WWW::ClickSendClient::CountriesApi;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::CountriesApi->new(username => $username, password => $password);

my $json_output = $api->countries_get();

print $json_output;
#import "CSCountriesApi.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
[apiConfig setUsername:@"USERNAME"];
[apiConfig setPassword:@"PASSWORD"];

CSCountriesApi *countriesApi = [[CSCountriesApi alloc] init];
[countriesApi countriesGetWithCompletionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire

if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}
CountriesAPI.countriesGet { (dataString, error) in
    guard let dataString = dataString else {
        print(error!)
        return
    }
    if let data = dataString.data(using: String.Encoding.utf8) {
        do {
            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                    print(dictonary)
            } else {
                print("Cannot convert the String value to JSON")
            }
        } catch let error as NSError {
            print(error)
        }
    }
}
    Coming Soon
package ClickSend;

import ClickSend.Api.CountriesApi;

public class view_countries {
  public static void main(String[] args) {
    CountriesApi apiInstance = new CountriesApi();
    try {
        String result = apiInstance.countriesGet();
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling CountriesApi#countriesGet");
        e.printStackTrace();
    }
  }
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "List of Countries.",
  "data": [
    {
      "code": "AF",
      "value": "Afghanistan"
    },
    {
      "code": "AU",
      "value": "Australia"
    },
    {
      "code": "FI",
      "value": "Finland"
    }
  ]
}

https://rest.clicksend.com/v3/countries

Get all country codes

Get all countries

Refer to Status Codes for definitions of HTTP status code responses.

Email To Sms

Everything about Email to SMS

View Allowed Emails

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \

'https://rest.clicksend.com/v3/sms/email-sms'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\EmailToSmsApi(new GuzzleHttp\Client(),$config);
$page = 1; // int | Page number
$limit = 10; // int | Number of records per page

try {
    $result = $apiInstance->smsEmailSmsGet($page, $limit);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling EmailToSmsApi->smsEmailSmsGet: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME, 
    Password = API_KEY  
};
var emailToSmsApi = new EmailToSmsApi(configuration);
var response = emailToSmsApi.SmsEmailSmsGet();
var api = require('./api.js');

var emailToSmsApi = new api.EmailToSmsApi("USERNAME", "API_KEY");

var page = 1;
var limit = 10;

emailToSmsApi.smsEmailSmsGet(page, limit).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::EmailToSmsApi.new

opts = {
  page: 1,  # Integer | Page number
  limit: 10 # Integer | Number of records per page
}

begin
  # Get list of email to sms allowed addresses
  result = api_instance.sms_email_sms_get(opts)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling EmailToSmsApi->sms_email_sms_get: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.EmailToSmsApi(clicksend_client.ApiClient(configuration))
page = 1 # int | Page number (optional) (default to 1)
limit = 10 # int | Number of records per page (optional) (default to 10)

try:
    # Get list of email to sms allowed addresses
    api_response = api_instance.sms_email_sms_get(page=page, limit=limit)
    print(api_response)
except ApiException as e:
    print("Exception when calling EmailToSmsApi->sms_email_sms_get: %s\n" % e)
use WWW::ClickSendClient::EmailToSmsApi;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::EmailToSmsApi->new(username => $username, password => $password);

my $json_output = $api->sms_email_sms_get('page' => '1' ,'limit' => '1');

print $json_output;
#import "CSDefaultConfiguration.h"
#import "CSEmailToSmsApi.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
[apiConfig setUsername:@"USERNAME"];
[apiConfig setPassword:@"PASSWORD"];

CSEmailToSmsApi *emailToSmsApi = [[CSEmailToSmsApi alloc] init];
NSNumber *page = [[NSNumber alloc] initWithInt:1];
NSNumber *limit = [[NSNumber alloc] initWithInt:15];

[emailToSmsApi smsEmailSmsGetWithPage:page limit:limit completionHandler:^(NSString *output, NSError *error) {
      if (error) {
           NSLog(@"Error: %@", error);
      } else {
           NSLog(@"%@", output);
      }
}];
import Alamofire

if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}

EmailToSmsAPI.smsEmailSmsGet { (dataString, error) in
    guard let dataString = dataString else {
        print(error!)
        return
    }

    if let data = dataString.data(using: String.Encoding.utf8) {
        do {
            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                print(dictonary)
            } else {
                print("Cannot convert the String value to JSON")
                }
        } catch let error as NSError {
            print(error)
        }
    }
}
    Coming Soon
package ClickSend;

import ClickSend.Api.EmailToSmsApi;

public class view_allowed_email {
  public static void main(String[] args) {
    ApiClient defaultClient = new ApiClient();
    defaultClient.setUsername("USERNAME");
    defaultClient.setPassword("API_KEY");
    EmailToSmsApi apiInstance = new EmailToSmsApi(defaultClient);
    Integer page = 1; // Integer | Page number
    Integer limit = 10; // Integer | Number of records per page
    try {
        String result = apiInstance.smsEmailSmsGet(page, limit);
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling EmailToSmsApi#smsEmailSmsGet");
        e.printStackTrace();
    }
  }
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "Here are some data.",
  "data": {
    "total": 25,
    "per_page": 15,
    "current_page": 1,
    "last_page": 2,
    "next_page_url": "https://rest.clicksend.com/v3/sms/email-sms/?page=2",
    "prev_page_url": null,
    "from": 1,
    "to": 15,
    "data": [
      {
        "email_address_id": 84,
        "email_address": "my@email.com",
        "from": "+13523944199"
      },
      {
        "email_address_id": 85,
        "email_address": "my@email.com",
        "from": "+13523944199"
      }
    ]
  }
}

https://rest.clicksend.com/v3/sms/email-sms

Get list of email to sms allowed addresses

Parameters

Parameter In Type Required Description
page query integer(int32) false Page number
limit query integer(int32) false Number of records per page

Refer to Status Codes for definitions of HTTP status code responses.

Add Allowed Email

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
     --request POST \
     --header "Content-Type: application/json" \

     --data-binary "    {
        \"email_address\":\"Cv3p0@gmail.com\",
        \"from\":\"+17128845887\"
    }" \
'https://rest.clicksend.com/v3/sms/email-sms'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\EmailToSmsApi(new GuzzleHttp\Client(), $config);
// \ClickSend\Model\EmailSMSAddress | EmailSMSAddress model
$email_sms_address = new \ClickSend\Model\EmailSMSAddress();
$email_sms_address->setEmailAddress("xxx@gmail.com");
$email_sms_address->setFrom("+17128845887");
$email_sms_address->setSubaccountId("74275");

try {
    $result = $apiInstance->smsEmailSmsPost($email_sms_address);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling EmailToSmsApi->smsEmailSmsPost: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME, 
    Password = API_KEY  
};
var emailToSmsApi = new EmailToSmsApi(configuration);
var response = emailToSmsApi.SmsEmailSmsPost(new EmailSMSAddress(
    emailAddress: "john@doe.com",
    from: "+11231231234",
    subaccountId: "SUB_ACCOUNT_ID
));
var api = require('./api.js');

var emailToSmsApi = new api.EmailToSmsApi("USERNAME", "API_KEY");

var emailSmsAddress = new api.EmailSMSAddress();

emailSmsAddress.emailAddress = "xxx@gmail.com";
emailSmsAddress.from = "+17128845887";
emailSmsAddress.subaccountId = "74275";

emailToSmsApi.smsEmailSmsPost(emailSmsAddress).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::EmailToSmsApi.new

# EmailSMSAddress | EmailSMSAddress model
email_sms_address = ClickSendClient::EmailSMSAddress.new(
  "email_address": "test1@test.com",
  "from": "from",
  "subaccount_id": 0
)

begin
  # Create email to sms allowed address
  result = api_instance.sms_email_sms_post(email_sms_address)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling EmailToSmsApi->sms_email_sms_post: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.EmailToSmsApi(clicksend_client.ApiClient(configuration))
# EmailSMSAddress | EmailSMSAddress model
email_sms_address = clicksend_client.EmailSMSAddress(
                    email_address="Cv3p0@gmail.com",
                    _from="+17128845887",
                    subaccount_id=74275) 

try:
    # Create email to sms allowed address
    api_response = api_instance.sms_email_sms_post(email_sms_address)
    print(api_response)
except ApiException as e:
    print("Exception when calling EmailToSmsApi->sms_email_sms_post: %s\n" % e)
use WWW::ClickSendClient::EmailToSmsApi;
use WWW::ClickSendClient::Object::EmailSMSAddress;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::EmailToSmsApi->new(username => $username, password => $password);

my %params = (
    'email_address' => 'test1@test.com',
    'from'          => '+61411111111',
    'subaccount_id' => '1234',
);

my $email_obj =  WWW::ClickSendClient::Object::EmailSMSAddress->new(%params);

my $json_output = $api->sms_email_sms_post('email_sms_address' =>  $email_obj);

print $json_output;
#import "CSDefaultConfiguration.h"
#import "CSEmailToSmsApi.h"


CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
[apiConfig setUsername:@"USERNAME"];
[apiConfig setPassword:@"PASSWORD"];

CSEmailToSmsApi *emailToSmsApi = [[CSEmailToSmsApi alloc] init];
CSEmailSMSAddress *emailSmsAddress = [[CSEmailSMSAddress alloc] init];

[emailToSmsApi smsEmailSmsPostWithEmailSmsAddress:emailSmsAddress completionHandler:^(NSString *output, NSError *error) {

    if (error) {
           NSLog(@"Error: %@", error);
    } else {
            NSLog(@"%@", output);
    }
}];
import Alamofire

if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}

let emailSmsAddr = EmailSMSAddress(emailAddress: "johndoe@email.com", from: "+17128845887", subaccountId: nil)

EmailToSmsAPI.smsEmailSmsPost(emailSmsAddress: emailSmsAddr) { (dataString, error) in
    guard let dataString = dataString else {
        print(error!)
        return
    }

    if let data = dataString.data(using: String.Encoding.utf8) {
        do {
            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                print(dictonary)
             } else {
                print("Cannot convert the String value to JSON")
            }
        } catch let error as NSError {
                print(error)
         }
     }
}
    Coming Soon
package ClickSend;

import ClickSend.Api.EmailToSmsApi;
import ClickSend.Model.EmailSMSAddress;

public class add_allowed_email {
  public static void main(String[] args) {
    ApiClient defaultClient = new ApiClient();
    defaultClient.setUsername("USERNAME");
    defaultClient.setPassword("API_KEY");
    EmailToSmsApi apiInstance = new EmailToSmsApi(defaultClient);
    // EmailSMSAddress | EmailSMSAddress model
    EmailSMSAddress emailSmsAddress = new EmailSMSAddress();
    emailSmsAddress.emailAddress("xxx@gmail.com");
    emailSmsAddress.from("+17128845887");
    emailSmsAddress.subaccountId("74275");
    try {
        String result = apiInstance.smsEmailSmsPost(emailSmsAddress);
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling EmailToSmsApi#smsEmailSmsPost");
        e.printStackTrace();
    }
  }
}

Body parameter

{
  "email_address": "email_address",
  "from": "from"
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "New data has been saved.",
  "data": {
    "email_address_id": 107,
    "email_address": "Cv3p0@gmail.com",
    "from": "+17128845887"
  }
}

https://rest.clicksend.com/v3/sms/email-sms

Create email to sms allowed address

Properties

Name Type Required Restrictions Description
email_address string true none Your email address
from string false yes Your sender id

Refer to Status Codes for definitions of HTTP status code responses.

View Stripped String Rules

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
'https://rest.clicksend.com/v3/sms/email-sms-stripped-strings'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\EmailToSmsApi(new GuzzleHttp\Client(),$config);
$page = 1; // int | Page number
$limit = 10; // int | Number of records per page

try {
    $result = $apiInstance->smsEmailSmsStrippedStringsGet($page, $limit);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling EmailToSmsApi->smsEmailSmsStrippedStringsGet: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME, 
    Password = API_KEY  
};
var emailToSmsApi = new EmailToSmsApi(configuration);
var response = emailToSmsApi.SmsEmailSmsStrippedStringsGet();
var api = require('./api.js');

var emailToSmsApi = new api.EmailToSmsApi("USERNAME", "API_KEY");

var page = 1;
var limit = 10;

emailToSmsApi.smsEmailSmsStrippedStringsGet(page, limit).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::EmailToSmsApi.new

opts = {
  page: 1,  # Integer | Page number
  limit: 10 # Integer | Number of records per page
}

begin
  # Get list of email to sms stripped string rules
  result = api_instance.sms_email_sms_stripped_strings_get(opts)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling EmailToSmsApi->sms_email_sms_stripped_strings_get: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.EmailToSmsApi(clicksend_client.ApiClient(configuration))
page = 1 # int | Page number (optional) (default to 1)
limit = 10 # int | Number of records per page (optional) (default to 10)

try:
    # Get list of email to sms stripped string rules
    api_response = api_instance.sms_email_sms_stripped_strings_get(page=page, limit=limit)
    print(api_response)
except ApiException as e:
    print("Exception when calling EmailToSmsApi->sms_email_sms_stripped_strings_get: %s\n" % e)
use WWW::ClickSendClient::EmailToSmsApi;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::EmailToSmsApi->new(username => $username, password => $password);

my $json_output = $api->sms_email_sms_stripped_strings_get('page' =>  '1','limit' => '10');

print $json_output;
#import "CSDefaultConfiguration.h"
#import "CSEmailToSmsApi.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
[apiConfig setUsername:@"USERNAME"];
[apiConfig setPassword:@"PASSWORD"];

CSEmailToSmsApi *emailToSmsApi = [[CSEmailToSmsApi alloc] init];
NSNumber *page = [[NSNumber alloc] initWithInt:1];
NSNumber *limit = [[NSNumber alloc] initWithInt:15];

[emailToSmsApi smsEmailSmsStrippedStringsGetWithPage:page limit:limit completionHandler:^(NSString *output, NSError *error) {
            if (error) {
                NSLog(@"Error: %@", error);
            } else {
                NSLog(@"%@", output);
            }
}];
import Alamofire

if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASWWORD") {
    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}

EmailToSmsAPI.smsEmailSmsStrippedStringsGet { (dataString, error) in
    guard let dataString = dataString else {
        print(error!)
        return
    }

    if let data = dataString.data(using: String.Encoding.utf8) {
        do {
            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                print(dictonary)
            } else {
                print("Cannot convert the String value to JSON")
            }
        } catch let error as NSError {
                print(error)
        }
    }
}
    Coming Soon
package ClickSend;

import ClickSend.Api.EmailToSmsApi;

public class view_all_stripped_string_rule {
  public static void main(String[] args) {
    ApiClient defaultClient = new ApiClient();
    defaultClient.setUsername("USERNAME");
    defaultClient.setPassword("API_KEY");
    EmailToSmsApi apiInstance = new EmailToSmsApi(defaultClient);
    Integer page = 1; // Integer | Page number
    Integer limit = 10; // Integer | Number of records per page
    try {
        String result = apiInstance.smsEmailSmsStrippedStringsGet(page, limit);
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling EmailToSmsApi#smsEmailSmsStrippedStringsGet");
        e.printStackTrace();
    }
  }
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "Here is your result.",
  "data": {
    "total": 2,
    "per_page": 15,
    "current_page": 1,
    "last_page": 1,
    "next_page_url": null,
    "prev_page_url": null,
    "from": 1,
    "to": 2,
    "data": [
      {
        "rule_id": 18,
        "strip_string": "This is a test1."
      },
      {
        "rule_id": 19,
        "strip_string": "This is a test2."
      }
    ]
  }
}

https://rest.clicksend.com/v3/sms/email-sms-stripped-strings

Get list of email to sms stripped string rules

Get list of email to sms stripped string rules

Parameters

Parameter In Type Required Description
page query integer(int32) false Page number
limit query integer(int32) false Number of records per page

Refer to Status Codes for definitions of HTTP status code responses.

Create Stripped String Rule

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
     --request POST \
     --header "Content-Type: application/json" \
     --data-binary "{
    \"strip_string\" : \"~~~test~~~\"
}" \
'https://rest.clicksend.com/v3/sms/email-sms-stripped-strings'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\EmailToSmsApi(new GuzzleHttp\Client(),$config);
// \ClickSend\Model\StrippedString | StrippedString model
$stripped_string = new \ClickSend\Model\StrippedString(); 
$stripped_string->setStripString("  xxx  ");

try {
    $result = $apiInstance->smsEmailSmsStrippedStringPost($stripped_string);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling EmailToSmsApi->smsEmailSmsStrippedStringPost: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME, 
    Password = API_KEY  
};
var emailToSmsApi = new EmailToSmsApi(configuration);
var response = emailToSmsApi.SmsEmailSmsStrippedStringPost(new StrippedString("string"));
var api = require('./api.js');

var emailToSmsApi = new api.EmailToSmsApi("USERNAME", "API_KEY");

var strippedString = new api.StrippedString();

strippedString.stripString = "  test  "

emailToSmsApi.smsEmailSmsStrippedStringPost(strippedString).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::EmailToSmsApi.new

# StrippedString | StrippedString model
stripped_string = ClickSendClient::StrippedString.new(
  "strip_string": "~~~~test~~~~"
)

begin
  # Create email to sms stripped string rule
  result = api_instance.sms_email_sms_stripped_string_post(stripped_string)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling EmailToSmsApi->sms_email_sms_stripped_string_post: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.EmailToSmsApi(clicksend_client.ApiClient(configuration))
stripped_string = clicksend_client.StrippedString(strip_string= '  test  ') # StrippedString | StrippedString model

try:
    # Create email to sms stripped string rule
    api_response = api_instance.sms_email_sms_stripped_string_post(stripped_string)
    print(api_response)
except ApiException as e:
    print("Exception when calling EmailToSmsApi->sms_email_sms_stripped_string_post: %s\n" % e)
use WWW::ClickSendClient::EmailToSmsApi;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::EmailToSmsApi->new(username => $username, password => $password);

my $json_output = $api->sms_email_sms_stripped_string_post('strip_string' =>  'XXXXXXXXX');

print $json_output;
#import "CSDefaultConfiguration.h"
#import "CSEmailToSmsApi.h"


CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
[apiConfig setUsername:@"USERNAME"];
[apiConfig setPassword:@"PASSWORD"];


CSStrippedString *strippedString = [[CSStrippedString alloc] init];
strippedString.stripString = @"string";

CSEmailToSmsApi *emailToSmsApiInstance = [[CSEmailToSmsApi alloc] init];
[emailToSmsApiInstance smsEmailSmsStrippedStringPostWithStrippedString:strippedString completionHandler:^(NSString *output, NSError *error) {
            if (error) {
                NSLog(@"Error: %@", error);
            } else {
                NSLog(@"%@", output);
            }
}];
import Alamofire

if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}

let stripedString = StrippedString(stripString: "string")

EmailToSmsAPI.smsEmailSmsStrippedStringPost(strippedString: stripedString) { (dataString, error) in
    guard let dataString = dataString else {
        print(error!)
        return
    }

    if let data = dataString.data(using: String.Encoding.utf8) {
        do {
            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                print(dictonary)
            } else {
                print("bad json")
            }
        } catch let error as NSError {
            print(error)
        }
    }
}
    Coming Soon
package ClickSend;

import ClickSend.Api.EmailToSmsApi;
import ClickSend.Model.StrippedString;

public class create_stripped_string_rule {
  public static void main(String[] args) {
    ApiClient defaultClient = new ApiClient();
    defaultClient.setUsername("USERNAME");
    defaultClient.setPassword("API_KEY");
    EmailToSmsApi apiInstance = new EmailToSmsApi(defaultClient);
    // StrippedString | StrippedString model
    StrippedString strippedString = new StrippedString(); 
    strippedString.stripString("  test  ");
    try {
        String result = apiInstance.smsEmailSmsStrippedStringPost(strippedString);
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling EmailToSmsApi#smsEmailSmsStrippedStringPost");
        e.printStackTrace();
    }
  }
}

Body parameter

{
  "strip_string": "~~~~test~~~~"
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "Strip string has been created.",
  "data": {
    "rule_id": 20,
    "strip_string": "~~~~test~~~~"
  }
}

https://rest.clicksend.com/v3/sms/email-sms-stripped-strings

Create email to sms stripped string rule

Create email to sms stripped string rules

Parameters

Parameter In Type Required Description
stripped-string body string true String to be stripped.

Refer to Status Codes for definitions of HTTP status code responses.

View Stripped String Rule

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
'https://rest.clicksend.com/v3/sms/email-sms-stripped-strings/{rule_id}'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\EmailToSmsApi(new GuzzleHttp\Client(),$config);
$rule_id = 1137; // int | Your rule id

try {
    $result = $apiInstance->smsEmailSmsStrippedStringGet($rule_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling EmailToSmsApi->smsEmailSmsStrippedStringGet: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME, 
    Password = API_KEY  
};
var emailToSmsApi = new EmailToSmsApi(configuration);
var response = emailToSmsApi.SmsEmailSmsStrippedStringGet(RULE_ID);
var api = require('./api.js');

var emailToSmsApi = new api.EmailToSmsApi("USERNAME", "API_KEY");

var ruleId = 1119

emailToSmsApi.smsEmailSmsStrippedStringGet(ruleId).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::EmailToSmsApi.new

rule_id = 56 # Integer | Your rule id

begin
  # Get email to sms stripped string rule
  result = api_instance.sms_email_sms_stripped_string_get(rule_id)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling EmailToSmsApi->sms_email_sms_stripped_string_get: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.EmailToSmsApi(clicksend_client.ApiClient(configuration))
rule_id = 74275 # int | Your rule id

try:
    # Get email to sms stripped string rule
    api_response = api_instance.sms_email_sms_stripped_string_get(rule_id)
    print(api_response)
except ApiException as e:
    print("Exception when calling EmailToSmsApi->sms_email_sms_stripped_string_get: %s\n" % e)
use WWW::ClickSendClient::EmailToSmsApi;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::EmailToSmsApi->new(username => $username, password => $password);

my $json_output = $api->sms_email_sms_stripped_string_get('rule_id' => '1234' );

print $json_output;
#import "CSDefaultConfiguration.h"
#import "CSEmailToSmsApi.h"

 CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
[apiConfig setUsername:@"USERNAME"];
[apiConfig setPassword:@"PASSWORD"];

CSEmailToSmsApi *emailToSmsApi = [[CSEmailToSmsApi alloc] init];
NSNumber *RuleId = [[NSNumber alloc] initWithInt:1];

[emailToSmsApi smsEmailSmsStrippedStringGetWithRuleId:RuleId completionHandler:^(NSString *output, NSError *error) {
       if (error) {
            NSLog(@"Error: %@", error);
       } else {
            NSLog(@"%@", output);
       }
}];
import Alamofire

if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}

EmailToSmsAPI.smsEmailSmsStrippedStringGet(ruleId: 1) { (dataString, error) in
    guard let dataString = dataString else {
        print(error!)
        return
    }

    if let data = dataString.data(using: String.Encoding.utf8) {
        do {
            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                print(dictonary)
            } else {
                print("bad json")
            }
        } catch let error as NSError {
            print(error)
        }
    }
}
    Coming Soon
package ClickSend;

import ClickSend.Api.EmailToSmsApi;

public class view_specific_stripped_string_rule {
  public static void main(String[] args) {
    ApiClient defaultClient = new ApiClient();
    defaultClient.setUsername("USERNAME");
    defaultClient.setPassword("API_KEY");
    EmailToSmsApi apiInstance = new EmailToSmsApi(defaultClient);
    Integer ruleId = 1067; // Integer | Your rule id
    try {
        String result = apiInstance.smsEmailSmsStrippedStringGet(ruleId);
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling EmailToSmsApi#smsEmailSmsStrippedStringGet");
        e.printStackTrace();
    }
  }
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "Here is your result.",
  "data": {
    "rule_id": 18,
    "strip_string": "You've received a reply from."
  }
}

https://rest.clicksend.com/v3/sms/email-sms-stripped-strings/{rule_id}

Get email to sms stripped string rule

Get email to sms stripped string rule

Parameters

Parameter In Type Required Description
rule_id path integer(int32) true Your rule id

Refer to Status Codes for definitions of HTTP status code responses.

Update Stripped String Rule

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
     --request PUT \
     --header "Content-Type: application/json" \
     --data-binary "{
    \"strip_string\" : \"~~~test1~~~\"
}" \
'https://rest.clicksend.com/v3/sms/email-sms-stripped-strings/{rule_id}'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\EmailToSmsApi(new GuzzleHttp\Client(),$config);
// \ClickSend\Model\StrippedString | StrippedString model
$stripped_string = new \ClickSend\Model\StrippedString(); 
$stripped_string->setStripString("  xxx  ");
$rule_id = 1137; // int | Your rule id

try {
    $result = $apiInstance->smsEmailSmsStrippedStringPut($stripped_string, $rule_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling EmailToSmsApi->smsEmailSmsStrippedStringPut: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME, 
    Password = API_KEY  
};
var emailToSmsApi = new EmailToSmsApi(configuration);
var response = emailToSmsApi.SmsEmailSmsStrippedStringPut(new StrippedString("NewString"), STRIPPED_STRING_ID);
var api = require('./api.js');

var emailToSmsApi = new api.EmailToSmsApi("USERNAME", "API_KEY");

var strippedString = new api.StrippedString();

strippedString.stripString = "  test  "

var ruleId = 1119;

emailToSmsApi.smsEmailSmsStrippedStringPut(strippedString, ruleId).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::EmailToSmsApi.new

# StrippedString | StrippedString model
stripped_string = ClickSendClient::StrippedString.new(
  strip_string: "~~~test1~~~"
)

rule_id = 1066 # Integer | Your rule id

begin
  # Update email to sms stripped string rule
  result = api_instance.sms_email_sms_stripped_string_put(stripped_string, rule_id)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling EmailToSmsApi->sms_email_sms_stripped_string_put: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.EmailToSmsApi(clicksend_client.ApiClient(configuration))
# StrippedString | StrippedString model
stripped_string = clicksend_client.StrippedString(strip_string= '  test1  ') 
rule_id = 1055 # int | Your rule id

try:
    # Update email to sms stripped string rule
    api_response = api_instance.sms_email_sms_stripped_string_put(stripped_string, rule_id)
    print(api_response)
except ApiException as e:
    print("Exception when calling EmailToSmsApi->sms_email_sms_stripped_string_put: %s\n" % e)
use WWW::ClickSendClient::EmailToSmsApi;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::EmailToSmsApi->new(username => $username, password => $password);

my $json_output = $api->sms_email_sms_stripped_string_put('rule_id' => '12345','strip_string' => 'xxxxxx');

print $json_output;
#import "CSDefaultConfiguration.h"
#import "CSEmailToSmsApi.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
[apiConfig setUsername:@"USERNAME"];
[apiConfig setPassword:@"PASSWORD"];

NSNumber *ruleId = [[NSNumber alloc] initWithInt:1];
CSStrippedString *strippedString = [[CSStrippedString alloc] init];
strippedString.stripString = @"string";

CSEmailToSmsApi *emailToSmsApiIntance = [[CSEmailToSmsApi alloc] init];
[emailToSmsApiIntance smsEmailSmsStrippedStringPutWithStrippedString:strippedString ruleId:ruleId completionHandler:^(NSString *output, NSError *error) {
      if (error) {
          NSLog(@"Error: %@", error);
      } else {
           NSLog(@"%@", output);
      }
}];
import Alamofire

if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}

let stripedString = StrippedString(stripString: "string")

EmailToSmsAPI.smsEmailSmsStrippedStringPut(strippedString: stripedString, ruleId: 1) { (dataString, error) in
    guard let dataString = dataString else {
        print(error!)
        return
    }

    if let data = dataString.data(using: String.Encoding.utf8) {
        do {
            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                print(dictonary)
            } else {
                print("bad json")
            }
        } catch let error as NSError {
            print(error)
        }
    }
}
    Coming Soon
package ClickSend;

import ClickSend.Api.EmailToSmsApi;
import ClickSend.Model.StrippedString;

public class update_stripped_string_rule {
  public static void main(String[] args) {
    ApiClient defaultClient = new ApiClient();
    defaultClient.setUsername("USERNAME");
    defaultClient.setPassword("API_KEY");
    EmailToSmsApi apiInstance = new EmailToSmsApi(defaultClient);
    // StrippedString | StrippedString model
    StrippedString strippedString = new StrippedString(); 
    strippedString.stripString("  test1  ");
    Integer ruleId = 1067; // Integer | Your rule id
    try {
        String result = apiInstance.smsEmailSmsStrippedStringPut(strippedString, ruleId);
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling EmailToSmsApi#smsEmailSmsStrippedStringPut");
        e.printStackTrace();
    }
  }
}

Body parameter

{
  "strip_string": "~~~test1~~~"
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "Strip string has been updated.",
  "data": {
    "rule_id": 20,
    "strip_string": "~~~~test1~~~~"
  }
}

https://rest.clicksend.com/v3/sms/email-sms-stripped-strings/{rule_id}

Update email to sms stripped string rule

Update email to sms stripped string rule

Parameters

Parameter In Type Required Description
rule_id path integer(int32) true Your rule id
stripped-string body string true String to be stripped.

Refer to Status Codes for definitions of HTTP status code responses.

Delete Stripped String Rule

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
     --request DELETE \
'https://rest.clicksend.com/v3/sms/email-sms-stripped-strings/{rule_id}'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\EmailToSmsApi(new GuzzleHttp\Client(),$config);
$rule_id = 1137; // int | Your rule id

try {
    $result = $apiInstance->smsEmailSmsStrippedStringDelete($rule_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling EmailToSmsApi->smsEmailSmsStrippedStringDelete: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME, 
    Password = API_KEY  
};
var emailToSmsApi = new EmailToSmsApi(configuration);
var response = emailToSmsApi.SmsEmailSmsStrippedStringDelete(RULE_ID);
var api = require('./api.js');

var emailToSmsApi = new api.EmailToSmsApi("USERNAME", "API_KEY");

var ruleId = 1119;

emailToSmsApi.smsEmailSmsStrippedStringDelete(ruleId).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::EmailToSmsApi.new

rule_id = 56 # Integer | Your rule id

begin
  # Delete email to sms stripped string rule
  result = api_instance.sms_email_sms_stripped_string_delete(rule_id)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling EmailToSmsApi->sms_email_sms_stripped_string_delete: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.EmailToSmsApi(clicksend_client.ApiClient(configuration))
rule_id = 56 # int | Your rule id

try:
    # Delete email to sms stripped string rule
    api_response = api_instance.sms_email_sms_stripped_string_delete(rule_id)
    print(api_response)
except ApiException as e:
    print("Exception when calling EmailToSmsApi->sms_email_sms_stripped_string_delete: %s\n" % e)
use WWW::ClickSendClient::EmailToSmsApi;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::EmailToSmsApi->new(username => $username, password => $password);

my $json_output = $api->sms_email_sms_stripped_string_delete('rule_id' => '1234');

print $json_output;
#import "CSDefaultConfiguration.h"
#import "CSEmailToSmsApi.h"


CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
[apiConfig setUsername:@"USERNAME"];
[apiConfig setPassword:@"PASSWORD"];

NSNumber *ruleid = [[NSNumber alloc] initWithInt:1];

CSEmailToSmsApi *emailToSmsApi = [[CSEmailToSmsApi alloc] init];
[emailToSmsApi smsEmailSmsStrippedStringDeleteWithRuleId:ruleid completionHandler:^(NSString *output, NSError *error) {
       if (error) {
            NSLog(@"Error: %@", error);
        } else {
             NSLog(@"%@", output);
        }
}];
import Alamofire

if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}

EmailToSmsAPI.smsEmailSmsStrippedStringDelete(ruleId: 1) { (dataString, error) in
    guard let dataString = dataString else {
        print(error!)
        return
    }

    if let data = dataString.data(using: String.Encoding.utf8) {
        do {
            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                print(dictonary)
            } else {
                print("bad json")
            }
        } catch let error as NSError {
            print(error)
        }
    }
}
    Coming Soon
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.EmailToSmsApi(clicksend_client.ApiClient(configuration))
rule_id = 56 # int | Your rule id

try:
    # Delete email to sms stripped string rule
    api_response = api_instance.sms_email_sms_stripped_string_delete(rule_id)
    print(api_response)
except ApiException as e:
    print("Exception when calling EmailToSmsApi->sms_email_sms_stripped_string_delete: %s\n" % e)

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "Strip string has been deleted.",
  "data": true
}

https://rest.clicksend.com/v3/sms/email-sms-stripped-strings/{rule_id}

Delete email to sms stripped string rule

Delete email to sms stripped string rule

Parameters

Parameter In Type Required Description
rule_id path integer(int32) true Your rule id

Refer to Status Codes for definitions of HTTP status code responses.

Master Email Templates

Master templates are templates that you can clone to a User Email Template which lets you edit and save it.

View Master Email Templates

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
'https://rest.clicksend.com/v3/email/master-templates'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\MasterEmailTemplatesApi(new GuzzleHttp\Client(),$config);
$page = 1; // int | Page number
$limit = 10; // int | Number of records per page

try {
    $result = $apiInstance->masterEmailTemplatesGet($page, $limit);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling MasterEmailTemplatesApi->masterEmailTemplatesGet: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME, 
    Password = API_KEY  
};
var masterEmailTemplatesApi = new MasterEmailTemplatesApi(configuration);
var response = masterEmailTemplatesApi.MasterEmailTemplatesGet();
var api = require('./api.js');

var masterEmailTemplateApi = new api.MasterEmailTemplatesApi("USERNAME", "API_KEY");

var page = 1;
var limit = 10;

masterEmailTemplateApi.masterEmailTemplatesGet(page, limit).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::MasterEmailTemplatesApi.new

opts = {
  page: 1, # Integer | Page number
  limit: 10 # Integer | Number of records per page
}

begin
  # Get all master email templates
  result = api_instance.master_email_templates_get(opts)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling MasterEmailTemplatesApi->master_email_templates_get: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.MasterEmailTemplatesApi(clicksend_client.ApiClient(configuration))
page = 1 # int | Page number (optional) (default to 1)
limit = 10 # int | Number of records per page (optional) (default to 10)

try:
    # Get all master email templates
    api_response = api_instance.master_email_templates_get(page=page, limit=limit)
    print(api_response)
except ApiException as e:
    print("Exception when calling MasterEmailTemplatesApi->master_email_templates_get: %s\n" % e)
use WWW::ClickSendClient::MasterEmailTemplatesApi;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::MasterEmailTemplatesApi->new(username => $username, password => $password);

my $json_output = $api->master_email_templates_get('page' => '1','limit' => '1');

print $json_output;
#import "CSMasterEmailTemplatesApi.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
[apiConfig setUsername:@"USERNAME"];
[apiConfig setPassword:@"PASSWORD"];

NSNumber *page = [[NSNumber alloc] initWithInt:1];
NSNumber *limit = [[NSNumber alloc] initWithInt:15];

CSMasterEmailTemplatesApi *masterEmailTemplatesApiInstance = [[CSMasterEmailTemplatesApi alloc] init];
[masterEmailTemplatesApiInstance masterEmailTemplatesGetWithPage:page limit:limit completionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire

if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}
MasterEmailTemplatesAPI.masterEmailTemplatesGet(page: 1, limit: 15) { (dataString, error) in
    guard let dataString = dataString else {
        print(error!)
        return
    }
    if let data = dataString.data(using: String.Encoding.utf8) {
        do {
            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                print(dictonary)
            } else {
                print("Cannot convert the String value to JSON")
            }
        } catch let error as NSError {
            print(error)
        }
    }
}
    Coming Soon
package ClickSend;

import ClickSend.Api.MasterEmailTemplatesApi;

public class view_all_master_email_template {
  public static void main(String[] args) {
    ApiClient defaultClient = new ApiClient();
    defaultClient.setUsername("USERNAME");
    defaultClient.setPassword("API_KEY");
    MasterEmailTemplatesApi apiInstance = new MasterEmailTemplatesApi(defaultClient);
    Integer page = 1; // Integer | Page number
    Integer limit = 10; // Integer | Number of records per page
    try {
        String result = apiInstance.masterEmailTemplatesGet(page, limit);
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling MasterEmailTemplatesApi#masterEmailTemplatesGet");
        e.printStackTrace();
    }
  }
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "List of Email Master Templates",
  "data": [
    {
      "template_id_master": 57,
      "template_name": "Basic 2",
      "date_added": "1458182912",
      "thumbnail": {
        "small": "https://s3-ap-southeast-2.amazonaws.com/clicksend-api-downloads/_email-marketing/_templates-master/basic2/thumb-small.jpg",
        "large": "https://s3-ap-southeast-2.amazonaws.com/clicksend-api-downloads/_email-marketing/_templates-master/basic2/thumb-large.jpg"
      }
    },
    {
      "template_id_master": 1,
      "template_name": "Minty",
      "date_added": "1445848821",
      "thumbnail": {
        "small": "https://s3-ap-southeast-2.amazonaws.com/clicksend-api-downloads/_email-marketing/_templates-master/minty/thumb-small.jpg",
        "large": "https://s3-ap-southeast-2.amazonaws.com/clicksend-api-downloads/_email-marketing/_templates-master/minty/thumb-large.jpg"
      }
    }
  ]
}

https://rest.clicksend.com/v3/email/master-templates

Get all master email templates.

Get all master email templates.

Parameters

Parameter In Type Required Description
page query integer(int32) false Page number
limit query integer(int32) false Number of records per page

Refer to Status Codes for definitions of HTTP status code responses.

View Master Email Template

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
'https://rest.clicksend.com/v3/email/master-templates/{template_id}'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\MasterEmailTemplatesApi(new GuzzleHttp\Client(),$config);
$template_id = 62; // int | Email template id

try {
    $result = $apiInstance->masterEmailTemplateGet($template_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling MasterEmailTemplatesApi->masterEmailTemplateGet: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME, 
    Password = API_KEY  
};
var masterEmailTemplatesApi = new MasterEmailTemplatesApi(configuration);
var response = masterEmailTemplatesApi.MasterEmailTemplateGet(TEMPLATE_ID);
var api = require('./api.js');

var masterEmailTemplateApi = new api.MasterEmailTemplatesApi("USERNAME", "API_KEY");

var templateId = 1;

masterEmailTemplateApi.masterEmailTemplateGet(templateId).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::MasterEmailTemplatesApi.new

template_id = 56 # Integer | Email template id

begin
  # Get specific master email template
  result = api_instance.master_email_template_get(template_id)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling MasterEmailTemplatesApi->master_email_template_get: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.MasterEmailTemplatesApi(clicksend_client.ApiClient(configuration))
template_id = 61 # int | Email template id

try:
    # Get specific master email template
    api_response = api_instance.master_email_template_get(template_id)
    print(api_response)
except ApiException as e:
    print("Exception when calling MasterEmailTemplatesApi->master_email_template_get: %s\n" % e)
use WWW::ClickSendClient::MasterEmailTemplatesApi;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::MasterEmailTemplatesApi->new(username => $username, password => $password);

my $json_output = $api->master_email_template_get('template_id' => '123');

print $json_output;
#import "CSMasterEmailTemplatesApi.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
[apiConfig setUsername:@"USERNAME"];
[apiConfig setPassword:@"PASSWORD"];

NSNumber *templateId = [[NSNumber alloc] initWithInt:1];

CSMasterEmailTemplatesApi *masterEmailTemplatesApiInstance = [[CSMasterEmailTemplatesApi alloc] init];
[masterEmailTemplatesApiInstance masterEmailTemplateGetWithTemplateId:templateId completionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire

if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}
MasterEmailTemplatesAPI.masterEmailTemplateGet(templateId: 1) { (dataString, error) in
    guard let dataString = dataString else {
        print(error!)
        return
    }
    if let data = dataString.data(using: String.Encoding.utf8) {
        do {
            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                print(dictonary)
            } else {
                print("Cannot convert the String value to JSON")
            }
        } catch let error as NSError {
            print(error)
        }
    }
}
    Coming Soon
package ClickSend;

import ClickSend.Api.MasterEmailTemplatesApi;

public class view_specific_master_email_template {
  public static void main(String[] args) {
    ApiClient defaultClient = new ApiClient();
    defaultClient.setUsername("USERNAME");
    defaultClient.setPassword("API_KEY");
    MasterEmailTemplatesApi apiInstance = new MasterEmailTemplatesApi(defaultClient);
    Integer templateId = 63; // Integer | Email template id
    try {
        String result = apiInstance.masterEmailTemplateGet(templateId);
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling MasterEmailTemplatesApi#masterEmailTemplateGet");
        e.printStackTrace();
    }
  }
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "Here is your email template",
  "data": {
    "template_id_master": 57,
    "template_name": "Basic 2",
    "date_added": "1458182912",
    "thumbnail": {
      "small": "https://s3-ap-southeast-2.amazonaws.com/clicksend-api-downloads/_email-marketing/_templates-master/basic2/thumb-small.jpg",
      "large": "https://s3-ap-southeast-2.amazonaws.com/clicksend-api-downloads/_email-marketing/_templates-master/basic2/thumb-large.jpg"
    }
  }
}

https://rest.clicksend.com/v3/email/master-templates/{template_id}

Get specific master email template

Get specific master email template

Parameters

Parameter In Type Required Description
template_id path integer(int32) true Email template id

Refer to Status Codes for definitions of HTTP status code responses.

View Template Categories

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
'https://rest.clicksend.com/v3/email/master-templates-categories'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\MasterEmailTemplatesApi(new GuzzleHttp\Client(),$config);
$page = 1; // int | Page number
$limit = 10; // int | Number of records per page

try {
    $result = $apiInstance->masterEmailTemplateCategoriesGet($page, $limit);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling MasterEmailTemplatesApi->masterEmailTemplateCategoriesGet: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME, 
    Password = API_KEY  
};
var masterEmailTemplatesApi = new MasterEmailTemplatesApi(configuration);
var response = masterEmailTemplatesApi.MasterEmailTemplateCategoriesGet();
var api = require('./api.js');

var masterEmailTemplateApi = new api.MasterEmailTemplatesApi("USERNAME", "API_KEY");

var page = 1;
var limit = 10;

masterEmailTemplateApi.masterEmailTemplateCategoriesGet(page, limit).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::MasterEmailTemplatesApi.new

opts = {
  page: 1,  # Integer | Page number
  limit: 10 # Integer | Number of records per page
}

begin
  # Get all master email template categories
  result = api_instance.master_email_template_categories_get(opts)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling MasterEmailTemplatesApi->master_email_template_categories_get: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.MasterEmailTemplatesApi(clicksend_client.ApiClient(configuration))
page = 1 # int | Page number (optional) (default to 1)
limit = 10 # int | Number of records per page (optional) (default to 10)

try:
    # Get all master email template categories
    api_response = api_instance.master_email_template_categories_get(page=page, limit=limit)
    print(api_response)
except ApiException as e:
    print("Exception when calling MasterEmailTemplatesApi->master_email_template_categories_get: %s\n" % e)
use WWW::ClickSendClient::MasterEmailTemplatesApi;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::MasterEmailTemplatesApi->new(username => $username, password => $password);

my $json_output = $api->master_email_template_categories_get('page' => '1','limit' => '1');

print $json_output;
#import "CSMasterEmailTemplatesApi.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
[apiConfig setUsername:@"USERNAME"];
[apiConfig setPassword:@"PASSWORD"];

NSNumber *categoryId = [[NSNumber alloc] initWithInt:1];
NSNumber *page = [[NSNumber alloc] initWithInt:1];
NSNumber *limit = [[NSNumber alloc] initWithInt:15];

CSMasterEmailTemplatesApi *masterEmailTemplatesApiInstance = [[CSMasterEmailTemplatesApi alloc] init];
[masterEmailTemplatesApiInstance masterEmailTemplatesInCategoryGetWithCategoryId:categoryId page:page limit:limit completionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire

if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}

MasterEmailTemplatesAPI.masterEmailTemplatesInCategoryGet(categoryId: 1, page: 15, limit: nil) { (dataString, error) in
    guard let dataString = dataString else {
        print(error!)
        return
    }
    if let data = dataString.data(using: String.Encoding.utf8) {
        do {
            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                print(dictonary)
            } else {
                print("Cannot convert the String value to JSON")
            }
        } catch let error as NSError {
        print(error)
        }
    }
}
    Coming Soon
package ClickSend;

import ClickSend.Api.MasterEmailTemplatesApi;

public class view_all_template_categories {
  public static void main(String[] args) {
    ApiClient defaultClient = new ApiClient();
    defaultClient.setUsername("USERNAME");
    defaultClient.setPassword("API_KEY");
    MasterEmailTemplatesApi apiInstance = new MasterEmailTemplatesApi(defaultClient);
    Integer page = 1; // Integer | Page number
    Integer limit = 10; // Integer | Number of records per page
    try {
        String result = apiInstance.masterEmailTemplateCategoriesGet(page, limit);
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling MasterEmailTemplatesApi#masterEmailTemplateCategoriesGet");
        e.printStackTrace();
    }
  }
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "List of Email Categories",
  "data": [
    {
      "category_id": 2,
      "name": "Alerts/Notificartions"
    },
    {
      "category_id": 3,
      "name": "Art"
    },
    {
      "category_id": 4,
      "name": "Birthday"
    },
    {
      "category_id": 23,
      "name": "Blank Template"
    }
  ]
}

https://rest.clicksend.com/v3/email/master-templates-categories

Get all master email template categories

Get all master email template categories

Parameters

Parameter In Type Required Description
page query integer(int32) false Page number
limit query integer(int32) false Number of records per page

Refer to Status Codes for definitions of HTTP status code responses.

View Template Category

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
'https://rest.clicksend.com/v3/email/master-templates-categories/{category_id}'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\MasterEmailTemplatesApi(new GuzzleHttp\Client(),$config);
$category_id = 4; // int | Email category id

try {
    $result = $apiInstance->masterEmailTemplateCategoryGet($category_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling MasterEmailTemplatesApi->masterEmailTemplateCategoryGet: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME, 
    Password = API_KEY  
};
var masterEmailTemplatesApi = new MasterEmailTemplatesApi(configuration);
var response = masterEmailTemplatesApi.MasterEmailTemplateCategoryGet(CATEGORY_ID);
var api = require('./api.js');

var masterEmailTemplateApi = new api.MasterEmailTemplatesApi("USERNAME", "API_KEY");

var categoryId = 2;

masterEmailTemplateApi.masterEmailTemplateCategoryGet(categoryId).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::MasterEmailTemplatesApi.new

category_id = 56 # Integer | Email category id

begin
  # Get specific master email template category
  result = api_instance.master_email_template_category_get(category_id)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling MasterEmailTemplatesApi->master_email_template_category_get: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.MasterEmailTemplatesApi(clicksend_client.ApiClient(configuration))
category_id = 16 # int | Email category id

try:
    # Get specific master email template category
    api_response = api_instance.master_email_template_category_get(category_id)
    print(api_response)
except ApiException as e:
    print("Exception when calling MasterEmailTemplatesApi->master_email_template_category_get: %s\n" % e)
use WWW::ClickSendClient::MasterEmailTemplatesApi;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::MasterEmailTemplatesApi->new(username => $username, password => $password);

my $json_output = $api->master_email_template_category_get('category_id' => '1');

print $json_output;
#import "CSMasterEmailTemplatesApi.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
[apiConfig setUsername:@"USERNAME"];
[apiConfig setPassword:@"PASSWORD"];

NSNumber *categoryId = [[NSNumber alloc] initWithInt:1];
NSNumber *page = [[NSNumber alloc] initWithInt:1];
NSNumber *limit = [[NSNumber alloc] initWithInt:15];

CSMasterEmailTemplatesApi *masterEmailTemplatesApiInstance = [[CSMasterEmailTemplatesApi alloc] init];
[masterEmailTemplatesApiInstance masterEmailTemplatesInCategoryGetWithCategoryId:categoryId page:page limit:limit completionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire

if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}

MasterEmailTemplatesAPI.masterEmailTemplatesInCategoryGet(categoryId: 1) { (dataString, error) in
    guard let dataString = dataString else {
        print(error!)
        return
    }
    if let data = dataString.data(using: String.Encoding.utf8) {
        do {
            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                print(dictonary)
            } else {
                print("Cannot convert the String value to JSON")
            }
        } catch let error as NSError {
        print(error)
        }
    }
}
    Coming Soon
package ClickSend;

import ClickSend.Api.MasterEmailTemplatesApi;

public class view_specific_template_category {
  public static void main(String[] args) {
    ApiClient defaultClient = new ApiClient();
    defaultClient.setUsername("USERNAME");
    defaultClient.setPassword("API_KEY");
    MasterEmailTemplatesApi apiInstance = new MasterEmailTemplatesApi(defaultClient);
    Integer categoryId = 2; // Integer | Email category id
    try {
        String result = apiInstance.masterEmailTemplateCategoryGet(categoryId);
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling MasterEmailTemplatesApi#masterEmailTemplateCategoryGet");
        e.printStackTrace();
    }
  }
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "List of Email Categories",
  "data": {
    "category_id": 4,
    "name": "Birthday"
  }
}

https://rest.clicksend.com/v3/email/master-templates-categories/{category_id}

Get specific master email template category

Get specific master email template category

Parameters

Parameter In Type Required Description
category_id path integer(int32) true Email category id

Refer to Status Codes for definitions of HTTP status code responses.

View Templates in Category

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
'https://rest.clicksend.com/v3/email/master-templates-categories/{category_id}/master-templates'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\MasterEmailTemplatesApi(new GuzzleHttp\Client(),$config);
$category_id = 4; // int | Email category id
$page = 1; // int | Page number
$limit = 10; // int | Number of records per page

try {
    $result = $apiInstance->masterEmailTemplatesInCategoryGet($category_id, $page, $limit);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling MasterEmailTemplatesApi->masterEmailTemplatesInCategoryGet: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME, 
    Password = API_KEY  
};
var masterEmailTemplatesApi = new MasterEmailTemplatesApi(configuration);
var response = masterEmailTemplatesApi.MasterEmailTemplatesInCategoryGet(CATEGORY_ID);
var api = require('./api.js');

var masterEmailTemplateApi = new api.MasterEmailTemplatesApi("USERNAME", "API_KEY");

var categoryId = 2;
var page = 1;
var limit = 10;

masterEmailTemplateApi.masterEmailTemplatesInCategoryGet(categoryId, page, limit).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::MasterEmailTemplatesApi.new

category_id = 4 # Integer | Email category id

opts = {
  page: 1, # Integer | Page number
  limit: 10 # Integer | Number of records per page
}

begin
  # Get all master email templates in a category
  result = api_instance.master_email_templates_in_category_get(category_id, opts)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling MasterEmailTemplatesApi->master_email_templates_in_category_get: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.MasterEmailTemplatesApi(clicksend_client.ApiClient(configuration))
category_id = 13 # int | Email category id
page = 1 # int | Page number (optional) (default to 1)
limit = 10 # int | Number of records per page (optional) (default to 10)

try:
    # Get all master email templates in a category
    api_response = api_instance.master_email_templates_in_category_get(category_id, page=page, limit=limit)
    print(api_response)
except ApiException as e:
    print("Exception when calling MasterEmailTemplatesApi->master_email_templates_in_category_get: %s\n" % e)
use WWW::ClickSendClient::MasterEmailTemplatesApi;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::MasterEmailTemplatesApi->new(username => $username, password => $password);

my $json_output = $api->master_email_templates_in_category_get('category_id' => '123', 'page' => '1' ,'limit' => '10' );

print $json_output;
#import "CSMasterEmailTemplatesApi.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
[apiConfig setUsername:@"USERNAME"];
[apiConfig setPassword:@"PASSWORD"];

NSNumber *categoryId = [[NSNumber alloc] initWithInt:1];
NSNumber *page = [[NSNumber alloc] initWithInt:1];
NSNumber *limit = [[NSNumber alloc] initWithInt:15];

CSMasterEmailTemplatesApi *masterEmailTemplatesApiInstance = [[CSMasterEmailTemplatesApi alloc] init];
[masterEmailTemplatesApiInstance masterEmailTemplatesInCategoryGetWithCategoryId:categoryId page:page limit:limit completionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire

if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}
MasterEmailTemplatesAPI.masterEmailTemplatesInCategoryGet(categoryId: 1) { (dataString, error) in
    guard let dataString = dataString else {
        print(error!)
        return
    }
    if let data = dataString.data(using: String.Encoding.utf8) {
        do {
            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                print(dictonary)
            } else {
                print("Cannot convert the String value to JSON")
            }
        } catch let error as NSError {
        print(error)
        }
    }
}
    Coming Soon
package ClickSend;

import ClickSend.Api.MasterEmailTemplatesApi;

public class view_template_in_category {
  public static void main(String[] args) {
    ApiClient defaultClient = new ApiClient();
    defaultClient.setUsername("USERNAME");
    defaultClient.setPassword("API_KEY");
    MasterEmailTemplatesApi apiInstance = new MasterEmailTemplatesApi(defaultClient);
    Integer categoryId = 2; // Integer | Email category id
    Integer page = 1; // Integer | Page number
    Integer limit = 10; // Integer | Number of records per page
    try {
        String result = apiInstance.masterEmailTemplatesInCategoryGet(categoryId, page, limit);
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling MasterEmailTemplatesApi#masterEmailTemplatesInCategoryGet");
        e.printStackTrace();
    }
  }
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "List of Email Templates By Category",
  "data": [
    {
      "template_id_master": 1,
      "category_id": 1,
      "template_name": "Minty",
      "body": "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" ...\n                     </tr>\n                  </tbody>\n               </table>\n            </td>\n         </tr>\n      </tbody>\n   </table>\n</body>\n</html>",
      "date_added": "1445848821",
      "thumbnail": {
        "small": "https://s3-ap-southeast-2.amazonaws.com/clicksend-api-downloads/_email-marketing/_templates-master/minty/thumb-small.jpg",
        "large": "https://s3-ap-southeast-2.amazonaws.com/clicksend-api-downloads/_email-marketing/_templates-master/minty/thumb-large.jpg"
      }
    }
  ]
}

https://rest.clicksend.com/v3/email/master-templates-categories/{category_id}/master-templates

Get all master email templates in a category

Get all master email templates in a category

Parameters

Parameter In Type Required Description
category_id path integer(int32) true Email category id
page query integer(int32) false Page number
limit query integer(int32) false Number of records per page

Refer to Status Codes for definitions of HTTP status code responses.

User Email Templates

These are your templates which can be edited and saved. You can create an email template by cloning from a Master Template.

View Email Templates

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
'https://rest.clicksend.com/v3/email/templates'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\UserEmailTemplatesApi(new GuzzleHttp\Client(),$config);
$page = 1; // int | Page number
$limit = 10; // int | Number of records per page

try {
    $result = $apiInstance->emailTemplatesGet($page, $limit);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling UserEmailTemplatesApi->emailTemplatesGet: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME, 
    Password = API_KEY  
};
var userEmailTemplatesApi = new UserEmailTemplatesApi(configuration);
var response = userEmailTemplatesApi.EmailTemplatesGet();
var api = require('./api.js');

var userEmailTemplateApi = new api.UserEmailTemplatesApi("USERNAME", "API_KEY");

var page = 1;
var limit = 10;

userEmailTemplateApi.emailTemplatesGet(page, limit).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::UserEmailTemplatesApi.new

opts = {
  page: 1,  # Integer | Page number
  limit: 10 # Integer | Number of records per page
}

begin
  # Get all user email templates
  result = api_instance.email_templates_get(opts)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling UserEmailTemplatesApi->email_templates_get: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.UserEmailTemplatesApi(clicksend_client.ApiClient(configuration))
page = 1 # int | Page number (optional) (default to 1)
limit = 10 # int | Number of records per page (optional) (default to 10)

try:
    # Get all user email templates
    api_response = api_instance.email_templates_get(page=page, limit=limit)
    print(api_response)
except ApiException as e:
    print("Exception when calling UserEmailTemplatesApi->email_templates_get: %s\n" % e)
use WWW::ClickSendClient::UserEmailTemplatesApi;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::UserEmailTemplatesApi->new(username => $username, password => $password);

my $json_output = $api->email_templates_get('page' => '1' ,'limit' => '10' );

print $json_output;
#import "CSUserEmailTemplatesApi.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
[apiConfig setUsername:@"USERNAME"];
[apiConfig setPassword:@"PASSWORD"];

NSNumber *page = [[NSNumber alloc] initWithInt:1];
NSNumber *limit = [[NSNumber alloc] initWithInt:15];

CSUserEmailTemplatesApi *userEmailTemplatesApiInstance = [[CSUserEmailTemplatesApi alloc] init];
[userEmailTemplatesApiInstance emailTemplatesGetWithPage:page limit:limit completionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire

if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}
UserEmailTemplatesAPI.emailTemplatesGet(page: 1, limit: 15) { (dataString, error) in
    guard let dataString = dataString else {
        print(error!)
        return
    }
    if let data = dataString.data(using: String.Encoding.utf8) {
        do {
            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                print(dictonary)
            } else {
                print("Cannot convert the String value to JSON")
            }
        } catch let error as NSError {
            print(error)
        }
    }
}
    Coming Soon
package ClickSend;

import ClickSend.Api.UserEmailTemplatesApi;

public class view_all_email_template {
   public static void main(String[] args) {
      ApiClient defaultClient = new ApiClient();
      defaultClient.setUsername("USERNAME");
      defaultClient.setPassword("API_KEY");
      UserEmailTemplatesApi apiInstance = new UserEmailTemplatesApi(defaultClient);
      Integer page = 1; // Integer | Page number
      Integer limit = 10; // Integer | Number of records per page
      try {
          String result = apiInstance.emailTemplatesGet(page, limit);
          System.out.println(result);
      } catch (ApiException e) {
          System.err.println("Exception when calling UserEmailTemplatesApi#emailTemplatesGet");
          e.printStackTrace();
      }
   }
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "Here are your email templates.",
  "data": {
    "total": 2,
    "per_page": 15,
    "current_page": 1,
    "last_page": 1,
    "next_page_url": null,
    "prev_page_url": null,
    "from": 1,
    "to": 2,
    "data": [
      {
        "template_id": 281,
        "template_name": "Test"
      },
      {
        "template_id": 290,
        "template_name": "Minions"
      }
    ]
  }
}

https://rest.clicksend.com/v3/email/templates

Get all user email templates

Get all user email templates

Parameters

Parameter In Type Required Description
page query integer(int32) false Page number
limit query integer(int32) false Number of records per page

Refer to Status Codes for definitions of HTTP status code responses.

Create Email Template

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
     --request POST \
     --header "Content-Type: application/json" \
     --data-binary "{
  \"template_name\": \"Minions\",
  \"template_id_master\": 57
}" \
'https://rest.clicksend.com/v3/email/templates'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\UserEmailTemplatesApi(new GuzzleHttp\Client(),$config);
// \ClickSend\Model\EmailTemplateNew | Email template model
$email_template = new \ClickSend\Model\EmailTemplateNew(); 
$email_template->setTemplateName("template");
$email_template->setTemplateIdMaster(57);

try {
    $result = $apiInstance->emailTemplatePost($email_template);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling UserEmailTemplatesApi->emailTemplatePost: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME, 
    Password = API_KEY  
};
var userEmailTemplatesApi = new UserEmailTemplatesApi(configuration);
var response = userEmailTemplatesApi.EmailTemplatePost(new EmailTemplateNew( 
    templateName: "Template Name",
    templateIdMaster: TEMPLATE_MASTER_ID
));
var api = require('./api.js');

var userEmailTemplateApi = new api.UserEmailTemplatesApi("USERNAME", "API_KEY");

var emailTemplate = new api.EmailTemplateNew();

emailTemplate.templateName = "templateName";
emailTemplate.templateIdMaster = 56;

userEmailTemplateApi.emailTemplatePost(emailTemplate).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::UserEmailTemplatesApi.new

# EmailTemplateNew | Email template model
email_template = ClickSendClient::EmailTemplateNew.new(
  "template_name": "template_name",
  "template_id_master": 10115
)

begin
  # Create email template
  result = api_instance.email_template_post(email_template)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling UserEmailTemplatesApi->email_template_post: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.UserEmailTemplatesApi(clicksend_client.ApiClient(configuration))
email_template = clicksend_client.EmailTemplateNew(
                  template_name='test_template',
                  template_id_master=57) # EmailTemplateNew | Email template model

try:
    # Create email template
    api_response = api_instance.email_template_post(email_template)
    print(api_response)
except ApiException as e:
    print("Exception when calling UserEmailTemplatesApi->email_template_post: %s\n" % e)
use WWW::ClickSendClient::UserEmailTemplatesApi;
use WWW::ClickSendClient::Object::EmailTemplateNew;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::UserEmailTemplatesApi->new(username => $username, password => $password);

my %params = (
    'template_name'      => 'template_name',
    'template_id_master' => '1234'
);

my $email_template_obj = WWW::ClickSendClient::Object::EmailTemplateNew->new(%params);
my $json_output = $api->email_template_post('email_template' => $email_template_obj);

print $json_output;
#import "CSUserEmailTemplatesApi.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
[apiConfig setUsername:@"USERNAME"];
[apiConfig setPassword:@"PASSWORD"];

CSEmailTemplateNew *emailTemplateNew = [[CSEmailTemplateNew alloc] init];
emailTemplateNew.templateName = @"string";
emailTemplateNew.templateIdMaster = 0;
CSUserEmailTemplatesApi *userEmailTemplatesApiInstance = [[CSUserEmailTemplatesApi alloc] init];
[userEmailTemplatesApiInstance emailTemplatePostWithEmailTemplate:emailTemplateNew completionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire

if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}
let emailTemplate = EmailTemplateNew(templateName: "String", templateIdMaster: 1);
UserEmailTemplatesAPI.emailTemplatePost(emailTemplate: emailTemplate) { (dataString, error) in
    guard let dataString = dataString else {
        print(error!)
        return
    }
    if let data = dataString.data(using: String.Encoding.utf8) {
        do {
            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                print(dictonary)
            } else {
                print("Cannot convert the String value to JSON")
            }
        } catch let error as NSError {
        print(error)
        }
    }
}
    Coming Soon
package ClickSend;

import java.math.BigDecimal;
import ClickSend.Api.UserEmailTemplatesApi;
import ClickSend.Model.EmailTemplateNew;

public class create_email_template {
   public static void main(String[] args) {
      ApiClient defaultClient = new ApiClient();
      defaultClient.setUsername("USERNAME");
      defaultClient.setPassword("API_KEY");
      UserEmailTemplatesApi apiInstance = new UserEmailTemplatesApi(defaultClient);
      EmailTemplateNew emailTemplate = new EmailTemplateNew(); // EmailTemplateNew | Email template model
      emailTemplate.templateName("java template");
      emailTemplate.templateIdMaster(new BigDecimal(57));
      try {
          String result = apiInstance.emailTemplatePost(emailTemplate);
          System.out.println(result);
      } catch (ApiException e) {
          System.err.println("Exception when calling UserEmailTemplatesApi#emailTemplatePost");
          e.printStackTrace();
      }
   }
}

Body parameter

{
  "template_name": "template_name",
  "template_id_master": 10115
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "New email template has been saved.",
  "data": {
    "template_id": 292,
    "template_id_master": 57,
    "template_name": "new minion template!",
    "body": "<div id=\"nb_wrapper\"><!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\"..."
  }
}

https://rest.clicksend.com/v3/email/templates

Create email template

Create email template

Properties

Name Type Required Restrictions Description
template_name string true none The intended name for the new template.
template_id_master number true none The ID of the master template you want to base on.

Refer to Status Codes for definitions of HTTP status code responses.

View Email Template

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
'https://rest.clicksend.com/v3/email/templates/{template_id}'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\UserEmailTemplatesApi(new GuzzleHttp\Client(),$config);
$template_id = 4609; // int | Email template id

try {
    $result = $apiInstance->emailTemplateGet($template_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling UserEmailTemplatesApi->emailTemplateGet: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME, 
    Password = API_KEY  
};
var userEmailTemplatesApi = new UserEmailTemplatesApi(configuration);
var response = userEmailTemplatesApi.EmailTemplateGet(TEMPLATE_ID);
var api = require('./api.js');

var userEmailTemplateApi = new api.UserEmailTemplatesApi("USERNAME", "API_KEY");

var templateId = 4471;

userEmailTemplateApi.emailTemplateGet(templateId).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::UserEmailTemplatesApi.new

template_id = 56 # Integer | Email template id

begin
  # Get specific user email template
  result = api_instance.email_template_get(template_id)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling UserEmailTemplatesApi->email_template_get: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.UserEmailTemplatesApi(clicksend_client.ApiClient(configuration))
template_id = 4085 # int | Email template id

try:
    # Get specific user email template
    api_response = api_instance.email_template_get(template_id)
    print(api_response)
except ApiException as e:
    print("Exception when calling UserEmailTemplatesApi->email_template_get: %s\n" % e)
use WWW::ClickSendClient::UserEmailTemplatesApi;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::UserEmailTemplatesApi->new(username => $username, password => $password);

my $json_output = $api->email_template_get('template_id' => '1234');

print $json_output;
#import "CSUserEmailTemplatesApi.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
[apiConfig setUsername:@"USERNAME"];
[apiConfig setPassword:@"PASSWORD"];

NSNumber *templateId = [[NSNumber alloc] initWithInt:1];

CSUserEmailTemplatesApi *userEmailTemplatesApiInstance = [[CSUserEmailTemplatesApi alloc] init];
[userEmailTemplatesApiInstance emailTemplateGetWithTemplateId:templateId completionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire

if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}
UserEmailTemplatesAPI.emailTemplateGet(templateId: 1) { (dataString, error) in
    guard let dataString = dataString else {
        print(error!)
        return
    }
    if let data = dataString.data(using: String.Encoding.utf8) {
        do {
            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                print(dictonary)
            } else {
                print("Cannot convert the String value to JSON")
            }
        } catch let error as NSError {
    print(error)
        }   
    }
}
    Coming Soon
package ClickSend;

import ClickSend.Api.UserEmailTemplatesApi;

public class view_specific_email_template {
   public static void main(String[] args) {
      ApiClient defaultClient = new ApiClient();
      defaultClient.setUsername("USERNAME");
      defaultClient.setPassword("API_KEY");
      UserEmailTemplatesApi apiInstance = new UserEmailTemplatesApi(defaultClient);
      Integer templateId = 4227; // Integer | Email template id
      try {
          String result = apiInstance.emailTemplateGet(templateId);
          System.out.println(result);
      } catch (ApiException e) {
          System.err.println("Exception when calling UserEmailTemplatesApi#emailTemplateGet");
          e.printStackTrace();
      }
   }
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "Here is your email template.",
  "data": {
    "template_id": 281,
    "template_id_master": 11,
    "template_name": "Test",
    "body": "<div id=\"nb_wrapper\"><!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\"> \n<html xmlns:v=\"urn:schemas-microsoft-com:vml\">\n<head>\n\n   <!-- Define Charset -->\n   ..."
  }
}

https://rest.clicksend.com/v3/email/templates/{template_id}

Get specific user email template

Get specific user email templates

Parameters

Parameter In Type Required Description
template_id path integer(int32) true Email template id

Refer to Status Codes for definitions of HTTP status code responses.

Update Email Template

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
     --request PUT \

     --data-binary "    {
        \"template_name\":\"Minions\",
        \"body\":\"This is a sample content: Sc0KNWgSMG for this template.\"
    }" \
'https://rest.clicksend.com/v3/email/templates/{template_id}'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\UserEmailTemplatesApi(new GuzzleHttp\Client(),$config);
$template_id = 4609; // int | Email template id
// \ClickSend\Model\EmailTemplateUpdate | Email template model
$email_template = new \ClickSend\Model\EmailTemplateUpdate(); 
$email_template->setTemplateName("template");
$email_template->setBody("template body");

try {
    $result = $apiInstance->emailTemplatePut($template_id, $email_template);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling UserEmailTemplatesApi->emailTemplatePut: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME, 
    Password = API_KEY  
};
var userEmailTemplatesApi = new UserEmailTemplatesApi(configuration);
var response = userEmailTemplatesApi.EmailTemplatePut(TEMPLATE_ID, new EmailTemplateUpdate(
    templateName: "New Name",
    body: "Body"
));
var api = require('./api.js');

var userEmailTemplateApi = new api.UserEmailTemplatesApi("USERNAME", "API_KEY");

var templateId = 4471;

var emailTemplate = new api.EmailTemplateUpdate();

emailTemplate.templateName = "templateName";
emailTemplate.body = "body";

userEmailTemplateApi.emailTemplatePut(templateId, emailTemplate).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::UserEmailTemplatesApi.new

template_id = 56 # Integer | Email template id

# EmailTemplateUpdate | Email template model
email_template = ClickSendClient::EmailTemplateUpdate.new(
  "template_name": "template_name",
  "body": "body"
)

begin
  # Update email template
  result = api_instance.email_template_put(template_id, email_template)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling UserEmailTemplatesApi->email_template_put: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.UserEmailTemplatesApi(clicksend_client.ApiClient(configuration))
template_id = 4086 # int | Email template id
# EmailTemplateUpdate | Email template model
email_template = clicksend_client.EmailTemplateUpdate(
                  template_name='update_template',
                  body='hey template updated now') 

try:
    # Update email template
    api_response = api_instance.email_template_put(template_id, email_template)
    print(api_response)
except ApiException as e:
    print("Exception when calling UserEmailTemplatesApi->email_template_put: %s\n" % e)
use WWW::ClickSendClient::UserEmailTemplatesApi;
use WWW::ClickSendClient::Object::EmailTemplateUpdate;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::UserEmailTemplatesApi->new(username => $username, password => $password);

my %params = (
    'template_name' => 'template_name',
    'body'          => 'body'
);

my $email_templ_update_obj = WWW::ClickSendClient::Object::EmailTemplateUpdate->new(%params);

my $json_output = $api->email_template_put('template_id' => '1234' ,'email_template' => $email_templ_update_obj);

print $json_output;
#import "CSUserEmailTemplatesApi.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
[apiConfig setUsername:@"USERNAME"];
[apiConfig setPassword:@"PASSWORD"];

CSEmailTemplateNew *emailTemplateNew = [[CSEmailTemplateNew alloc] init];
emailTemplateNew.templateName = @"string";
emailTemplateNew.templateIdMaster =0;
CSUserEmailTemplatesApi *userEmailTemplatesApiInstance = [[CSUserEmailTemplatesApi alloc] init];
[userEmailTemplatesApiInstance emailTemplatePostWithEmailTemplate:emailTemplateNew completionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire

if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}

let emailTemplate = EmailTemplateNew(
                            templateName: "templateName", 
                            templateIdMaster: 1
                    )
UserEmailTemplatesAPI.emailTemplatePost(emailTemplate: emailTemplate) { (dataString, error) in
    guard let dataString = dataString else {
        print(error!)
        return
    }
    if let data = dataString.data(using: String.Encoding.utf8) {
        do {
            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                print(dictonary)
            } else {
                print("Cannot convert the String value to JSON")
            }
        } catch let error as NSError {
        print(error)
        }
    }
}
    Coming Soon
package ClickSend;

import ClickSend.Api.UserEmailTemplatesApi;
import ClickSend.Model.EmailTemplateUpdate;

public class update_email_template {
   public static void main(String[] args) {
      ApiClient defaultClient = new ApiClient();
      defaultClient.setUsername("USERNAME");
      defaultClient.setPassword("API_KEY");
      UserEmailTemplatesApi apiInstance = new UserEmailTemplatesApi(defaultClient);
      Integer templateId = 4227; // Integer | Email template id
      EmailTemplateUpdate emailTemplate = new EmailTemplateUpdate(); // EmailTemplateUpdate | Email template model
      emailTemplate.templateName("java template");
      emailTemplate.body("update template content");
      try {
          String result = apiInstance.emailTemplatePut(templateId, emailTemplate);
          System.out.println(result);
      } catch (ApiException e) {
          System.err.println("Exception when calling UserEmailTemplatesApi#emailTemplatePut");
          e.printStackTrace();
      }
   }
}

Body parameter

{
  "template_name": "template_name",
  "body": "body"
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "Your email template has been updated.",
  "data": {
    "template_id": 281,
    "template_id_master": 11,
    "template_name": "NewTemplate",
    "body": "This is the new body of your template"
  }
}

https://rest.clicksend.com/v3/email/templates/{template_id}

Update email template

Update email template

Parameters

Parameter In Type Required Description
template_id path integer(int32) true Email template id

Properties

Name Type Required Restrictions Description
template_name string false none The intended name for the template.
body string true none Your template body.

Refer to Status Codes for definitions of HTTP status code responses.

Delete Email Template

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
     --request DELETE \
'https://rest.clicksend.com/v3/email/templates/{template_id}'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\UserEmailTemplatesApi(new GuzzleHttp\Client(),$config);
$template_id = 4609; // int | Email template id

try {
    $result = $apiInstance->emailTemplateDelete($template_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling UserEmailTemplatesApi->emailTemplateDelete: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME, 
    Password = API_KEY  
};
var userEmailTemplatesApi = new UserEmailTemplatesApi(configuration);
var response = userEmailTemplatesApi.EmailTemplateDelete(TEMPLATE_ID);
var api = require('./api.js');

var userEmailTemplateApi = new api.UserEmailTemplatesApi("USERNAME", "API_KEY");

var templateId = 4471;

userEmailTemplateApi.emailTemplateDelete(templateId).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::UserEmailTemplatesApi.new

template_id = 56 # Integer | Email template id

begin
  # Delete user email template
  result = api_instance.email_template_delete(template_id)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling UserEmailTemplatesApi->email_template_delete: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.UserEmailTemplatesApi(clicksend_client.ApiClient(configuration))
template_id = 4085 # int | Email template id

try:
    # Delete user email template
    api_response = api_instance.email_template_delete(template_id)
    print(api_response)
except ApiException as e:
    print("Exception when calling UserEmailTemplatesApi->email_template_delete: %s\n" % e)
use WWW::ClickSendClient::UserEmailTemplatesApi;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::UserEmailTemplatesApi->new(username => $username, password => $password);

my $json_output = $api->email_template_delete('template_id' => '1234');

print $json_output;
#import "CSUserEmailTemplatesApi.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
[apiConfig setUsername:@"USERNAME"];
[apiConfig setPassword:@"PASSWORD"];

NSNumber *templateId = [[NSNumber alloc] initWithInt:1];

CSUserEmailTemplatesApi *userEmailTemplatesApiInstance = [[CSUserEmailTemplatesApi alloc] init];
[userEmailTemplatesApiInstance emailTemplateDeleteWithTemplateId:templateId completionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire

if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}

UserEmailTemplatesAPI.emailTemplateDelete(templateId: 1) { (dataString, error) in
    guard let dataString = dataString else {
        print(error!)
        return
    }
    if let data = dataString.data(using: String.Encoding.utf8) {
        do {
            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                print(dictonary)
            } else {
                print("Cannot convert the String value to JSON")
            }
        } catch let error as NSError {
            print(error)
        }
    }
}
    Coming Soon
package ClickSend;

import ClickSend.Api.UserEmailTemplatesApi;

public class delete_email_template {
   public static void main(String[] args) {
      ApiClient defaultClient = new ApiClient();
      defaultClient.setUsername("USERNAME");
      defaultClient.setPassword("API_KEY");
      UserEmailTemplatesApi apiInstance = new UserEmailTemplatesApi(defaultClient);
      Integer templateId = 4259; // Integer | Email template id
      try {
          String result = apiInstance.emailTemplateDelete(templateId);
          System.out.println(result);
      } catch (ApiException e) {
          System.err.println("Exception when calling UserEmailTemplatesApi#emailTemplateDelete");
          e.printStackTrace();
      }
   }
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "Your email template has been deleted.",
  "data": []
}

https://rest.clicksend.com/v3/email/templates/{template_id}

Delete user email template

Delete user email template

Parameters

Parameter In Type Required Description
template_id path integer(int32) true Email template id

Refer to Status Codes for definitions of HTTP status code responses.

Email Addresses

View Allowed Email Addresses

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
'https://rest.clicksend.com/v3/email/addresses'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\EmailMarketingApi(new GuzzleHttp\Client(),$config);
$page = 1; // int | Page number
$limit = 10; // int | Number of records per page

try {
    $result = $apiInstance->allowedEmailAddressGet($page, $limit);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling EmailMarketingApi->allowedEmailAddressGet: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME, 
    Password = API_KEY  
};
var emailMarketingApi = new EmailMarketingApi(configuration);
var response = emailMarketingApi.AllowedEmailAddressGet();
var api = require('./api.js');

var emailMarketingApi = new api.EmailMarketingApi("USERNAME", "API_KEY");

var page = 1;
var limit = 10;

emailMarketingApi.allowedEmailAddressGet(page, limit).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::EmailMarketingApi.new

opts = {
  page: 1,  # Integer | Page number
  limit: 10 # Integer | Number of records per page
}

begin
  # Get all email addresses
  result = api_instance.allowed_email_address_get(opts)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling EmailMarketingApi->allowed_email_address_get: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.EmailMarketingApi(clicksend_client.ApiClient(configuration))
page = 1 # int | Page number (optional) (default to 1)
limit = 10 # int | Number of records per page (optional) (default to 10)

try:
    # Get all email addresses
    api_response = api_instance.allowed_email_address_get(page=page, limit=limit)
    print(api_response)
except ApiException as e:
    print("Exception when calling EmailMarketingApi->allowed_email_address_get: %s\n" % e)
use WWW::ClickSendClient::EmailMarketingApi;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::EmailMarketingApi->new(username => $username, password => $password);

my $json_output = $api->allowed_email_address_get('page' => '1' ,'limit'  => '');

print $json_output;
#import "CSEmailMarketingApi.h"


CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
[apiConfig setUsername:@"USERNAME"];
[apiConfig setPassword:@"PASSWORD"];

NSNumber *page = [[NSNumber alloc] initWithInt:1];
NSNumber *limit = [[NSNumber alloc] initWithInt:1];

CSEmailMarketingApi *emailMarketingApiInstance = [[CSEmailMarketingApi alloc] init];
[emailMarketingApiInstance allowedEmailAddressGetWithPage:page limit:limit completionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire

if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}
EmailMarketingAPI.allowedEmailAddressGet { (dataString, error) in
    guard let dataString = dataString else {
        print(error!)
        return
    }

    if let data = dataString.data(using: String.Encoding.utf8) {
        do {
            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                print(dictonary)
            } else {
                print("Cannot convert the String value to JSON")
            }
        } catch let error as NSError {
            print(error)
        }
    }
}
    Coming Soon
package ClickSend;

import ClickSend.Api.EmailMarketingApi;

public class view_all_allowed_email_address {
  public static void main(String[] args) {
    ApiClient defaultClient = new ApiClient();
    defaultClient.setUsername("USERNAME");
    defaultClient.setPassword("API_KEY");
    EmailMarketingApi apiInstance = new EmailMarketingApi(defaultClient);
    Integer page = 1; // Integer | Page number
    Integer limit = 10; // Integer | Number of records per page
    try {
        String result = apiInstance.allowedEmailAddressGet(page, limit);
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling EmailMarketingApi#allowedEmailAddressGet");
        e.printStackTrace();
    }
  }
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "Here are your email addresses",
  "data": {
    "total": 2,
    "per_page": 15,
    "current_page": 1,
    "last_page": 1,
    "next_page_url": null,
    "prev_page_url": null,
    "from": 1,
    "to": 2,
    "data": [
      {
        "email_address_id": 2,
        "email_address": "test@user.com",
        "verified": 1,
        "date_added": "1447736880"
      },
      {
        "email_address_id": 3,
        "email_address": "test2@user.com",
        "verified": 0,
        "date_added": "1449042967"
      }
    ]
  }
}

https://rest.clicksend.com/v3/email/addresses

Get all email addresses

Get all email addresses

Parameters

Parameter In Type Required Description
page query integer(int32) false Page number
limit query integer(int32) false Number of records per page

Refer to Status Codes for definitions of HTTP status code responses.

Create Allowed Email Address

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
     --request POST \
     --header "Content-Type: application/json" \
     --data-binary "{
  \"email_address\": \"johndoe1@user.com\",
  \"Body\": \"\"
}" \
'https://rest.clicksend.com/v3/email/addresses'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\EmailMarketingApi(new GuzzleHttp\Client(),$config);
$email_address = new \ClickSend\Model\EmailAddress(); // \ClickSend\Model\EmailAddress |
$email_address->setEmailAddress("xxx@gmail.com"); 

try {
    $result = $apiInstance->allowedEmailAddressPost($email_address);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling EmailMarketingApi->allowedEmailAddressPost: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME, 
    Password = API_KEY  
};
var deliveryIssuesApi = new DeliveryIssuesApi(configuration);
var response = emailMarketingApi.AllowedEmailAddressPost(new EmailAddress(
    emailAddress: "john@doe.com"
));
var api = require('./api.js');

var emailMarketingApi = new api.EmailMarketingApi("USERNAME", "API_KEY");

var emailAddress = new api.EmailAddress();

emailAddress.emailAddress = "xxx@gmail.com";

emailMarketingApi.allowedEmailAddressPost(emailAddress).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::EmailMarketingApi.new

# EmailAddress |
opts = {
  email_address: ClickSendClient::EmailAddress.new(
    "email_address": "test@test.com"
  )
}

begin
  # Create allowed Email Address
  result = api_instance.allowed_email_address_post(opts)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling EmailMarketingApi->allowed_email_address_post: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.EmailMarketingApi(clicksend_client.ApiClient(configuration))
# EmailAddress |  (optional)
email_address = clicksend_client.EmailAddress(email_address='abc@gmail.com') 

try:
    # Create allowed Email Address
    api_response = api_instance.allowed_email_address_post(email_address=email_address)
    print(api_response)
except ApiException as e:
    print("Exception when calling EmailMarketingApi->allowed_email_address_post: %s\n" % e)
use WWW::ClickSendClient::EmailMarketingApi;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::EmailMarketingApi->new(username => $username, password => $password);

my $json_output = $api->allowed_email_address_post('email_address' => 'test2@test.com');

print $json_output;
#import "CSEmailMarketingApi.h"


CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
[apiConfig setUsername:@"USERNAME"];
[apiConfig setPassword:@"PASSWORD"];

CSEmailMarketingApi *emailMarketingApiInstance = [[CSEmailMarketingApi alloc] init];

CSEmailAddress *emailAddress = [[CSEmailAddress alloc] init];
emailAddress.emailAddress = @"johndoe1@gmail.com";

[emailMarketingApiInstance allowedEmailAddressPostWithEmailAddress:emailAddress completionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire

if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}

EmailMarketingAPI.allowedEmailAddressPost { (dataString, error) in
    guard let dataString = dataString else {
        print(error!)
        return
    }
    if let data = dataString.data(using: String.Encoding.utf8) {
        do {
            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                print(dictonary)
            } else {
                print("Cannot convert the String value to JSON")
            }
        } catch let error as NSError {
            print(error)
        }
    }
}
    Coming Soon
package ClickSend;

import ClickSend.Api.EmailMarketingApi;
import ClickSend.Model.EmailAddress;

public class create_allowed_email_address {
  public static void main(String[] args) {
    ApiClient defaultClient = new ApiClient();
    defaultClient.setUsername("USERNAME");
    defaultClient.setPassword("API_KEY");
    EmailMarketingApi apiInstance = new EmailMarketingApi(defaultClient);
    EmailAddress emailAddress = new EmailAddress(); // EmailAddress | 
    emailAddress.emailAddress("xxx@gmail.com");
    try {
        String result = apiInstance.allowedEmailAddressPost(emailAddress);
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling EmailMarketingApi#allowedEmailAddressPost");
        e.printStackTrace();
    }
  }
}

Body parameter

{
  "email_address": "test@test.com",
  "body": "test"
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "Email address has been created.",
  "data": {
    "email_address_id": 5,
    "email_address": "test222@user.com",
    "verified": 0,
    "date_added": "1458009394"
  }
}

https://rest.clicksend.com/v3/email/addresses

Create allowed Email Address

Create allowed Email Address

Parameters

Parameter In Type Required Description
body body string true Email to be allowed.

Refer to Status Codes for definitions of HTTP status code responses.

Send Email Verification Token

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
     --request PUT \
'https://rest.clicksend.com/v3/email/address-verify/{email_address_id}/send'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\EmailMarketingApi(new GuzzleHttp\Client(),$config);
$email_address_id = 4366; // int | Allowed email address id

try {
    $result = $apiInstance->sendVerificationTokenGet($email_address_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling EmailMarketingApi->sendVerificationTokenGet: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME, 
    Password = API_KEY  
};
var emailMarketingApi = new EmailMarketingApi(configuration);
var response = emailMarketingApi.SendVerificationTokenGet(EMAIL_ADDRESS_ID);
var api = require('./api.js');

var emailMarketingApi = new api.EmailMarketingApi("USERNAME", "API_KEY");

var emailAddressId = 4399;

emailMarketingApi.sendVerificationTokenGet(emailAddressId).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::EmailMarketingApi.new

email_address_id = 56 # Integer | Allowed email address id

begin
  # Send verification token
  result = api_instance.send_verification_token_get(email_address_id)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling EmailMarketingApi->send_verification_token_get: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.EmailMarketingApi(clicksend_client.ApiClient(configuration))
email_address_id = 56 # int | Allowed email address id

try:
    # Send verification token
    api_response = api_instance.send_verification_token_get(email_address_id)
    print(api_response)
except ApiException as e:
    print("Exception when calling EmailMarketingApi->send_verification_token_get: %s\n" % e)
use WWW::ClickSendClient::EmailMarketingApi;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::EmailMarketingApi->new(username => $username, password => $password);

my $json_output = $api->send_verification_token_put('email_address_id' => '12345');

print $json_output;
#import "CSEmailMarketingApi.h"


CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
[apiConfig setUsername:@"USERNAME"];
[apiConfig setPassword:@"PASSWORD"];

NSNumber *emailId = [[NSNumber alloc] initWithInt:1];

CSEmailMarketingApi *emailMarketingApiInstance = [[CSEmailMarketingApi alloc] init];
[emailMarketingApiInstance sendVerificationTokenGetWithEmailAddressId:emailId completionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire

if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}

EmailMarketingAPI.sendVerificationTokenGet(emailAddressId: 1) { (dataString, error) in
    guard let dataString = dataString else {
        print(error!)
        return
    }

    if let data = dataString.data(using: String.Encoding.utf8) {
        do {
            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                print(dictonary)
            } else {
                print("Cannot convert the String value to JSON")
            }
        } catch let error as NSError {
            print(error)
        }
    }
}
    Coming Soon
package ClickSend;

import ClickSend.Api.EmailMarketingApi;

public class send_email_verification_token {
  public static void main(String[] args) {
    ApiClient defaultClient = new ApiClient();
    defaultClient.setUsername("USERNAME");
    defaultClient.setPassword("API_KEY");
    EmailMarketingApi apiInstance = new EmailMarketingApi(defaultClient);
    Integer emailAddressId = 4244; // Integer | Allowed email address id
    try {
        String result = apiInstance.sendVerificationTokenGet(emailAddressId);
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling EmailMarketingApi#sendVerificationTokenGet");
        e.printStackTrace();
    }
  }
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "Verification email has been sent.",
  "data": null
}

https://rest.clicksend.com/v3/email/address-verify/{email_address_id}/send

Send verification token

Send verification token

Parameters

Parameter In Type Required Description
email_address_id path integer(int32) true Allowed email address id

Refer to Status Codes for definitions of HTTP status code responses.

Verify Allowed Email Address

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
     --request PUT \
'https://rest.clicksend.com/v3/email/address-verify/{email_address_id}/verify/{activation_token}'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\EmailMarketingApi(new GuzzleHttp\Client(),$config);
$email_address_id = 4366; // int | Allowed email address id
$activation_token = "C3395F04-F2CA-4BD5-A2B5-5A96D598A7F0"; // string | Your activation token.

try {
    $result = $apiInstance->verifyAllowedEmailAddressGet($email_address_id, $activation_token);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling EmailMarketingApi->verifyAllowedEmailAddressGet: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME, 
    Password = API_KEY  
};
var emailMarketingApi = new EmailMarketingApi(configuration);
var response = emailMarketingApi.VerifyAllowedEmailAddressGet(EMAIL_ADDRESS_ID, "ACTIVATION_CODE");
var api = require('./api.js');

var emailMarketingApi = new api.EmailMarketingApi("USERNAME", "API_KEY");

var emailAddressId = 4400;
var activationToken = "B7A249DE-81EB-47FA-B320-B2F1D9EDAEFA";

emailMarketingApi.verifyAllowedEmailAddressGet(emailAddressId, activationToken).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::EmailMarketingApi.new

email_address_id = 56 # Integer | Allowed email address id

activation_token = "activation_token" # String | Your activation token.

begin
  # Verify email address using verification token
  result = api_instance.verify_allowed_email_address_get(email_address_id, activation_token)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling EmailMarketingApi->verify_allowed_email_address_get: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.EmailMarketingApi(clicksend_client.ApiClient(configuration))
email_address_id = 56 # int | Allowed email address id
activation_token = 'activation_token_example' # str | Your activation token.

try:
    # Verify email address using verification token
    api_response = api_instance.verify_allowed_email_address_get(email_address_id, activation_token)
    print(api_response)
except ApiException as e:
    print("Exception when calling EmailMarketingApi->verify_allowed_email_address_get: %s\n" % e)
use WWW::ClickSendClient::EmailMarketingApi;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::EmailMarketingApi->new(username => $username, password => $password);

my $json_output = $api->verify_allowed_email_address_put('email_address_id' => '12345' , 'activation_token' => 'XXXXXXXX-XXXXX-XXXXXX-XXXX-XXXXXXXX');

print $json_output;
#import "CSEmailMarketingApi.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
[apiConfig setUsername:@"USERNAME"];
[apiConfig setPassword:@"PASSWORD"];


CSEmailMarketingApi *emailMarketingApiInstance = [[CSEmailMarketingApi alloc] init];
NSNumber *emailAddressId = [[NSNumber alloc] initWithInt:1];

[emailMarketingApiInstance verifyAllowedEmailAddressGetWithEmailAddressId:emailAddressId activationToken:@"activation_token" completionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire

if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]

EmailMarketingAPI.verifyAllowedEmailAddressGet(emailAddressId: 1, activationToken: "activation_token") { (dataString, error) in
    guard let dataString = dataString else {
        print(error!)
        return
    }

    if let data = dataString.data(using: String.Encoding.utf8) {
        do {
            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                print(dictonary)
            } else {
                print("Cannot convert the String value to JSON")
            }
        } catch let error as NSError {
            print(error)
        }
    }
}
    Coming Soon
package ClickSend;

import ClickSend.Api.EmailMarketingApi;

public class verify_allowed_email_address {
  public static void main(String[] args) {
    ApiClient defaultClient = new ApiClient();
    defaultClient.setUsername("USERNAME");
    defaultClient.setPassword("API_KEY");
    EmailMarketingApi apiInstance = new EmailMarketingApi(defaultClient);
    Integer emailAddressId = 4245; // Integer | Allowed email address id
    // String | Your activation token.
    String activationToken = "activation_token_example"; 
    try {
        String result = apiInstance.verifyAllowedEmailAddressGet(emailAddressId, activationToken);
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling EmailMarketingApi#verifyAllowedEmailAddressGet");
        e.printStackTrace();
    }
  }
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "Email address verified.",
  "data": {
    "email_address_id": 5,
    "email_address": "test222@user.com",
    "verified": 1,
    "date_added": "1458009394"
  }
}

https://rest.clicksend.com/v3/email/address-verify/{email_address_id}/verify/{activation_token}

Verify email address using verification token

Verify email address using verification token

Parameters

Parameter In Type Required Description
email_address_id path integer(int32) true Allowed email address id
activation_token path string true Your activation token.

Refer to Status Codes for definitions of HTTP status code responses.

View Allowed Email Address

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
'https://rest.clicksend.com/v3/email/addresses/{email_address_id}'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\EmailMarketingApi(new GuzzleHttp\Client(),$config);
$email_address_id = 4366; // int | Allowed email address id

try {
    $result = $apiInstance->specificAllowedEmailAddressGet($email_address_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling EmailMarketingApi->specificAllowedEmailAddressGet: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME, 
    Password = API_KEY  
};
var emailMarketingApi = new EmailMarketingApi(configuration);
var response = emailMarketingApi.SpecificAllowedEmailAddressGet(EMAIL_ADDRESS_ID);
var api = require('./api.js');

var emailMarketingApi = new api.EmailMarketingApi("USERNAME", "API_KEY");

var emailAddressId = 4400;

emailMarketingApi.specificAllowedEmailAddressGet(emailAddressId).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::EmailMarketingApi.new

email_address_id = 56 # Integer | Allowed email address id

begin
  # Get specific email address
  result = api_instance.specific_allowed_email_address_get(email_address_id)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling EmailMarketingApi->specific_allowed_email_address_get: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.EmailMarketingApi(clicksend_client.ApiClient(configuration))
email_address_id = 56 # int | Allowed email address id

try:
    # Get specific email address
    api_response = api_instance.specific_allowed_email_address_get(email_address_id)
    print(api_response)
except ApiException as e:
    print("Exception when calling EmailMarketingApi->specific_allowed_email_address_get: %s\n" % e)
use WWW::ClickSendClient::EmailMarketingApi;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::EmailMarketingApi->new(username => $username, password => $password);

my $json_output = $api->specific_allowed_email_address_get('email_address_id' => '12345' );

print $json_output;
#import "CSEmailMarketingApi.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
[apiConfig setUsername:@"USERNAME"];
[apiConfig setPassword:@"PASSWORD"];

NSNumber *emailId = [[NSNumber alloc] initWithInt:1];
CSEmailMarketingApi *emailMarketingApiInstance = [[CSEmailMarketingApi alloc] init];
[emailMarketingApiInstance specificAllowedEmailAddressGetWithEmailAddressId:emailId completionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire

if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}

EmailMarketingAPI.specificAllowedEmailAddressGet(emailAddressId: 1) { (dataString, error) in
    guard let dataString = dataString else {
        print(error!)
        return
    }

    if let data = dataString.data(using: String.Encoding.utf8) {
        do {
            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                print(dictonary)
            } else {
                print("Cannot convert the String value to JSON")
            }
        } catch let error as NSError {
            print(error)
        }
    }
}
    Coming Soon
package ClickSend;

import ClickSend.Api.EmailMarketingApi;

public class view_specific_allowed_email_address {
  public static void main(String[] args) {
    ApiClient defaultClient = new ApiClient();
    defaultClient.setUsername("USERNAME");
    defaultClient.setPassword("API_KEY");
    EmailMarketingApi apiInstance = new EmailMarketingApi(defaultClient);
    Integer emailAddressId = 4245; // Integer | Allowed email address id
    try {
        String result = apiInstance.specificAllowedEmailAddressGet(emailAddressId);
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling EmailMarketingApi#specificAllowedEmailAddressGet");
        e.printStackTrace();
    }
  }
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "Here is your email address.",
  "data": {
    "email_address_id": 4,
    "email_address": "test3@user.com",
    "verified": 0,
    "date_added": "1449043066"
  }
}

https://rest.clicksend.com/v3/email/addresses/{email_address_id}

Get specific email address

Get specific email address

Parameters

Parameter In Type Required Description
email_address_id path integer(int32) true Allowed email address id

Refer to Status Codes for definitions of HTTP status code responses.

Delete Allowed Email Address

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
     --request DELETE \
'https://rest.clicksend.com/v3/email/addresses/{email_address_id}'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\EmailMarketingApi(new GuzzleHttp\Client(),$config);
$email_address_id = 4245; // int | Allowed email address id

try {
    $result = $apiInstance->specificAllowedEmailAddressDelete($email_address_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling EmailMarketingApi->specificAllowedEmailAddressDelete: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME, 
    Password = API_KEY  
};
var emailMarketingApi = new EmailMarketingApi(configuration);
var response = emailMarketingApi.SpecificAllowedEmailAddressDelete(EMAIL_ADDRESS_ID);
var api = require('./api.js');

var emailMarketingApi = new api.EmailMarketingApi("USERNAME", "API_KEY");

var emailAddressId = 4400;

emailMarketingApi.specificAllowedEmailAddressDelete(emailAddressId).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::EmailMarketingApi.new

email_address_id = 4161 # Integer | Allowed email address id

begin
  # Delete specific email address
  result = api_instance.specific_allowed_email_address_delete(email_address_id)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling EmailMarketingApi->specific_allowed_email_address_delete: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.EmailMarketingApi(clicksend_client.ApiClient(configuration))
email_address_id = 56 # int | Allowed email address id

try:
    # Delete specific email address
    api_response = api_instance.specific_allowed_email_address_delete(email_address_id)
    print(api_response)
except ApiException as e:
    print("Exception when calling EmailMarketingApi->specific_allowed_email_address_delete: %s\n" % e)
use WWW::ClickSendClient::EmailMarketingApi;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::EmailMarketingApi->new(username => $username, password => $password);

my $json_output = $api->specific_allowed_email_address_delete('email_address_id' => '1111' );

print $json_output;
#import "CSEmailMarketingApi.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
[apiConfig setUsername:@"USERNAME"];
[apiConfig setPassword:@"PASSWORD"];

NSNumber *emailId = [[NSNumber alloc] initWithInt:1];
CSEmailMarketingApi *emailMarketingApiInstance = [[CSEmailMarketingApi alloc] init];
[emailMarketingApiInstance specificAllowedEmailAddressDeleteWithEmailAddressId:emailId completionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire

if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}

EmailMarketingAPI.specificAllowedEmailAddressDelete(emailAddressId: 1) { (dataString, error) in
    guard let dataString = dataString else {
        print(error!)
        return
    }

    if let data = dataString.data(using: String.Encoding.utf8) {
        do {
            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                print(dictonary)
            } else {
                print("Cannot convert the String value to JSON")
            }
        } catch let error as NSError {
            print(error)
        }
    }
}
    Coming Soon
package ClickSend;

import ClickSend.Api.EmailMarketingApi;

public class delete_allowed_email_address {
  public static void main(String[] args) {
    ApiClient defaultClient = new ApiClient();
    defaultClient.setUsername("USERNAME");
    defaultClient.setPassword("API_KEY");
    EmailMarketingApi apiInstance = new EmailMarketingApi(defaultClient);
    Integer emailAddressId = 4244; // Integer | Allowed email address id
    try {
        String result = apiInstance.specificAllowedEmailAddressDelete(emailAddressId);
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling EmailMarketingApi#specificAllowedEmailAddressDelete");
        e.printStackTrace();
    }
  }
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "Email address deleted.",
  "data": null
}

https://rest.clicksend.com/v3/email/addresses/{email_address_id}

Delete specific email address

Delete specific email address

Parameters

Parameter In Type Required Description
email_address_id path integer(int32) true Allowed email address id

Refer to Status Codes for definitions of HTTP status code responses.

Email Campaigns

Everything about Email Campaigns

Send Email Campaign

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
     --request POST \
     --header "Content-Type: application/json" \
     --data-binary "{
  \"name\" : \"John Doe\",
  \"subject\" : \"Lorem Ipsum\",
  \"from_email_address_id\" : 2,
  \"from_name\" : \"From name\",
  \"template_id\" : 31,
  \"body\" : \"<p>This is a test</p>\",
  \"list_id\" : 456
}" \
'https://rest.clicksend.com/v3/email-campaigns/send'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\EmailMarketingApi(new GuzzleHttp\Client(),$config);
$email_campaign = new \ClickSend\Model\EmailCampaign(); // \ClickSend\Model\EmailCampaign | Email model
$email_campaign->setName("John Doe");
$email_campaign->setSubject("Lorem Ipsum");
$email_campaign->setBody("<p>This is a test</p>");
$email_campaign->setFromEmailAddressId(4366);
$email_campaign->setFromName("From name");
$email_campaign->setTemplateId(4299);
$email_campaign->setListId(185161);
$email_campaign->setSchedule(1577012461);

try {
    $result = $apiInstance->emailCampaignPost($email_campaign);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling EmailMarketingApi->emailCampaignPost: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME, 
    Password = API_KEY  
};
var emailMarketingApi = new EmailMarketingApi(configuration);
var emailCampaign = new EmailCampaign(
    name: "My Campaign",
    subject: "This is test Subject",
    body: "This is test body",
    fromEmailAddressId: FROM_EMAIL_ADDRESS_ID,
    fromName: "My Name",
    templateId: TEMPLATE_ID,
    listId: LIST_ID,
    schedule: 1123123
);
var response = emailMarketingApi.EmailCampaignPost(emailCampaign);
var api = require('./api.js');

var emailMarketingApi = new api.EmailMarketingApi("USERNAME", "API_KEY");

var emailCampaign = new api.EmailCampaign();

emailCampaign.name = "name";
emailCampaign.subject = "subject";
emailCampaign.body = "body";
emailCampaign.fromEmailAddressId = 4197;
emailCampaign.fromName = "bv";
emailCampaign.templateId = 4299;
emailCampaign.listId = 185161;

emailMarketingApi.emailCampaignPost(emailCampaign).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::EmailMarketingApi.new

# EmailCampaign | Email model
email_campaign = ClickSendClient::EmailCampaign.new(
  "schedule": 0,
  "list_id": 123,
  "subject": "subject",
  "from_email_address_id": 1234,
  "name": "name",
  "template_id": 6.027456183070403,
  "body": "body",
  "from_name": "from_name"
)

begin
  # Send email campaign
  result = api_instance.email_campaign_post(email_campaign)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling EmailMarketingApi->email_campaign_post: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.EmailMarketingApi(clicksend_client.ApiClient(configuration))
email_campaign = clicksend_client.EmailCampaign(
                name="John Doe",
                subject="Lorem Ipsum",
                from_email_address_id=2,
                from_name="From name",
                template_id=31,
                body="<p>This is a test</p>",
                list_id=185161) # EmailCampaign | Email model

try:
    # Send email campaign
    api_response = api_instance.email_campaign_post(email_campaign)
    print(api_response)
except ApiException as e:
    print("Exception when calling EmailMarketingApi->email_campaign_post: %s\n" % e)
use WWW::ClickSendClient::EmailMarketingApi;
use WWW::ClickSendClient::Object::EmailCampaign;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::EmailMarketingApi->new(username => $username, password => $password);

my %params = (
    'name'                  => 'name',
    'subject'               => 'subject',
    'body'                  => 'body',
    'from_email_address_id' => 'from_email_address_id',
    'from_name'             => 'from_name',
    'template_id'           => 'template_id',
    'list_id'               => 'list_id',
    'schedule'              => 'schedule'
);

my $email_campaign_obj = WWW::ClickSendClient::Object::EmailCampaign->new(%params);
my $json_output = $api->email_campaign_post('email_campaign' => $email_campaign_obj);

print $json_output;
#import "CSEmailToSmsApi.h"
#import "CSEmailMarketingApi.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
[apiConfig setUsername:@"USERNAME"];
[apiConfig setPassword:@"PASSWORD"];

CSEmailMarketingApi *emailMarketingApiInstance = [[CSEmailMarketingApi alloc] init];
CSEmailCampaign *emailCampaign = [[CSEmailCampaign alloc] init];
emailCampaign.name = @"John Doe";
emailCampaign.subject = @"Lerem ipsum";
emailCampaign.fromEmailAddressId = @(2);
emailCampaign.fromName = @"From Name";
emailCampaign.templateId = @(31);
emailCampaign.body = @"This is a test";
emailCampaign.listId = @(456);

[emailMarketingApiInstance emailCampaignPostWithEmailCampaign:emailCampaign completionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire

if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}
let emailCampaign = EmailCampaign(
                        name: "name", 
                        subject: "string", 
                        body: "string", 
                        fromEmailAddressId: 1, 
                        fromName: "string", 
                        templateId: 2, 
                        listId: 1, 
                        schedule: 2
                    )
EmailMarketingAPI.emailCampaignPost(emailCampaign: emailCampaign, completion: { (dataString, error) in
    guard let dataString = dataString else {
        print(error!)
        return
    }
    if let data = dataString.data(using: String.Encoding.utf8) {
        do {
            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                print(dictonary)
            } else {
                print("Cannot convert the String value to JSON")
            }
        } catch let error as NSError {
            print(error)
        }
    }
})
    Coming Soon
package ClickSend;

import java.math.BigDecimal;
import ClickSend.Api.EmailMarketingApi;
import ClickSend.Model.EmailCampaign;

public class send_email_campaign {
  public static void main(String[] args) {
    ApiClient defaultClient = new ApiClient();
    defaultClient.setUsername("USERNAME");
    defaultClient.setPassword("API_KEY");
    EmailMarketingApi apiInstance = new EmailMarketingApi(defaultClient);
    EmailCampaign emailCampaign = new EmailCampaign(); // EmailCampaign | Email model
    emailCampaign.name("name");
    emailCampaign.subject("subject");
    emailCampaign.body("body");
    emailCampaign.fromEmailAddressId(new BigDecimal(4245));
    emailCampaign.fromName("name");
    emailCampaign.templateId(new BigDecimal(4299));
    emailCampaign.listId(new BigDecimal(185161));
    emailCampaign.schedule(new Integer(1545477071));
    try {
        String result = apiInstance.emailCampaignPost(emailCampaign);
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling EmailMarketingApi#emailCampaignPost");
        e.printStackTrace();
    }
  }
}

Body parameter

{
  "schedule": 0,
  "list_id": 123,
  "subject": "subject",
  "from_email_address_id": 1234,
  "name": "name",
  "template_id": 6.027456183070403,
  "body": "body",
  "from_name": "from_name"
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "Email campaign has been created.",
  "data": {
    "total_count": 6,
    "total_price": "0.0066",
    "queued_count": 2,
    "data": {
      "email_campaign_id": 69,
      "name": "John Doe",
      "user_id": 1201,
      "subaccount_id": 1038,
      "subject": "Lorem Ipsum",
      "list_id": 456,
      "from_email_address_id": 2,
      "from_name": "From name",
      "template_id": 31,
      "schedule": "",
      "status": "Queued",
      "date_added": "1458011424",
      "custom_string": "",
      "send_count": 0,
      "open_count": 0,
      "click_count": 0,
      "hard_bounce_count": 0,
      "soft_bounce_count": 0,
      "abuse_count": 0,
      "unsubscribe_count": 0,
      "body": "<p>This is a test</p>",
      "body_plain_text": "This is a test"
    },
    "_currency": {
      "currency_name_short": "AUD",
      "currency_prefix_d": "$",
      "currency_prefix_c": "c",
      "currency_name_long": "Australian Dollars"
    }
  }
}

https://rest.clicksend.com/v3/email-campaigns/send

Send email campaign

Send email campaign

Properties

Name Type Required Restrictions Description
name string true none Your campaign name.
subject string true none Your campaign subject.
body string true none Your campaign message.
from_email_address_id number true none The allowed email address id.
from_name string true none Your name or business name.
template_id number false none Your template id.
list_id number true none Your contact list id.
schedule integer(int32) false none Your schedule timestamp.

Refer to Status Codes for definitions of HTTP status code responses.

Calculate Email Campaign Price

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
     --request POST \
     --header "Content-Type: application/json" \
     --data-binary "{
  \"name\" : \"John Doe\",
  \"subject\" : \"Lorem Ipsum\",
  \"from_email_address_id\" : 2,
  \"from_name\" : \"From name\",
  \"template_id\" : 31,
  \"body\" : \"<p>This is a test</p>\",
  \"list_id\" : 456
}" \
'https://rest.clicksend.com/v3/email-campaigns/price'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\EmailMarketingApi(new GuzzleHttp\Client(),$config);
$email_campaign = new \ClickSend\Model\EmailCampaign(); // \ClickSend\Model\EmailCampaign | Email model
$email_campaign->setName("John Doe");
$email_campaign->setSubject("Lorem Ipsum");
$email_campaign->setBody("<p>This is a test</p>");
$email_campaign->setFromEmailAddressId(4366);
$email_campaign->setFromName("From name");
$email_campaign->setTemplateId(4299);
$email_campaign->setListId(185161);

try {
    $result = $apiInstance->emailCampaignPricePost($email_campaign);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling EmailMarketingApi->emailCampaignPricePost: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME, 
    Password = API_KEY  
};
var emailMarketingApi = new EmailMarketingApi(configuration);
var emailCampaign = new EmailCampaign(
    name: "My Campaign",
    subject: "This is test Subject",
    body: "This is test body",
    fromEmailAddressId:  FROM_EMAIL_ADDRESS_ID,
    fromName: "My Name",
    templateId: TEMPLATE_ID,
    listId: LIST_ID,
    schedule: 1123123
);
var response = emailMarketingApi.EmailCampaignPricePost(emailCampaign);
var api = require('./api.js');

var emailMarketingApi = new api.EmailMarketingApi("USERNAME", "API_KEY");

var emailCampaign = new api.EmailCampaign();

emailCampaign.name = "name";
emailCampaign.subject = "subject";
emailCampaign.body = "body";
emailCampaign.fromEmailAddressId = 4197;
emailCampaign.fromName = "bv";
emailCampaign.templateId = 4299;
emailCampaign.listId = 185161;
emailCampaign.schedule = 1546167661;

emailMarketingApi.emailCampaignPricePost(emailCampaign).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::EmailMarketingApi.new

# EmailCampaign | Email model
email_campaign = ClickSendClient::EmailCampaign.new(
  "schedule": 0,
  "list_id": 123,
  "subject": "subject",
  "from_email_address_id": 1234,
  "name": "name",
  "template_id": 6.027456183070403,
  "body": "body",
  "from_name": "from_name"
)

begin
  # Calculate email campaign price
  result = api_instance.email_campaign_price_post(email_campaign)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling EmailMarketingApi->email_campaign_price_post: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.EmailMarketingApi(clicksend_client.ApiClient(configuration))
email_campaign = clicksend_client.EmailCampaign(
                    name="John Doe",
                    subject="Lorem Ipsum",
                    from_email_address_id=2,
                    from_name="From name",
                    template_id=31,
                    body="<p>This is a test</p>",
                    list_id=185161) # EmailCampaign | Email model

try:
    # Calculate email campaign price
    api_response = api_instance.email_campaign_price_post(email_campaign)
    print(api_response)
except ApiException as e:
    print("Exception when calling EmailMarketingApi->email_campaign_price_post: %s\n" % e)
use WWW::ClickSendClient::EmailMarketingApi;
use WWW::ClickSendClient::Object::EmailCampaign;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::EmailMarketingApi->new(username => $username, password => $password);

my %params = (
    'name'                  => 'name',
    'subject'               => '(First Name)(Cust. 2)(Cust. 3)(Cust. 4)(Email Address)',
    'body'                  => 'body',
    'from_email_address_id' => 'from_email_address_id',
    'from_name'             => 'from_name',
    'template_id'           => 'template_id',
    'list_id'               => 'list_id',
    'schedule'              => '0'
);

my $email_campaign_obj = WWW::ClickSendClient::Object::EmailCampaign->new(%params);

my $json_output = $api->email_campaign_price_post('email_campaign' => $email_campaign_obj);

print $json_output;
#import "CSEmailMarketingApi.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
[apiConfig setUsername:@"USERNAME"];
[apiConfig setPassword:@"PASSWORD"];

CSEmailCampaign *emailCampaign = [[CSEmailCampaign alloc] init];
emailCampaign.name = @"John Doe";
emailCampaign.subject = @"Lerem ipsum";
emailCampaign.fromEmailAddressId = @(2);
emailCampaign.fromName = @"From Name";
emailCampaign.templateId = @(31);
emailCampaign.body = @"This is a test";
emailCampaign.listId = @(456);

CSEmailMarketingApi *emailMarketingApiInstance = [[CSEmailMarketingApi alloc] init];
[emailMarketingApiInstance emailCampaignPricePostWithEmailCampaign:emailCampaign 
                                                    completionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire

if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}

let emailCampaign = EmailCampaign(name: "tring", 
                                    subject: "string", 
                                    body: "string", 
                                    fromEmailAddressId: 1, 
                                    fromName: "string", 
                                    templateId: 2, 
                                    listId: 1, 
                                    schedule: 2)

EmailMarketingAPI.emailCampaignPricePost(emailCampaign: emailCampaign) { (dataString, error) in
    guard let dataString = dataString else {
        print(error!)
        return
    }
    if let data = dataString.data(using: String.Encoding.utf8) {
        do {
            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                print(dictonary)
            } else {
                print("Cannot convert the String value to JSON")
            }
        } catch let error as NSError {
            print(error)
        }
    }
}
    Coming Soon
package ClickSend;

import java.math.BigDecimal;
import ClickSend.Api.EmailMarketingApi;
import ClickSend.Model.EmailCampaign;

public class calculate_email_campaign_price {
  public static void main(String[] args) {
    ApiClient defaultClient = new ApiClient();
    defaultClient.setUsername("USERNAME");
    defaultClient.setPassword("API_KEY");
    EmailMarketingApi apiInstance = new EmailMarketingApi(defaultClient);
    // EmailCampaign | Email model
    EmailCampaign emailCampaign = new EmailCampaign(); 
    emailCampaign.name("name");
    emailCampaign.subject("subject");
    emailCampaign.body("body");
    emailCampaign.fromEmailAddressId(new BigDecimal(4245));
    emailCampaign.fromName("name");
    emailCampaign.templateId(new BigDecimal(4299));
    emailCampaign.listId(new BigDecimal(185161));
    emailCampaign.schedule(new Integer(147852369));
    try {
        String result = apiInstance.emailCampaignPricePost(emailCampaign);
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling EmailMarketingApi#emailCampaignPricePost");
        e.printStackTrace();
    }
  }
}

Body parameter

{
  "schedule": 0,
  "list_id": 123,
  "subject": "subject",
  "from_email_address_id": 1234,
  "name": "name",
  "template_id": 6.027456183070403,
  "body": "body",
  "from_name": "from_name"
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "Total price for email campaign.",
  "data": {
    "total_count": 6,
    "total_price": "0.0066",
    "queued_count": 2,
    "data": {
      "name": "John Doe",
      "subject": "Lorem Ipsum",
      "from_email_address_id": 2,
      "from_name": "From name",
      "template_id": 31,
      "body": "<p>This is a test</p>",
      "list_id": 456
    },
    "_currency": {
      "currency_name_short": "AUD",
      "currency_prefix_d": "$",
      "currency_prefix_c": "c",
      "currency_name_long": "Australian Dollars"
    }
  }
}

https://rest.clicksend.com/v3/email-campaigns/price

Calculate email campaign price

Calculate email campaign price

Properties

Name Type Required Restrictions Description
name string true none Your campaign name.
subject string true none Your campaign subject.
body string true none Your campaign message.
from_email_address_id number true none The allowed email address id.
from_name string true none Your name or business name.
template_id number false none Your template id.
list_id number true none Your contact list id.
schedule integer(int32) false none Your schedule timestamp.

Refer to Status Codes for definitions of HTTP status code responses.

View All Email Campaigns

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
'https://rest.clicksend.com/v3/email-campaigns'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\EmailMarketingApi(new GuzzleHttp\Client(),$config);
$page = 1; // int | Page number
$limit = 10; // int | Number of records per page

try {
    $result = $apiInstance->emailCampaignsGet($page, $limit);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling EmailMarketingApi->emailCampaignsGet: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME, 
    Password = API_KEY  
};
var emailMarketingApi = new EmailMarketingApi(configuration);
var response = emailMarketingApi.EmailCampaignsGet();
var api = require('./api.js');

var emailMarketingApi = new api.EmailMarketingApi("USERNAME", "API_KEY");

var page = 1;
var limit = 10;

emailMarketingApi.emailCampaignsGet(page, limit).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::EmailMarketingApi.new

opts = {
  page: 1,  # Integer | Page number
  limit: 10 # Integer | Number of records per page
}

begin
  # Get all email campaigns
  result = api_instance.email_campaigns_get(opts)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling EmailMarketingApi->email_campaigns_get: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.EmailMarketingApi(clicksend_client.ApiClient(configuration))
page = 1 # int | Page number (optional) (default to 1)
limit = 10 # int | Number of records per page (optional) (default to 10)

try:
    # Get all email campaigns
    api_response = api_instance.email_campaigns_get(page=page, limit=limit)
    print(api_response)
except ApiException as e:
    print("Exception when calling EmailMarketingApi->email_campaigns_get: %s\n" % e)
use WWW::ClickSendClient::EmailMarketingApi;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::EmailMarketingApi->new(username => $username, password => $password);

my $json_output = $api->email_campaigns_get('page' => '1', 'limit' => '123');

print $json_output;
#import "CSEmailMarketingApi.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
[apiConfig setUsername:@"USERNAME"];
[apiConfig setPassword:@"PASSWORD"];

NSNumber *page = [[NSNumber alloc] initWithInt:1];
NSNumber *limit =[[NSNumber alloc] initWithInt:15];
CSEmailMarketingApi *emailMarketingApiInstance = [[CSEmailMarketingApi alloc] init];
[emailMarketingApiInstance emailCampaignsGetWithPage:page limit:limit completionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire

if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}
EmailMarketingAPI.emailCampaignsGet(page: 1, limit: 15) { (dataString, error) in
    guard let dataString = dataString else {
        print(error!)
        return
    }
    if let data = dataString.data(using: String.Encoding.utf8) {
        do {
            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                print(dictonary)
            } else {
                print("Cannot convert the String value to JSON")
            }
        } catch let error as NSError {
            print(error)
        }
    }
}
    Coming Soon
package ClickSend;

import ClickSend.Api.EmailMarketingApi;

public class view_all_email_campaign {
  public static void main(String[] args) {
    ApiClient defaultClient = new ApiClient();
    defaultClient.setUsername("USERNAME");
    defaultClient.setPassword("API_KEY");
    EmailMarketingApi apiInstance = new EmailMarketingApi(defaultClient);
    Integer page = 1; // Integer | Page number
    Integer limit = 10; // Integer | Number of records per page
    try {
        String result = apiInstance.emailCampaignsGet(page, limit);
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling EmailMarketingApi#emailCampaignsGet");
        e.printStackTrace();
    }
  }
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "Here are your email campaigns",
  "data": {
    "total": 5,
    "per_page": 15,
    "current_page": 1,
    "last_page": 1,
    "next_page_url": null,
    "prev_page_url": null,
    "from": 1,
    "to": 5,
    "data": [
      {
        "email_campaign_id": 64,
        "name": "test email",
        "user_id": 1201,
        "subaccount_id": 1038,
        "subject": "My test subject",
        "list_id": 443,
        "from_email_address_id": 2,
        "from_name": "Test name",
        "template_id": 24,
        "schedule": "",
        "status": "Sent",
        "date_added": "1455586793",
        "custom_string": "",
        "send_count": 0,
        "open_count": 5,
        "click_count": 0,
        "hard_bounce_count": 0,
        "soft_bounce_count": 0,
        "abuse_count": 0,
        "unsubscribe_count": 0
      },
      {
        "email_campaign_id": 65,
        "name": "test email",
        "user_id": 1201,
        "subaccount_id": 1038,
        "subject": "My test subject",
        "list_id": 443,
        "from_email_address_id": 2,
        "from_name": "Test name",
        "template_id": 24,
        "schedule": "",
        "status": "Queued",
        "date_added": "1455586848",
        "custom_string": "",
        "send_count": 0,
        "open_count": 0,
        "click_count": 0,
        "hard_bounce_count": 0,
        "soft_bounce_count": 0,
        "abuse_count": 0,
        "unsubscribe_count": 0
      }
    ]
  }
}

https://rest.clicksend.com/v3/email-campaigns

Get all email campaigns

Get all email campaigns

Parameters

Parameter In Type Required Description
page query integer(int32) false Page number
limit query integer(int32) false Number of records per page

Refer to Status Codes for definitions of HTTP status code responses.

View Email Campaign

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
'https://rest.clicksend.com/v3/email-campaigns/{email_campaign_id}'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\EmailMarketingApi(new GuzzleHttp\Client(),$config);
$email_campaign_id = 6805; // int | Allowed email campaign id

try {
    $result = $apiInstance->emailCampaignGet($email_campaign_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling EmailMarketingApi->emailCampaignGet: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME, 
    Password = API_KEY  
};
var emailMarketingApi = new EmailMarketingApi(configuration);
var response = emailMarketingApi.EmailCampaignGet(CAMPAIGN_ID);
var api = require('./api.js');

var emailMarketingApi = new api.EmailMarketingApi("USERNAME", "API_KEY");

var emailCampaignId = 7196;

emailMarketingApi.emailCampaignGet(emailCampaignId).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::EmailMarketingApi.new

email_campaign_id = 56 # Integer | Allowed email campaign id

begin
  # Get specific email campaign
  result = api_instance.email_campaign_get(email_campaign_id)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling EmailMarketingApi->email_campaign_get: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.EmailMarketingApi(clicksend_client.ApiClient(configuration))
email_campaign_id = 56 # int | Allowed email campaign id

try:
    # Get specific email campaign
    api_response = api_instance.email_campaign_get(email_campaign_id)
    print(api_response)
except ApiException as e:
    print("Exception when calling EmailMarketingApi->email_campaign_get: %s\n" % e)
use WWW::ClickSendClient::EmailMarketingApi;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::EmailMarketingApi->new(username => $username, password => $password);

my $json_output = $api->email_campaign_get('email_campaign_id' => '123');

print $json_output;
#import "CSEmailMarketingApi.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
[apiConfig setUsername:@"USERNAME"];
[apiConfig setPassword:@"PASSWORD"];

NSNumber *emailCampaignId = [[NSNumber alloc] initWithInt:1];
CSEmailMarketingApi *emailMarketingApiInstance = [[CSEmailMarketingApi alloc] init];
[emailMarketingApiInstance emailCampaignGetWithEmailCampaignId:emailCampaignId completionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire

if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}

EmailMarketingAPI.emailCampaignGet(emailCampaignId: 1) { (dataString, error) in
    guard let dataString = dataString else {
        print(error!)
        return
    }
    if let data = dataString.data(using: String.Encoding.utf8) {
        do {
            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                print(dictonary)
            } else {
                print("Cannot convert the String value to JSON")
            }
        } catch let error as NSError {
            print(error)
        }
    }
}
    Coming Soon
package ClickSend;

import ClickSend.Api.EmailMarketingApi;

public class view_specific_email_campaign {
  public static void main(String[] args) {
    ApiClient defaultClient = new ApiClient();
    defaultClient.setUsername("USERNAME");
    defaultClient.setPassword("API_KEY");
    EmailMarketingApi apiInstance = new EmailMarketingApi(defaultClient);
    Integer emailCampaignId = 6676; // Integer | Allowed email campaign id
    try {
        String result = apiInstance.emailCampaignGet(emailCampaignId);
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling EmailMarketingApi#emailCampaignGet");
        e.printStackTrace();
    }
  }
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "Here is your email campaign.",
  "data": {
    "email_campaign_id": 64,
    "name": "test email",
    "user_id": 1201,
    "subaccount_id": 1038,
    "subject": "My test subject",
    "list_id": 443,
    "from_email_address_id": 2,
    "from_name": "Test name",
    "template_id": 24,
    "schedule": "",
    "status": "Sent",
    "date_added": "1455586793",
    "custom_string": "",
    "send_count": 0,
    "open_count": 5,
    "click_count": 0,
    "hard_bounce_count": 0,
    "soft_bounce_count": 0,
    "abuse_count": 0,
    "unsubscribe_count": 0,
    "body": "<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\" \"http://www.w3.org/TR/REC-html40/loose.dtd\">\n<html><body><p>This is a test</p></body></html>\n",
    "body_plain_text": "This is a test"
  }
}

https://rest.clicksend.com/v3/email-campaigns/{email_campaign_id}

Get specific email campaign

Get specific email campaign

Refer to Status Codes for definitions of HTTP status code responses.

Update Email Campaign

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
     --request PUT \
     --header "Content-Type: application/json" \
     --data-binary "{
  \"name\" : \"John Doe\",
  \"subject\" : \"Lorem Ipsum\",
  \"from_email_address_id\" : 2,
  \"from_name\" : \"From name\",
  \"template_id\" : 31,
  \"body\" : \"<p>This is a test</p>\",
  \"list_id\" : 456
}" \
'https://rest.clicksend.com/v3/email-campaigns/{email_campaign_id}'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\EmailMarketingApi(new GuzzleHttp\Client(),$config);
$email_campaign_id = 7538; // int | Allowed email campaign id
$email_campaign = new \ClickSend\Model\EmailCampaign(); // \ClickSend\Model\EmailCampaign | Email model
$email_campaign->setName("John Doe");
$email_campaign->setSubject("Lorem Ipsum");
$email_campaign->setBody("<p>This is a test</p>");
$email_campaign->setFromEmailAddressId(4366);
$email_campaign->setFromName("From name");
$email_campaign->setTemplateId(4299);
$email_campaign->setListId(185161);

try {
    $result = $apiInstance->emailCampaignPut($email_campaign_id, $email_campaign);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling EmailMarketingApi->emailCampaignPut: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME, 
    Password = API_KEY  
};
var emailMarketingApi = new EmailMarketingApi(configuration);
var emailCampaign = new EmailCampaign(
    name: "My Campaign",
    subject: "This is test Subject",
    body: "This is test body",
    fromEmailAddressId:  FROM_EMAIL_ADDRESS_ID,
    fromName: "My Name",
    templateId: TEMPLATE_ID,
    listId: LIST_ID,
    schedule: 1123123
);
var response = emailMarketingApi.EmailCampaignPut(CAMPAIGN_ID, emailCampaign);
var api = require('./api.js');

var emailMarketingApi = new api.EmailMarketingApi("USERNAME", "API_KEY");

var emailCampaignId = 7197;

var emailCampaign = new api.EmailCampaign();

emailCampaign.name = "name";
emailCampaign.subject = "subject";
emailCampaign.body = "body";
emailCampaign.fromEmailAddressId = 4197;
emailCampaign.fromName = "bv";
emailCampaign.templateId = 4299;
emailCampaign.listId = 185161;

emailMarketingApi.emailCampaignPut(emailCampaignId, emailCampaign).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::EmailMarketingApi.new

email_campaign_id = 56 # Integer | Allowed email campaign id

# EmailCampaign | Email model
email_campaign = ClickSendClient::EmailCampaign.new(
  "schedule": 0,
  "list_id": 123,
  "subject": "subject",
  "from_email_address_id": 4062,
  "name": "name",
  "template_id": 4077,
  "body": "body",
  "from_name": "from_name"
)

begin
  # Edit email campaign
  result = api_instance.email_campaign_put(email_campaign_id, email_campaign)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling EmailMarketingApi->email_campaign_put: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.EmailMarketingApi(clicksend_client.ApiClient(configuration))
email_campaign_id = 56 # int | Allowed email campaign id
email_campaign = clicksend_client.EmailCampaign(
                name="John Doe",
                subject="Lorem Ipsum",
                from_email_address_id=2,
                from_name="From name",
                template_id=31,
                body="<p>This is a test</p>",
                list_id=185161) # EmailCampaign | Email model

try:
    # Edit email campaign
    api_response = api_instance.email_campaign_put(email_campaign_id, email_campaign)
    print(api_response)
except ApiException as e:
    print("Exception when calling EmailMarketingApi->email_campaign_put: %s\n" % e)
use WWW::ClickSendClient::EmailMarketingApi;
use WWW::ClickSendClient::Object::EmailCampaign;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::EmailMarketingApi->new(username => $username, password => $password);

my %params = (
    'name'                  => 'name',
    'subject'               => 'subject',
    'body'                  => 'body',
    'from_email_address_id' => 'from_email_address_id',
    'from_name'             => 'from_name',
    'template_id'           => 'template_id',
    'list_id'               => 'list_id',
    'schedule'              => '0'
);

my $email_campaign_obj = WWW::ClickSendClient::Object::EmailCampaign->new(%params);
my $json_output = $api->email_campaign_put('email_campaign_id' => '1234', 'email_campaign' => $email_campaign_obj);

print $json_output;
#import "CSEmailMarketingApi.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
[apiConfig setUsername:@"USERNAME"];
[apiConfig setPassword:@"PASSWORD"];

NSNumber *emailId = [[NSNumber alloc] initWithInt:1];
CSEmailCampaign *emailCampaign = [[CSEmailCampaign alloc] init];
emailCampaign.name = @"John Doe";
emailCampaign.subject = @"Lerem ipsum";
emailCampaign.fromEmailAddressId = @(2);
emailCampaign.fromName = @"From Name";
emailCampaign.templateId = @(31);
emailCampaign.body = @"This is a test";
emailCampaign.listId = @(456);

CSEmailMarketingApi *emailMarketingApiInstance = [[CSEmailMarketingApi alloc] init];
[emailMarketingApiInstance emailCampaignPutWithEmailCampaignId:emailId emailCampaign:emailCampaign  completionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire

if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}

let emailCampaign = EmailCampaign(
                        name: "John Doe", 
                        subject: "Lerem ipsum", 
                        body: "Lerem ipsum", 
                        fromEmailAddressId: 2, 
                        fromName: "string", 
                        templateId: 2, 
                        listId: 1, 
                        schedule: 2
                    )
EmailMarketingAPI.emailCampaignPut(emailCampaignId: 1, emailCampaign: emailCampaign) { (dataString, error) in
    guard let dataString = dataString else {
        print(error!)
        return
    }
    if let data = dataString.data(using: String.Encoding.utf8) {
        do {
            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                print(dictonary)
            } else {
                print("Cannot convert the String value to JSON")
            }
        } catch let error as NSError {
            print(error)
        }
    }
}
    Coming Soon
package ClickSend;

import java.math.BigDecimal;
import ClickSend.Api.EmailMarketingApi;
import ClickSend.Model.EmailCampaign;

public class update_email_campaign {
  public static void main(String[] args) {
    ApiClient defaultClient = new ApiClient();
    defaultClient.setUsername("USERNAME");
    defaultClient.setPassword("API_KEY");
    EmailMarketingApi apiInstance = new EmailMarketingApi(defaultClient);
    Integer emailCampaignId = 6804; // Integer | Allowed email campaign id
    // EmailCampaign | Email model
    EmailCampaign emailCampaign = new EmailCampaign(); 
    emailCampaign.name("name");
    emailCampaign.subject("subject");
    emailCampaign.body("body");
    emailCampaign.fromEmailAddressId(new BigDecimal(4245));
    emailCampaign.fromName("name");
    emailCampaign.templateId(new BigDecimal(4299));
    emailCampaign.listId(new BigDecimal(185161));
    emailCampaign.schedule(new Integer(147852369));
    try {
        String result = apiInstance.emailCampaignPut(emailCampaignId, emailCampaign);
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling EmailMarketingApi#emailCampaignPut");
        e.printStackTrace();
    }
  }
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "Email campaign has been updated.",
  "data": {
    "email_campaign_id": 69,
    "name": "John Doe",
    "user_id": 1201,
    "subaccount_id": 1038,
    "subject": "Lorem Ipsum",
    "list_id": 456,
    "from_email_address_id": 2,
    "from_name": "From name",
    "template_id": 31,
    "schedule": "13213213212",
    "status": "Scheduled",
    "date_added": "1458011424",
    "custom_string": "",
    "send_count": 0,
    "open_count": 0,
    "click_count": 0,
    "hard_bounce_count": 0,
    "soft_bounce_count": 0,
    "abuse_count": 0,
    "unsubscribe_count": 0,
    "body": "<p>This is a test</p>",
    "body_plain_text": "This is a test"
  }
}

https://rest.clicksend.com/v3/email-campaigns/{email_campaign_id}

Edit email campaign

Edit email campaign

Parameters

Parameter In Type Required Description
email_campaign_id path integer(int32) true Allowed email campaign id

Refer to Status Codes for definitions of HTTP status code responses.

Cancel Email Campaign

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
     --request PUT \
'https://rest.clicksend.com/v3/email-campaigns/{email_campaign_id}/cancel'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\EmailMarketingApi(new GuzzleHttp\Client(),$config);
$email_campaign_id = 7103; // int | Allowed email campaign id

try {
    $result = $apiInstance->cancelEmailCampaignPut($email_campaign_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling EmailMarketingApi->cancelEmailCampaignPut: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME, 
    Password = API_KEY  
};
var emailMarketingApi = new EmailMarketingApi(configuration);
var response = emailMarketingApi.CancelEmailCampaignPut(EMAIL_CAMPAIGN_ID);
var api = require('./api.js');

var emailMarketingApi = new api.EmailMarketingApi("USERNAME", "API_KEY");

var emailCampaignId = 7197;

emailMarketingApi.cancelEmailCampaignPut(emailCampaignId).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::EmailMarketingApi.new

email_campaign_id = 56 # Integer | Allowed email campaign id

begin
  # Cancel email campaign
  result = api_instance.cancel_email_campaign_put(email_campaign_id)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling EmailMarketingApi->cancel_email_campaign_put: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.EmailMarketingApi(clicksend_client.ApiClient(configuration))
email_campaign_id = 56 # int | Allowed email campaign id

try:
    # Cancel email campaign
    api_response = api_instance.cancel_email_campaign_put(email_campaign_id)
    print(api_response)
except ApiException as e:
    print("Exception when calling EmailMarketingApi->cancel_email_campaign_put: %s\n" % e)
use WWW::ClickSendClient::EmailMarketingApi;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::EmailMarketingApi->new(username => $username, password => $password);

my $json_output = $api->cancel_email_campaign_put('email_campaign_id' => '1234');

print $json_output;
#import "CSEmailMarketingApi.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
[apiConfig setUsername:@"USERNAME"];
[apiConfig setPassword:@"PASSWORD"];

NSNumber *emailCampaignId =[[NSNumber alloc] initWithInt:1];
CSEmailMarketingApi *emailMarketingApiInstance = [[CSEmailMarketingApi alloc] init];
[emailMarketingApiInstance cancelEmailCampaignPutWithEmailCampaignId:emailCampaignId 
                                                    completionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire

if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}
EmailMarketingAPI.cancelEmailCampaignPut(emailCampaignId: 1) { (dataString, error) in
    guard let dataString = dataString else {
        print(error!)
        return
    }
    if let data = dataString.data(using: String.Encoding.utf8) {
        do {
            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                print(dictonary)
            } else {
                print("Cannot convert the String value to JSON")
            }
        } catch let error as NSError {
            print(error)
        }
    }
}
    Coming Soon
package ClickSend;

import ClickSend.Api.EmailMarketingApi;

public class cancel_email_campaign {
  public static void main(String[] args) {
    ApiClient defaultClient = new ApiClient();
    defaultClient.setUsername("USERNAME");
    defaultClient.setPassword("API_KEY");
    EmailMarketingApi apiInstance = new EmailMarketingApi(defaultClient);
    Integer emailCampaignId = 6805; // Integer | Allowed email campaign id
    try {
        String result = apiInstance.cancelEmailCampaignPut(emailCampaignId);
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling EmailMarketingApi#cancelEmailCampaignPut");
        e.printStackTrace();
    }
  }
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "Email campaign has been cancelled.",
  "data": {
    "email_campaign_id": 69,
    "name": "John Doe",
    "user_id": 1201,
    "subaccount_id": 1038,
    "subject": "Lorem Ipsum",
    "list_id": 456,
    "from_email_address_id": 2,
    "from_name": "From name",
    "template_id": 31,
    "schedule": "13213213212",
    "status": "Cancelled",
    "date_added": "1458011424",
    "custom_string": "",
    "send_count": 0,
    "open_count": 0,
    "click_count": 0,
    "hard_bounce_count": 0,
    "soft_bounce_count": 0,
    "abuse_count": 0,
    "unsubscribe_count": 0,
    "body": "<p>This is a test</p>",
    "body_plain_text": "This is a test"
  }
}

https://rest.clicksend.com/v3/email-campaigns/{email_campaign_id}/cancel

Cancel email campaign

Cancel email campaign

Parameters

Parameter In Type Required Description
email_campaign_id path integer(int32) true Allowed email campaign id
date_from query integer(int32) false Start date (Unix Timestamp e.g. 1436849372)
date_to query integer(int32) false End date (Unix Timestamp e.g. 1436879372)
page query integer(int32) false Page number
limit query integer(int32) false Number of records per page

Refer to Status Codes for definitions of HTTP status code responses.

View Email Campaign History

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
'https://rest.clicksend.com/v3/email-campaigns/{campaign_id}/history'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\EmailMarketingApi(new GuzzleHttp\Client(),$config);
$email_campaign_id = 7102; // int | Allowed email campaign id
$date_from = '1436849372'; // int | Start date
$date_to = '1436899372'; // int | End date
$page = 1; // int | Page number
$limit = 10; // int | Number of records per page

try {
    $result = $apiInstance->emailCampaignHistoryGet($email_campaign_id, $date_from, $date_to, $page, $limit);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling EmailMarketingApi->emailCampaignHistoryGet: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME, 
    Password = API_KEY  
};
var emailMarketingApi = new EmailMarketingApi(configuration);
var response = emailMarketingApi.EmailCampaignHistoryGet(EMAIL_CAMPAIGN_ID);
var api = require('./api.js');

var emailMarketingApi = new api.EmailMarketingApi("USERNAME", "API_KEY");

var emailCampaignId = 7196;
var dateFrom = '1436479372';
var dateTo = '1436879372';
var page = 1;
var limit = 10;

emailMarketingApi.emailCampaignHistoryGet(emailCampaignId, dateFrom, dateTo, page, limit).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::EmailMarketingApi.new

email_campaign_id = 6594 # Integer | Allowed email campaign id

opts = {
  date_from: 1436849372, # Integer | Start date
  date_to: 1436879372,   # Integer | End date
  page: 1,       # Integer | Page number
  limit: 10      # Integer | Number of records per page
}

begin
  # Get specific email campaign history
  result = api_instance.email_campaign_history_get(email_campaign_id, opts)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling EmailMarketingApi->email_campaign_history_get: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.EmailMarketingApi(clicksend_client.ApiClient(configuration))
email_campaign_id = 56 # int | Allowed email campaign id
date_from = 1436849372 # int | Start date (optional)
date_to = 1436879372 # int | End date (optional)
page = 1 # int | Page number (optional) (default to 1)
limit = 10 # int | Number of records per page (optional) (default to 10)

try:
    # Get specific email campaign history
    api_response = api_instance.email_campaign_history_get(email_campaign_id, date_from=date_from, date_to=date_to, page=page, limit=limit)
    print(api_response)
except ApiException as e:
    print("Exception when calling EmailMarketingApi->email_campaign_history_get: %s\n" % e)

use WWW::ClickSendClient::EmailMarketingApi;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::EmailMarketingApi->new(username => $username, password => $password);
my $json_output = $api->email_campaign_history_get('email_campaign_id' => '123' ,'date_from'  => '' ,'date_to' => '','page' => '' ,'limit' => '' );

print $json_output;
#import "CSEmailMarketingApi.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
[apiConfig setUsername:@"USERNAME"];
[apiConfig setPassword:@"PASSWORD"];

NSNumber *emailId = [[NSNumber alloc] initWithInt:1];
NSNumber *dateFrom = [[NSNumber alloc] initWithInt:1436849372];
NSNumber *dateTo = [[NSNumber alloc] initWithInt:1436879372];
NSNumber *page = [[NSNumber alloc] initWithInt:15];
NSNumber *limit = [[NSNumber alloc] initWithInt:0];

CSEmailMarketingApi *emailMarketingApiInstance = [[CSEmailMarketingApi alloc] init];
[emailMarketingApiInstance emailCampaignHistoryGetWithEmailCampaignId:emailId  
                                                            dateFrom:dateFrom 
                                                            dateTo:dateTo 
                                                            page:page 
                                                            limit:limit 
                                                            completionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire

if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}

EmailMarketingAPI.emailCampaignHistoryGet(emailCampaignId: 1, 
                                            dateFrom: 1436849372, 
                                            dateTo: 1436879372, 
                                            page: 1, 
                                            limit: 15) { (dataString, error) in
    guard let dataString = dataString else {
        print(error!)
        return
    }
    if let data = dataString.data(using: String.Encoding.utf8) {
        do {
            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                print(dictonary)
            } else {
                print("Cannot convert the String value to JSON")
            }
        } catch let error as NSError {
            print(error)
        }
    }
}
    Coming Soon
package ClickSend;

import ClickSend.Api.EmailMarketingApi;

public class view_email_campaign_history {
  public static void main(String[] args) {
    ApiClient defaultClient = new ApiClient();
    defaultClient.setUsername("USERNAME");
    defaultClient.setPassword("API_KEY");
    EmailMarketingApi apiInstance = new EmailMarketingApi(defaultClient);
    Integer emailCampaignId = 6804; // Integer | Allowed email campaign id
    Integer dateFrom = 1436849372; // Integer | Start date
    Integer dateTo = 1436879372; // Integer | End date
    Integer page = 1; // Integer | Page number
    Integer limit = 10; // Integer | Number of records per page
    try {
        String result = apiInstance.emailCampaignHistoryGet(emailCampaignId, dateFrom, dateTo, page, limit);
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling EmailMarketingApi#emailCampaignHistoryGet");
        e.printStackTrace();
    }
  }
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "Here is your result.",
  "data": {
    "total": 3,
    "per_page": 15,
    "current_page": 1,
    "last_page": 1,
    "next_page_url": null,
    "prev_page_url": null,
    "from": 1,
    "to": 3,
    "data": [
      {
        "email_campaign_id": 77,
        "from_name": "test name",
        "from_address": "4",
        "to_name": "test2@test.com",
        "to_address": "test2@test.com",
        "contact_id": 669105,
        "subject": "tet subject",
        "message_id": "7CB3227C-7F8C-4A72-A0CB-36283236D99F",
        "processed_at": null,
        "status": "SpamReport",
        "open_count": 0,
        "click_count": 0,
        "hard_bounce_count": 13,
        "soft_bounce_count": 1
      },
      {
        "email_campaign_id": 77,
        "from_name": "test name",
        "from_address": "4",
        "to_name": "test@test.com",
        "to_address": "test@test.com",
        "contact_id": 669104,
        "subject": "tet subject",
        "message_id": "603C5349-5A24-40B4-89ED-F7619F7CC8A3",
        "processed_at": null,
        "status": null,
        "open_count": 0,
        "click_count": 0,
        "hard_bounce_count": 0,
        "soft_bounce_count": 0
      },
      {
        "email_campaign_id": 77,
        "from_name": "test name",
        "from_address": "4",
        "to_name": "test2@test.com",
        "to_address": "test2@test.com",
        "contact_id": 669105,
        "subject": "tet subject",
        "message_id": "5C5C0918-B263-42AA-8B5D-9E8ACECC0C64",
        "processed_at": null,
        "status": null,
        "open_count": 0,
        "click_count": 0,
        "hard_bounce_count": 0,
        "soft_bounce_count": 0
      }
    ]
  }
}

https://rest.clicksend.com/v3/email-campaigns/{email_campaign_id}/history

Get specific email campaign history

Get specific email campaign history

Refer to Status Codes for definitions of HTTP status code responses.

Export Email Campaign History

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
'https://rest.clicksend.com/v3/email-campaigns/{campaign_id}/history/export'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\EmailMarketingApi(new GuzzleHttp\Client(),$config);
$email_campaign_id = 7102; // int | Allowed email campaign id
$date_from = '1436849372'; // int | Start date
$date_to = '1436879372'; // int | End date

try {
    $result = $apiInstance->emailCampaignHistoryExportGet($email_campaign_id, $date_from, $date_to);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling EmailMarketingApi->emailCampaignHistoryExportGet: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME, 
    Password = API_KEY  
};
var emailMarketingApi = new EmailMarketingApi(configuration);
var response = emailMarketingApi.EmailCampaignHistoryExportGet(CAMPAIGN_ID);
var api = require('./api.js');

var emailMarketingApi = new api.EmailMarketingApi("USERNAME", "API_KEY");

var emailCampaignId = 7196;
var dateFrom = '1436849372';
var dateTo = '1436879372';
var page = 1;
var limit = 10;

emailMarketingApi.emailCampaignHistoryExportGet(emailCampaignId, dateFrom, dateTo, page, limit).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::EmailMarketingApi.new

email_campaign_id = 56 # Integer | Allowed email campaign id

opts = {
  date_from: 1436849372, # Integer | Start date
  date_to: 1436879372    # Integer | End date
}

begin
  # Export specific email campaign history
  result = api_instance.email_campaign_history_export_get(email_campaign_id, opts)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling EmailMarketingApi->email_campaign_history_export_get: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.EmailMarketingApi(clicksend_client.ApiClient(configuration))
email_campaign_id = 56 # int | Allowed email campaign id
date_from = 1436849372 # int | Start date (optional)
date_to = 1436879372 # int | End date (optional)

try:
    # Export specific email campaign history
    api_response = api_instance.email_campaign_history_export_get(email_campaign_id, date_from=date_from, date_to=date_to)
    print(api_response)
except ApiException as e:
    print("Exception when calling EmailMarketingApi->email_campaign_history_export_get: %s\n" % e)
use WWW::ClickSendClient::EmailMarketingApi;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::EmailMarketingApi->new(username => $username, password => $password);

my $json_output = $api->email_campaign_history_export_get('email_campaign_id' => '1234' ,'date_from'  => '' ,'date_to' => '' );

print $json_output;
#import "CSEmailMarketingApi.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
[apiConfig setUsername:@"USERNAME"];
[apiConfig setPassword:@"PASSWORD"];

NSNumber *emailId = [[NSNumber alloc] initWithInt:1];
NSNumber *dateFrom = [[NSNumber alloc] initWithInt:1436849372];
NSNumber *dateTo = [[NSNumber alloc] initWithInt:1436879372];

CSEmailMarketingApi *emailMarketingApiInstance = [[CSEmailMarketingApi alloc] init];
[emailMarketingApiInstance emailCampaignHistoryExportGetWithEmailCampaignId:emailId dateFrom:dateFrom dateTo:dateTo completionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire

if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}

EmailMarketingAPI.emailCampaignHistoryExportGet(emailCampaignId: 1) { (dataString, error) in
    guard let dataString = dataString else {
        print(error!)
        return
    }
    if let data = dataString.data(using: String.Encoding.utf8) {
        do {
        if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                print(dictonary)
            } else {
                print("Cannot convert the String value to JSON")
            }
        } catch let error as NSError {
            print(error)
        }
    }
}
    Coming Soon
package ClickSend;

import ClickSend.Api.EmailMarketingApi;

public class export_email_campaign_history {
  public static void main(String[] args) {
    ApiClient defaultClient = new ApiClient();
    defaultClient.setUsername("USERNAME");
    defaultClient.setPassword("API_KEY");
    EmailMarketingApi apiInstance = new EmailMarketingApi(defaultClient);
    Integer emailCampaignId = 6804; // Integer | Allowed email campaign id
    Integer dateFrom = 1436849372; // Integer | Start date
    Integer dateTo = 1436879372; // Integer | End date
    try {
        String result = apiInstance.emailCampaignHistoryExportGet(emailCampaignId, dateFrom, dateTo);
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling EmailMarketingApi#emailCampaignHistoryExportGet");
        e.printStackTrace();
    }
  }
}

https://rest.clicksend.com/v3/email-campaigns/{email_campaign_id}/history/export

Export specific email campaign history

Export specific email campaign history

Parameters

Parameter In Type Required Description
email_campaign_id path integer(int32) true Allowed email campaign id
date_from query integer(int32) false Start date (Unix Timestamp e.g. 1436849372)
date_to query integer(int32) false End date (Unix Timestamp e.g. 1436879372)

Refer to Status Codes for definitions of HTTP status code responses.

Transactional Email

Send Email

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
     --request POST \
     --header "Content-Type: application/json" \
     --data-binary "    {
       \"to\":[
          {
             \"email\":\"test@clicksend.com\",
             \"name\":\"John Doe\"
          }
       ],
       \"cc\":[
          {
             \"email\":\"test2@clicksend.com\",
             \"name\":\"Jane Doe\"
          }
       ],
       \"bcc\":[
          {
             \"email\":\"test3@clicksend.com\",
             \"name\":\"Joseph Doe\"
          }
       ],
       \"from\":{
          \"email_address_id\":1,
          \"name\":\"Joanne Doe\"
       },
       \"subject\":\"Test subject\",
       \"body\":\"Lorem ipsum\",
       \"attachments\":[
          {
             \"content\":\"ZmlsZSBjb250ZW50cw==\",
             \"type\":\"text/plain\",
             \"filename\":\"text.txt\",
             \"disposition\":\"attachment\",
             \"content_id\":\"text\"
          }
       ]
    }" \
'https://rest.clicksend.com/v3/email/send'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\TransactionalEmailApi(new GuzzleHttp\Client(),$config);
$email = new \ClickSend\Model\Email(); // \ClickSend\Model\Email | Email model
$email_recipient=new \ClickSend\Model\EmailRecipient();
$email_recipient->setEmail("test@clicksend.com");
$email_recipient->setName("John Doe");
$email_from=new \ClickSend\Model\EmailFrom();
$email_from->setEmailAddressId(4366);
$email_from->setName("Joanne Doe");
$attachment = new \ClickSend\Model\Attachment();
$attachment->setContent("ZmlsZSBjb250ZW50cw==");
$attachment->setType("text/plain");
$attachment->setFilename("text.txt");
$attachment->setDisposition("attachment");
$attachment->setContentId("text");
$email->setTo([$email_recipient]);
$email->setFrom($email_from);
$email->setSubject("Test subject");
$email->setBody("Lorem ipsum");

try {
    $result = $apiInstance->emailSendPost($email);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling TransactionalEmailApi->emailSendPost: ', $e->getMessage(), PHP_EOL;
}
?>
var transactionalEmailApi = new TransactionalEmailApi(configuration);
var listOfRecipients = new List<EmailRecipient>();
listOfRecipients.Add(new EmailRecipient(
    email: "john@doe.com",
    name: "John Doe"
));
var listOfCC = new List<EmailRecipient>();
listOfCC.Add(new EmailRecipient(
    email: "john@doe.com",
    name: "John Doe"
));
var listOfBCC = new List<EmailRecipient>();
listOfBCC.Add(new EmailRecipient(
    email: "john@doe.com",
    name: "John Doe"
));
var listOfAttachments = new List<Attachment>();
listOfAttachments.Add(new Attachment(
    content: "content",
    type: "type",
    filename: "filename",
    disposition: "disposition",
    contentId: "contentId"
));
var emailFrom = new EmailFrom(
    emailAddressId: FROM_EMAIL_ID_GOES,
    name: "John Doe"
);
var response = transactionalEmailApi.EmailSendPost(new Email(
    to: listOfRecipients,
    cc: listOfCC,
    bcc: listOfBCC,
    from: emailFrom,
    subject: "Test Subject",
    body: "Test Body",
    attachments: listOfAttachments
));
var api = require('./api.js');

var emailTransactionalApi = new api.TransactionalEmailApi("USERNAME", "API_KEY");

var emailRecipient = new api.EmailRecipient();

emailRecipient.email = "test@clicksend.com";
emailRecipient.name = "John doe";

var emailFrom = new api.EmailFrom();

emailFrom.emailAddressId = 4197;
emailFrom.name = "john";

var attachment = new api.Attachment();

attachment.content = "ZmlsZSBjb250ZW50cw==";
attachment.type = "text/plain";
attachment.filename = "text.txt";
attachment.disposition = "attachment";
attachment.contentId = "text";

var email = new api.Email();

email.to = [emailRecipient];
email.cc = [emailRecipient];
email.bcc = [emailRecipient];
email.from = emailFrom;
email.subject = "subject";
email.body = "body";
email.attachments = [attachment];

emailTransactionalApi.emailSendPost(email).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::TransactionalEmailApi.new

email = ClickSendClient::Email.new # Email | Email model

email.to = [
  ClickSendClient::EmailRecipient.new("name": "name", "email": "email"),
  ClickSendClient::EmailRecipient.new("name": "name", "email": "email")
]

email.cc = [
  ClickSendClient::EmailRecipient.new("name": "name", "email": "email"),
  ClickSendClient::EmailRecipient.new("name": "name", "email": "email")
]

email.bcc = [
  ClickSendClient::EmailRecipient.new("name": "name", "email": "email"),
  ClickSendClient::EmailRecipient.new("name": "name", "email": "email")
]

email.from = ClickSendClient::EmailFrom.new(
  "name": "name",
  "email_address_id": 56
)

email.attachments = [
  ClickSendClient::Attachment.new(
    "disposition": "attachment",
    "filename": "text.txt",
    "content_id": "text",
    "type": "text/plain",
    "content": "ZmlsZSBjb250ZW50cw=="
  ),
  ClickSendClient::Attachment.new(
    "disposition": "attachment",
    "filename": "text2.txt",
    "content_id": "text2",
    "type": "text/plain",
    "content": "ZmlsZSBjb250ZW50cw=="
  )
]

email.subject = "Subject"

email.body = "Lorem ipsum"

begin
  # Send transactional email
  result = api_instance.email_send_post(email)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling TransactionalEmailApi->email_send_post: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException
from clicksend_client import EmailRecipient
from clicksend_client import EmailFrom
from clicksend_client import Attachment

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.TransactionalEmailApi(clicksend_client.ApiClient(configuration))
email_receipient=EmailRecipient(email='example@gmail.com',name='abc')
email_from=EmailFrom(email_address_id='4197',name='abc')
attachment=Attachment(content='ZmlsZSBjb250ZW50cw==',
                      type='text/plain',
                      filename='text.txt',
                      disposition='attachment',
                      content_id='text')
# Email | Email model
email = clicksend_client.Email(to=[email_receipient],
                              cc=[email_receipient],
                              bcc=[email_receipient],
                              _from=email_from,
                              subject="Test subject",
                              body="this is body",
                              attachments=[attachment],
                              schedule=14785562325) 

try:
    # Send transactional email
    api_response = api_instance.email_send_post(email)
    print(api_response)
except ApiException as e:
    print("Exception when calling TransactionalEmailApi->email_send_post: %s\n" % e)
use WWW::ClickSendClient::TransactionalEmailApi;
use WWW::ClickSendClient::Object::Email;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::TransactionalEmailApi->new(username => $username, password => $password);

my %params = (
    'to' => [
        {
            'name'  => 'test1',
            'email' => 'test1@test.com',
        },
        {
            'name'  => 'test3',
            'email' => 'test3@test.com',
        }
    ],
    'cc' => [
        {
            'name'  => 'test2',
            'email' => 'test2@test.com',
        }
    ],
    'bcc' => [
        {
            'name'  => 'test3',
            'email' => 'test3@test.com',
        }
    ],
    'from' => [
        {
            'name'  => 'test3',
            'email' => 'test3@test.com',
        }
    ],
    'body'                  => 'body',
    'subject'               => 'this is subject',
    'from.email_address_id' => '1233',
    'from.name'             => 'From NAME'
);

my $email_obj = WWW::ClickSendClient::Object::Email->new(%params);

my $json_output = $api->email_send_post('email' => $email_obj);

print $json_output;
#import "CSTransactionalEmailApi.h"
#import "CSDefaultConfiguration.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
// Configure HTTP basic authorization (authentication scheme: BasicAuth)
[apiConfig setUsername:@"USERNAME"];
[apiConfig setPassword:@"PASSWORD"];

CSEmailRecipient *emailRecipient = [[CSEmailRecipient alloc] init];
emailRecipient.email = @"email";
emailRecipient.name = @"name";

CSEmailRecipient *ccRecipient = [[CSEmailRecipient alloc] init];
ccRecipient.email = @"email";
ccRecipient.name = @"name";

CSEmailFrom *emailFrom = [[CSEmailFrom alloc] init];
emailFrom.emailAddressId = @"email_addr_id";
emailFrom.name = @"name";

CSEmail *email = [[CSEmail alloc] init];
email.to = [[NSArray alloc] initWithObjects:emailRecipient, nil];
email.cc = [[NSArray alloc] initWithObjects:ccRecipient, nil];
email.from = emailFrom;
email.body = @"body";

CSTransactionalEmailApi *transEmailApi = [[CSTransactionalEmailApi alloc] init];
[transEmailApi emailSendPostWithEmail:email completionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire
if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}

let emailRecipient = EmailRecipient(
    email: "email", 
    name: "name"
)
let ccRecipient = EmailRecipient(
    email: "email",
    name: "name"
)
let emailFrom = EmailFrom(
    emailAddressId: "email_address_id", 
    name: "name"
)

let email = Email(
    to: [emailRecipient], 
    cc: [ccRecipient], 
    bcc: nil, 
    from: emailFrom, 
    subject: "subject", 
    body: "body", 
    attachments: nil, 
    schedule: nil
)

TransactionalEmailAPI.emailSendPost(email: email) { (dataString, error) in
    if let error = error {
        print(error)
    } else {
        if let data = dataString!.data(using: String.Encoding.utf8) {
            do {
                if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                    print(dictonary)
                } else {
                    print("bad json")
                }
                } catch let error as NSError {
                print(error)
            }
        }
    }
}
    Coming Soon
package ClickSend;

import java.math.BigDecimal;
import java.util.Arrays;
import java.util.List;
import ClickSend.Api.TransactionalEmailApi;
import ClickSend.Model.Attachment;
import ClickSend.Model.Email;
import ClickSend.Model.EmailFrom;
import ClickSend.Model.EmailRecipient;

public class send_email {
  public static void main(String[] args) {
    ApiClient defaultClient = new ApiClient();
    defaultClient.setUsername("USERNAME");
    defaultClient.setPassword("API_KEY");
    TransactionalEmailApi apiInstance = new TransactionalEmailApi(defaultClient);
    EmailRecipient emailRecipient=new EmailRecipient();
    emailRecipient.email("example@gmail.com");
    emailRecipient.name("abc");
    List<EmailRecipient> emailRecipientList=Arrays.asList(emailRecipient);
    EmailFrom emailFrom=new EmailFrom();
    emailFrom.emailAddressId("4197");
    emailFrom.name("abc");
    Attachment attachment= new Attachment();
    attachment.content("ZmlsZSBjb250ZW50cw==");
    attachment.contentId("text");
    attachment.disposition("attachment");
    attachment.type("text/plain");
    attachment.filename("text.txt");
    List<Attachment> attachmentList=Arrays.asList(attachment);
    Email email = new Email(); // Email | Email model
    email.to(emailRecipientList);
    email.cc(emailRecipientList);
    email.bcc(emailRecipientList);
    email.from(emailFrom);
    email.subject("subject");
    email.body("body");
    email.attachments(attachmentList);
    email.schedule(new BigDecimal(147258369));
    try {
        String result = apiInstance.emailSendPost(email);
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling TransactionalEmailApi#emailSendPost");
        e.printStackTrace();
    }
  }
}

Body parameter

{
  "cc": [
    {
      "name": "name",
      "email": "email"
    },
    {
      "name": "name",
      "email": "email"
    }
  ],
  "schedule": 1904610115,
  "bcc": [
    {
      "name": "name",
      "email": "email"
    },
    {
      "name": "name",
      "email": "email"
    }
  ],
  "attachments": [
    {
      "disposition": "disposition",
      "filename": "filename",
      "content_id": "content_id",
      "type": "type",
      "content": "content"
    },
    {
      "disposition": "disposition",
      "filename": "filename",
      "content_id": "content_id",
      "type": "type",
      "content": "content"
    }
  ],
  "from": {
    "name": "name",
    "email_address_id": "email"
  },
  "to": [
    {
      "name": "name",
      "email": "email"
    },
    {
      "name": "name",
      "email": "email"
    }
  ],
  "body": "body"
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "Transactional email queued for delivery.",
  "data": {
    "user_id": 1,
    "subaccount_id": 1,
    "from_email_address_id": 1,
    "from_name": "Joanne Doe",
    "to": [
      {
        "email": "test@clicksend.com",
        "name": "John Doe"
      }
    ],
    "cc": [
      {
        "email": "test2@clicksend.com",
        "name": "Jane Doe"
      }
    ],
    "bcc": [
      {
        "email": "test3@clicksend.com",
        "name": "Joseph Doe"
      }
    ],
    "subject": "Test subject",
    "body": "Lorem ipsum",
    "body_plain_text": "Lorem ipsum",
    "schedule": 1507018182,
    "message_id": "21C632C1-3FCC-4EFF-8191-6079244F0142",
    "status": "WaitApproval",
    "status_text": "Accepted for delivery",
    "soft_bounce_count": 0,
    "hard_bounce_count": 0,
    "price": "0.0050",
    "date_added": 1507018182,
    "custom_string": null,
    "_attachments": [
      {
        "file_name": "text.txt",
        "content_type": "text/plain",
        "content_disposition": "attachment",
        "content_id": "text",
        "_attachment_file_url": "https://rest.clicksend.com/files/3C2284DC-7C37-47BA-8C95-3F12A4B987B7.txt"
      }
    ],
    "_currency": {
      "currency_name_short": "GBP",
      "currency_prefix_d": "£",
      "currency_prefix_c": "p",
      "currency_name_long": "British Pounds"
    }
  }
}

https://rest.clicksend.com/v3/email/send

Send transactional email

Send transactional email

Properties

Name Type Required Restrictions Description
to array true none Array of To Recipient items. (array of names and emails)
cc array false none Array of Cc Recipient items. (array of names and emails)
bcc array false none Array of Bcc Recipient items. (array of names and emails)
from object true none From Email object. (object containing name and email)
body string true none Body of the email.
attachments array false none Array of Attachment items.
schedule number false none Schedule.
name string false none Name of person email belongs to
email string true none Email to be used.
content string true none The base64-encoded contents of the file.
type string true none The type of file being attached.
filename string true none The name of the file being attached.
disposition string true none Inline for content that can be displayed within the email, or attachment for any other files.
content_id string true none An ID for the content.

Refer to Status Codes for definitions of HTTP status code responses.

Calculate Email Price

Code samples

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "Here's the email price.",
  "data": {
    "to_array": [
      {
        "email": "test@user",
        "name": "user1"
      }
    ],
    "cc_array": [
      {
        "email": "user1@test.com",
        "name": "cc1"
      }
    ],
    "bcc_array": null,
    "subject": "test subject",
    "body": "This is a test <img src='cid:test'/>",
    "price": 0.002,
    "_currency": {
      "currency_name_short": "AUD",
      "currency_prefix_d": "$",
      "currency_prefix_c": "c",
      "currency_name_long": "Australian Dollars"
    }
  }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
            ->setUsername('USERNAME')
            ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\TransactionalEmailApi(new GuzzleHttp\Client(),$config);

$email = new \ClickSend\Model\Email(); // \ClickSend\Model\Email | Email model
$email_recipient=new \ClickSend\Model\EmailRecipient();
$email_recipient->setEmail("test@clicksend.com");
$email_recipient->setName("John Doe");
$email_from=new \ClickSend\Model\EmailFrom();
$email_from->setEmailAddressId(4366);
$email_from->setName("Joanne Doe");
$attachment= new \ClickSend\Model\Attachment();
$attachment->setContent("ZmlsZSBjb250ZW50cw==");
$attachment->setType("text/plain");
$attachment->setFilename("text.txt");
$attachment->setDisposition("attachment");
$attachment->setContentId("text");
$email->setTo([$email_recipient]);
$email->setFrom($email_from);
$email->setSubject("Test subject");
$email->setBody("Lorem ipsum");

try {
    $result = $apiInstance->emailPricePost($email);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling TransactionalEmailApi->emailPricePost: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME,
    Password = API_KEY
}; 
var transactionalEmailApi = new TransactionalEmailApi(configuration);
var listOfRecipients = new List<EmailRecipient>();
listOfRecipients.Add(new EmailRecipient(
    email: "john@doe.com",
    name: "John Doe"
));
var listOfCC = new List<EmailRecipient>();
listOfCC.Add(new EmailRecipient(
    email: "john@doe.com",
    name: "John Doe"
));
var listOfBCC = new List<EmailRecipient>();
listOfBCC.Add(new EmailRecipient(
    email: "john@doe.com",
    name: "John Doe"
));
var listOfAttachments = new List<Attachment>();
listOfAttachments.Add(new Attachment(
    content: "content",
    type: "type",
    filename: "filename",
    disposition: "disposition",
    contentId: "contentId"
));
var emailFrom = new EmailFrom(
    emailAddressId: FROM_EMAIL_ID_GOES,
    name: "John Doe"
);
var response = transactionalEmailApi.EmailPricePost(new Email(
    to: listOfRecipients,
    cc: listOfCC,
    bcc: listOfBCC,
    from: emailFrom,
    subject: "Test Subject",
    body: "Test Body",
    attachments: listOfAttachments
));
var api = require('./api.js');

var emailTransactionalApi = new api.TransactionalEmailApi("USERNAME", "API_KEY");

var emailRecipient = new api.EmailRecipient();

emailRecipient.email = "test@clicksend.com";
emailRecipient.name = "John doe";

var emailFrom = new api.EmailFrom();

emailFrom.emailAddressId = 4197;
emailFrom.name = "john";

var attachment = new api.Attachment();
attachment.content = "ZmlsZSBjb250ZW50cw==";
attachment.type = "text/plain";
attachment.filename = "text.txt";
attachment.disposition = "attachment";
attachment.contentId = "text";

var email = new api.Email();

email.to = [emailRecipient];
email.cc = [emailRecipient];
email.bcc = [emailRecipient];
email.from = emailFrom;
email.subject = "subject";
email.body = "body";
email.attachments = [attachment];

emailTransactionalApi.emailPricePost(email).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::TransactionalEmailApi.new

email = ClickSendClient::Email.new # Email | Email model

email.to = [
  ClickSendClient::EmailRecipient.new("name": "name", "email": "email"),
  ClickSendClient::EmailRecipient.new("name": "name", "email": "email")
]

email.cc = [
  ClickSendClient::EmailRecipient.new("name": "name", "email": "email"),
  ClickSendClient::EmailRecipient.new("name": "name", "email": "email")
]

email.bcc = [
  ClickSendClient::EmailRecipient.new("name": "name", "email": "email"),
  ClickSendClient::EmailRecipient.new("name": "name", "email": "email")
]

email.from = ClickSendClient::EmailFrom.new(
  "name": "name",
  "email_address_id": 56
)

email.attachments = [
  ClickSendClient::Attachment.new(
    "disposition": "attachment",
    "filename": "text.txt",
    "content_id": "text",
    "type": "text/plain",
    "content": "ZmlsZSBjb250ZW50cw=="
  ),
  ClickSendClient::Attachment.new(
    "disposition": "attachment",
    "filename": "text2.txt",
    "content_id": "text2",
    "type": "text/plain",
    "content": "ZmlsZSBjb250ZW50cw=="
  )
]

email.subject = "Subject"

email.body = "Lorem ipsum"

begin
  # Get transactional email price
  result = api_instance.email_price_post(email)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling TransactionalEmailApi->email_price_post: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException
from clicksend_client import EmailRecipient
from clicksend_client import EmailFrom
from clicksend_client import Attachment

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.TransactionalEmailApi(clicksend_client.ApiClient(configuration))
email_receipient=EmailRecipient(email='example@gmail.com',name='abc')
email_from=EmailFrom(email_address_id='4197',name='abc')
attachment=Attachment(content='ZmlsZSBjb250ZW50cw==',
                      type='text/plain',
                      filename='text.txt',
                      disposition='attachment',
                      content_id='text')
# Email | Email model
email = clicksend_client.Email(to=[email_receipient],
                              cc=[email_receipient],
                              bcc=[email_receipient],
                              _from=email_from,
                              subject="Test subject",
                              body="this is body",
                              attachments=[attachment],
                              schedule=14785562325) 

try:
    # Get transactional email price
    api_response = api_instance.email_price_post(email)
    print(api_response)
except ApiException as e:
    print("Exception when calling TransactionalEmailApi->email_price_post: %s\n" % e)
use WWW::ClickSendClient::TransactionalEmailApi;
use WWW::ClickSendClient::Object::Email;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::TransactionalEmailApi->new(username => $username, password => $password);

my %params = (
    'to' => [
        {
            'name'  => 'test1',
            'email' => 'test1@test.com',
        },
        {
            'name'  => 'test3',
            'email' => 'test3@test.com',
        }
    ],
    'cc' => [
        {
            'name'  => 'test2',
            'email' => 'test2@test.com',
        }
    ],
    'bcc' => [
        {
            'name'  => 'test3',
            'email' => 'test3@test.com',
        }
    ],
    'from' => [
        {
            'name'  => 'test3',
            'email' => 'test3@test.com',
        }
    ],
    'body'                  => 'body',
    'subject'               => 'this is subject',
    'from.email_address_id' => '1233',
    'from.name'             => 'From NAME'
);

my $email_obj = WWW::ClickSendClient::Object::Email->new(%params);

my $json_output = $api->email_price_post('email' => $email_obj);

print $json_output;
#import "CSTransactionalEmailApi.h"
#import "CSDefaultConfiguration.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
// Configure HTTP basic authorization (authentication scheme: BasicAuth)
[apiConfig setUsername:@"USERNAME"];
[apiConfig setPassword:@"PASSWORD"];

CSEmailRecipient *emailRecipient = [[CSEmailRecipient alloc] init];
emailRecipient.email = @"email";
emailRecipient.name = @"name";

CSEmailRecipient *ccRecipient = [[CSEmailRecipient alloc] init];
ccRecipient.email = @"email";
ccRecipient.name = @"name";

CSEmailFrom *emailFrom = [[CSEmailFrom alloc] init];
emailFrom.emailAddressId = @"email_addr_id";
emailFrom.name = @"name";

CSEmail *email = [[CSEmail alloc] init];
email.to = [[NSArray alloc] initWithObjects:emailRecipient, nil];
email.cc = [[NSArray alloc] initWithObjects:ccRecipient, nil];
email.from = emailFrom;
email.body = @"body";

CSTransactionalEmailApi *transEmailApi = [[CSTransactionalEmailApi alloc] init];
[transEmailApi emailPricePostWithEmail:email completionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire
if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}

let emailRecipient = EmailRecipient(
                        email: "email", 
                        name: "name"
                    )
let ccRecipient = EmailRecipient(
                    email: "email", 
                    name: "name"
                )

let emailFrom = EmailFrom(
                    emailAddressId: "email_address_id", 
                    name: "name"
                )

let email = Email(
                to: [emailRecipient], 
                cc: [ccRecipient], 
                bcc: nil, from: 
                emailFrom, 
                subject: "subject", 
                body: "body", 
                attachments: nil, 
                schedule: nil
            )

TransactionalEmailAPI.emailPricePost(email: email) { (dataString, error) in
    if let error = error {
        print(error)
    } else {
        if let data = dataString!.data(using: String.Encoding.utf8) {
            do {
                if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                    print(dictonary)
                } else {
                    print("bad json")
                }
            } catch let error as NSError {
                print(error)
            }
        }
    }
}
    Coming Soon
package ClickSend;

import java.math.BigDecimal;
import java.util.Arrays;
import java.util.List;
import ClickSend.Api.TransactionalEmailApi;
import ClickSend.Model.Attachment;
import ClickSend.Model.Email;
import ClickSend.Model.EmailFrom;
import ClickSend.Model.EmailRecipient;

public class calculate_email_price {
  public static void main(String[] args) {
    ApiClient defaultClient = new ApiClient();
    defaultClient.setUsername("USERNAME");
    defaultClient.setPassword("API_KEY");
    TransactionalEmailApi apiInstance = new TransactionalEmailApi(defaultClient);
    EmailRecipient emailRecipient=new EmailRecipient();
    emailRecipient.email("example@gmail.com");
    emailRecipient.name("abc");
    List<EmailRecipient> emailRecipientList=Arrays.asList(emailRecipient);
    EmailFrom emailFrom=new EmailFrom();
    emailFrom.emailAddressId("4197");
    emailFrom.name("abc");
    Attachment attachment= new Attachment();
    attachment.content("ZmlsZSBjb250ZW50cw==");
    attachment.contentId("text");
    attachment.disposition("attachment");
    attachment.type("text/plain");
    attachment.filename("text.txt");
    List<Attachment> attachmentList=Arrays.asList(attachment);
    Email email = new Email(); // Email | Email model
    email.to(emailRecipientList);
    email.cc(emailRecipientList);
    email.bcc(emailRecipientList);
    email.from(emailFrom);
    email.subject("subject");
    email.body("body");
    email.attachments(attachmentList);
    email.schedule(new BigDecimal(147258369));
    try {
        String result = apiInstance.emailPricePost(email);
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling TransactionalEmailApi#emailPricePost");
        e.printStackTrace();
    }
  }
}

Body parameter

{
  "cc": [
    {
      "name": "name",
      "email": "email"
    },
    {
      "name": "name",
      "email": "email"
    }
  ],
  "schedule": 1904610115,
  "bcc": [
    {
      "name": "name",
      "email": "email"
    },
    {
      "name": "name",
      "email": "email"
    }
  ],
  "attachments": [
    {
      "disposition": "disposition",
      "filename": "filename",
      "content_id": "content_id",
      "type": "type",
      "content": "content"
    },
    {
      "disposition": "disposition",
      "filename": "filename",
      "content_id": "content_id",
      "type": "type",
      "content": "content"
    }
  ],
  "from": [
    {
      "name": "name",
      "email": "email"
    },
    {
      "name": "name",
      "email": "email"
    }
  ],
  "to": [
    {
      "name": "name",
      "email": "email"
    },
    {
      "name": "name",
      "email": "email"
    }
  ],
  "body": "body"
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "Here is your result.",
  "data": {
    "total": 2,
    "per_page": 15,
    "current_page": 1,
    "last_page": 1,
    "next_page_url": null,
    "prev_page_url": null,
    "from": 1,
    "to": 15,
    "data": [
      {
        "user_id": 1201,
        "subaccount_id": 1039,
        "from_email_address_id": 2,
        "from_name": "test",
        "to": [
          {
            "email": "test1@user.com"
          }
        ],
        "cc": null,
        "bcc": null,
        "subject": "test email transaction",
        "body": "This is a test content",
        "body_plain_text": "This is a test content",
        "schedule": "1469002942",
        "message_id": "988067DE-9318-448F-B225-7A5A695B23D1",
        "status": "Queued:WaitSend",
        "status_text": null,
        "soft_bounce_count": 0,
        "hard_bounce_count": 0,
        "price": "0.0822",
        "date_added": "1469002942",
        "custom_string": null,
        "_attachments": [
          {
            "file_name": "test.jpg",
            "content_type": "image/jpeg",
            "content_disposition": "attachment",
            "content_id": "<cid:PHP-CID-5b3eb73f50a7cf7f423dc97070bb3b5280312308>",
            "_attachment_file_url": "https://rest.clicksend.com/files/B5664FA5-CEBD-40B0-BED1-5CFF0CA027BD.jpg"
          }
        ],
        "_currency": {
          "currency_name_short": "PHP",
          "currency_prefix_d": "?",
          "currency_prefix_c": "c",
          "currency_name_long": "Philippine Peso"
        }
      }
    ]
  }
}

https://rest.clicksend.com/v3/email/price

Get transactional email price

Get transactional email price

Properties

Name Type Required Restrictions Description
to array true none Array of To Recipient items. (array of names and emails)
cc array false none Array of Cc Recipient items. (array of names and emails)
bcc array false none Array of Bcc Recipient items. (array of names and emails)
from object true none From Email object. (object containing name and email)
body string true none Body of the email.
attachments array false none Array of Attachment items.
schedule number false none Schedule.
name string false none Name of person email belongs to
email string true none Email to be used.
content string true none The base64-encoded contents of the file.
type string true none The type of file being attached.
filename string true none The name of the file being attached.
disposition string true none Inline for content that can be displayed within the email, or attachment for any other files.
content_id string true none An ID for the content.

Refer to Status Codes for definitions of HTTP status code responses.

View Email History

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
'https://rest.clicksend.com/v3/email/history'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\TransactionalEmailApi(new GuzzleHttp\Client(),$config);
$date_from = '1436849372'; // int | Start date
$date_to = '1436879372'; // int | End date
$page = 1; // int | Page number
$limit = 10; // int | Number of records per page

try {
    $result = $apiInstance->emailHistoryGet($date_from, $date_to, $page, $limit);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling TransactionalEmailApi->emailHistoryGet: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME, 
    Password = API_KEY  
};
var transactionalEmailApi = new TransactionalEmailApi(configuration);

var dateFrom = '1546913229';
var dateTo = '1546923229';
var page = 1;
var limit = 10;

var response = transactionalEmailApi.EmailHistoryGet(dateFrom, dateTo, page, limit);
var api = require('./api.js');

var emailTransactionalApi = new api.TransactionalEmailApi("USERNAME", "API_KEY");

var dateFrom = '1546913229';
var dateTo = '1546923229';
var page = 1;
var limit = 10;

emailTransactionalApi.emailHistoryGet(dateFrom, dateTo, page, limit).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::TransactionalEmailApi.new

opts = {
  date_from: 1546913229, # Integer | Start date
  date_to: 1546923229, # Integer | End date
  page: 1, # Integer | Page number
  limit: 10 # Integer | Number of records per page
}

begin
  # Get all transactional email history
  result = api_instance.email_history_get(opts)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling TransactionalEmailApi->email_history_get: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.TransactionalEmailApi(clicksend_client.ApiClient(configuration))
date_from = 1546913229 # int | Start date (optional)
date_to = 1546923229 # int | End date (optional)
page = 1 # int | Page number (optional) (default to 1)
limit = 10 # int | Number of records per page (optional) (default to 10)

try:
    # Get all transactional email history
    api_response = api_instance.email_history_get(date_from=date_from, date_to=date_to, page=page, limit=limit)
    print(api_response)
except ApiException as e:
    print("Exception when calling TransactionalEmailApi->email_history_get: %s\n" % e)
use WWW::ClickSendClient::TransactionalEmailApi;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::TransactionalEmailApi->new(username => $username, password => $password);

my $json_output = $api->email_history_get(
    'limit' => '1',
    'page' => '1',
    'date_to' => '1546913229',
    'date_from' => '1546923229'
 );

print $json_output;
#import "CSTransactionalEmailApi.h"
#import "CSDefaultConfiguration.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
// Configure HTTP basic authorization (authentication scheme: BasicAuth)
[apiConfig setUsername:@"USERNAME"];
[apiConfig setPassword:@"PASSWORD"];

NSNumber *fromDate = [NSNumber numberWithInt:1436849372];
NSNumber *toDate = [NSNumber numberWithInt:1436879372];

CSTransactionalEmailApi *transEmailApi = [[CSTransactionalEmailApi alloc] init];
[transEmailApi emailHistoryGetWithDateFrom:fromDate dateTo:toDate page:@(1) limit:@(15) completionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire
if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}

TransactionalEmailAPI.emailHistoryGet { (dataString, error) in
    if let error = error {
        print(error)
    } else {
        if let data = dataString!.data(using: String.Encoding.utf8) {
            do {
                if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                    print(dictonary)
                } else {
                    print("bad json")
                }
            } catch let error as NSError {
                print(error)
            }
        }
    }
}
    Coming Soon
package ClickSend;

import ClickSend.Api.TransactionalEmailApi;

public class view_email_history {
  public static void main(String[] args) {
    ApiClient defaultClient = new ApiClient();
    defaultClient.setUsername("USERNAME");
    defaultClient.setPassword("API_KEY");
    TransactionalEmailApi apiInstance = new TransactionalEmailApi(defaultClient);
    Integer dateFrom = 1546913229; // Integer | Start date
    Integer dateTo = 1546923229; // Integer | End date
    Integer page = 1; // Integer | Page number
    Integer limit = 10; // Integer | Number of records per page
    try {
        String result = apiInstance.emailHistoryGet(dateFrom, dateTo, page, limit);
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling TransactionalEmailApi#emailHistoryGet");
        e.printStackTrace();
    }
  }
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "Here is your result.",
  "data": {
    "total": 1,
    "per_page": 15,
    "current_page": 1,
    "last_page": 1,
    "next_page_url": null,
    "prev_page_url": null,
    "from": 1,
    "to": 15,
    "data": [
      {
        "user_id": 1201,
        "subaccount_id": 1039,
        "from_email_address_id": 2,
        "from_name": "test",
        "to": [
          {
            "email": "test1@user.com"
          }
        ],
        "cc": null,
        "bcc": null,
        "subject": "test email transaction",
        "body": "This is a test content",
        "body_plain_text": "This is a test content",
        "schedule": "1469002942",
        "message_id": "988067DE-9318-448F-B225-7A5A695B23D1",
        "status": "Queued:WaitSend",
        "status_text": null,
        "soft_bounce_count": 0,
        "hard_bounce_count": 0,
        "price": "0.0822",
        "date_added": "1469002942",
        "custom_string": null,
        "_attachments": [
          {
            "file_name": "test.jpg",
            "content_type": "image/jpeg",
            "content_disposition": "attachment",
            "content_id": "<cid:PHP-CID-5b3eb73f50a7cf7f423dc97070bb3b5280312308>",
            "_attachment_file_url": "https://rest.clicksend.com/files/B5664FA5-CEBD-40B0-BED1-5CFF0CA027BD.jpg"
          }
        ],
        "_currency": {
          "currency_name_short": "PHP",
          "currency_prefix_d": "?",
          "currency_prefix_c": "c",
          "currency_name_long": "Philippine Peso"
        }
      }
    ]
  }
}

https://rest.clicksend.com/v3/email/history

Get all transactional email history

Get all transactional email history

Parameters

Parameter In Type Required Description
date_from query integer(int32) false Start date (Unix Timestamp e.g. 1436849372)
date_to query integer(int32) false End date (Unix Timestamp e.g. 1436879372)
page query integer(int32) false Page number
limit query integer(int32) false Number of records per page

Refer to Status Codes for definitions of HTTP status code responses.

Export Email History

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
'https://rest.clicksend.com/v3/email/history/export?filename={filename}'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\TransactionalEmailApi(new GuzzleHttp\Client(),$config);
$filename = "filename_example"; // string | Filename to download history as
$date_from = '1436849372'; // int | Start date
$date_to = '1436879372'; // int | End date

try {
    $result = $apiInstance->emailHistoryExportGet($filename, $date_from, $date_to);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling TransactionalEmailApi->emailHistoryExportGet: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME, 
    Password = API_KEY  
};
var transactionalEmailApi = new TransactionalEmailApi(configuration);

var filename = "filename";
var dateFrom = '1546913229';
var dateTo = '1546923229';

var response = transactionalEmailApi.EmailHistoryExportGet(filename, dateFrom, dateTo);
var api = require('./api.js');

var emailTransactionalApi = new api.TransactionalEmailApi("USERNAME", "API_KEY");

var filename = "filename";
var dateFrom = '1546913229';
var dateTo = '1546923229';

emailTransactionalApi.emailHistoryExportGet(filename, dateFrom, dateTo).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::TransactionalEmailApi.new

filename = "filename_example" # String | Filename to download history as

opts = {
  date_from: 1546913229, # Integer | Start date
  date_to: 1546923229 # Integer | End date
}

begin
  # Export all Transactional Email history
  result = api_instance.email_history_export_get(filename, opts)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling TransactionalEmailApi->email_history_export_get: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.TransactionalEmailApi(clicksend_client.ApiClient(configuration))
filename = 'filename_example' # str | Filename to download history as
date_from = 1546913229 # int | Start date (optional)
date_to = 1546923229 # int | End date (optional)

try:
    # Export all Transactional Email history
    api_response = api_instance.email_history_export_get(filename, date_from=date_from, date_to=date_to)
    print(api_response)
except ApiException as e:
    print("Exception when calling TransactionalEmailApi->email_history_export_get: %s\n" % e)
use WWW::ClickSendClient::TransactionalEmailApi;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::TransactionalEmailApi->new(username => $username, password => $password);

my $json_output = $api->email_history_export_get('filename' => 'filename','date_to' => '1546913229','date_from' => '1546923229');

print $json_output;
#import "CSTransactionalEmailApi.h"
#import "CSDefaultConfiguration.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
// Configure HTTP basic authorization (authentication scheme: BasicAuth)
[apiConfig setUsername:@"USERNAME"];
[apiConfig setPassword:@"PASSWORD"];

NSNumber *fromDate = [NSNumber numberWithInt:1436849372];
NSNumber *toDate = [NSNumber numberWithInt:1436879372];

CSTransactionalEmailApi *transEmailApi = [[CSTransactionalEmailApi alloc] init];
[transEmailApi emailHistoryExportGetWithFilename:@"filename" dateFrom:fromDate dateTo:toDate completionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire
if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}

TransactionalEmailAPI.emailHistoryExportGet(filename: "filename") { (dataString, error) in
    if let error = error {
        print(error)
    } else {
        if let data = dataString!.data(using: String.Encoding.utf8) {
            do {
                if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                    print(dictonary)
                } else {
                    print("bad json")
                }
            } catch let error as NSError {
                print(error)
            }
        }
    }
}
    Coming Soon
package ClickSend;

import ClickSend.Api.TransactionalEmailApi;

public class export_email_history {
  public static void main(String[] args) {
    ApiClient defaultClient = new ApiClient();
    defaultClient.setUsername("USERNAME");
    defaultClient.setPassword("API_KEY");
    TransactionalEmailApi apiInstance = new TransactionalEmailApi(defaultClient);
    String filename = "filename_example"; // String | Filename to download history as
    Integer dateFrom = 1546913229; // Integer | Start date
    Integer dateTo = 1546923229; // Integer | End date
    try {
        String result = apiInstance.emailHistoryExportGet(filename, dateFrom, dateTo);
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling TransactionalEmailApi#emailHistoryExportGet");
        e.printStackTrace();
    }
  }
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "Download your file here.",
  "data": {
    "url": "https://rest.clicksend.com/files/22D55AF9-6CF0-476D-A8B3-82A998FD2738?filename=export.csv"
  }
}

https://rest.clicksend.com/v3/email/history/export

Export all Transactional Email history

Export all Transactional Email history

Parameters

Parameter In Type Required Description
filename query string true Filename to download history as
date_from query integer(int32) false Start date (Unix Timestamp e.g. 1436849372)
date_to query integer(int32) false End date (Unix Timestamp e.g. 1436879372)

Refer to Status Codes for definitions of HTTP status code responses.

Email Delivery Receipt Rules

Everything about Email Delivery Receipt Automations

View Email Delivery Receipt Rules

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
'https://rest.clicksend.com/v3/automations/email/receipt'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\EmailDeliveryReceiptRulesApi(new GuzzleHttp\Client(),$config);
$q = "q_example"; // string | Your keyword or query.
$page = 1; // int | Page number
$limit = 10; // int | Number of records per page

try {
    $result = $apiInstance->emailDeliveryReceiptAutomationsGet($q, $page, $limit);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling EmailDeliveryReceiptRulesApi->emailDeliveryReceiptAutomationsGet: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME, 
    Password = API_KEY  
};
var emailDeliveryReceiptRulesApi = new EmailDeliveryReceiptRulesApi(configuration);
var response = emailDeliveryReceiptRulesApi.EmailDeliveryReceiptAutomationsGet();
var api = require('./api.js');

var emailDeliveryApi = new api.EmailDeliveryReceiptRulesApi("USERNAME", "API_KEY");

var q = "q_example";
var page = 1;
var limit = 10;

emailDeliveryApi.emailDeliveryReceiptAutomationsGet(q, page, limit).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::EmailDeliveryReceiptRulesApi.new

opts = {
  page: 1,  # Integer | Page number
  limit: 10 # Integer | Number of records per page
}

begin
  # Get all email delivery receipt automations
  result = api_instance.email_delivery_receipt_automations_get(opts)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling EmailDeliveryReceiptRulesApi->email_delivery_receipt_automations_get: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.EmailDeliveryReceiptRulesApi(clicksend_client.ApiClient(configuration))
page = 1 # int | Page number (optional) (default to 1)
limit = 10 # int | Number of records per page (optional) (default to 10)

try:
    # Get all email delivery receipt automations
    api_response = api_instance.email_delivery_receipt_automations_get(page=page, limit=limit)
    print(api_response)
except ApiException as e:
    print("Exception when calling EmailDeliveryReceiptRulesApi->email_delivery_receipt_automations_get: %s\n" % e)
use WWW::ClickSendClient::SMSDeliveryReceiptRulesApi;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::SMSDeliveryReceiptRulesApi->new(username => $username, password => $password);

my $json_output = $api->sms_delivery_receipt_automations_get('page' => '1' ,'limit' => '10');

print $json_output;
#import "CSEmailDeliveryReceiptRulesApi.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
[apiConfig setUsername:@"USERNAME"];
[apiConfig setPassword:@"PASSWORD"];

NSNumber *page = [[NSNumber alloc] initWithInt:1];
NSNumber *limit = [[NSNumber alloc] initWithInt:15];

CSEmailDeliveryReceiptRulesApi *emailDeliveryReceiptApiInstance = [[CSEmailDeliveryReceiptRulesApi alloc] init];
[emailDeliveryReceiptApiInstance emailDeliveryReceiptAutomationsGetWithQ:@"string" page:page limit:limit completionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire

if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}

EmailDeliveryReceiptRulesAPI.emailDeliveryReceiptAutomationsGet(q: "string", page: 1, limit: 15) { (dataString, error) in
    guard let dataString = dataString else {
        print(error!)
        return
    }
    if let data = dataString.data(using: String.Encoding.utf8) {
        do {
            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                print(dictonary)
            } else {
                print("Cannot convert the String value to JSON")
            }
        } catch let error as NSError {
            print(error)
        }
    }
}
    Coming Soon
package ClickSend;

import ClickSend.Api.EmailDeliveryReceiptRulesApi;

public class view_all_email_delivery_receipt_rule {
  public static void main(String[] args) {
    ApiClient defaultClient = new ApiClient();
    defaultClient.setUsername("USERNAME");
    defaultClient.setPassword("API_KEY");
    EmailDeliveryReceiptRulesApi apiInstance = new EmailDeliveryReceiptRulesApi(defaultClient);
    String q = "q_example"; // String | Your keyword or query.
    Integer page = 1; // Integer | Page number
    Integer limit = 10; // Integer | Number of records per page
    try {
      String result = apiInstance.emailDeliveryReceiptAutomationsGet(q, page, limit);
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling EmailDeliveryReceiptRulesApi#emailDeliveryReceiptAutomationsGet");
        e.printStackTrace();
    }
  }
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "Here is your result.",
  "data": {
    "total": 4,
    "per_page": 15,
    "current_page": 1,
    "last_page": 1,
    "next_page_url": null,
    "prev_page_url": null,
    "from": 1,
    "to": 4,
    "data": [
      {
        "receipt_rule_id": 1,
        "rule_name": "Email Test Rule",
        "match_type": 0,
        "action": "URL",
        "action_address": "http://yourdomain.com",
        "enabled": 1
      },
      {
        "receipt_rule_id": 2,
        "rule_name": "test",
        "match_type": 0,
        "action": "URL",
        "action_address": "http://yourdomain.com",
        "enabled": 1
      }
    ]
  }
}

https://rest.clicksend.com/v3/automations/email/receipts

Get all email delivery receipt automations

Get all email delivery receipt automations

Parameters

Parameter In Type Required Description
page query integer(int32) false Page number
limit query integer(int32) false Number of records per page

Refer to Status Codes for definitions of HTTP status code responses.

Create Email Delivery Receipt Rule

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
     --request POST \
     --header "Content-Type: application/json" \
     --data-binary "    {
        \"rule_name\":\"My Rule\",
        \"match_type\": 0,
        \"action\":\"URL\",
        \"action_address\":\"http://yourdomain.com\",
        \"enabled\":1
    }" \
'https://rest.clicksend.com/v3/automations/email/receipt'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\EmailDeliveryReceiptRulesApi(new GuzzleHttp\Client(),$config);
// \ClickSend\Model\DeliveryReceiptRule | Email delivery receipt rule model
$delivery_receipt_rule = new \ClickSend\Model\DeliveryReceiptRule(); 
$delivery_receipt_rule->setRuleName("my rule");
$delivery_receipt_rule->setMatchType(0);
$delivery_receipt_rule->setAction("URL");
$delivery_receipt_rule->setActionAddress("http://example.com");
$delivery_receipt_rule->setEnabled(1);

try {
    $result = $apiInstance->emailDeliveryReceiptAutomationPost($delivery_receipt_rule);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling EmailDeliveryReceiptRulesApi->emailDeliveryReceiptAutomationPost: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME, 
    Password = API_KEY  
};
var deliveryIssuesApi = new DeliveryIssuesApi(configuration);
var response = emailDeliveryReceiptRulesApi.EmailDeliveryReceiptAutomationPost(new DeliveryReceiptRule(
    ruleName: "RULE_NAME",
    matchType: 0,
    action: "URL",
    actionAddress: "http://yourdomain.com",
    enabled: 1
));
var api = require('./api.js');

var emailDeliveryApi = new api.EmailDeliveryReceiptRulesApi("USERNAME", "API_KEY");

var deliveryReceiptRule = new api.DeliveryReceiptRule();

deliveryReceiptRule.ruleName = "My Rule";
deliveryReceiptRule.matchType = 0;
deliveryReceiptRule.actionAddress = "http://example.com";
deliveryReceiptRule.action = "URL";
deliveryReceiptRule.enabled = 1;

emailDeliveryApi.emailDeliveryReceiptAutomationPost(deliveryReceiptRule).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::EmailDeliveryReceiptRulesApi.new

# DeliveryReceiptRule | fax delivery receipt rule model
delivery_receipt_rule = ClickSendClient::DeliveryReceiptRule.new(
  "rule_name": "rule_name",
  "match_type": 1,
  "action": "action",
  "action_address": "action_address",
  "enabled": 1

begin
  # Create email delivery receipt automations
  result = api_instance.email_delivery_receipt_automation_post(delivery_receipt_rule)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling EmailDeliveryReceiptRulesApi->email_delivery_receipt_automation_post: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.EmailDeliveryReceiptRulesApi(clicksend_client.ApiClient(configuration))
# DeliveryReceiptRule | Email delivery receipt rule model
delivery_receipt_rule = clicksend_client.DeliveryReceiptRule(
                        rule_name="My Rule",
                        match_type=0,
                        action="URL",
                        action_address="http://yourdomain.com",
                        enabled=1) 
try:
    # Create email delivery receipt automations
    api_response = api_instance.email_delivery_receipt_automation_post(delivery_receipt_rule)
    print(api_response)
except ApiException as e:
    print("Exception when calling EmailDeliveryReceiptRulesApi->email_delivery_receipt_automation_post: %s\n" % e)
use WWW::ClickSendClient::SMSDeliveryReceiptRulesApi;
use WWW::ClickSendClient::Object::DeliveryReceiptRule;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::SMSDeliveryReceiptRulesApi->new(username => $username, password => $password);

my %params = (
    'rule_name'      => 'rule_name',
    'match_type'     => '1',
    'action'         => 'EMAIL_FIXED',
    'action_address' => 'test1@test.com',
    'enabled'        => '0'
);

my $sms_delivery_obj = WWW::ClickSendClient::Object::DeliveryReceiptRule->new(%params);
my $json_output = $api->sms_delivery_receipt_automation_post('delivery_receipt_rule' => $sms_delivery_obj);

print $json_output;
#import "CSEmailDeliveryReceiptRulesApi.h"
#import "CSDeliveryReceiptRule.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
[apiConfig setUsername:@"USERNAME"];
[apiConfig setPassword:@"PASSWORD"];


CSDeliveryReceiptRule *deliveryReceiptRule = [[CSDeliveryReceiptRule alloc] init];
deliveryReceiptRule.ruleName = @"rule_name";
deliveryReceiptRule.action = @"SMS";
deliveryReceiptRule.actionAddress = @"action_anddress";
deliveryReceiptRule.enabled = @"1";

"
CSEmailDeliveryReceiptRulesApi *emailDeliveryReceiptApiInstance = [[CSEmailDeliveryReceiptRulesApi alloc] init];
[emailDeliveryReceiptApiInstance emailDeliveryReceiptAutomationPostWithDeliveryReceiptRule:deliveryReceiptRule completionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire

if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}
let deliveryReceiptRule = DeliveryReceiptRule(
                                ruleName: "rulename", 
                                matchType: 1, 
                                action: "action", 
                                actionAddress: "actionAddress", 
                                enabled: 1
                            )

EmailDeliveryReceiptRulesAPI.emailDeliveryReceiptAutomationPost(deliveryReceiptRule: deliveryReceiptRule) { (dataString, error) in
    guard let dataString = dataString else {
        print(error!)
        return
    }
    if let data = dataString.data(using: String.Encoding.utf8) {
        do {
            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                print(dictonary)
            } else {
                print("Cannot convert the String value to JSON")
            }
        } catch let error as NSError {
            print(error)
        }
    }
}
    Coming Soon
package ClickSend;

import java.math.BigDecimal;
import ClickSend.Api.EmailDeliveryReceiptRulesApi;
import ClickSend.Model.DeliveryReceiptRule;

public class create_email_delivery_receipt_rule {
  public static void main(String[] args) {
    ApiClient defaultClient = new ApiClient();
    defaultClient.setUsername("USERNAME");
    defaultClient.setPassword("API_KEY");
    EmailDeliveryReceiptRulesApi apiInstance = new EmailDeliveryReceiptRulesApi(defaultClient);
    // DeliveryReceiptRule | Email delivery receipt rule model
    DeliveryReceiptRule deliveryReceiptRule = new DeliveryReceiptRule();
    deliveryReceiptRule.ruleName("rulename");
    deliveryReceiptRule.matchType(new BigDecimal(0));
    deliveryReceiptRule.action("URL");
    deliveryReceiptRule.actionAddress("http://yourdomain.com");
    deliveryReceiptRule.enabled(new BigDecimal(1));
    try {
        String result = apiInstance.emailDeliveryReceiptAutomationPost(deliveryReceiptRule);
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling EmailDeliveryReceiptRulesApi#emailDeliveryReceiptAutomationPost");
        e.printStackTrace();
    }
  }
}

Body parameter

{
  "action_address": "action_address",
  "rule_name": "rule_name",
  "match_type": 1,
  "action": "action",
  "enabled": 1
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "Automation email receipt rule has been created.",
  "data": {
    "receipt_rule_id": 8,
    "rule_name": "My Rule",
    "match_type": 0,
    "action": "URL",
    "action_address": "http://yourdomain.com",
    "enabled": 1
  }
}

https://rest.clicksend.com/v3/automations/email/receipts

Create email delivery receipt automations

Create email delivery receipt automations

Properties

Name Type Required Restrictions Description
rule_name string true none Rule Name.
match_type number true none Match Type. 0=All reports.
action string true none Action to be taken (AUTO_REPLY, EMAIL_USER, EMAIL_FIXED, URL, SMS, POLL, GROUP_SMS, MOVE_CONTACT, CREATE_CONTACT, CREATE_CONTACT_PLUS_EMAIL, CREATE_CONTACT_PLUS_NAME_EMAIL CREATE_CONTACT_PLUS_NAME, SMPP, NONE).
action_address string true none Action address.
enabled number true none Enabled: Disabled=0 or Enabled=1.

Refer to Status Codes for definitions of HTTP status code responses.

View Email Delivery Receipt Rule

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
'https://rest.clicksend.com/v3/automations/email/receipt/{rule_id}'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\EmailDeliveryReceiptRulesApi(new GuzzleHttp\Client(),$config);
$receipt_rule_id = 27; // int | Receipt rule id

try {
    $result = $apiInstance->emailDeliveryReceiptAutomationGet($receipt_rule_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling EmailDeliveryReceiptRulesApi->emailDeliveryReceiptAutomationGet: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME, 
    Password = API_KEY  
};
var emailDeliveryReceiptRulesApi = new EmailDeliveryReceiptRulesApi(configuration);
var response = emailDeliveryReceiptRulesApi.EmailDeliveryReceiptAutomationGet(RULE_ID);
var api = require('./api.js');

var emailDeliveryApi = new api.EmailDeliveryReceiptRulesApi("USERNAME", "API_KEY");

var receiptRuleId = 27;

emailDeliveryApi.emailDeliveryReceiptAutomationGet(receiptRuleId).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::EmailDeliveryReceiptRulesApi.new

receipt_rule_id = 56 # Integer | Receipt rule id

begin
  # Get specific email delivery receipt automation
  result = api_instance.email_delivery_receipt_automation_get(receipt_rule_id)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling EmailDeliveryReceiptRulesApi->email_delivery_receipt_automation_get: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.EmailDeliveryReceiptRulesApi(clicksend_client.ApiClient(configuration))
receipt_rule_id = 20 # int | Receipt rule id

try:
    # Get specific email delivery receipt automation
    api_response = api_instance.email_delivery_receipt_automation_get(receipt_rule_id)
    print(api_response)
except ApiException as e:
    print("Exception when calling EmailDeliveryReceiptRulesApi->email_delivery_receipt_automation_get: %s\n" % e)
use WWW::ClickSendClient::EmailDeliveryReceiptRulesApi;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::emailDeliveryReceiptRulesApi->new(username => $username, password => $password);

my $json_output = $api->email_delivery_receipt_automation_get('receipt_rule_id' => '1234');

print $json_output;
#import "CSEmailDeliveryReceiptRulesApi.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
[apiConfig setUsername:@"USERNAME"];
[apiConfig setPassword:@"PASSWORD"];

NSNumber *receiptRuleId = [[NSNumber alloc] initWithInt:1];

CSEmailDeliveryReceiptRulesApi *emailDeliveryReceiptApiInstance = [[CSEmailDeliveryReceiptRulesApi alloc] init];
[emailDeliveryReceiptApiInstance emailDeliveryReceiptAutomationGetWithReceiptRuleId:receiptRuleId completionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire

if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}

EmailDeliveryReceiptRulesAPI.emailDeliveryReceiptAutomationGet(receiptRuleId: 1) { (dataString, error) in
    guard let dataString = dataString else {
        print(error!)
        return
    }
    if let data = dataString.data(using: String.Encoding.utf8) {
        do {
            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                print(dictonary)
            } else {
                print("Cannot convert the String value to JSON")
            }
        } catch let error as NSError {
        print(error)
        }
    }
}
    Coming Soon
package ClickSend;

import ClickSend.Api.EmailDeliveryReceiptRulesApi;

public class view_specific_email_delivery_receipt_rule {
  public static void main(String[] args) {
    ApiClient defaultClient = new ApiClient();
    defaultClient.setUsername("USERNAME");
    defaultClient.setPassword("API_KEY");
    EmailDeliveryReceiptRulesApi apiInstance = new EmailDeliveryReceiptRulesApi(defaultClient);
    Integer receiptRuleId = 21; // Integer | Receipt rule id
    try {
        String result = apiInstance.emailDeliveryReceiptAutomationGet(receiptRuleId);
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling EmailDeliveryReceiptRulesApi#emailDeliveryReceiptAutomationGet");
        e.printStackTrace();
    }
  }
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "Here is your result.",
  "data": {
    "receipt_rule_id": 1,
    "rule_name": "Email Test Rule",
    "match_type": 0,
    "action": "URL",
    "action_address": "http://yourdomain.com",
    "enabled": 1
  }
}

https://rest.clicksend.com/v3/automations/email/receipts/{receipt_rule_id}

Get specific email delivery receipt automation

Get specific email delivery receipt automation

Parameters

Parameter In Type Required Description
receipt_rule_id path integer(int32) true Receipt rule id

Refer to Status Codes for definitions of HTTP status code responses.

Update Email Delivery Receipt Rule

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
     --request PUT \
     --header "Content-Type: application/json" \
     --data-binary "    {
        \"rule_name\":\"My Rule\",
        \"match_type\": 0,
        \"action\":\"URL\",
        \"action_address\":\"http://yourdomain.com\",
        \"enabled\":1
    }" \
'https://rest.clicksend.com/v3/automations/email/receipt/{rule_id}'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\EmailDeliveryReceiptRulesApi(new GuzzleHttp\Client(),$config);
$receipt_rule_id = 27; // int | Receipt rule id
// \ClickSend\Model\DeliveryReceiptRule | Delivery receipt rule model
$delivery_receipt_rule = new \ClickSend\Model\DeliveryReceiptRule(); 
$delivery_receipt_rule->setRuleName("my rule");
$delivery_receipt_rule->setMatchType(0);
$delivery_receipt_rule->setAction("URL");
$delivery_receipt_rule->setActionAddress("http://example.com");
$delivery_receipt_rule->setEnabled(1);

try {
    $result = $apiInstance->emailDeliveryReceiptAutomationPut($receipt_rule_id, $delivery_receipt_rule);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling EmailDeliveryReceiptRulesApi->emailDeliveryReceiptAutomationPut: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME, 
    Password = API_KEY  
};
var emailDeliveryReceiptRulesApi = new EmailDeliveryReceiptRulesApi(configuration);
var response = emailDeliveryReceiptRulesApi.EmailDeliveryReceiptAutomationPut(RULE_ID,new DeliveryReceiptRule(
    ruleName: "New Name",
    matchType:  0,
    action: "URL",
    actionAddress: "https://someaddress.com",
    enabled: 1
));
var api = require('./api.js');

var emailDeliveryApi = new api.EmailDeliveryReceiptRulesApi("USERNAME", "API_KEY");

var deliveryReceiptRule = new api.DeliveryReceiptRule();

deliveryReceiptRule.ruleName = "My Rule";
deliveryReceiptRule.matchType = 0;
deliveryReceiptRule.actionAddress = "http://example.com";
deliveryReceiptRule.action = "URL";
deliveryReceiptRule.enabled = 1;

var receiptRuleId = 26;

emailDeliveryApi.emailDeliveryReceiptAutomationPut(receiptRuleId, deliveryReceiptRule).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::EmailDeliveryReceiptRulesApi.new

receipt_rule_id = 18 # Integer | Receipt rule id

# DeliveryReceiptRule | fax delivery receipt rule model
delivery_receipt_rule = ClickSendClient::DeliveryReceiptRule.new(
  "rule_name": "rule_name",
  "match_type": 1,
  "action": "action",
  "action_address": "action_address",
  "enabled": 1
)

begin
  # Update email delivery receipt automation
  result = api_instance.email_delivery_receipt_automation_put(receipt_rule_id, delivery_receipt_rule)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling EmailDeliveryReceiptRulesApi->email_delivery_receipt_automation_put: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.EmailDeliveryReceiptRulesApi(clicksend_client.ApiClient(configuration))
receipt_rule_id = 20 # int | Receipt rule id
# DeliveryReceiptRule | Delivery receipt rule model
delivery_receipt_rule = clicksend_client.DeliveryReceiptRule(
                        rule_name="My Updated Rule",
                        match_type=0,
                        action="URL",
                        action_address="http://yourdomain.com",
                        enabled=1) 

try:
    # Update email delivery receipt automation
    api_response = api_instance.email_delivery_receipt_automation_put(receipt_rule_id, delivery_receipt_rule)
    print(api_response)
except ApiException as e:
    print("Exception when calling EmailDeliveryReceiptRulesApi->email_delivery_receipt_automation_put: %s\n" % e)
use WWW::ClickSendClient::SMSDeliveryReceiptRulesApi;
use WWW::ClickSendClient::Object::DeliveryReceiptRule;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::SMSDeliveryReceiptRulesApi->new(username => $username, password => $password);

my %params = (
    'rule_name'      => 'rule_name',
    'match_type'     => '1',
    'action'         => 'EMAIL_FIXED',
    'action_address' => 'test1@test.com',
    'enabled'        => '0'
);

my $sms_delivery_obj = WWW::ClickSendClient::Object::DeliveryReceiptRule->new(%params);

my $json_output = $api->sms_delivery_receipt_automation_put('receipt_rule_id' => '1234','delivery_receipt_rule' => $sms_delivery_obj);

print $json_output;
#import "CSEmailDeliveryReceiptRulesApi.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
[apiConfig setUsername:@"USERNAME"];
[apiConfig setPassword:@"PASSWORD"];

NSNumber *ruleId = [[NSNumber alloc] initWithInt:1];

CSDeliveryReceiptRule *deliveryReceiptRule = [[CSDeliveryReceiptRule alloc] init];
deliveryReceiptRule.ruleName = @"rule_name";
deliveryReceiptRule.action = @"SMS";
deliveryReceiptRule.actionAddress = @"action_anddress";
deliveryReceiptRule.enabled = @"1";


CSEmailDeliveryReceiptRulesApi *emailDeliveryReceiptApiInstance = [[CSEmailDeliveryReceiptRulesApi alloc] init];
[emailDeliveryReceiptApiInstance emailDeliveryReceiptAutomationPutWithReceiptRuleId:ruleId deliveryReceiptRule:deliveryReceiptRule completionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire

if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}
let deliveryReceiptRule = DeliveryReceiptRule(
                            ruleName: "rulename", 
                            matchType: 1, 
                            action: "action", 
                            actionAddress: "actionAddress", 
                            enabled: 1
                        )

EmailDeliveryReceiptRulesAPI.emailDeliveryReceiptAutomationPut(receiptRuleId: 1, deliveryReceiptRule: deliveryReceiptRule) { (dataString, error) in
    guard let dataString = dataString else {
        print(error!)
        return
    }
    if let data = dataString.data(using: String.Encoding.utf8) {
        do {
            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                print(dictonary)
            } else {
                print("Cannot convert the String value to JSON")
            }
        } catch let error as NSError {
            print(error)
        }
    }
}
    Coming Soon
package ClickSend;

import java.math.BigDecimal;
import ClickSend.Api.EmailDeliveryReceiptRulesApi;
import ClickSend.Model.DeliveryReceiptRule;

public class update_email_delivery_receipt_rule {
  public static void main(String[] args) {
    ApiClient defaultClient = new ApiClient();
    defaultClient.setUsername("USERNAME");
    defaultClient.setPassword("API_KEY");
    EmailDeliveryReceiptRulesApi apiInstance = new EmailDeliveryReceiptRulesApi(defaultClient);
    Integer receiptRuleId = 22; // Integer | Receipt rule id
    // DeliveryReceiptRule | Delivery receipt rule model
    DeliveryReceiptRule deliveryReceiptRule = new DeliveryReceiptRule(); 
    deliveryReceiptRule.ruleName("rulename");
    deliveryReceiptRule.matchType(new BigDecimal(0));
    deliveryReceiptRule.action("URL");
    deliveryReceiptRule.actionAddress("http://yourdomain.com");
    deliveryReceiptRule.enabled(new BigDecimal(1));
    try {
        String result = apiInstance.emailDeliveryReceiptAutomationPut(receiptRuleId, deliveryReceiptRule);
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling EmailDeliveryReceiptRulesApi#emailDeliveryReceiptAutomationPut");
        e.printStackTrace();
    }
  }
}

Body parameter

{
  "action_address": "action_address",
  "rule_name": "rule_name",
  "match_type": 1,
  "action": "action",
  "enabled": 1
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "Automation email receipt rule has been updated.",
  "data": {
    "receipt_rule_id": 8,
    "rule_name": "My Rule",
    "match_type": 0,
    "action": "URL",
    "action_address": "http://yourdomain.com",
    "enabled": 1
  }
}

https://rest.clicksend.com/v3/automations/email/receipts/{receipt_rule_id}

Update email delivery receipt automation

Update email delivery receipt automation

Parameters

Parameter In Type Required Description
receipt_rule_id path integer(int32) true Receipt rule id

Properties

Name Type Required Restrictions Description
rule_name string true none Rule Name.
match_type number true none Match Type. 0=All reports.
action string true none Action to be taken (AUTO_REPLY, EMAIL_USER, EMAIL_FIXED, URL, SMS, POLL, GROUP_SMS, MOVE_CONTACT, CREATE_CONTACT, CREATE_CONTACT_PLUS_EMAIL, CREATE_CONTACT_PLUS_NAME_EMAIL CREATE_CONTACT_PLUS_NAME, SMPP, NONE).
action_address string true none Action address.
enabled number true none Enabled: Disabled=0 or Enabled=1.

Refer to Status Codes for definitions of HTTP status code responses.

Delete Email Delivery Receipt Rule

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
     --request DELETE \
'https://rest.clicksend.com/v3/automations/email/receipt/{rule_id}'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\EmailDeliveryReceiptRulesApi(new GuzzleHttp\Client(),$config);
$receipt_rule_id = 27; // int | Receipt rule id

try {
    $result = $apiInstance->emailDeliveryReceiptAutomationDelete($receipt_rule_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling EmailDeliveryReceiptRulesApi->emailDeliveryReceiptAutomationDelete: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME, 
    Password = API_KEY  
};
var emailDeliveryReceiptRulesApi = new EmailDeliveryReceiptRulesApi(configuration);
var response = emailDeliveryReceiptRulesApi.EmailDeliveryReceiptAutomationDelete(RULE_ID);
var api = require('./api.js');

var emailDeliveryApi = new api.EmailDeliveryReceiptRulesApi("USERNAME", "API_KEY");

var receiptRuleId = 26;

emailDeliveryApi.emailDeliveryReceiptAutomationDelete(receiptRuleId).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::EmailDeliveryReceiptRulesApi.new

receipt_rule_id = 56 # Integer | Receipt rule id

begin
  # Delete email delivery receipt automation
  result = api_instance.email_delivery_receipt_automation_delete(receipt_rule_id)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling EmailDeliveryReceiptRulesApi->email_delivery_receipt_automation_delete: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.EmailDeliveryReceiptRulesApi(clicksend_client.ApiClient(configuration))
receipt_rule_id = 20 # int | Receipt rule id

try:
    # Delete email delivery receipt automation
    api_response = api_instance.email_delivery_receipt_automation_delete(receipt_rule_id)
    print(api_response)
except ApiException as e:
    print("Exception when calling EmailDeliveryReceiptRulesApi->email_delivery_receipt_automation_delete: %s\n" % e)
use WWW::ClickSendClient::SMSDeliveryReceiptRulesApi;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::SMSDeliveryReceiptRulesApi->new(username => $username, password => $password);

my $json_output = $api->sms_delivery_receipt_automation_delete('receipt_rule_id' => '1234');

print $json_output;
#import "CSEmailDeliveryReceiptRulesApi.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
[apiConfig setUsername:@"USERNAME"];
[apiConfig setPassword:@"PASSWORD"];

NSNumber *ruleId = [[NSNumber alloc] initWithInt:1];
CSEmailDeliveryReceiptRulesApi *emailDeliveryReceiptApiInstance = [[CSEmailDeliveryReceiptRulesApi alloc] init];
[emailDeliveryReceiptApiInstance emailDeliveryReceiptAutomationDeleteWithReceiptRuleId:ruleId completionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire

if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}
EmailDeliveryReceiptRulesAPI.emailDeliveryReceiptAutomationDelete(receiptRuleId: 1) { (dataString, error) in
    guard let dataString = dataString else {
        print(error!)
        return
    }
    if let data = dataString.data(using: String.Encoding.utf8) {
        do {
            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                print(dictonary)
            } else {
                print("Cannot convert the String value to JSON")
            }
        } catch let error as NSError {
            print(error)
        }
    }
}
    Coming Soon
package ClickSend;

import ClickSend.Api.EmailDeliveryReceiptRulesApi;

public class delete_email_delivery_receipt_rule {
  public static void main(String[] args) {
    ApiClient defaultClient = new ApiClient();
    defaultClient.setUsername("USERNAME");
    defaultClient.setPassword("API_KEY");
    EmailDeliveryReceiptRulesApi apiInstance = new EmailDeliveryReceiptRulesApi(defaultClient);
    Integer receiptRuleId = 21; // Integer | Receipt rule id
    try {
        String result = apiInstance.emailDeliveryReceiptAutomationDelete(receiptRuleId);
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling EmailDeliveryReceiptRulesApi#emailDeliveryReceiptAutomationDelete");
        e.printStackTrace();
    }
  }
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "Automation email receipt rule has been deleted.",
  "data": true
}

https://rest.clicksend.com/v3/automations/email/receipts/{receipt_rule_id}

Delete email delivery receipt automation

Delete email delivery receipt automation

Parameters

Parameter In Type Required Description
receipt_rule_id path integer(int32) true Receipt rule id

Refer to Status Codes for definitions of HTTP status code responses.

Fax

Send Fax

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
     --request POST \

     --header "Content-Type: application/json" \
     --data-binary "{
    \"file_url\":\"https://s3-ap-southeast-2.amazonaws.com/clicksend-api-downloads/_public/_examples/document.pdf\",
    \"messages\":[
        {
            \"source\":\"php\",
            \"to\":\"+61261111111\",
            \"schedule\":\"1436874701\",
            \"custom_string\":\"custom_string\",
            \"country\":\"AF\",
            \"from_email\":\"will@smith.com\"
        },
        {
            \"source\":\"php\",
            \"to\":\"+61261111122\",
            \"schedule\":\"1436874701\",
            \"custom_string\":\"custom_string\",
            \"country\":\"AF\",
            \"from_email\":\"john@doe.com\"
        }
    ]
}" \
'https://rest.clicksend.com/v3/fax/send'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\FAXApi(new GuzzleHttp\Client(),$config);
$fax_message_list= new \ClickSend\Model\FaxMessage();
$fax_message_list->setSource("php");
$fax_message_list->setTo("+61261111111");
$fax_message_list->setListId("185161");
$fax_message_list->setCustomString("custom_string");
$fax_message_list->setFromEmail("will@smith.com");
// \ClickSend\Model\FaxMessageCollection | FaxMessageCollection model
$fax_message = new \ClickSend\Model\FaxMessageCollection();
$fax_message->setMessages([$fax_message_list]);
$fax_message->setFileUrl("https://s3-ap-southeast-2.amazonaws.com/clicksend-api-downloads/_public/_examples/document.pdf"); 

try {
    $result = $apiInstance->faxSendPost($fax_message);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling FAXApi->faxSendPost: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME, 
    Password = API_KEY  
};
var faxApi = new FAXApi(configuration);
var listOfFaxMessages = new List<FaxMessage>();
listOfFaxMessages.Add(new FaxMessage(
    source: "sdk",
    to: "+11231231234",
    from: "+11231231234",
    schedule: Timestamp,
    customString: "CustomString",
    country: "CA",
    fromEmail: "john@doe.com"
));
var faxMessageCollection = new FaxMessageCollection(listOfFaxMessages, "https://s3-ap-southeast-2.amazonaws.com/clicksend-api-downloads/_public/_examples/document.pdf");
var response = faxApi.FaxSendPost(faxMessageCollection);
var api = require('./api.js');

var faxApi = new api.FAXApi("USERNAME", "API_KEY");

var faxMessageList = new api.FaxMessage();

faxMessageList.source = "php";
faxMessageList.to = "+61261111111";
faxMessageList.listId = 185161;
faxMessageList.from = "4197";
faxMessageList.customString = "custom_string";
faxMessageList.country = "AF";
faxMessageList.fromEmail = "will@smith.com";

var faxMessage = new api.FaxMessageCollection();

faxMessage.messages = [faxMessageList]
faxMessage.fileUrl = "https://s3-ap-southeast-2.amazonaws.com/clicksend-api-downloads/_public/_examples/document.pdf";

faxApi.faxSendPost(faxMessage).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::FAXApi.new

# FaxMessageCollection | FaxMessageCollection model
fax_messages = ClickSendClient::FaxMessageCollection.new(
  "file_url": "file_url",
  messages: [
    ClickSendClient::FaxMessage.new(
      "schedule": 6,
      "to": +61411111111,
      "from": "from",
      "source": "source",
      "custom_string": "custom_string"
    ),
    ClickSendClient::FaxMessage.new(
      "schedule": 6,
      "to": "+61422222222",
      "from": "from",
      "source": "source",
      "to": "to",
      "custom_string": "custom_string"
    )
  ]
)

begin
  # Send a fax using supplied supported file-types.
  result = api_instance.fax_send_post(fax_messages)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling FAXApi->fax_send_post: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client import FaxMessage
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.FAXApi(clicksend_client.ApiClient(configuration))
file_url='https://s3-ap-southeast-2.amazonaws.com/clicksend-api-downloads/_public/_examples/document.pdf'
fax_message_list = [FaxMessage(
                  "sdk","+11231231234",185161,"+11231231234",1,"CustomString","CA","john@doe.com")];
# FaxMessageCollection | FaxMessageCollection model
fax_message = clicksend_client.FaxMessageCollection(file_url=file_url,messages=fax_message_list) 

try:
    # Send a fax using supplied supported file-types.
    api_response = api_instance.fax_send_post(fax_message)
    print(api_response)
except ApiException as e:
    print("Exception when calling FAXApi->fax_send_post: %s\n" % e)
use WWW::ClickSendClient::FAXApi;
use WWW::ClickSendClient::Object::FaxMessageCollection;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::FAXApi->new(username => $username, password => $password);

my %params = (
    'messages' => [
        {
            'source'        => 'perl',
            'to'            => '+61261111111',
            'schedule'      => '1436874701',
            'custom_string' => 'custom_string',
            'country'       => 'AF',
            'from_email'    => 'test1@test.com'
        },
        {
            'source'        => 'perl',
            'to'            => '+61261111122',
            'schedule'      => '1436874701',
            'custom_string' => 'custom_string',
            'country'       => 'AF',
            'from_email'    => 'test1@test1.com'
        }
    ],
    'file_url' => 'https://www.domain.com/examples/document.pdf'
);

my $fax_message_obj = WWW::ClickSendClient::Object::FaxMessageCollection->new(%params);
my $json_output = $api->fax_send_post('fax_message' => $fax_message_obj);

print $json_output;
#import "CSFAXApi.h"
#import "CSDefaultConfiguration.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
// Configure HTTP basic authorization (authentication scheme: BasicAuth)
[apiConfig setUsername:@"USERNAME"];
[apiConfig setPassword:@"PASSWORD"];

CSFaxMessage *faxMessage = [[CSFaxMessage alloc] init];
faxMessage.source = @"objc";
faxMessage.to = @"+61261111111";
faxMessage.listId = [NSNumber numberWithInt:1];
faxMessage.from = @"from";
faxMessage.customString = @"custom_string";
faxMessage.country = @"AF";
faxMessage.fromEmail = @"will@smith.com";

CSFaxMessage *faxMessage2 = [[CSFaxMessage alloc] init];
faxMessage2.source = @"objc";
faxMessage2.to = @"+61261111111";
faxMessage2.listId = [NSNumber numberWithInt:1];
faxMessage2.from = @"from";
faxMessage2.customString = @"custom_string";
faxMessage2.country = @"AF";
faxMessage2.fromEmail = @"will@smith.com";

CSFaxMessageCollection *faxMessageCollection = [[CSFaxMessageCollection alloc] init];
faxMessageCollection.messages = [NSArray arrayWithObjects:faxMessage, faxMessage2, nil];
faxMessageCollection.fileUrl = @"fileUrl";

CSFAXApi *faxApi = [[CSFAXApi alloc] init];
[faxApi faxSendPostWithFaxMessage:faxMessageCollection completionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire
if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
`ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}

let faxMessage = FaxMessage(
                    source: "swift", 
                    to: "+61261111111", 
                    listId: 1, 
                    from: "from", 
                    schedule: 1436874701, 
                    customString: "custom_string", 
                    country: "AF", 
                    fromEmail: "will@smith.com"
                )
let faxMessage2 = FaxMessage(
                    source: "swift", 
                    to: "+61261111111", 
                    listId: 1, 
                    from: "from", 
                    schedule: nil, 
                    customString: "custom_string", 
                    country: "AF", 
                    fromEmail: "will@smith.com"
                )

let faxMessageCollection = FaxMessageCollection(messages: [faxMessage, faxMessage2], fileUrl: "fileUrl")

FAXAPI.faxSendPost(faxMessage: faxMessageCollection) { (dataString, error) in
    if let error = error {
        print(error)
    } else {
        if let data = dataString!.data(using: String.Encoding.utf8) {
            do {
                if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                    print(dictonary)
                } else {
                    print("bad json")
                }
            } catch let error as NSError {
                print(error)
            }
        }
    }
}
    Coming Soon
package ClickSend;

import java.util.Arrays;
import java.util.List;
import ClickSend.Api.FaxApi;
import ClickSend.Model.FaxMessage;
import ClickSend.Model.FaxMessageCollection;

public class send_fax {
  public static void main(String[] args) {
    ApiClient defaultClient = new ApiClient();
    defaultClient.setUsername("USERNAME");
    defaultClient.setPassword("API_KEY");
    FaxApi apiInstance = new FaxApi(defaultClient);
    FaxMessage fax_message=new FaxMessage();
    fax_message.source("sdk");
    fax_message.to("+11231231234");
    fax_message.listId(new Integer(185161));
    fax_message.from("+11231231234");
    fax_message.schedule(new Integer(1545477071));
    fax_message.customString("CustomString");
    fax_message.country("AF");
    fax_message.fromEmail("john@doe.com");
    List<FaxMessage> faxMessageList=Arrays.asList(fax_message);
    // FaxMessageCollection | FaxMessageCollection model
    FaxMessageCollection faxMessage = new FaxMessageCollection(); 
    faxMessage.messages(faxMessageList);
    faxMessage.fileUrl("https://s3-ap-southeast-2.amazonaws.com/clicksend-api-downloads/_public/_examples/document.pdf");
    try {
        String result = apiInstance.faxSendPost(faxMessage);
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling FaxApi#faxSendPost");
        e.printStackTrace();
    }
  }
}

Body parameter

{
  "file_url": "file_url",
  "messages": [
    {
      "schedule": 6,
      "to": 61411111111,
      "from": "from",
      "source": "source",
      "to": "to",
      "custom_string": "custom_string"
    },
    {
      "schedule": 6,
      "to": "+61422222222",
      "from": "from",
      "source": "source",
      "to": "to",
      "custom_string": "custom_string"
    }
  ]
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "Fax queued for delivery.",
  "data": {
    "total_price": 13.2,
    "total_count": 1,
    "queued_count": 1,
    "messages": [
      {
        "user_id": 1,
        "subaccount_id": 1,
        "list_id": null,
        "message_id": "6BBEB11E-CAA6-4B04-8537-63619F3D6B37",
        "to": "+61261111122",
        "from": "+61298441484",
        "carrier": "",
        "country": "AU",
        "custom_string": "custom_string",
        "schedule": "1436874701",
        "message_pages": 6,
        "message_price": "13.2000",
        "status_code": null,
        "status_text": null,
        "date_added": 1457504350,
        "from_email": "john@doe.com",
        "_file_url": "https://rest.clicksend.com/files/98DDA1A4-8A74-4831-8FAF-CC4B4EBD8241.pdf",
        "status": "SUCCESS"
      }
    ],
    "_currency": {
      "currency_name_short": "AUD",
      "currency_prefix_d": "$",
      "currency_prefix_c": "c",
      "currency_name_long": "Australian Dollars"
    }
  }
}

https://rest.clicksend.com/v3/fax/send

Supported File Types

Documents

File type Required to be passed to uploads endpoint first?
pdf No
docx Yes
doc Yes
rtf Yes

Send a fax using supplied supported file-types.

Letter File Options

Use existing URL

With this option, you can use an existing URL to a pdf document. For example, you might generate the pdf on your server.

When using an existing url make sure that it is publicly accessible as it will not work if it is private.

Upload File to Our Server

With this option, you can use the /uploads endpoint to upload the document. The /uploads endpoint returns a URL that can be used in the /fax/send endpoint.

Properties

Name Type Required Restrictions Description
file_url string true none URL of file to send
source string true none Your method of sending e.g. 'wordpress', 'php', 'c#'.
to string true none Recipient fax number in E.164 format.
list_id integer(int32) false none Your list ID if sending to a whole list. Can be used instead of 'to'.
from string true yes Your sender id. Must be a valid fax number.
schedule integer(int32) false none Leave blank for immediate delivery. Your schedule time in unix format http://help.clicksend.com/what-is-a-unix-timestamp
custom_string string false none Your reference. Will be passed back with all replies and delivery reports.
country string false none ISO alpha-2 character country code e.g. 'US', we use this to format the recipient number if it's not in international format.
from_email string false none An email address where the reply should be emailed to.

Refer to Status Codes for definitions of HTTP status code responses.

Calculate Fax Price

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
     --request POST \

     --header "Content-Type: application/json" \
     --data-binary "{
    \"file_url\":\"https://s3-ap-southeast-2.amazonaws.com/clicksend-api-downloads/_public/_examples/document.pdf\",
    \"messages\":[
        {
            \"source\":\"php\",
            \"to\":\"+61261111111\",
            \"schedule\":\"1436874701\",
            \"custom_string\":\"custom_string\",
            \"country\":\"AF\",
            \"from_email\":\"will@smith.com\"
        },
        {
            \"source\":\"php\",
            \"to\":\"+61261111122\",
            \"schedule\":\"1436874701\",
            \"custom_string\":\"custom_string\",
            \"country\":\"AF\",
            \"from_email\":\"john@doe.com\"
        }
    ]
}" \
'https://rest.clicksend.com/v3/fax/price'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\FAXApi(new GuzzleHttp\Client(),$config);
$fax_message_list= new \ClickSend\Model\FaxMessage();
$fax_message_list->setSource("php");
$fax_message_list->setTo("+61261111111");
$fax_message_list->setListId("185161");
$fax_message_list->setCustomString("custom_string");
$fax_message_list->setFromEmail("will@smith.com");
// \ClickSend\Model\FaxMessageCollection | FaxMessageCollection model
$fax_message = new \ClickSend\Model\FaxMessageCollection();
$fax_message->setMessages([$fax_message_list]);
$fax_message->setFileUrl("https://s3-ap-southeast-2.amazonaws.com/clicksend-api-downloads/_public/_examples/document.pdf"); 

try {
    $result = $apiInstance->faxPricePost($fax_message);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling FAXApi->faxPricePost: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME, 
    Password = API_KEY  
};
var faxApi = new FAXApi(configuration);
var listOfFaxMessages = new List<FaxMessage>();
listOfFaxMessages.Add(new FaxMessage( 
    dource: "sdk",
    to: "+11231231234",
    from: "+11231231234",
    schedule: Timestamp,
    customString: "CustomString",
    country: "CA",
    fromEmail: "john@doe.com"
));
var faxMessageCollection = new FaxMessageCollection(listOfFaxMessages, "https://s3-ap-southeast-2.amazonaws.com/clicksend-api-downloads/_public/_examples/document.pdf");
var response = faxApi.FaxPricePost(faxMessageCollection);
var api = require('./api.js');

var faxApi = new api.FAXApi("USERNAME", "API_KEY");

var faxMessageList = new api.FaxMessage();

faxMessageList.source = "php";
faxMessageList.to = "+61261111111";
faxMessageList.listId = 185161;
faxMessageList.from = "4197";
faxMessageList.customString = "custom_string";
faxMessageList.country = "AF";
faxMessageList.fromEmail = "will@smith.com";

var faxMessage = new api.FaxMessageCollection();

faxMessage.messages = [faxMessageList]
faxMessage.fileUrl = "https://s3-ap-southeast-2.amazonaws.com/clicksend-api-downloads/_public/_examples/document.pdf";

faxApi.faxPricePost(faxMessage).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::FAXApi.new

# FaxMessageCollection | FaxMessageCollection model
fax_messages = ClickSendClient::FaxMessageCollection.new(
  "file_url": "file_url",
  messages: [
    ClickSendClient::FaxMessage.new(
      "schedule": 6,
      "from": "from",
      "source": "source",
      "to": "+61411111111",
      "custom_string": "custom_string"
    ),
    ClickSendClient::FaxMessage.new(
      "schedule": 6,
      "from": "from",
      "source": "source",
      "to": "+61422222222",
      "custom_string": "custom_string"
    )
  ]
)

begin
  # Calculate Total Price for Fax Messages sent
  result = api_instance.fax_price_post(fax_messages)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling FAXApi->fax_price_post: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client import FaxMessage
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.FAXApi(clicksend_client.ApiClient(configuration))
file_url='https://s3-ap-southeast-2.amazonaws.com/clicksend-api-downloads/_public/_examples/document.pdf'
fax_message_list = [FaxMessage(
                  "sdk","+11231231234",185161,"+11231231234",1,"CustomString","CA","john@doe.com")];
# FaxMessageCollection | FaxMessageCollection model
fax_message = clicksend_client.FaxMessageCollection(file_url=file_url,messages=fax_message_list)

try:
    # Calculate Total Price for Fax Messages sent
    api_response = api_instance.fax_price_post(fax_message)
    print(api_response)
except ApiException as e:
    print("Exception when calling FAXApi->fax_price_post: %s\n" % e)
use WWW::ClickSendClient::FAXApi;
use WWW::ClickSendClient::Object::FaxMessageCollection;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::FAXApi->new(username => $username, password => $password);

my %params = (
    'messages' => [
        {
            'source'        => 'perl',
            'to'            => '+61261111111',
            'schedule'      => '1436874701',
            'custom_string' => 'custom_string',
            'country'       => 'AF',
            'from_email'    => 'test1@test.com'
        },
        {
            'source'        => 'perl',
            'to'            => '+61261111122',
            'schedule'      => '1436874701',
            'custom_string' => 'custom_string',
            'country'       => 'AF',
            'from_email'    => 'test1@test1.com'
        }
    ],
    'file_url' => 'https://www.domain.com/examples/document.pdf'
);

my $fax_message_obj = WWW::ClickSendClient::Object::FaxMessageCollection->new(%params);

my $json_output = $api->fax_price_post('fax_message' => $fax_message_obj);

print $json_output;
#import "CSFAXApi.h"
#import "CSDefaultConfiguration.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
// Configure HTTP basic authorization (authentication scheme: BasicAuth)
[apiConfig setUsername:@"USERNAME"];
[apiConfig setPassword:@"PASSWORD"];

CSFaxMessage *faxMessage = [[CSFaxMessage alloc] init];
faxMessage.source = @"objc";
faxMessage.to = @"+61261111111";
faxMessage.listId = [NSNumber numberWithInt:1];
faxMessage.from = @"from";
faxMessage.customString = @"custom_string";
faxMessage.country = @"AF";
faxMessage.fromEmail = @"will@smith.com";

CSFaxMessage *faxMessage2 = [[CSFaxMessage alloc] init];
faxMessage2.source = @"objc";
faxMessage2.to = @"+61261111111";
faxMessage2.listId = [NSNumber numberWithInt:1];
faxMessage2.from = @"from";
faxMessage2.customString = @"custom_string";
faxMessage2.country = @"AF";
faxMessage2.fromEmail = @"will@smith.com";

CSFaxMessageCollection *faxMessageCollection = [[CSFaxMessageCollection alloc] init];
faxMessageCollection.messages = [NSArray arrayWithObjects:faxMessage, faxMessage2, nil];

faxMessageCollection.fileUrl = @"fileUrl";
CSFAXApi *faxApi = [[CSFAXApi alloc] init];
[faxApi faxPricePostWithFaxMessage:faxMessageCollection completionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire
if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}

let faxMessage = FaxMessage(
                    source: "swift", 
                    to: "+61261111111", 
                    listId: 1, 
                    from: "from", 
                    schedule: 1436874701, 
                    customString: "custom_string", 
                    country: "AF", 
                    fromEmail: "will@smith.com"
                )
let faxMessage2 = FaxMessage(
                    source: "swift", 
                    to: "+61261111111", 
                    listId: 1, 
                    from: "from", 
                    schedule: nil, 
                    customString: "custom_string", 
                    country: "AF", 
                    fromEmail: "will@smith.com"
                )

let faxMessageCollection = FaxMessageCollection(messages: [faxMessage, faxMessage2], fileUrl: "fileUrl")
FAXAPI.faxPricePost(faxMessage: faxMessageCollection) { (dataString, error) in
    if let error = error {
        print(error)
    } else {
        if let data = dataString!.data(using: String.Encoding.utf8) {
            do {
                if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                    print(dictonary)
                } else {
                    print("bad json")
                }
            } catch let error as NSError {
                print(error)
            }
        }
    }
}
    Coming Soon
package ClickSend;

import java.util.Arrays;
import java.util.List;
import ClickSend.Api.FaxApi;
import ClickSend.Model.FaxMessage;
import ClickSend.Model.FaxMessageCollection;

public class calculate_fax_price {
  public static void main(String[] args) {
    ApiClient defaultClient = new ApiClient();
    defaultClient.setUsername("USERNAME");
    defaultClient.setPassword("API_KEY");
    FaxApi apiInstance = new FaxApi(defaultClient);
    FaxMessage fax_message=new FaxMessage();
    fax_message.source("sdk");
    fax_message.to("+11231231234");
    fax_message.listId(new Integer(185161));
    fax_message.from("+11231231234");
    fax_message.schedule(new Integer(1545477071));
    fax_message.customString("CustomString");
    fax_message.country("AF");
    fax_message.fromEmail("john@doe.com");
    List<FaxMessage> faxMessageList=Arrays.asList(fax_message);
    // FaxMessageCollection | FaxMessageCollection model
    FaxMessageCollection faxMessage = new FaxMessageCollection(); 
    faxMessage.messages(faxMessageList);
    faxMessage.fileUrl("https://s3-ap-southeast-2.amazonaws.com/clicksend-api-downloads/_public/_examples/document.pdf");
    try {
        String result = apiInstance.faxPricePost(faxMessage);
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling FaxApi#faxPricePost");
        e.printStackTrace();
    }
  }
}

Body parameter

{
  "file_url": "file_url",
  "messages": [
    {
      "from": "from",
      "source": "source",
      "to": "+61411111111",
      "custom_string": "custom_string"
    },
    {
      "from": "from",
      "source": "source",
      "to": "+61422222222",
      "custom_string": "custom_string"
    }
  ]
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "Here are some prices.",
  "data": {
    "total_price": 13.2,
    "total_count": 1,
    "queued_count": 1,
    "messages": [
      {
        "user_id": 1,
        "subaccount_id": 1,
        "list_id": null,
        "message_id": "6BBEB11E-CAA6-4B04-8537-63619F3D6B37",
        "to": "+61261111122",
        "from": "+61298441484",
        "carrier": "",
        "country": "AU",
        "custom_string": "custom_string",
        "schedule": "1436874701",
        "message_pages": 6,
        "message_price": "13.2000",
        "status_code": null,
        "status_text": null,
        "date_added": 1457504350,
        "from_email": "john@doe.com",
        "_file_url": "https://rest.clicksend.com/files/98DDA1A4-8A74-4831-8FAF-CC4B4EBD8241.pdf",
        "status": "SUCCESS"
      }
    ],
    "_currency": {
      "currency_name_short": "AUD",
      "currency_prefix_d": "$",
      "currency_prefix_c": "c",
      "currency_name_long": "Australian Dollars"
    }
  }
}

https://rest.clicksend.com/v3/fax/price

Calculate Total Price for Fax Messages sent

Properties

Name Type Required Restrictions Description
file_url string true none URL of file to send
source string true none Your method of sending e.g. 'wordpress', 'php', 'c#'.
to string true none Recipient fax number in E.164 format.
list_id integer(int32) false none Your list ID if sending to a whole list. Can be used instead of 'to'.
from string true yes Your sender id. Must be a valid fax number.
schedule integer(int32) false none Leave blank for immediate delivery. Your schedule time in unix format http://help.clicksend.com/what-is-a-unix-timestamp
custom_string string false none Your reference. Will be passed back with all replies and delivery reports.
country string false none ISO alpha-2 character country code e.g. 'US', we use this to format the recipient number if it's not in international format.
from_email string false none An email address where the reply should be emailed to.

Refer to Status Codes for definitions of HTTP status code responses.

View Fax Receipts

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \

'https://rest.clicksend.com/v3/fax/receipts'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\FAXApi(new GuzzleHttp\Client(),$config);
$page = 1; // int | Page number
$limit = 10; // int | Number of records per page

try {
    $result = $apiInstance->faxReceiptsGet($page, $limit);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling FAXApi->faxReceiptsGet: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME, 
    Password = API_KEY  
};
var faxApi = new FAXApi(configuration);
var response = faxApi.FaxReceiptsGet();
var api = require('./api.js');

var faxApi = new api.FAXApi("USERNAME", "API_KEY");

var page = 1;
var limit = 10;

faxApi.faxReceiptsGet(page, limit).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::FAXApi.new

begin
  # Get List of Fax Receipts
  result = api_instance.fax_receipts_get
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling FAXApi->fax_receipts_get: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.FAXApi(clicksend_client.ApiClient(configuration))

try:
    # Get List of Fax Receipts
    api_response = api_instance.fax_receipts_get()
    print(api_response)
except ApiException as e:
    print("Exception when calling FAXApi->fax_receipts_get: %s\n" % e)
use WWW::ClickSendClient::FAXApi;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::FAXApi->new(username => $username, password => $password);

my $json_output = $api->fax_receipts_get();

print $json_output;
#import "CSFAXApi.h"
#import "CSDefaultConfiguration.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
// Configure HTTP basic authorization (authentication scheme: BasicAuth)
[apiConfig setUsername:@"USERNAME"];
[apiConfig setPassword:@"PASSWORD"];

CSFAXApi *faxApi = [[CSFAXApi alloc] init];
[faxApi faxReceiptsGetWithPage:@(1) limit:@(15) completionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire
if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}

FAXAPI.faxReceiptsGet { (dataString, error) in
    if let error = error {
        print(error)
    } else {
        if let data = dataString!.data(using: String.Encoding.utf8) {
            do {
                if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                    print(dictonary)
                } else {
                    print("bad json")
                }
            } catch let error as NSError {
                print(error)
            }
        }
    }
}
    Coming Soon
package ClickSend;

import ClickSend.Api.FaxApi;

public class view_all_fax_receipt {
  public static void main(String[] args) {
    ApiClient defaultClient = new ApiClient();
    defaultClient.setUsername("USERNAME");
    defaultClient.setPassword("API_KEY");
    FaxApi apiInstance = new FaxApi(defaultClient);
    Integer page = 1; // Integer | Page number
    Integer limit = 10; // Integer | Number of records per page
    try {
      String result = apiInstance.faxReceiptsGet(page, limit);
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling FaxApi#faxReceiptsGet");
        e.printStackTrace();
    }
  }
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "Here are your delivery receipts.",
  "data": {
    "total": 1,
    "per_page": 15,
    "current_page": 1,
    "last_page": 1,
    "next_page_url": null,
    "prev_page_url": null,
    "from": 1,
    "to": 1,
    "data": [
      {
        "timestamp_send": "1450854013",
        "timestamp": "1451200622",
        "message_id": "88AB118E-EB1B-478C-98CE-6C73ABA23F67",
        "status_code": "Completed",
        "status_text": "",
        "error_code": "",
        "error_text": "",
        "custom_string": "",
        "subaccount_id": 1,
        "message_type": "fax"
      }
    ]
  }
}

https://rest.clicksend.com/v3/fax/receipts

Get List of Fax Receipts

Push Delivery Receipts

If you prefer, we can push message replies to your server as they arrive with us.

  1. Log into your account.
  2. Click on your profile on the top right.
  3. Then click on the Messaging Settings option.
  4. Click on Fax then Delivery Reports.
  5. Click the 'Add New Rule' button.
  6. Select the 'URL' action.
  7. Enter the URL and click 'Save'.

The following variables will be posted to the URL specified:

Variable Description
timestamp_send Timestamp of the original send request in UNIX format. e.g 1439173980
timestamp Timestamp of delivery report in UNIX format. e.g 1439173981
message_id Message ID, returned when originally sending the message.
status Delivered or Undelivered
status_code Status code. Refer to 'Fax Delivery Status Codes' in docs.
status_text Status text.
error_code Error code.
error_text Error text.
custom_string A custom string used when sending the original message.
user_id The user ID of the user who sent the message.
subaccount_id The subaccount ID of the user who sent the message.
message_type 'fax' (constant).

Pull Delivery Receipts

Receive delivery reports by polling. You can poll our server and retrieve delivery reports at a time that suits you.

  1. Log into your account.
  2. Click on your profile on the top right.
  3. Then click on the Messaging Settings option.
  4. Click on Fax then Delivery Rules.
  5. Click the 'Add New Rule' button.
  6. Select the 'Poll' action.
  7. Then click 'Save'.

Refer to Status Codes for definitions of HTTP status code responses.

View Specific Fax Receipt

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \

'https://rest.clicksend.com/v3/fax/receipts/{message_id}'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\FAXApi(new GuzzleHttp\Client(),$config);
$message_id = "message_id_example"; // string | ID of the message receipt to retrieve

try {
    $result = $apiInstance->faxReceiptsByMessageIdGet($message_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling FAXApi->faxReceiptsByMessageIdGet: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME, 
    Password = API_KEY  
};
var faxApi = new FAXApi(configuration);
var response = faxApi.FaxReceiptsByMessageIdGet("MESSAGE_ID");
var api = require('./api.js');

var faxApi = new api.FAXApi("USERNAME", "API_KEY");

var messageId = "message_id_example";

faxApi.faxReceiptsByMessageIdGet(messageId).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::FAXApi.new

message_id = "message_id_example" # String | ID of the message receipt to retrieve

begin
  # Get a single fax receipt based on message id.
  result = api_instance.fax_receipts_by_message_id_get(message_id)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling FAXApi->fax_receipts_by_message_id_get: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.FAXApi(clicksend_client.ApiClient(configuration))
message_id = 'message_id_example' # str | ID of the message receipt to retrieve

try:
    # Get a single fax receipt based on message id.
    api_response = api_instance.fax_receipts_by_message_id_get(message_id)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling FAXApi->fax_receipts_by_message_id_get: %s\n" % e)
use WWW::ClickSendClient::FAXApi;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::FAXApi->new(username => $username, password => $password);

my $json_output = $api->fax_receipts_by_message_id_get('message_id' => '1234');

print $json_output;
#import "CSFAXApi.h"
#import "CSDefaultConfiguration.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
// Configure HTTP basic authorization (authentication scheme: BasicAuth)
[apiConfig setUsername:@"USERNAME"];
[apiConfig setPassword:@"PASSWORD"];

CSFAXApi *faxApi = [[CSFAXApi alloc] init];
[faxApi faxReceiptsByMessageIdGetWithMessageId:@"message_id" completionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire
if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}

FAXAPI.faxReceiptsByMessageIdGet(messageId: "message_id") { (dataString, error) in
    if let error = error {
        print(error)
    } else {
        if let data = dataString!.data(using: String.Encoding.utf8) {
            do {
                if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                    print(dictonary)
                } else {
                    print("bad json")
                }
            } catch let error as NSError {
                print(error)
            }
        }
    }
}
    Coming Soon
package ClickSend;

import ClickSend.Api.FaxApi;

public class view_specific_fax_receipt {
  public static void main(String[] args) {
    ApiClient defaultClient = new ApiClient();
    defaultClient.setUsername("USERNAME");
    defaultClient.setPassword("API_KEY");
    FaxApi apiInstance = new FaxApi(defaultClient);
    // String | ID of the message receipt to retrieve
    String messageId = "message_id_example"; 
    try {
        String result = apiInstance.faxReceiptsByMessageIdGet(messageId);
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling FaxApi#faxReceiptsByMessageIdGet");
        e.printStackTrace();
    }
  }
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "Here is your fax receipt.",
  "data": {
    "user_id": 1,
    "subaccount_id": 1,
    "list_id": null,
    "message_id": "3FAC74F1-D2AF-479B-8955-6395D561DEF4",
    "to": "+61267132168",
    "from": "+61267132168",
    "carrier": "",
    "country": "AU",
    "custom_string": "custom_string",
    "schedule": "1436874701",
    "message_pages": "1.00",
    "message_price": "1.000000",
    "status": "WaitApproval",
    "status_code": null,
    "status_text": null,
    "date_added": 1454394659
  }
}

https://rest.clicksend.com/v3/fax/receipts/{message_id}

Get a single fax receipt based on message id.

Parameters

Parameter In Type Required Description
message_id path string true ID of the message receipt to retrieve

Refer to Status Codes for definitions of HTTP status code responses.

View Fax History

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \

'https://rest.clicksend.com/v3/fax/
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\FAXApi(new GuzzleHttp\Client(),$config);
$date_from = '2018-01-01'; // int | Customize result by setting from date (timestamp) Example: 1457572619.
$date_to = '2019-01-01'; // int | Customize result by setting to date (timestamp) Example: 1457573000.
$q = "q_example"; // string | Custom query Example: status:Sent,status_code:201.
$order = "order_example"; // string | Order result by Example: date_added:desc,list_id:desc.
$page = 1; // int | Page number
$limit = 10; // int | Number of records per page

try {
    $result = $apiInstance->faxHistoryGet($date_from, $date_to, $q, $order, $page, $limit);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling FAXApi->faxHistoryGet: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME, 
    Password = API_KEY  
};
var faxApi = new FAXApi(configuration);

var dateFrom = '1546913229';
var dateTo = '1546923229';
var q = 'q_example';
var order = 'order_example';
var page = 1;
var limit = 10;

var response = faxApi.FaxHistoryGet(dateFrom, dateTo, q, order, page, limit);
var api = require('./api.js');

var faxApi = new api.FAXApi("USERNAME", "API_KEY");

var dateFrom = '1546913229';
var dateTo = '1546923229';
var q = 'q_example';
var order = 'order_example';
var page = 1;
var limit = 10;

faxApi.faxHistoryGet(dateFrom, dateTo, q, order, page, limit).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::FAXApi.new

opts = {
  "date_from": 1546913229, # Integer | Customize result by setting from date (timestamp) Example: 1457572619.
  "date_to": 1546923229, # Integer | Customize result by setting to date (timestamp) Example: 1457573000.
  "q": "q_example", # String | Custom query Example: status:Sent,status_code:201.
  "order": "order_example", # String | Order result by Example: date_added:desc,list_id:desc.
  "page": 1, # Integer | Page number
  "limit": 10 # Integer | Number of records per page
}

begin
  # Get a list of Fax History.
  result = api_instance.fax_history_get(opts)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling FAXApi->fax_history_get: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.FAXApi(clicksend_client.ApiClient(configuration))
date_from = 1546913229 # int | Customize result by setting from date (timestamp) Example: 1457572619. (optional)
date_to = 1546923229 # int | Customize result by setting to date (timestamp) Example: 1457573000. (optional)
q = 'q_example' # str | Custom query Example: status:Sent,status_code:201. (optional)
order = 'order_example' # str | Order result by Example: date_added:desc,list_id:desc. (optional)
page = 1 # int | Page number (optional) (default to 1)
limit = 10 # int | Number of records per page (optional) (default to 10)

try:
    # Get a list of Fax History.
    api_response = api_instance.fax_history_get(date_from=date_from, date_to=date_to, q=q, order=order, page=page, limit=limit)
    print(api_response)
except ApiException as e:
    print("Exception when calling FAXApi->fax_history_get: %s\n" % e)
use WWW::ClickSendClient::FAXApi;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::FAXApi->new(username => $username, password => $password);

my %params = (
    'date_from' => '1457572619',
    'date_to'   => '1457573000',
    'q'         => 'status_code:201',
    'order'     => 'list_id:desc',
    'page'      => '1',
    'limit'     => '6'
);

my $json_output = $api->fax_history_get(%params);

print $json_output;
#import "CSFAXApi.h"
#import "CSDefaultConfiguration.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
// Configure HTTP basic authorization (authentication scheme: BasicAuth)
[apiConfig setUsername:@"USERNAME"];
[apiConfig setPassword:@"PASSWORD"];

NSNumber *dateFrom = [NSNumber numberWithInt:3113123];
NSNumber *dateTo = [NSNumber numberWithInt:3113125];
CSFAXApi *faxApi = [[CSFAXApi alloc] init];
[faxApi faxHistoryGetWithDateFrom:dateFrom dateTo:dateTo q:@"q" order:@"order" page:@(1) limit:@(15) completionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire
if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}

FAXAPI.faxHistoryGet { (dataString, error) in
    if let error = error {
        print(error)
    } else {
        if let data = dataString!.data(using: String.Encoding.utf8) {
            do {
                if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                    print(dictonary)
                } else {
                    print("bad json")
                }
            } catch let error as NSError {
                print(error)
            }
        }
    }
}
    Coming Soon
package ClickSend;

import ClickSend.Api.FaxApi;

public class view_fax_history {
  public static void main(String[] args) {
        ApiClient defaultClient = new ApiClient();
        defaultClient.setUsername("USERNAME");
        defaultClient.setPassword("API_KEY");
        FaxApi apiInstance = new FaxApi(defaultClient);
        Integer dateFrom = 1546913229; // Integer | Customize result by setting from date (timestamp) Example: 1457572619.
        Integer dateTo = 1546923229; // Integer | Customize result by setting to date (timestamp) Example: 1457573000.
        String q = "q_example"; // String | Custom query Example: status:Sent,status_code:201.
        String order = "order_example"; // String | Order result by Example: date_added:desc,list_id:desc.
        Integer page = 1; // Integer | Page number
        Integer limit = 10; // Integer | Number of records per page
        try {
            String result = apiInstance.faxHistoryGet(dateFrom, dateTo, q, order, page, limit);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling FaxApi#faxHistoryGet");
            e.printStackTrace();
        }
  }
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "Here is your history.",
  "data": {
    "total": 1,
    "per_page": 15,
    "current_page": 1,
    "last_page": 1,
    "next_page_url": null,
    "prev_page_url": null,
    "from": 1,
    "to": 2,
    "data": [
      {
        "user_id": 1,
        "subaccount_id": 1,
        "list_id": null,
        "message_id": "2FDA7622-FC6E-4D21-B335-32FF860D7E19",
        "to": "+61261111115",
        "from": "+61267132168",
        "carrier": "",
        "country": "AU",
        "custom_string": "custom_string",
        "schedule": "1436874701",
        "message_pages": "6.00",
        "message_price": "13.2000",
        "status": "Sent",
        "status_code": "201",
        "status_text": "Sent",
        "date_added": 1457572619,
        "from_email": null,
        "_file_url": "https://s3-ap-southeast-2.amazonaws.com/clicksend-api-downloads/_public/_examples/document.pdf",
        "date": null,
        "_api_username": "username"
      }
    ]
  }
}

https://rest.clicksend.com/v3/fax/history

Get a list of Fax History.

Parameters

Parameter In Type Required Description
date_from query integer(int32) false Start date (Unix Timestamp e.g. 1436849372)
date_to query integer(int32) false End date (Unix Timestamp e.g. 1436879372)
q query string false Custom query Example: status:Sent,status_code:201.
order query string false Order result by Example: date_added:desc,list_id:desc.
page query integer(int32) false Page number
limit query integer(int32) false Number of records per page

Refer to Status Codes for definitions of HTTP status code responses.

Global Sending

Everything about Global Sending

Select Countries for Global Sending

Code samples

curl --location --request POST 'https://rest.clicksend.com/v3/user-countries' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA==' \
--data '{
  "country_list_ids": [1, 2]
}'
  Coming Soon
  Coming Soon
  Coming Soon
  Coming Soon
  Coming Soon
  Coming Soon
  Coming Soon
  Coming Soon
  Coming Soon
  Coming Soon

Body parameter

{
  "country_list_ids": [1, 2]
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
 "response_msg": "Here are your countries selection.",
  "data": [
    {
      "id": 1,
      "name": "Australia",
      "code": "AU",
      "region": "Oceania",
      "agreed_at": null,
      "registration_entity": null,
      "registration_status":  {
          "id": 1,
          "name": "NOT_INITIATED"
      },
      "jotform_id": "12345",
      "sms_registration_type": 0,
      "block_registration": 0,
      "block_leads": 0,
      "trial_from_address": "",
      "restricted_sending": 0,
      "trial_sending": 0,
      "trial_sending_description": "",
      "has_regulation_requirements": 0,
      "registration_steps_url": "https://clicksend.helpdocs.com",
      "regulation_requirements_description": "You can only send from a Dedicated ShortCode. Marketing Messages must be sent from a zero-rated shortcode. Messages must comply with DIA guidelines including opt-in consent and a way to opt-out. https://help.clicksend.com/article/7ifkmw5vd5-australia%22"
    }
  ]
}

https://rest.clicksend.com/v3/user-countries

Select Countries

Use this endpoint to select countries that you intend to send sms / mms to. To remove / unselect a country, just remove the country id from the array in the payload.

Properties

Name Type Required Restrictions Description
country_list_ids number true none Country list ID's

Refer to Status Codes for definitions of HTTP status code responses.

Get Countries for Global Sending

Code samples

curl --location 'https://rest.clicksend.com/v3/user-countries' \
--header 'Authorization: Bearer YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA==' \
  Coming Soon
  Coming Soon
  Coming Soon
  Coming Soon
  Coming Soon
  Coming Soon
  Coming Soon
  Coming Soon
  Coming Soon
  Coming Soon

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "Here are your countries selection.",
  "data": [
    {
      "id": 1,
      "name": "Australia",
      "code": "AU",
      "region": "Oceania",
      "agreed_at": null,
      "registration_entity": null,
      "registration_status":  {
          "id": 1,
          "name": "NOT_INITIATED"
      },
      "jotform_id": "12345",
      "sms_registration_type": 0,
      "block_registration": 0,
      "block_leads": 0,
      "trial_from_address": "",
      "restricted_sending": 0,
      "trial_sending": 0,
      "trial_sending_description": "",
      "has_regulation_requirements": 0,
      "registration_steps_url": "https://clicksend.helpdocs.com",
      "regulation_requirements_description": "You can only send from a Dedicated ShortCode. Marketing Messages must be sent from a zero-rated shortcode. Messages must comply with DIA guidelines including opt-in consent and a way to opt-out. https://help.clicksend.com/article/7ifkmw5vd5-australia%22" 
    }
   ]
}

https://rest.clicksend.com/v3/user-countries

Get Countries for global sending

Get the list of selected countries.

Refer to Status Codes for definitions of HTTP status code responses.

Agree to rules and regulation

Code samples

curl --location --request POST 'https://rest.clicksend.com/v3/user-countries/agree' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA==' \
  Coming Soon
  Coming Soon
  Coming Soon
  Coming Soon
  Coming Soon
  Coming Soon
  Coming Soon
  Coming Soon
  Coming Soon
  Coming Soon

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
 "response_msg": "Here are your countries selection.",
  "data": [
    {
      "id": 1,
      "name": "Australia",
      "code": "AU",
      "region": "Oceania",
      "agreed_at": null,
      "registration_entity": null,
      "registration_status":  {
          "id": 1,
          "name": "NOT_INITIATED"
      },
      "jotform_id": "12345",
      "sms_registration_type": 0,
      "block_registration": 0,
      "block_leads": 0,
      "trial_from_address": "",
      "restricted_sending": 0,
      "trial_sending": 0,
      "trial_sending_description": "",
      "has_regulation_requirements": 0,
      "registration_steps_url": "https://clicksend.helpdocs.com",
      "regulation_requirements_description": "You can only send from a Dedicated ShortCode. Marketing Messages must be sent from a zero-rated shortcode. Messages must comply with DIA guidelines including opt-in consent and a way to opt-out. https://help.clicksend.com/article/7ifkmw5vd5-australia%22"
    }
  ]
}

https://rest.clicksend.com/v3/user-countries/agree

Update Country Rule

To agree on rules and regulations of selected countries and confirm selection.

Properties

Name Type Required Restrictions Description
country_list_ids number true none Country list ID's

Refer to Status Codes for definitions of HTTP status code responses.

List Countries

Code samples

curl --location 'https://rest.clicksend.com/v3/country-list' \
--header 'Authorization: Bearer YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA==' \
  Coming Soon
  Coming Soon
  Coming Soon
  Coming Soon
  Coming Soon
  Coming Soon
  Coming Soon
  Coming Soon
  Coming Soon
  Coming Soon

Response

{
    "http_code": 200,
    "response_code": "SUCCESS",
    "response_msg": "List of Countries.",
    "data": [
        {
            "id": 1,
            "name": "Australia",
            "code": "AU",
            "region": "Oceania"
        }
    ]
}

https://rest.clicksend.com/v3/country-list

List of countries

List of countries with IDs that can be used in selecting countries for Global sending.

Refer to Status Codes for definitions of HTTP status code responses.

Inbound FAX Rules

Everything about Inbound FAX Automations

View Fax Inbound Rules

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
'https://rest.clicksend.com/v3/automations/fax/inbound'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\InboundFAXRulesApi(new GuzzleHttp\Client(),$config);
$q = "q_example"; // string | Your keyword or query.
$page = 1; // int | Page number
$limit = 10; // int | Number of records per page

try {
    $result = $apiInstance->faxInboundAutomationsGet($q, $page, $limit);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling InboundFAXRulesApi->faxInboundAutomationsGet: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME, 
    Password = API_KEY  
};
var inboundFAXRulesApi = new InboundFAXRulesApi(configuration);
var response = inboundFAXRulesApi.FaxInboundAutomationsGet();
var api = require('./api.js');

var inboundFaxRuleApi = new api.InboundFAXRulesApi("USERNAME", "API_KEY");

var q = "q_example";
var page = 1;
var limit = 10;

inboundFaxRuleApi.faxInboundAutomationsGet(q, page, limit).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::InboundFAXRulesApi.new

opts = {
  page: 1, # Integer | Page number
  limit: 10 # Integer | Number of records per page
}

begin
  # Get all inbound fax automations
  result = api_instance.fax_inbound_automations_get(opts)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling InboundFAXRulesApi->fax_inbound_automations_get: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.InboundFAXRulesApi(clicksend_client.ApiClient(configuration))
page = 1 # int | Page number (optional) (default to 1)
limit = 10 # int | Number of records per page (optional) (default to 10)

try:
    # Get all inbound fax automations
    api_response = api_instance.fax_inbound_automations_get(page=page, limit=limit)
    print(api_response)
except ApiException as e:
    print("Exception when calling InboundFAXRulesApi->fax_inbound_automations_get: %s\n" % e)
use WWW::ClickSendClient::InboundFAXRulesApi;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::InboundFAXRulesApi->new(username => $username, password => $password);

my $json_output = $api->fax_inbound_automations_get('page' => '1','limit' => '10');

print $json_output;
#import "CSInboundFaxRulesApi.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
[apiConfig setUsername:@"USERNAME"];
[apiConfig setPassword:@"PASSWORD"];

NSNumber *page = [[NSNumber alloc] initWithInt:1];
NSNumber *limit = [[NSNumber alloc] initWithInt:15];

CSInboundFAXRulesApi *inboundFAXRulesApiInstance = [[CSInboundFAXRulesApi alloc] init];
[inboundFAXRulesApiInstance faxInboundAutomationsGetWithQ:@"q" page:page limit:limit completionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire

if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}

InboundFAXRulesAPI.faxInboundAutomationsGet(q: nil, page: 1, limit: 15) { (dataString, error) in
    guard let dataString = dataString else {
        print(error!)
        return
    }
    if let data = dataString.data(using: String.Encoding.utf8) {
        do {
            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                print(dictonary)
            } else {
                print("Cannot convert the String value to JSON")
            }
        } catch let error as NSError {
            print(error)
        }
    }
}
    Coming Soon
package ClickSend;

import ClickSend.Api.InboundFaxRulesApi;

public class view_all_fax_inbound_rule {
  public static void main(String[] args) {
    ApiClient defaultClient = new ApiClient();
    defaultClient.setUsername("USERNAME");
    defaultClient.setPassword("BCE1D523-8C58-92FB-462B-42BF578C55B2");
    InboundFaxRulesApi apiInstance = new InboundFaxRulesApi(defaultClient);
    Integer page = 1; // Integer | Page number
    Integer limit = 10; // Integer | Number of records per page
    String q = "q_example"; // String | Your keyword or query.
    try {
      String result = apiInstance.faxInboundAutomationsGet(q, page, limit);
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling InboundFaxRulesApi#faxInboundAutomationsGet");
        e.printStackTrace();
    }
  }
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "Your inbound fax.",
  "data": {
    "total": 2,
    "per_page": 15,
    "current_page": 1,
    "last_page": 2,
    "next_page_url": "https://rest.clicksend.com/v3/automations/fax/inbound?page=2",
    "prev_page_url": null,
    "from": 1,
    "to": 15,
    "data": [
      {
        "inbound_rule_id": 1,
        "dedicated_number": "19",
        "rule_name": "Email",
        "user_id": 1,
        "action": "EMAIL_FIXED",
        "action_address": "test@test.com",
        "enabled": 1
      },
      {
        "inbound_rule_id": 2,
        "dedicated_number": "19",
        "rule_name": "URL",
        "user_id": 1,
        "action": "URL",
        "action_address": "http://yourdomain.com",
        "enabled": 0
      }
    ]
  }
}

https://rest.clicksend.com/v3/automations/fax/inbound

Get all inbound fax automations

Get all inbound fax automations

Parameters

Parameter In Type Required Description
page query integer(int32) false Page number
limit query integer(int32) false Number of records per page

Refer to Status Codes for definitions of HTTP status code responses.

Create Fax Inbound Rule

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
     --request POST \
     --header "Content-Type: application/json" \
     --data-binary "    {
        \"dedicated_number\":\"+61298441484\",
        \"rule_name\":\"Rule Name\",
        \"action\":\"EMAIL_FIXED\",
        \"action_address\":\"email@domain.com\",
        \"enabled\":1
    }" \
'https://rest.clicksend.com/v3/automations/fax/inbound'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\InboundFAXRulesApi(new GuzzleHttp\Client(),$config);
 // \ClickSend\Model\InboundFaxRule | Inbound fax rule model
$inbound_fax_rule = new \ClickSend\Model\InboundFaxRule();
$inbound_fax_rule->setDedicatedNumber("*");
$inbound_fax_rule->setRuleName("rule name");
$inbound_fax_rule->setAction("EMAIL_FIXED");
$inbound_fax_rule->setActionAddress("email@domain.com");
$inbound_fax_rule->setEnabled(1);

try {
    $result = $apiInstance->faxInboundAutomationPost($inbound_fax_rule);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling InboundFAXRulesApi->faxInboundAutomationPost: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME, 
    Password = API_KEY  
};
var inboundFAXRulesApi = new InboundFAXRulesApi(configuration);
var response = inboundFAXRulesApi.FaxInboundAutomationPost(new InboundFaxRule(
    dedicatedNumber: "+11231231234",
    ruleName: "New Rule",
    action: "EMAIL_FIXED",
    actionAddress: "email@domain.com",
    enabled: 1
));
var api = require('./api.js');

var inboundFaxRuleApi = new api.InboundFAXRulesApi("USERNAME", "API_KEY");

var inboundFaxRule = new api.InboundFaxRule();

inboundFaxRule.dedicatedNumber = "*";
inboundFaxRule.ruleName = "Rule Name";
inboundFaxRule.action = "EMAIL_FIXED";
inboundFaxRule.actionAddress = "abc@gmail.com";
inboundFaxRule.enabled = 1;

inboundFaxRuleApi.faxInboundAutomationPost(inboundFaxRule).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::InboundFAXRulesApi.new

# InboundFAXRule | Inbound fax rule model
inbound_fax_rule = ClickSendClient::InboundFAXRule.new(
  "action_address": "action_address",
  "dedicated_number": "dedicated_number",
  "rule_name": "rule_name",
  "action": "action",
  "enabled": 1
)

begin
  # Create new inbound fax automation
  result = api_instance.fax_inbound_automation_post(inbound_fax_rule)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling InboundFAXRulesApi->fax_inbound_automation_post: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.InboundFAXRulesApi(clicksend_client.ApiClient(configuration))
inbound_fax_rule = clicksend_client.InboundFAXRule(
                  dedicated_number="121",
                  rule_name="Rule Name",
                  action="EMAIL_FIXED",
                  action_address="email@domain.com",
                  enabled=1) # InboundFAXRule | Inbound fax rule model

try:
    # Create new inbound fax automation
    api_response = api_instance.fax_inbound_automation_post(inbound_fax_rule)
    print(api_response)
except ApiException as e:
    print("Exception when calling InboundFAXRulesApi->fax_inbound_automation_post: %s\n" % e)
use WWW::ClickSendClient::InboundFAXRulesApi;
use WWW::ClickSendClient::Object::InboundFAXRule;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::InboundFAXRulesApi->new(username => $username, password => $password);

my %params = (
    'action_address'   => 'action_address',
    'dedicated_number' => 'dedicated_number',
    'rule_name'        => 'rule_name',
    'action'           => 'action',
    'enabled'          => 1
);

my $inbound_fax_rule_obj = WWW::ClickSendClient::Object::InboundFAXRule->new(%params);
my $json_output = $api->fax_inbound_automation_post('inbound_fax_rule' => $inbound_fax_rule_obj);

print $json_output;
#import "CSInboundFaxRulesApi.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
[apiConfig setUsername:@"USERNAME"];
[apiConfig setPassword:@"PASSWORD"];

CSInboundFaxRule *inboundFaxRule = [[CSInboundFaxRule alloc] init];
inboundFaxRule.dedicatedNumber = @"dedicated_number";
inboundFaxRule.ruleName = @"rule_name";
inboundFaxRule.action = @"action";
inboundFaxRule.actionAddress = @"action_address";
inboundFaxRule.enabled = 0;

CSInboundFAXRulesApi *inboundFAXRulesApiInstance = [[CSInboundFAXRulesApi alloc] init];
[inboundFAXRulesApiInstance faxInboundAutomationPostWithInboundFaxRule:inboundFaxRule completionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire

if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}

let inboundFaxRule = InboundFaxRule(
                            dedicatedNumber: "dedicate_number",
                            ruleName: "rule_name",
                            action: "action",
                            actionAddress: "action_address",
                            enabled: 0
                        )

InboundFAXRulesAPI.faxInboundAutomationPost(inboundFaxRule: inboundFaxRule) { (dataString, error) in
    guard let dataString = dataString else {
        print(error!)
        return
    }
    if let data = dataString.data(using: String.Encoding.utf8) {
        do {
            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                print(dictonary)
            } else {
                print("Cannot convert the String value to JSON")
            }
        } catch let error as NSError {
            print(error)
        }
    }
}
    Coming Soon
package ClickSend;

import java.math.BigDecimal;
import ClickSend.Api.InboundFaxRulesApi;
import ClickSend.Model.InboundFaxRule;

public class create_fax_inbound_rule {
  public static void main(String[] args) {
    ApiClient defaultClient = new ApiClient();
    defaultClient.setUsername("USERNAME");
    defaultClient.setPassword("API_KEY");
    InboundFaxRulesApi apiInstance = new InboundFaxRulesApi(defaultClient);
    // InboundFaxRule | Inbound fax rule model
    InboundFaxRule inboundFaxRule = new InboundFaxRule(); 
    inboundFaxRule.dedicatedNumber("*");
    inboundFaxRule.ruleName("rulename");
    inboundFaxRule.action("EMAIL_FIXED");
    inboundFaxRule.actionAddress("john@doe.com");
    inboundFaxRule.enabled(new BigDecimal(1));
    try {
        String result = apiInstance.faxInboundAutomationPost(inboundFaxRule);
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling InboundFaxRulesApi#faxInboundAutomationPost");
        e.printStackTrace();
    }
  }
}

Body parameter

{
  "action_address": "action_address",
  "dedicated_number": "dedicated_number",
  "rule_name": "rule_name",
  "action": "action",
  "enabled": 1
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "New rule has been added.",
  "data": {
    "inbound_rule_id": 24,
    "dedicated_number": "+61298441484",
    "rule_name": "My Rule",
    "user_id": 1,
    "action": "EMAIL_FIXED",
    "action_address": "email@domain.com",
    "enabled": 1
  }
}

https://rest.clicksend.com/v3/automations/fax/inbound

Create new inbound fax automation

Create new inbound fax automation

Properties

Name Type Required Restrictions Description
dedicated_number string true none Dedicated Number. Can be '*' to apply to all numbers.
rule_name string true none Rule Name.
action string true none Action to be taken (AUTO_REPLY, EMAIL_USER, EMAIL_FIXED, URL, SMS, POLL, GROUP_SMS, MOVE_CONTACT, CREATE_CONTACT, CREATE_CONTACT_PLUS_EMAIL, CREATE_CONTACT_PLUS_NAME_EMAIL CREATE_CONTACT_PLUS_NAME, SMPP, NONE).
action_address string true none Action address.
enabled number true none Enabled: Disabled=0 or Enabled=1.

Refer to Status Codes for definitions of HTTP status code responses.

View Fax Inbound Rule

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
'https://rest.clicksend.com/v3/automations/fax/inbound/{inbound_rule_id}'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\InboundFAXRulesApi(new GuzzleHttp\Client(),$config);
$inbound_rule_id = 64733; // int | Inbound rule id

try {
    $result = $apiInstance->faxInboundAutomationGet($inbound_rule_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling InboundFAXRulesApi->faxInboundAutomationGet: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME, 
    Password = API_KEY  
};
var inboundFAXRulesApi = new InboundFAXRulesApi(configuration);
var response = inboundFAXRulesApi.FaxInboundAutomationGet(RULE_ID);
var api = require('./api.js');

var inboundFaxRuleApi = new api.InboundFAXRulesApi("USERNAME", "API_KEY");

var inboundRuleId = 62850;

inboundFaxRuleApi.faxInboundAutomationGet(inboundRuleId).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::InboundFAXRulesApi.new

inbound_rule_id = 56 # Integer | Inbound rule id

begin
  # Get specific inbound fax automation
  result = api_instance.fax_inbound_automation_get(inbound_rule_id)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling InboundFAXRulesApi->fax_inbound_automation_get: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.InboundFAXRulesApi(clicksend_client.ApiClient(configuration))
inbound_rule_id = 58108 # int | Inbound rule id

try:
    # Get specific inbound fax automation
    api_response = api_instance.fax_inbound_automation_get(inbound_rule_id)
    print(api_response)
except ApiException as e:
    print("Exception when calling InboundFAXRulesApi->fax_inbound_automation_get: %s\n" % e)
use WWW::ClickSendClient::InboundFAXRulesApi;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::InboundFAXRulesApi->new(username => $username, password => $password);

my $json_output = $api->fax_inbound_automation_get('inbound_rule_id' => '12345');

print $json_output;
#import "CSInboundFaxRulesApi.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
[apiConfig setUsername:@"USERNAME"];
[apiConfig setPassword:@"PASSWORD"];

NSNumber *ruleId = [[NSNumber alloc] initWithInt:1];

CSInboundFAXRulesApi *inboundFAXRulesApiInstance = [[CSInboundFAXRulesApi alloc] init];
[inboundFAXRulesApiInstance faxInboundAutomationGetWithInboundRuleId:ruleId completionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire

if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}

InboundFAXRulesAPI.faxInboundAutomationGet(inboundRuleId: 1) { (dataString, error) in
    guard let dataString = dataString else {
        print(error!)
        return
    }
    if let data = dataString.data(using: String.Encoding.utf8) {
        do {
            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                print(dictonary)
            } else {
                print("Cannot convert the String value to JSON")
            }
        } catch let error as NSError {
            print(error)
        }
    }
}
    Coming Soon
package ClickSend;

import ClickSend.Api.InboundFaxRulesApi;

public class view_specific_fax_inbound_rule {
  public static void main(String[] args) {
    ApiClient defaultClient = new ApiClient();
    defaultClient.setUsername("USERNAME");
    defaultClient.setPassword("API_KEY");
    InboundFaxRulesApi apiInstance = new InboundFaxRulesApi(defaultClient);
    Integer inboundRuleId = 60319; // Integer | Inbound rule id
    try {
        String result = apiInstance.faxInboundAutomationGet(inboundRuleId);
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling InboundFaxRulesApi#faxInboundAutomationGet");
        e.printStackTrace();
    }
  }
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "Your inbound fax.",
  "data": {
    "inbound_rule_id": 14,
    "dedicated_number": "+61298441484",
    "rule_name": "Rule Name",
    "user_id": 1,
    "action": "EMAIL_FIXED",
    "action_address": "email@domain.com",
    "enabled": 1
  }
}

https://rest.clicksend.com/v3/automations/fax/inbound/{inbound_rule_id}

Get specific inbound fax automation

Get specific inbound fax automation

Parameters

Parameter In Type Required Description
inbound_rule_id path integer(int32) true Inbound rule id

Refer to Status Codes for definitions of HTTP status code responses.

Update Fax Inbound Rule

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
     --request PUT \
     --header "Content-Type: application/json" \
     --data-binary "    {
        \"dedicated_number\":\"+61298441484\",
        \"rule_name\":\"Rule Name\",
        \"action\":\"EMAIL_FIXED\",
        \"action_address\":\"email@domain.com\",
        \"enabled\":1
    }" \
'https://rest.clicksend.com/v3/automations/fax/inbound/{inbound_rule_id}'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\InboundFAXRulesApi(new GuzzleHttp\Client(),$config);
$inbound_rule_id = 64733; // int | Inbound rule id
// \ClickSend\Model\InboundFaxRule | Inbound fax rule model
$inbound_fax_rule = new \ClickSend\Model\InboundFaxRule(); 
$inbound_fax_rule->setDedicatedNumber("*");
$inbound_fax_rule->setRuleName("rule name");
$inbound_fax_rule->setAction("EMAIL_FIXED");
$inbound_fax_rule->setActionAddress("email@domain.com");
$inbound_fax_rule->setEnabled(1);

try {
    $result = $apiInstance->faxInboundAutomationPut($inbound_rule_id, $inbound_fax_rule);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling InboundFAXRulesApi->faxInboundAutomationPut: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME, 
    Password = API_KEY  
};
var inboundFAXRulesApi = new InboundFAXRulesApi(configuration);
var response = inboundFAXRulesApi.FaxInboundAutomationPut(RULE_ID,new InboundFaxRule(
    dedicatedNumber: "+11231231234",
    ruleName: "New Rule",
    action: "EMAIL_FIXED",
    actionAddress: "email@domain.com",
    enabled: 1
));
var api = require('./api.js');

var inboundFaxRuleApi = new api.InboundFAXRulesApi("USERNAME", "API_KEY");

var inboundRuleId = 62850;

var inboundFaxRule = new api.InboundFaxRule();

inboundFaxRule.dedicatedNumber = "*";
inboundFaxRule.ruleName = "Rule Name";
inboundFaxRule.action = "EMAIL_FIXED";
inboundFaxRule.actionAddress = "abc@gmail.com";
inboundFaxRule.enabled = 1;

inboundFaxRuleApi.faxInboundAutomationPut(inboundRuleId, inboundFaxRule).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::InboundFAXRulesApi.new

inbound_rule_id = 56 # Integer | Inbound rule id

# InboundFAXRule | Inbound fax rule model
inbound_fax_rule = ClickSendClient::InboundFAXRule.new(
  "action_address": "action_address",
  "dedicated_number": "dedicated_number",
  "rule_name": "rule_name",
  "action": "action",
  "enabled": 1
)

begin
  # Update inbound fax automation
  result = api_instance.fax_inbound_automation_put(inbound_rule_id, inbound_fax_rule)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling InboundFAXRulesApi->fax_inbound_automation_put: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.InboundFAXRulesApi(clicksend_client.ApiClient(configuration))
inbound_rule_id = 10 # int | Inbound rule id
inbound_fax_rule = clicksend_client.InboundFAXRule(
                  dedicated_number="121",
                  rule_name="Rule Name",
                  action="EMAIL_FIXED",
                  action_address="email@domain.com",
                  enabled=1) # InboundFAXRule | Inbound fax rule model

try:
    # Update inbound fax automation
    api_response = api_instance.fax_inbound_automation_put(inbound_rule_id, inbound_fax_rule)
    print(api_response)
except ApiException as e:
    print("Exception when calling InboundFAXRulesApi->fax_inbound_automation_put: %s\n" % e)
use WWW::ClickSendClient::InboundFAXRulesApi;
use WWW::ClickSendClient::Object::InboundFAXRule;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::InboundFAXRulesApi->new(username => $username, password => $password);

my %params = (
    'action_address'   => 'test1@test.com',
    'dedicated_number' => '+6111111111',
    'rule_name'        => 'rule_name',
    'action'           => 'EMAIL_FIXED',
    'enabled'          => 1
);

my $inbound_fax_rule_obj = WWW::ClickSendClient::Object::InboundFAXRule->new(%params);
my $json_output = $api->fax_inbound_automation_put('inbound_rule_id' => '1234' ,'inbound_fax_rule' => $inbound_fax_rule_obj);

print $json_output;
#import "CSInboundFaxRulesApi.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
[apiConfig setUsername:@"USERNAME"];
[apiConfig setPassword:@"PASSWORD"];

NSNumber *inboundRuleId = [[NSNumber alloc] initWithInt:1];
CSInboundFaxRule *inboundFaxRule = [[CSInboundFaxRule alloc] init];
inboundFaxRule.dedicatedNumber =@"dedicated_number";
inboundFaxRule.ruleName = @"rule_name";
inboundFaxRule.action = @"action";
inboundFaxRule.actionAddress = @"action_Address";
inboundFaxRule.enabled = 0;

CSInboundFAXRulesApi *inboundFAXRulesApiInstance = [[CSInboundFAXRulesApi alloc] init];
[inboundFAXRulesApiInstance faxInboundAutomationPutWithInboundRuleId:inboundRuleId inboundFaxRule:inboundFaxRule completionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire

if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}

let inboundFaxRule = InboundFaxRule(dedicatedNumber: "dedicated_number",
ruleName: "rule_name",
action: "action",
actionAddress: "action_address",
enabled: 0)

InboundFAXRulesAPI.faxInboundAutomationPut(inboundRuleId: 1, inboundFaxRule: inboundFaxRule) { (dataString, error) in
    guard let dataString = dataString else {
        print(error!)
        return
    }
    if let data = dataString.data(using: String.Encoding.utf8) {
        do {
            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                print(dictonary)
            } else {
                print("Cannot convert the String value to JSON")
            }
        } catch let error as NSError {
            print(error)
        }
    }
}
    Coming Soon
package ClickSend;

import java.math.BigDecimal;
import ClickSend.Api.InboundFaxRulesApi;
import ClickSend.Model.InboundFaxRule;

public class update_fax_inbound_rule {
  public static void main(String[] args) {
    ApiClient defaultClient = new ApiClient();
    defaultClient.setUsername("USERNAME");
    defaultClient.setPassword("API_KEY");
    InboundFaxRulesApi apiInstance = new InboundFaxRulesApi(defaultClient);
    Integer inboundRuleId = 60791; // Integer | Inbound rule id
     // InboundFaxRule | Inbound fax rule model
    InboundFaxRule inboundFaxRule = new InboundFaxRule();
    inboundFaxRule.dedicatedNumber("*");
    inboundFaxRule.ruleName("rulename");
    inboundFaxRule.action("EMAIL_FIXED");
    inboundFaxRule.actionAddress("john@doe.com");
    inboundFaxRule.enabled(new BigDecimal(1));
    try {
        String result = apiInstance.faxInboundAutomationPut(inboundRuleId, inboundFaxRule);
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling InboundFaxRulesApi#faxInboundAutomationPut");
        e.printStackTrace();
    }
  }
}

Body parameter

{
  "action_address": "action_address",
  "dedicated_number": "dedicated_number",
  "rule_name": "rule_name",
  "action": "action",
  "enabled": 1
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "Your inbound fax.",
  "data": {
    "inbound_rule_id": 14,
    "dedicated_number": "+61298441484",
    "rule_name": "Rule Name",
    "user_id": 1,
    "action": "EMAIL_FIXED",
    "action_address": "email@domain.com",
    "enabled": 1
  }
}

https://rest.clicksend.com/v3/automations/fax/inbound/{inbound_rule_id}

Update inbound fax automation

Update inbound fax automation

Parameters

Parameter In Type Required Description
inbound_rule_id path integer(int32) true Inbound rule id

Properties

Name Type Required Restrictions Description
dedicated_number string true none Dedicated Number. Can be '*' to apply to all numbers.
rule_name string true none Rule Name.
action string true none Action to be taken (AUTO_REPLY, EMAIL_USER, EMAIL_FIXED, URL, SMS, POLL, GROUP_SMS, MOVE_CONTACT, CREATE_CONTACT, CREATE_CONTACT_PLUS_EMAIL, CREATE_CONTACT_PLUS_NAME_EMAIL CREATE_CONTACT_PLUS_NAME, SMPP, NONE).
action_address string true none Action address.
enabled number true none Enabled: Disabled=0 or Enabled=1.

Refer to Status Codes for definitions of HTTP status code responses.

Delete Fax Inbound Rule

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
     --request DELETE \
'https://rest.clicksend.com/v3/automations/fax/inbound/{inbound_rule_id}'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\InboundFAXRulesApi(new GuzzleHttp\Client(),$config);
$inbound_rule_id = 64733; // int | Inbound rule id

try {
    $result = $apiInstance->faxInboundAutomationDelete($inbound_rule_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling InboundFAXRulesApi->faxInboundAutomationDelete: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME, 
    Password = API_KEY  
};
var inboundFAXRulesApi = new InboundFAXRulesApi(configuration);
var response = inboundFAXRulesApi.FaxInboundAutomationDelete(RULE_ID);
var api = require('./api.js');

var inboundFaxRuleApi = new api.InboundFAXRulesApi("USERNAME", "API_KEY");

var inboundRuleId = 62850;

inboundFaxRuleApi.faxInboundAutomationDelete(inboundRuleId).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::InboundFAXRulesApi.new

inbound_rule_id = 56 # Integer | Inbound rule id

begin
  # Delete inbound fax automation
  result = api_instance.fax_inbound_automation_delete(inbound_rule_id)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling InboundFAXRulesApi->fax_inbound_automation_delete: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.InboundFAXRulesApi(clicksend_client.ApiClient(configuration))
inbound_rule_id = 58108 # int | Inbound rule id

try:
    # Delete inbound fax automation
    api_response = api_instance.fax_inbound_automation_delete(inbound_rule_id)
    print(api_response)
except ApiException as e:
    print("Exception when calling InboundFAXRulesApi->fax_inbound_automation_delete: %s\n" % e)

use WWW::ClickSendClient::InboundFAXRulesApi;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::InboundFAXRulesApi->new(username => $username, password => $password);

my $json_output = $api->fax_inbound_automation_delete('inbound_rule_id' => '1234');

print $json_output;
#import "CSInboundFaxRulesApi.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
[apiConfig setUsername:@"USERNAME"];
[apiConfig setPassword:@"PASSWORD"];

NSNumber *ruleId =[[NSNumber alloc] initWithInt:1];

CSInboundFAXRulesApi *inboundFAXRulesApiInstance = [[CSInboundFAXRulesApi alloc] init];
[inboundFAXRulesApiInstance faxInboundAutomationDeleteWithInboundRuleId:ruleId completionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire

if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}

InboundFAXRulesAPI.faxInboundAutomationDelete(inboundRuleId: 1) { (dataString, error) in
    guard let dataString = dataString else {
        print(error!)
        return
    }
    if let data = dataString.data(using: String.Encoding.utf8) {
        do {
            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                print(dictonary)
            } else {
                print("Cannot convert the String value to JSON")
            }
        } catch let error as NSError {
        print(error)
        }
    }
}
    Coming Soon
package ClickSend;

import ClickSend.Api.InboundFaxRulesApi;

public class delete_fax_inbound_rule {
  public static void main(String[] args) {
    ApiClient defaultClient = new ApiClient();
    defaultClient.setUsername("USERNAME");
    defaultClient.setPassword("API_KEY");
    InboundFaxRulesApi apiInstance = new InboundFaxRulesApi(defaultClient);
    Integer inboundRuleId = 60319; // Integer | Inbound rule id
    try {
        String result = apiInstance.faxInboundAutomationDelete(inboundRuleId);
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling InboundFaxRulesApi#faxInboundAutomationDelete");
        e.printStackTrace();
    }
  }
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "Your fax inbound rule has been deleted.",
  "data": []
}

https://rest.clicksend.com/v3/automations/fax/inbound/{inbound_rule_id}

Delete inbound fax automation

Delete inbound fax automation

Parameters

Parameter In Type Required Description
inbound_rule_id path integer(int32) true Inbound rule id

Refer to Status Codes for definitions of HTTP status code responses.

FAX Delivery Receipt Rules

Everything about FAX Delivery Receipt Automations

View FAX Delivery Receipt Rules

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
'https://rest.clicksend.com/v3/automations/email/receipt'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\FAXDeliveryReceiptRulesApi(new GuzzleHttp\Client(),$config);
$q = "q_example"; // string | Your keyword or query.
$page = 1; // int | Page number
$limit = 10; // int | Number of records per page

try {
    $result = $apiInstance->faxDeliveryReceiptAutomationsGet($q, $page, $limit);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling FAXDeliveryReceiptRulesApi->faxDeliveryReceiptAutomationsGet: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME, 
    Password = API_KEY  
};
var faxDeliveryReceiptRulesApi = new FAXDeliveryReceiptRulesApi(configuration);
var response = faxDeliveryReceiptRulesApi.FaxDeliveryReceiptAutomationsGet();
var api = require('./api.js');

var faxDeliveryReceiptApi = new api.FAXDeliveryReceiptRulesApi("USERNAME", "API_KEY");

var q = "q_example";
var page = 1;
var limit = 10;

faxDeliveryReceiptApi.faxDeliveryReceiptAutomationsGet(q, page, limit).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::FAXDeliveryReceiptRulesApi.new

opts = {
  page: 1,  # Integer | Page number
  limit: 10 # Integer | Number of records per page
}

begin
  # Get all fax delivery receipt automations
  result = api_instance.fax_delivery_receipt_automations_get(opts)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling FAXDeliveryReceiptRulesApi->fax_delivery_receipt_automations_get: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.FAXDeliveryReceiptRulesApi(clicksend_client.ApiClient(configuration))
page = 1 # int | Page number (optional) (default to 1)
limit = 10 # int | Number of records per page (optional) (default to 10)

try:
    # Get all fax delivery receipt automations
    api_response = api_instance.fax_delivery_receipt_automations_get(page=page, limit=limit)
    print(api_response)
except ApiException as e:
    print("Exception when calling FAXDeliveryReceiptRulesApi->fax_delivery_receipt_automations_get: %s\n" % e)
use WWW::ClickSendClient::FAXDeliveryReceiptRulesApi;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::FAXDeliveryReceiptRulesApi->new(username => $username, password => $password);

my $json_output = $api->fax_delivery_receipt_automations_get('page' => '1', 'limit' => '10');

print $json_output;
#import "CSFaxDeliveryReceiptRulesApi.h"
#import "CSDefaultConfiguration.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
// Configure HTTP basic authorization (authentication scheme: BasicAuth)
[apiConfig setUsername:@"USERNAME"];
[apiConfig setPassword:@"PASSWORD"];

CSFaxDeliveryReceiptRulesApi *faxDeliveryRecieptRules = [[CSFaxDeliveryReceiptRulesApi alloc] init];
[faxDeliveryRecieptRules faxDeliveryReceiptAutomationsGetWithQ:@"q" page:@(1) limit:@(15) completionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire
if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}

FAXDeliveryReceiptRulesAPI.faxDeliveryReceiptAutomationsGet { (dataString, error) in
    if let error = error {
        print(error)
    } else {
        if let data = dataString!.data(using: String.Encoding.utf8) {
            do {
                if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                    print(dictonary)
                } else {
                    print("Cannot convert the String value to JSON")
                }
            } catch let error as NSError {
                print(error)
            }
        }
    }
}
    Coming Soon
package ClickSend;

import ClickSend.Api.FaxDeliveryReceiptRulesApi;

public class view_all_fax_delivery_receipt_rule {
  public static void main(String[] args) {
    ApiClient defaultClient = new ApiClient();
    defaultClient.setUsername("USERNAME");
    defaultClient.setPassword("API_KEY");
    FaxDeliveryReceiptRulesApi apiInstance = new FaxDeliveryReceiptRulesApi(defaultClient);
    String q = "q_example"; // String | Your keyword or query.
    Integer page = 1; // Integer | Page number
    Integer limit = 10; // Integer | Number of records per page
    try {
      String result = apiInstance.faxDeliveryReceiptAutomationsGet(q, page, limit);
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling FaxDeliveryReceiptRulesApi#faxDeliveryReceiptAutomationsGet");
        e.printStackTrace();
    }
  }
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "Here is your result.",
  "data": {
    "total": 2,
    "per_page": 15,
    "current_page": 1,
    "last_page": 1,
    "next_page_url": null,
    "prev_page_url": null,
    "from": 1,
    "to": 4,
    "data": [
      {
        "receipt_rule_id": 1,
        "rule_name": "Email Test Rule",
        "match_type": 0,
        "action": "URL",
        "action_address": "http://yourdomain.com",
        "enabled": 1
      },
      {
        "receipt_rule_id": 2,
        "rule_name": "test",
        "match_type": 0,
        "action": "URL",
        "action_address": "http://yourdomain.com",
        "enabled": 1
      }
    ]
  }
}

https://rest.clicksend.com/v3/automations/fax/receipts

Get all fax delivery receipt automations

Get all fax delivery receipt automations

Parameters

Parameter In Type Required Description
page query integer(int32) false Page number
limit query integer(int32) false Number of records per page

Refer to Status Codes for definitions of HTTP status code responses.

Create FAX Delivery Receipt Rule

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
     --request POST \
     --header "Content-Type: application/json" \
     --data-binary "    {
        \"rule_name\":\"My Rule\",
        \"match_type\": 0,
        \"action\":\"URL\",
        \"action_address\":\"http://yourdomain.com\",
        \"enabled\":1
    }" \
'https://rest.clicksend.com/v3/automations/email/receipt'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\FAXDeliveryReceiptRulesApi(new GuzzleHttp\Client(),$config);
// \ClickSend\Model\DeliveryReceiptRule | fax delivery receipt rule model
$delivery_receipt_rule = new \ClickSend\Model\DeliveryReceiptRule();
$delivery_receipt_rule->setRuleName("rule name");
$delivery_receipt_rule->setMatchType(0);
$delivery_receipt_rule->setAction("URL");
$delivery_receipt_rule->setActionAddress("http://example.com");
$delivery_receipt_rule->setEnabled(1);

try {
    $result = $apiInstance->faxDeliveryReceiptAutomationPost($delivery_receipt_rule);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling FAXDeliveryReceiptRulesApi->faxDeliveryReceiptAutomationPost: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME, 
    Password = API_KEY  
};
var faxDeliveryReceiptRulesApi = new FAXDeliveryReceiptRulesApi(configuration);
var response = faxDeliveryReceiptRulesApi.FaxDeliveryReceiptAutomationPost(new DeliveryReceiptRule(
    ruleName: "NEW RULE",
    matchType: 0,
    action: "URL",
    actionAddress: "http://yourdomain.com",
    enabled: 1
));
var api = require('./api.js');

var faxDeliveryReceiptApi = new api.FAXDeliveryReceiptRulesApi("USERNAME", "API_KEY");

var deliveryReceiptRule = new api.DeliveryReceiptRule();

deliveryReceiptRule.ruleName = "My Rule";
deliveryReceiptRule.matchType = 0;
deliveryReceiptRule.action = "URL";
deliveryReceiptRule.actionAddress = "http://example.com";
deliveryReceiptRule.enabled = 1;

faxDeliveryReceiptApi.faxDeliveryReceiptAutomationPost(deliveryReceiptRule).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::FAXDeliveryReceiptRulesApi.new

# DeliveryReceiptRule | fax delivery receipt rule model
delivery_receipt_rule = ClickSendClient::DeliveryReceiptRule.new(
  "rule_name": "rule_name",
  "match_type": 0,
  "action": "EMAIL_FIXED",
  "action_address": "action_address",
  "enabled": 1
)

begin
  # Create fax delivery receipt automations
  result = api_instance.fax_delivery_receipt_automation_post(delivery_receipt_rule)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling FAXDeliveryReceiptRulesApi->fax_delivery_receipt_automation_post: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.FAXDeliveryReceiptRulesApi(clicksend_client.ApiClient(configuration))
# DeliveryReceiptRule | fax delivery receipt rule model
delivery_receipt_rule = clicksend_client.DeliveryReceiptRule(
                        rule_name="My Rule",
                        match_type= 0,
                        action="URL",
                        action_address="http://yourdomain.com",
                        enabled=1) 

try:
    # Create fax delivery receipt automations
    api_response = api_instance.fax_delivery_receipt_automation_post(delivery_receipt_rule)
    print(api_response)
except ApiException as e:
    print("Exception when calling FAXDeliveryReceiptRulesApi->fax_delivery_receipt_automation_post: %s\n" % e)
use WWW::ClickSendClient::FAXDeliveryReceiptRulesApi;
use WWW::ClickSendClient::Object::DeliveryReceiptRule;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::FAXDeliveryReceiptRulesApi->new(username => $username, password => $password);

my %params = (
    'rule_name'      => 'rule_name',
    'match_type'     => '2',
    'action'         => 'EMAIL_FIXED',
    'action_address' => 'test1@test.com',
    'enabled'        => '1'
);

my $delivery_receipt_rule_obj = WWW::ClickSendClient::Object::DeliveryReceiptRule->new(%params);

my $json_output = $api->fax_delivery_receipt_automation_post('delivery_receipt_rule' => $delivery_receipt_rule_obj);

print $json_output;
#import "CSFaxDeliveryReceiptRulesApi.h"
#import "CSDefaultConfiguration.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
// Configure HTTP basic authorization (authentication scheme: BasicAuth)
[apiConfig setUsername:@"USERNAME"];
[apiConfig setPassword:@"PASSWORD"];

CSDeliveryReceiptRule *deliveryRule = [[CSDeliveryReceiptRule alloc] init];
deliveryRule.ruleName = @"rule_name";
deliveryRule.matchType = @(0);
deliveryRule.action = @"action";
deliveryRule.actionAddress = @"action_address";
deliveryRule.enabled = @(1);

CSFAXDeliveryReceiptRulesApi *faxDeliveryRecieptRules = [[CSFAXDeliveryReceiptRulesApi alloc] init];
[faxDeliveryRecieptRules faxDeliveryReceiptAutomationPostWithDeliveryReceiptRule:deliveryRule completionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire
if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}

let deliveryReceiptRule = DeliveryReceiptRule(
                            ruleName: "rule_name", 
                            matchType: 1, 
                            action: "action", 
                            actionAddress: "action_address", 
                            enabled: 1
                        )

FAXDeliveryReceiptRulesAPI.faxDeliveryReceiptAutomationPost(deliveryReceiptRule: deliveryReceiptRule) { (dataString, error) in
    if let error = error {
        print(error)
    } else {
        if let data = dataString!.data(using: String.Encoding.utf8) {
            do {
                if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                    print(dictonary)
                } else {
                    print("Cannot convert the String value to JSON")
                }
            } catch let error as NSError {
                print(error)
            }
        }
    }
}
    Coming Soon
package ClickSend;

import java.math.BigDecimal;
import ClickSend.Api.FaxDeliveryReceiptRulesApi;
import ClickSend.Model.DeliveryReceiptRule;

public class create_fax_delivery_receipt_rule {
  public static void main(String[] args) {
    ApiClient defaultClient = new ApiClient();
    defaultClient.setUsername("USERNAME");
    defaultClient.setPassword("API_KEY");
    FaxDeliveryReceiptRulesApi apiInstance = new FaxDeliveryReceiptRulesApi(defaultClient);
    // DeliveryReceiptRule | fax delivery receipt rule model
    DeliveryReceiptRule deliveryReceiptRule = new DeliveryReceiptRule();
    deliveryReceiptRule.ruleName("rulename");
    deliveryReceiptRule.matchType(new BigDecimal(0));
    deliveryReceiptRule.action("URL");
    deliveryReceiptRule.actionAddress("http://yourdomain.com");
    deliveryReceiptRule.enabled(new BigDecimal(1));
    try {
        String result = apiInstance.faxDeliveryReceiptAutomationPost(deliveryReceiptRule);
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling FaxDeliveryReceiptRulesApi#faxDeliveryReceiptAutomationPost");
        e.printStackTrace();
    }
  }
}

Body parameter

{
  "action_address": "action_address",
  "rule_name": "rule_name",
  "match_type": "EMAIL_FIXED",
  "action": "action",
  "enabled": 1
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "Your new Fax receipt has been added.",
  "data": {
    "receipt_rule_id": 4,
    "rule_name": "My Rule",
    "match_type": 2,
    "action": "EMAIL_FIXED",
    "action_address": "john@doe.com",
    "enabled": 1
  }
}

https://rest.clicksend.com/v3/automations/fax/receipts

Create fax delivery receipt automations

Create fax delivery receipt automations

Properties

Name Type Required Restrictions Description
rule_name string true none Rule Name.
match_type number true none Match Type. 0=All reports.
action string true none Action to be taken (AUTO_REPLY, EMAIL_USER, EMAIL_FIXED, URL, SMS, POLL, GROUP_SMS, MOVE_CONTACT, CREATE_CONTACT, CREATE_CONTACT_PLUS_EMAIL, CREATE_CONTACT_PLUS_NAME_EMAIL CREATE_CONTACT_PLUS_NAME, SMPP, NONE).
action_address string true none Action address.
enabled number true none Enabled: Disabled=0 or Enabled=1.

Refer to Status Codes for definitions of HTTP status code responses.

View FAX Delivery Receipt Rule

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
'https://rest.clicksend.com/v3/automations/email/receipt/{rule_id}'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\FAXDeliveryReceiptRulesApi(new GuzzleHttp\Client(),$config);
$receipt_rule_id = 139; // int | Receipt rule id

try {
    $result = $apiInstance->faxDeliveryReceiptAutomationGet($receipt_rule_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling FAXDeliveryReceiptRulesApi->faxDeliveryReceiptAutomationGet: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME, 
    Password = API_KEY  
};
var faxDeliveryReceiptRulesApi = new FAXDeliveryReceiptRulesApi(configuration);
var response = faxDeliveryReceiptRulesApi.FaxDeliveryReceiptAutomationGet(RULE_ID);
var api = require('./api.js');

var faxDeliveryReceiptApi = new api.FAXDeliveryReceiptRulesApi("USERNAME", "API_KEY");

var receiptRuleId = 136;

faxDeliveryReceiptApi.faxDeliveryReceiptAutomationGet(receiptRuleId).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::FAXDeliveryReceiptRulesApi.new

receipt_rule_id = 56 # Integer | Receipt rule id

begin
  # Get specific fax delivery receipt automation
  result = api_instance.fax_delivery_receipt_automation_get(receipt_rule_id)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling FAXDeliveryReceiptRulesApi->fax_delivery_receipt_automation_get: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.FAXDeliveryReceiptRulesApi(clicksend_client.ApiClient(configuration))
receipt_rule_id = 130 # int | Receipt rule id

try:
    # Get specific fax delivery receipt automation
    api_response = api_instance.fax_delivery_receipt_automation_get(receipt_rule_id)
    print(api_response)
except ApiException as e:
    print("Exception when calling FAXDeliveryReceiptRulesApi->fax_delivery_receipt_automation_get: %s\n" % e)
use WWW::ClickSendClient::FAXDeliveryReceiptRulesApi;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::FAXDeliveryReceiptRulesApi->new(username => $username, password => $password);

my $json_output = $api->fax_delivery_receipt_automation_get('receipt_rule_id' => '12345');

print $json_output;
#import "CSFaxDeliveryReceiptRulesApi.h"
#import "CSDefaultConfiguration.h"


CSFAXDeliveryReceiptRulesApi *faxDeliveryRecieptRules = [[CSFAXDeliveryReceiptRulesApi alloc] init];
[faxDeliveryRecieptRules  faxDeliveryReceiptAutomationGetWithReceiptRuleId:@(1) completionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire
if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}

FAXDeliveryReceiptRulesAPI.faxDeliveryReceiptAutomationGet(receiptRuleId: 1) { (dataString, error) in
    if let error = error {
        print(error)
    } else {
        if let data = dataString!.data(using: String.Encoding.utf8) {
            do {
                if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                    print(dictonary)
                } else {
                    print("Cannot convert the String value to JSON")
                }
            } catch let error as NSError {
                print(error)
            }
        }
    }
}
    Coming Soon
package ClickSend;

import ClickSend.Api.FaxDeliveryReceiptRulesApi;

public class view_specific_fax_delivery_receipt_rule {
  public static void main(String[] args) {
    ApiClient defaultClient = new ApiClient();
    defaultClient.setUsername("USERNAME");
    defaultClient.setPassword("API_KEY");
    FaxDeliveryReceiptRulesApi apiInstance = new FaxDeliveryReceiptRulesApi(defaultClient);
    Integer receiptRuleId = 130; // Integer | Receipt rule id
    try {
        String result = apiInstance.faxDeliveryReceiptAutomationGet(receiptRuleId);
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling FaxDeliveryReceiptRulesApi#faxDeliveryReceiptAutomationGet");
        e.printStackTrace();
    }
  }
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "Your rule incoming fax receipt.",
  "data": {
    "receipt_rule_id": 4,
    "rule_name": "My Rule",
    "match_type": 2,
    "action": "EMAIL_FIXED",
    "action_address": "john@doe.com",
    "enabled": 1
  }
}

https://rest.clicksend.com/v3/automations/fax/receipts/{receipt_rule_id}

Get specific fax delivery receipt automation

Get specific fax delivery receipt automation

Parameters

Parameter In Type Required Description
receipt_rule_id path integer(int32) true Receipt rule id

Refer to Status Codes for definitions of HTTP status code responses.

Update FAX Delivery Receipt Rule

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
     --request PUT \
     --header "Content-Type: application/json" \
     --data-binary "    {
        \"rule_name\":\"My Rule\",
        \"match_type\": 0,
        \"action\":\"URL\",
        \"action_address\":\"http://yourdomain.com\",
        \"enabled\":1
    }" \
'https://rest.clicksend.com/v3/automations/email/receipt/{rule_id}'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\FAXDeliveryReceiptRulesApi(new GuzzleHttp\Client(),$config);
$receipt_rule_id = 139; // int | Receipt rule id
 // \ClickSend\Model\DeliveryReceiptRule | Delivery receipt rule model
$delivery_receipt_rule = new \ClickSend\Model\DeliveryReceiptRule();
$delivery_receipt_rule->setRuleName("rule name");
$delivery_receipt_rule->setMatchType(0);
$delivery_receipt_rule->setAction("URL");
$delivery_receipt_rule->setActionAddress("http://example.com");
$delivery_receipt_rule->setEnabled(1);

try {
    $result = $apiInstance->faxDeliveryReceiptAutomationPut($receipt_rule_id, $delivery_receipt_rule);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling FAXDeliveryReceiptRulesApi->faxDeliveryReceiptAutomationPut: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME, 
    Password = API_KEY  
};
var faxDeliveryReceiptRulesApi = new FAXDeliveryReceiptRulesApi(configuration);
var response = faxDeliveryReceiptRulesApi.FaxDeliveryReceiptAutomationPut(128, new DeliveryReceiptRule(
    ruleName: "NEW RULE",
    matchType: 0,
    action: "URL",
    actionAddress: "http://yourdomain.com",
    enabled: 1
));
var api = require('./api.js');

var faxDeliveryReceiptApi = new api.FAXDeliveryReceiptRulesApi("USERNAME", "API_KEY");

var receiptRuleId = 136;

var deliveryReceiptRule = new api.DeliveryReceiptRule();

deliveryReceiptRule.ruleName = "My Rule";
deliveryReceiptRule.matchType = 0;
deliveryReceiptRule.action = "URL";
deliveryReceiptRule.actionAddress = "http://example.com";
deliveryReceiptRule.enabled = 1;

faxDeliveryReceiptApi.faxDeliveryReceiptAutomationPut(receiptRuleId,deliveryReceiptRule).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::FAXDeliveryReceiptRulesApi.new

receipt_rule_id = 56 # Integer | Receipt rule id

# DeliveryReceiptRule | fax delivery receipt rule model
delivery_receipt_rule = ClickSendClient::DeliveryReceiptRule.new(
  "rule_name": "rule_name",
  "match_type": 0,
  "action": "EMAIL_FIXED",
  "action_address": "action_address",
  "enabled": 1
)

begin
  # Update fax delivery receipt automation
  result = api_instance.fax_delivery_receipt_automation_put(receipt_rule_id, delivery_receipt_rule)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling FAXDeliveryReceiptRulesApi->fax_delivery_receipt_automation_put: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.FAXDeliveryReceiptRulesApi(clicksend_client.ApiClient(configuration))
receipt_rule_id = 130 # int | Receipt rule id
# DeliveryReceiptRule | Delivery receipt rule model
delivery_receipt_rule = clicksend_client.DeliveryReceiptRule(
                        rule_name="My Updated Rule",
                        match_type= 0,
                        action="URL",
                        action_address="http://yourdomain.com",
                        enabled=1)

try:
    # Update fax delivery receipt automation
    api_response = api_instance.fax_delivery_receipt_automation_put(receipt_rule_id, delivery_receipt_rule)
    print(api_response)
except ApiException as e:
    print("Exception when calling FAXDeliveryReceiptRulesApi->fax_delivery_receipt_automation_put: %s\n" % e)
use WWW::ClickSendClient::FAXDeliveryReceiptRulesApi;
use WWW::ClickSendClient::Object::DeliveryReceiptRule;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::FAXDeliveryReceiptRulesApi->new(username => $username, password => $password);

my %params = (
    'rule_name'      => 'rule_name',
    'match_type'     => '2',
    'action'         => 'EMAIL_FIXED',
    'action_address' => 'test1@test.com',
    'enabled'        => '1'
);

my $delivery_receipt_rule_obj = WWW::ClickSendClient::Object::DeliveryReceiptRule->new(%params);
my $json_output = $api->fax_delivery_receipt_automation_put('receipt_rule_id' => '1234' , 'delivery_receipt_rule' => $delivery_receipt_rule_obj);

print $json_output;
#import "CSFaxDeliveryReceiptRulesApi.h"
#import "CSDefaultConfiguration.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
// Configure HTTP basic authorization (authentication scheme: BasicAuth)
[apiConfig setUsername:@"USERNAME"];
[apiConfig setPassword:@"PASSWORD"];

CSDeliveryReceiptRule *deliveryRule = [[CSDeliveryReceiptRule alloc] init];
deliveryRule.ruleName = @"rule_name";
deliveryRule.matchType = @(0);
deliveryRule.action = @"action";
deliveryRule.actionAddress = @"action_address";
deliveryRule.enabled = @(1);

CSFAXDeliveryReceiptRulesApi *faxDeliveryRecieptRules = [[CSFAXDeliveryReceiptRulesApi alloc] init];
[faxDeliveryRecieptRules  faxDeliveryReceiptAutomationPutWithReceiptRuleId:@(1) deliveryReceiptRule:faxDeliveryRecieptRules completionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire
if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}

let deliveryReceiptRule = DeliveryReceiptRule(
                                ruleName: "rule_name", 
                                matchType: 1, 
                                action: "action", 
                                actionAddress: "action_address", 
                                enabled: 1
                            )

FAXDeliveryReceiptRulesAPI.faxDeliveryReceiptAutomationPut(receiptRuleId: 1, deliveryReceiptRule: deliveryReceiptRule) { (datString, error) in
    if let error = error {
        print(error)
    } else {
        if let data = datString!.data(using: String.Encoding.utf8) {
            do {
                if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                    print(dictonary)
                } else {
                    print("bad json")
                }
            } catch let error as NSError {
                print(error)
            }
        }
    }
}
    Coming Soon
package ClickSend;

import java.math.BigDecimal;
import ClickSend.Api.FaxDeliveryReceiptRulesApi;
import ClickSend.Model.DeliveryReceiptRule;

public class update_fax_delivery_receipt_rule {
  public static void main(String[] args) {
    ApiClient defaultClient = new ApiClient();
    defaultClient.setUsername("USERNAME");
    defaultClient.setPassword("API_KEY");
    FaxDeliveryReceiptRulesApi apiInstance = new FaxDeliveryReceiptRulesApi(defaultClient);
    Integer receiptRuleId = 133; // Integer | Receipt rule id
    // DeliveryReceiptRule | Delivery receipt rule model
    DeliveryReceiptRule deliveryReceiptRule = new DeliveryReceiptRule(); 
    deliveryReceiptRule.ruleName("rulename");
    deliveryReceiptRule.matchType(new BigDecimal(0));
    deliveryReceiptRule.action("URL");
    deliveryReceiptRule.actionAddress("http://yourdomain.com");
    deliveryReceiptRule.enabled(new BigDecimal(1));
    try {
        String result = apiInstance.faxDeliveryReceiptAutomationPut(receiptRuleId, deliveryReceiptRule);
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling FaxDeliveryReceiptRulesApi#faxDeliveryReceiptAutomationPut");
        e.printStackTrace();
    }
  }
}

Body parameter

{
  "action_address": "action_address",
  "rule_name": "rule_name",
  "match_type": "EMAIL_FIXED",
  "action": "action",
  "enabled": 1
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "Your rule incoming fax receipt has been updated.",
  "data": {
    "receipt_rule_id": 4,
    "rule_name": "My Rule",
    "match_type": 1,
    "action": "EMAIL_FIXED",
    "action_address": "john@doe.com",
    "enabled": 1
  }
}

https://rest.clicksend.com/v3/automations/fax/receipts/{receipt_rule_id}

Update fax delivery receipt automation

Update fax delivery receipt automation

Parameters

Parameter In Type Required Description
receipt_rule_id path integer(int32) true Receipt rule id

Properties

Name Type Required Restrictions Description
rule_name string true none Rule Name.
match_type number true none Match Type. 0=All reports.
action string true none Action to be taken (AUTO_REPLY, EMAIL_USER, EMAIL_FIXED, URL, SMS, POLL, GROUP_SMS, MOVE_CONTACT, CREATE_CONTACT, CREATE_CONTACT_PLUS_EMAIL, CREATE_CONTACT_PLUS_NAME_EMAIL CREATE_CONTACT_PLUS_NAME, SMPP, NONE).
action_address string true none Action address.
enabled number true none Enabled: Disabled=0 or Enabled=1.

Refer to Status Codes for definitions of HTTP status code responses.

Delete FAX Delivery Receipt Rule

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
     --request DELETE \
'https://rest.clicksend.com/v3/automations/email/receipt/{rule_id}'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\FAXDeliveryReceiptRulesApi(new GuzzleHttp\Client(),$config);
$receipt_rule_id = 139; // int | Receipt rule id

try {
    $result = $apiInstance->faxDeliveryReceiptAutomationDelete($receipt_rule_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling FAXDeliveryReceiptRulesApi->faxDeliveryReceiptAutomationDelete: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME, 
    Password = API_KEY  
};
var faxDeliveryReceiptRulesApi = new FAXDeliveryReceiptRulesApi(configuration);
var response = faxDeliveryReceiptRulesApi.FaxDeliveryReceiptAutomationDelete(RULE_ID);
var api = require('./api.js');

var faxDeliveryReceiptApi = new api.FAXDeliveryReceiptRulesApi("USERNAME", "API_KEY");

var receiptRuleId = 136;

faxDeliveryReceiptApi.faxDeliveryReceiptAutomationDelete(receiptRuleId).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::FAXDeliveryReceiptRulesApi.new

receipt_rule_id = 56 # Integer | Receipt rule id

begin
  # Delete fax delivery receipt automation
  result = api_instance.fax_delivery_receipt_automation_delete(receipt_rule_id)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling FAXDeliveryReceiptRulesApi->fax_delivery_receipt_automation_delete: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.FAXDeliveryReceiptRulesApi(clicksend_client.ApiClient(configuration))
receipt_rule_id = 130 # int | Receipt rule id

try:
    # Delete fax delivery receipt automation
    api_response = api_instance.fax_delivery_receipt_automation_delete(receipt_rule_id)
    print(api_response)
except ApiException as e:
    print("Exception when calling FAXDeliveryReceiptRulesApi->fax_delivery_receipt_automation_delete: %s\n" % e)
use WWW::ClickSendClient::FAXDeliveryReceiptRulesApi;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::FAXDeliveryReceiptRulesApi->new(username => $username, password => $password);

my $json_output = $api->fax_delivery_receipt_automation_delete('receipt_rule_id' => '123456');

print $json_output;
#import "CSFaxDeliveryReceiptRulesApi.h"
#import "CSDefaultConfiguration.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
// Configure HTTP basic authorization (authentication scheme: BasicAuth)
[apiConfig setUsername:@"USERNAME"];
[apiConfig setPassword:@"PASSWORD"];

CSFAXDeliveryReceiptRulesApi *faxDeliveryRecieptRules = [[CSFAXDeliveryReceiptRulesApi alloc] init];
[faxDeliveryRecieptRules  faxDeliveryReceiptAutomationDeleteWithReceiptRuleId:@(1) completionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire
if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}

let deliveryReceiptRule = DeliveryReceiptRule(ruleName: "rule_name", matchType: 1, action: "action", actionAddress: "action_address", enabled: 1)

FAXDeliveryReceiptRulesAPI.faxDeliveryReceiptAutomationDelete(receiptRuleId: 1) { (dataString, error) in
    if let error = error {
        print(error)
    } else {
        if let data = datString!.data(using: String.Encoding.utf8) {
            do {
                if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                    print(dictonary)
                } else {
                    print("bad json")
                }
            } catch let error as NSError {
                print(error)
            }
        }
    }
}
    Coming Soon
package ClickSend;

import ClickSend.Api.FaxDeliveryReceiptRulesApi;

public class delete_fax_delivery_receipt_rule {
  public static void main(String[] args) {
    ApiClient defaultClient = new ApiClient();
    defaultClient.setUsername("USERNAME");
    defaultClient.setPassword("API_KEY");
    FaxDeliveryReceiptRulesApi apiInstance = new FaxDeliveryReceiptRulesApi(defaultClient);
    Integer receiptRuleId = 130; // Integer | Receipt rule id
    try {
        String result = apiInstance.faxDeliveryReceiptAutomationDelete(receiptRuleId);
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling FaxDeliveryReceiptRulesApi#faxDeliveryReceiptAutomationDelete");
        e.printStackTrace();
    }
  }
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "Your rule incoming fax receipt has been deleted.",
  "data": null
}

https://rest.clicksend.com/v3/automations/fax/receipts/{receipt_rule_id}

Delete fax delivery receipt automation

Delete fax delivery receipt automation

Parameters

Parameter In Type Required Description
receipt_rule_id path integer(int32) true Receipt rule id

Refer to Status Codes for definitions of HTTP status code responses.

MMS

Send MMS

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
     --request POST \
     --header "Content-Type: application/json" \

     --data-binary "    {
        \"media_file\":\"http://yourdomain.com/tpLaX6A.gif\",
        \"messages\":[
           {
             \"source\" : \"php\",
             \"subject\": \"This is a subject\",
             \"from\" : \"test\",
             \"body\" : \"This is a test body with special character: 英\",
             \"to\": \"+61437111222\",
             \"country\": \"AU\"
           }
        ]
    }" \
'https://rest.clicksend.com/v3/mms/send'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\MMSApi(new GuzzleHttp\Client(),$config);
$mms_message = new \ClickSend\Model\MmsMessage();
$mms_message->setTo("+61437111222");
$mms_message->setBody("This is a test body with special character");
$mms_message->setSubject("This is a subject");
$mms_message->setFrom("test");
$mms_message->setCountry("AU");
$mms_message->setSource("php");
$mms_message->setListId(185161);
$mms_message->setCustomString("custom");
$mms_message->setFromEmail("xxx@gmail.com");
// \ClickSend\Model\MmsMessageCollection | MmsMessageCollection model
$mms_messages = new \ClickSend\Model\MmsMessageCollection();
$mms_messages->setMediaFile("https://media.tenor.com/images/a3c2a6cf42e0ac49ebd7cd347d10fe94/tenor.gif");
$mms_messages->setMessages([$mms_message]);

try {
    $result = $apiInstance->mmsSendPost($mms_messages);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling MMSApi->mmsSendPost: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME, 
    Password = API_KEY  
};
var mmsApi = new MMSApi(configuration);
var listOfMessages = new List<MmsMessage>();
listOfMessages.Add(new MmsMessage() { 
    To = "+11231231234",
    Body = "This is test body",
    Subject = "test subject",
    From = "+11231231234",
    Country = "CA",
    Source = "sdk",
    Schedule = TimeStamp,
    CustomString = "Custom String",
    FromEmail = "john@doe.com"
});
var mmsCollection = new MmsMessageCollection("https://yourdomain.com/file.jpg", listOfMessages);
var response = mmsApi.MmsSendPost(mmsCollection);
var api = require('./api.js');

var mmsApi = new api.MMSApi("USERNAME", "API_KEY");

var mmsMessage = new api.MmsMessage();

mmsMessage.to = "+61437111222";
mmsMessage.body = "body";
mmsMessage.subject = "subject";
mmsMessage.from = "abc@gmail.com";
mmsMessage.country = "US";
mmsMessage.source = "source";
mmsMessage.listId = 185161;
mmsMessage.customString = "custom";
mmsMessage.fromEmail = "xxx@gmail.com";

var mmsMessages = new api.MmsMessageCollection();

mmsMessages.mediaFile = "https://yourdomain/sample.gif";
mmsMessages.messages = [mmsMessage]

mmsApi.mmsSendPost(mmsMessages).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::MMSApi.new

# MmsMessageCollection | MmsMessageCollection model
mms_messages = ClickSendClient::MmsMessageCollection.new(
  "media_file": "media_file",
  messages: [
    ClickSendClient::MmsMessage.new(
      "schedule": 0,
      "subject": "subject",
      "from": "from",
      "to": "+61411111111",
      "source": "sdk",
      "body": "body",
      "custom_string": "custom_string"
    ),
    ClickSendClient::MmsMessage.new(
      "schedule": 0,
      "subject": "subject",
      "from": "from",
      "to": "+61422222222",
      "source": "sdk",
      "body": "body",
      "custom_string": "custom_string"
    )
  ]
)

begin
  # Send MMS
  result = api_instance.mms_send_post(mms_messages)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling MMSApi->mms_send_post: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client import MmsMessage
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.MMSApi(clicksend_client.ApiClient(configuration))
MmsMessage=MmsMessage(to='+61437111222',
                      body='This is a test body with special character',
                      subject='This is a subject',
                      _from='test',
                      country='AU')
mms_messages = clicksend_client.MmsMessageCollection(
              media_file='https://test.com/test.gif',
              messages=[MmsMessage])
try:
    # Send MMS
    api_response = api_instance.mms_send_post(mms_messages)
    print(api_response)
except ApiException as e:
    print("Exception when calling MMSApi->mms_send_post: %s\n" % e)
use WWW::ClickSendClient::MMSApi;
use WWW::ClickSendClient::Object::MmsMessageCollection;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::MMSApi->new(username => $username, password => $password);

my %params = (
    'media_file' => 'https://domain.com/Example.jpg',
    'messages'   => [
        {
            'to'            => 'to',
            'body'          => 'body',
            'subject'       => 'subject',
            'from'          => 'from',
            'country'       => 'country',
            'source'        => 'source',
            'schedule'      => 'schedule',
            'custom_string' => 'custom_string',
            'from_email'    => 'from_email',
            'messages'      => 'messages',
        }
    ],
);

my $mms_messages_obj = WWW::ClickSendClient::Object::MmsMessageCollection->new(%params);

my $json_output = $api->mms_send_post('mms_messages' => $mms_messages_obj);

print $json_output;
#import "CSSmsApi.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
[apiConfig setUsername:@"USERNAME"];
[apiConfig setPassword:@"PASSWORD"];

CSSmsMessage *smsMessages = [[CSSmsMessage alloc] init];
smsMessages.from = @"from";
smsMessages.body = @"body";
smsMessages.to = @"to";
smsMessages.source = @"objc";
smsMessages.schedule = nil;
smsMessages.customString = @"custom_string";
smsMessages.listId = nil;
smsMessages.country = @"country";
smsMessages.fromEmail = @"from_email";

CSSmsMessageCollection *smsMessagesCollection = [[CSSmsMessageCollection alloc] init];

CSSMSApi *smsApiInstance = [[CSSMSApi alloc] init];
[smsApiInstance smsSendPostWithSmsMessages:smsMessagesCollection completionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire

if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}

let messages = MmsMessage(to: "to",
                          body: "body",
                          subject: "subject",
                          from: "from",
                          country: "country",
                          source: "swift",
                          listId: 1,
                          schedule: nil,
                          customString: "custom_string",
                          fromEmail: nil)

let mmsMessages =  MmsMessageCollection(mediaFile: "mediaFile", messages: [messages])
MMSAPI.mmsSendPost(mmsMessages: mmsMessages) { (dataString, error) in
    guard let dataString = dataString else {
        print(error!)
        return
    }
    if let data = dataString.data(using: String.Encoding.utf8) {
        do {
            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                print(dictonary)
            } else {
                print("Cannot convert the String value to JSON")
            }
        } catch let error as NSError {
            print(error)
        }
    }
}
    Coming Soon
package ClickSend;

import java.util.Arrays;
import java.util.List;
import ClickSend.Api.MmsApi;
import ClickSend.Model.MmsMessage;
import ClickSend.Model.MmsMessageCollection;

public class send_mms {
  public static void main(String[] args) {
    ApiClient defaultClient = new ApiClient();
    defaultClient.setUsername("USERNAME");
    defaultClient.setPassword("API_KEY");
    MmsApi apiInstance = new MmsApi(defaultClient);
    MmsMessage mmsMessage=new MmsMessage();
    mmsMessage.to("+61437111222");
    mmsMessage.body("This is a test body with special character");
    mmsMessage.subject("This is a subject");
    mmsMessage.from("test");
    mmsMessage.country("AU");
    mmsMessage.source("source");
    List<MmsMessage> mmsMessageList=Arrays.asList(mmsMessage);
    // MmsMessageCollection | MmsMessageCollection model
    MmsMessageCollection mmsMessages = new MmsMessageCollection(); 
    mmsMessages.mediaFile("https://test.com/test.gif");
    mmsMessages.messages(mmsMessageList);
    try {
        String result = apiInstance.mmsSendPost(mmsMessages);
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling MmsApi#mmsSendPost");
        e.printStackTrace();
    }
  }
}

Body parameter

{
  "messages": [
    {
      "subject": "subject",
      "from": "from",
      "to": "+61411111111",
      "source": "sdk",
      "body": "body",
      "custom_string": "custom_string"
    },
    {
      "subject": "subject",
      "from": "from",
      "to": "+61422222222",
      "source": "sdk",
      "body": "body",
      "custom_string": "custom_string"
    }
  ],
  "media_file": "media_file"
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "Messages queued for delivery.",
  "data": {
    "total_price": 19.36,
    "total_count": 1,
    "queued_count": 1,
    "messages": [
      {
        "list_id": null,
        "contact_id": 4,
        "message_id": "D7A79BF1-4806-43F8-8339-6B9F8385D9A4",
        "to": "+61298444214",
        "subject": "This is a subject",
        "from": "+61411111111",
        "body": "John This is a test message.",
        "country": "AU",
        "custom_string": "",
        "schedule": "",
        "message_parts": 1,
        "message_price": "2.4200",
        "_media_file_url": "https://yourdomain.com/tpLaX6A.gif",
        "status": "SUCCESS"
      }
    ]
  }
}

https://rest.clicksend.com/v3/mms/send

Send MMS

You can post up to 1000 messages with each API call. You can send to a mix of contacts and contact lists, as long as the total number of recipients is up to 1000. The response contains a status and details for each recipient.

Refer to Application Status Codes for the possible response message status strings.

How many characters can I send in a message?

Standard MMS Message

1500 characters

Unicode MMS Message

500 characters

If a message is longer the allowed number of characters it will be truncated. If a message contains any characters that aren't in the GSM 03.38 character set, the message type will be treated as unicode. (https://en.wikipedia.org/wiki/GSM_03.38)

Maximum File Size

You can send a single attachment with a size of up to 250 kB. Some older devices can only accept attachments with up to 30 kB.

Supported File Types

Images

File type Required to be passed to uploads endpoint first?
jpg No
gif No
jpeg Yes
png Yes
bmp Yes

Properties

Name Type Required Restrictions Description
media_file string true none Media file you want to send
to string true none Recipient phone number in E.164 format
body string true none Your message
subject string true none Subject line (max 20 characters)
from string true yes Your sender id

Refer to Status Codes for definitions of HTTP status code responses.

Calculate MMS Price

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
     --request POST \
     --header "Content-Type: application/json" \

     --data-binary "    {
        \"media_file\":\"http://yourdomain.com/tpLaX6A.gif\",
        \"messages\":[
           {
             \"source\" : \"php\",
             \"subject\": \"This is a subject\",
             \"from\" : \"test\",
             \"body\" : \"This is a test body with special character: 英\",
             \"to\": \"+61437111222\",
             \"country\": \"AU\"
           }
        ]
    }" \
'https://rest.clicksend.com/v3/mms/price'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\MMSApi(new GuzzleHttp\Client(),$config);
$mms_message = new \ClickSend\Model\MmsMessage();
$mms_message->setTo("+61437111222");
$mms_message->setBody("This is a test body with special character");
$mms_message->setSubject("This is a subject");
$mms_message->setFrom("test");
$mms_message->setCountry("AU");
$mms_message->setSource("php");
$mms_message->setListId(185161);
$mms_message->setCustomString("custom");
$mms_message->setFromEmail("xxx@gmail.com");
// \ClickSend\Model\MmsMessageCollection | MmsMessageCollection model
$mms_messages = new \ClickSend\Model\MmsMessageCollection();
$mms_messages->setMediaFile("https://media.tenor.com/images/a3c2a6cf42e0ac49ebd7cd347d10fe94/tenor.gif");
$mms_messages->setMessages([$mms_message]);

try {
    $result = $apiInstance->mmsPricePost($mms_messages);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling MMSApi->mmsPricePost: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME, 
    Password = API_KEY  
};
var mmsApi = new MMSApi(configuration);
var listOfMessages = new List<MmsMessage>();
listOfMessages.Add(new MmsMessage(
    to: "+11231231234",
    body: "This is test body",
    subject: "test subject",
    from: "+11231231234",
    country: "CA",
    source: "sdk",
    schedule: TimeStamp,
    customString: "Custom String",
    fromEmail: "john@doe.com"
));
var mmsCollection = new MmsMessageCollection("https://mydomain.com/file.jpg", listOfMessages);
var response = mmsApi.MmsPricePost(mmsCollection);
var api = require('./api.js');

var mmsApi = new api.MMSApi("USERNAME", "API_KEY");

var mmsMessage = new api.MmsMessage();

mmsMessage.to = "+61437111222";
mmsMessage.body = "body";
mmsMessage.subject = "subject";
mmsMessage.from = "abc@gmail.com";
mmsMessage.country = "US";
mmsMessage.source = "source";
mmsMessage.listId = 185161;
mmsMessage.customString = "custom";
mmsMessage.fromEmail = "xxx@gmail.com";

var mmsMessages = new api.MmsMessageCollection();

mmsMessages.mediaFile = "https://your-domain/sample.gif";
mmsMessages.messages = [mmsMessage]

mmsApi.mmsPricePost(mmsMessages).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::MMSApi.new

# MmsMessageCollection | MmsMessageCollection model
mms_messages = ClickSendClient::MmsMessageCollection.new(
  "media_file": "media_file",
  messages: [
    ClickSendClient::MmsMessage.new(
      "subject": "subject",
      "from": "from",
      "to": "+61411111111",
      "source": "sdk",
      "body": "body",
      "custom_string": "custom_string"
    ),
    ClickSendClient::MmsMessage.new(
      "subject": "subject",
      "from": "from",
      "to": "+61422222222",
      "source": "sdk",
      "body": "body",
      "custom_string": "custom_string"
    )
  ]
)

begin
  # Get Price for MMS sent
  result = api_instance.mms_price_post(mms_messages)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling MMSApi->mms_price_post: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client import MmsMessage
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.MMSApi(clicksend_client.ApiClient(configuration))
MmsMessage=MmsMessage(to='+61437111222',
                      body='This is a test body with special character',
                      subject='This is a subject',
                      _from='test',
                      country='AU')
# MmsMessageCollection | MmsMessageCollection model
mms_messages = clicksend_client.MmsMessageCollection(
                media_file='https://test.com/test.gif',
                messages=[MmsMessage]) 

try:
    # Get Price for MMS sent
    api_response = api_instance.mms_price_post(mms_messages)
    print(api_response)
except ApiException as e:
    print("Exception when calling MMSApi->mms_price_post: %s\n" % e)
use WWW::ClickSendClient::MMSApi;
use WWW::ClickSendClient::Object::MmsMessageCollection;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::MMSApi->new(username => $username, password => $password);

my %params = (
    'media_file' => 'https://domain.com/Example.jpg',
    'messages'   => [
        {
            'to'            => 'to',
            'body'          => 'body',
            'subject'       => 'subject',
            'from'          => 'from',
            'country'       => 'country',
            'source'        => 'source',
            'schedule'      => 'schedule',
            'custom_string' => 'custom_string',
            'from_email'    => 'from_email',
            'messages'      => 'messages',
        }
    ],
);

my $mms_messages_obj = WWW::ClickSendClient::Object::MmsMessageCollection->new(%params);

my $json_output = $api->mms_price_post('mms_messages' => $mms_messages_obj);

print $json_output;
#import "CSSmsApi.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
[apiConfig setUsername:@"USERNAME"];
[apiConfig setPassword:@"PASSWORD"];

CSSmsMessage *smsMessages = [[CSSmsMessage alloc] init];
smsMessages.from = @"from";
smsMessages.body = @"body";
smsMessages.to = @"to";
smsMessages.source = @"objc";
smsMessages.schedule = nil;
smsMessages.customString = @"custom_string";
smsMessages.listId = nil;
smsMessages.country = @"country";
smsMessages.fromEmail = @"from_email";

CSSmsMessageCollection *smsMessagesCollection = [[CSSmsMessageCollection alloc] init];

CSSMSApi *smsApiInstance = [[CSSMSApi alloc] init];
[smsApiInstance smsPricePostWithSmsMessages:smsMessagesCollection completionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire

if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}

let messages = MmsMessage(to: "to",
                          body: "body",
                          subject: "subject",
                          from: "from",
                          country: "country",
                          source: "swift",
                          listId: 1,
                          schedule: nil,
                          customString: nil,
                          fromEmail: nil)

let mmsMessages = MmsMessageCollection(mediaFile: "media_file", messages: [messages])
MMSAPI.mmsPricePost(mmsMessages:mmsMessages) { (dataString, error) in
    guard let dataString = dataString else {
        print(error!)
        return
    }
    if let data = dataString.data(using: String.Encoding.utf8) {
        do {
            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                print(dictonary)
            } else {
                print("Cannot convert the String value to JSON")
            }
        } catch let error as NSError {
            print(error)
        }
    }
}
    Coming Soon
package ClickSend;

import java.util.Arrays;
import java.util.List;
import ClickSend.Api.MmsApi;
import ClickSend.Model.MmsMessage;
import ClickSend.Model.MmsMessageCollection;

public class calculate_mms_price {
  public static void main(String[] args) {
    ApiClient defaultClient = new ApiClient();
    defaultClient.setUsername("USERNAME");
    defaultClient.setPassword("API_KEY");
    MmsApi apiInstance = new MmsApi(defaultClient);
    MmsMessage mmsMessage=new MmsMessage();
    mmsMessage.to("+61437111222");
    mmsMessage.body("This is a test body with special character");
    mmsMessage.subject("This is a subject");
    mmsMessage.from("test");
    mmsMessage.country("AU");
    mmsMessage.source("source");
    List<MmsMessage> mmsMessageList=Arrays.asList(mmsMessage);
    // MmsMessageCollection | MmsMessageCollection model
    MmsMessageCollection mmsMessages = new MmsMessageCollection(); 
    mmsMessages.mediaFile("https://test.com/test.gif");
    mmsMessages.messages(mmsMessageList);
    try {
        String result = apiInstance.mmsPricePost(mmsMessages);
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling MmsApi#mmsPricePost");
        e.printStackTrace();
    }
  }
}

Body parameter

{
  "messages": [
    {
      "subject": "subject",
      "from": "from",
      "to": "+61411111111",
      "source": "sdk",
      "body": "body",
      "custom_string": "custom_string"
    },
    {
      "subject": "subject",
      "from": "from",
      "to": "+61422222222",
      "source": "sdk",
      "body": "body",
      "custom_string": "custom_string"
    }
  ],
  "media_file": "media_file"
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "Messages queued for delivery.",
  "data": {
    "total_price": 19.36,
    "total_count": 1,
    "queued_count": 1,
    "messages": [
      {
        "list_id": null,
        "contact_id": 4,
        "message_id": "2E7EFEC7-70FE-4E29-8F80-31A2F59003E8",
        "to": "+61298444214",
        "subject": "This is a subject",
        "from": "test",
        "body": "John This is a test message.",
        "country": "AU",
        "custom_string": "",
        "schedule": "",
        "message_parts": 1,
        "message_price": "2.4200",
        "_media_file_url": "http://yourdomain.com/_mms/279FDB02-DC5A-449C-869A-AFB5F0E632B4.gif",
        "status": "SUCCESS"
      }
    ]
  }
}

https://rest.clicksend.com/v3/mms/price

Get Price for MMS sent

Properties

Name Type Required Restrictions Description
media_file string true none Media file you want to send
to string true none Recipient phone number in E.164 format
body string true none Your message
subject string true none Subject line (max 20 characters)
from string true yes Your sender id

Refer to Status Codes for definitions of HTTP status code responses.

View MMS History

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \

'https://rest.clicksend.com/v3/mms/history?date_from=&date_to='
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\MMSApi(new GuzzleHttp\Client(),$config);
$q = "q_example"; // string | Custom query Example: from:{number},status_code:201.
$date_from = '1436879372'; // int | Start date
$date_to = '1436879372'; // int | End date
$page = 1; // int | Page number
$limit = 10; // int | Number of records per page

try {
    $result = $apiInstance->mmsHistoryGet($q, $date_from, $date_to, $page, $limit);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling MMSApi->mmsHistoryGet: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME, 
    Password = API_KEY  
};
var mmsApi = new MMSApi(configuration);

var q = "q_example";
var dateFrom = '1436879372';
var dateTo = '1436879372';
var page = 1;
var limit = 10;

var response = mmsApi.MmsHistoryGet(q, dateFrom, dateTo, page, limit);
var api = require('./api.js');

var mmsApi = new api.MMSApi("USERNAME", "API_KEY");

var q = "q_example";
var dateFrom = '1436879372';
var dateTo = '1436879372';
var page = 1;
var limit = 10;

mmsApi.mmsHistoryGet(q, dateFrom, dateTo, page, limit).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::MMSApi.new

opts = {
  date_from: 1436849372, # Integer | Start date
  date_to: 1436879372,   # Integer | End date
  page: 1,       # Integer | Page number
  limit: 10      # Integer | Number of records per page
}

begin
  # Get all mms history
  result = api_instance.mms_history_get(opts)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling MMSApi->mms_history_get: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.MMSApi(clicksend_client.ApiClient(configuration))
date_from = 1436879372 # int | Start date (optional)
date_to = 1436879372 # int | End date (optional)
page = 1 # int | Page number (optional) (default to 1)
limit = 10 # int | Number of records per page (optional) (default to 10)

try:
    # Get all mms history
    api_response = api_instance.mms_history_get(date_from=date_from, date_to=date_to, page=page, limit=limit)
    print(api_response)
except ApiException as e:
    print("Exception when calling MMSApi->mms_history_get: %s\n" % e)
use WWW::ClickSendClient::MMSApi;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::MMSApi->new(username => $username, password => $password);

my $json_output = $api->mms_history_get('date_from' => '1436879372','date_to' => '1446879372' , 'page'  => '1','limit'=> '20');

print $json_output;
#import "CSMMSApi.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
// Configure HTTP basic authorization (authentication scheme: BasicAuth)
[apiConfig setUsername:@"YOUR_USERNAME"];
[apiConfig setPassword:@"YOUR_PASSWORD"];


CSMMSApi *mmsAPI = [[CSMMSApi alloc] init];

NSNumber *dateFromTimestamp = [NSNumber numberWithInt:1436849372];
NSNumber *dateToTimestamp = [NSNumber numberWithInt:1436879372];

[mmsAPI mmsHistoryGetWithQ:@"" dateFrom:dateFromTimestamp dateTo:dateToTimestamp page:@(1) limit:@(15) completionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire

if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}

MMSAPI.mmsHistoryGet { (dataString, error) in
    guard let dataString = dataString else {
        print(error!)
        return
    }

    if let data = dataString.data(using: String.Encoding.utf8) {
        do {
            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                print(dictonary)
            } else {
                print("Cannot convert the String value to JSON")
            }
        } catch let error as NSError {
            print(error)
        }
    }
}
    Coming Soon
package ClickSend;

import ClickSend.Api.MmsApi;

public class view_mms_history {
  public static void main(String[] args) {
    ApiClient defaultClient = new ApiClient();
    defaultClient.setUsername("USERNAME");
    defaultClient.setPassword("API_KEY");
    MmsApi apiInstance = new MmsApi(defaultClient);
    // String | Custom query Example: from:{number},status_code:201.
    String q = "q_example"; 
    Integer dateFrom = 1436879372; // Integer | Start date
    Integer dateTo = 1436879372; // Integer | End date
    Integer page = 1; // Integer | Page number
    Integer limit = 10; // Integer | Number of records per page
    try {
      String result = apiInstance.mmsHistoryGet(q, dateFrom, dateTo, page, limit);
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling MmsApi#mmsHistoryGet");
        e.printStackTrace();
    }
  }
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "Here are your data.",
  "data": {
    "total": 1,
    "per_page": 15,
    "current_page": 1,
    "last_page": 1,
    "next_page_url": null,
    "prev_page_url": null,
    "from": 1,
    "to": 1,
    "data": [
      {
        "direction": "out",
        "date": "1436932432",
        "to": "+16783270696",
        "body": "Chocolate bar icing icing oat cake carrot cake jelly cotton 1iQByXxdLN.",
        "status": "Completed",
        "from": "sendlist",
        "schedule": "1436879372",
        "status_code": null,
        "status_text": null,
        "error_code": null,
        "error_text": null,
        "message_id": "4E90F4C3-43A3-489D-9AB8-DA1F4332A0C3",
        "message_parts": "1.00",
        "message_price": "0.070000",
        "from_email": null,
        "list_id": null,
        "custom_string": "this is a test",
        "contact_id": 0,
        "user_id": 1,
        "subaccount_id": 1,
        "country": "US",
        "carrier": "",
        "first_name": "John",
        "last_name": "Doe",
        "_api_username": "johndoe"
      }
    ]
  }
}

https://rest.clicksend.com/v3/mms/history

Get all mms history

Parameters

Parameter In Type Required Description
date_from query integer(int32) false Start date (Unix Timestamp e.g. 1436849372)
date_to query integer(int32) false End date (Unix Timestamp e.g. 1436879372)
page query integer(int32) false Page number
limit query integer(int32) false Number of records per page

Refer to Status Codes for definitions of HTTP status code responses.

Export MMS History

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \

'https://rest.clicksend.com/v3/mms/history/export?filename={filename}'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\MMSApi(new GuzzleHttp\Client(),$config);
$filename = "filename_example"; // string | Filename to download history as

try {
    $result = $apiInstance->mmsHistoryExportGet($filename);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling MMSApi->mmsHistoryExportGet: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME, 
    Password = API_KEY  
};
var mmsApi = new MMSApi(configuration);
var response = mmsApi.MmsHistoryExportGet("File Name");
var api = require('./api.js');

var mmsApi = new api.MMSApi("USERNAME", "API_KEY");

var filename = "filename";

mmsApi.mmsHistoryExportGet(filename).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
  config.username = 'USERNAME'
  config.password = 'API_KEY'
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
end

api_instance = ClickSendClient::MMSApi.new

filename = "filename_example" # String | Filename to download history as

begin
  # Export all mms history
  result = api_instance.mms_history_export_get(filename)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling MMSApi->mms_history_export_get: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.MMSApi(clicksend_client.ApiClient(configuration))
filename = 'mms_history' # str | Filename to download history as

try:
    # Export all mms history
    api_response = api_instance.mms_history_export_get(filename)
    print(api_response)
except ApiException as e:
    print("Exception when calling MMSApi->mms_history_export_get: %s\n" % e)
use WWW::ClickSendClient::MMSApi;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::MMSApi->new(username => $username, password => $password);

my $json_output = $api->mms_history_export_get('filename' => 'test_file');

print $json_output;
#import "CSMMSApi.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
// Configure HTTP basic authorization (authentication scheme: BasicAuth)
[apiConfig setUsername:@"YOUR_USERNAME"];
[apiConfig setPassword:@"YOUR_PASSWORD"];

CSMMSApi *mmsAPI = [[CSMMSApi alloc] init];
[mmsAPI mmsHistoryExportGetWithFilename:@"string" completionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire

if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}

MMSAPI.mmsHistoryExportGet(filename: "test.csv") { (dataString, error) in
    guard let dataString = dataString else {
        print(error!)
        return
    }

    if let data = dataString.data(using: String.Encoding.utf8) {
        do {
            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                print(dictonary)
            } else {
                print("bad json")
            }
        } catch let error as NSError {
            print(error)
        }
    }
}
    Coming Soon
package ClickSend;

import ClickSend.Api.MmsApi;

public class export_mms_history {
  public static void main(String[] args) {
    ApiClient defaultClient = new ApiClient();
    defaultClient.setUsername("USERNAME");
    defaultClient.setPassword("API_KEY");
    MmsApi apiInstance = new MmsApi(defaultClient);
    // String | Filename to download history as
    String filename = "filename_example"; 
    try {
        String result = apiInstance.mmsHistoryExportGet(filename);
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling MmsApi#mmsHistoryExportGet");
        e.printStackTrace();
    }
  }
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "Download your file here.",
  "data": {
    "url": "https://rest.clicksend.com/files/22D55AF9-6CF0-476D-A8B3-82A998FD2738?filename=export.csv"
  }
}

https://rest.clicksend.com/v3/mms/history/export

Export all mms history

Parameters

Parameter In Type Required Description
filename query string true Filename to download history as

Refer to Status Codes for definitions of HTTP status code responses.

MMS Campaign

Send MMS Campaign

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
     --request POST \

     --header "Content-Type: application/json" \
     --data-binary "{
    \"list_id\":428,
    \"name\":\"My Campaign 1\",
    \"from\":\"+61353787448\",
    \"body\":\"This is my new campaign message.\",
    \"schedule\":1444821615,
    \"subject\": \"test\",
    \"media_file\": \"http://yourdomain.com/tpLaX6A.gif\"
}" \
'https://rest.clicksend.com/v3/mms-campaigns/send'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\MmsCampaignApi(new GuzzleHttp\Client(),$config);
$campaign = new \ClickSend\Model\MmsCampaign(); // \ClickSend\Model\MmsCampaign | MmsCampaign model
$campaign->setListId(185161);
$campaign->setName("My Campaign 1");
$campaign->setBody("This is my new campaign message.");
$campaign->setFrom("+61353787448");
$campaign->setSchedule(1577013061);
$campaign->setSubject("test");
$campaign->setMediaFile("https://media.tenor.com/images/a3c2a6cf42e0ac49ebd7cd347d10fe94/tenor.gif");

try {
    $result = $apiInstance->mmsCampaignsSendPost($campaign);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling MmsCampaignApi->mmsCampaignsSendPost: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME,
    Password = API_KEY  
};
var mmsCampaignApi = new MmsCampaignApi(configuration);
var response = mmsCampaignApi.MmsCampaignsSendPost(new MmsCampaign() {
    ListId =  LIST_ID,
    Name = "Name",
    Body = "This is test body",
    From = "+11231231234",
    Schedule = TimeStamp,
    Subject = "Test subject",
    MediaFile = "https://yourdomain.com/file.jpg"
});
var api = require('./api.js');

var mmsCampaignApi = new api.MmsCampaignApi("USERNAME", "API_KEY");

var campaign = new api.MmsCampaign();

campaign.listId = 185161;
campaign.name = "My Campaign 1";
campaign.body = "This is my new campaign message.";
campaign.from = "+61353787448";
campaign.subject = "subject";
campaign.mediaFile = "https://thumbs.gfycat.com/BelatedComplexJerboa-small.gif";

mmsCampaignApi.mmsCampaignsSendPost(campaign).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::MmsCampaignApi.new

# MmsCampaign | MmsCampaign model
campaign = ClickSendClient::MmsCampaign.new(
  "schedule": 0,
  "list_id": 1234,
  "name": "name",
  "from": "from",
  "body": "body",
  "subject": "subject",
  "media_file": "media_file_url"
)

begin
  # Create mms campaign
  result = api_instance.mms_campaigns_send_post(campaign)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling MmsCampaignApi->mms_campaigns_send_post: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.MmsCampaignApi(clicksend_client.ApiClient(configuration))
# MmsCampaign | MmsCampaign model
campaign = clicksend_client.MmsCampaign(
            list_id=185161,
            name="My Campaign 1",
            _from="+61353787448",
            body="This is my new campaign message.",
            schedule=1444821615,
            subject="test",
            media_file="http://yourdomain.com/tpLaX6A.gif")

try:
    # Create mms campaign
    api_response = api_instance.mms_campaigns_send_post(campaign)
    print(api_response)
except ApiException as e:
    print("Exception when calling MmsCampaignApi->mms_campaigns_send_post: %s\n" % e)
use WWW::ClickSendClient::MmsCampaignApi;
use WWW::ClickSendClient::Object::MmsCampaign;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::MmsCampaignApi->new(username => $username, password => $password);

my %params = (
    'list_id'    => 'list_id',
    'name'       => 'name',
    'body'       => 'body',
    'from'       => 'from',
    'schedule'   => 'schedule',
    'subject'    => 'subject',
    'media_file' => 'media_file_url'
);

my $mms_obj = WWW::ClickSendClient::Object::MmsCampaign->new(%params);
my $json_output = $api->mms_campaigns_send_post('campaign' => $mms_obj);

print $json_output;
#import "CSMmsCampaign.h"
#import "CSDefaultConfiguration.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
// Configure HTTP basic authorization (authentication scheme: BasicAuth)
[apiConfig setUsername:@"USERNAME"];
[apiConfig setPassword:@"PASSWORD"];

CSMmsCampaign *campaign = [[CSMmsCampaign alloc] init];
campaign.listId = @(428);
campaign.name = @"name";
campaign.body = @"body";
campaign.from = @"+61353787448";
campaign.subject = @"subject";
campaign.mediaFile = @"http://yourdomain.com/tpLaX6A.gif";

CSMmsCampaignApi *mmsCampaignApi = [[CSMmsCampaignApi alloc] init];
[mmsCampaignApi mmsCampaignsSendPostWithCampaign:campaign completionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire
if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}

let mmsCampaign = MmsCampaign(
                    listId: 428,
                    name: "name",
                    body: "body",
                    from: "+61353787448",
                    schedule: nil,
                    subject: "subject",
                    mediaFile: "http://yourdomain.com/tpLaX6A.gif"
                )

MmsCampaignAPI.mmsCampaignsSendPost(campaign: mmsCampaign) { (dataString, error) in
    if let error = error {
        print(error)
    } else {
        if let data = dataString!.data(using: String.Encoding.utf8) {
            do {
                if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                    print(dictonary)
                } else {
                    print("Cannot convert the String value to JSON")
                }
            } catch let error as NSError {
                print(error)
            }
        }
    }
}
    Coming Soon
package ClickSend;

import ClickSend.Api.MmsCampaignApi;
import ClickSend.Model.MmsCampaign;

public class create_mms_campaign {
  public static void main(String[] args) {
    ApiClient defaultClient = new ApiClient();
    defaultClient.setUsername("USERNAME");
    defaultClient.setPassword("API_KEY");
    MmsCampaignApi apiInstance = new MmsCampaignApi(defaultClient);
    MmsCampaign campaign = new MmsCampaign(); // MmsCampaign | MmsCampaign model
    campaign.listId(new Integer(185161));
    campaign.name("My Campaign 1");
    campaign.body("This is my new campaign message.");
    campaign.from("+61353787448");
    campaign.schedule(new Integer(1545477071));
    campaign.subject("test");
    campaign.mediaFile("http://yourdomain.com/tpLaX6A.gif");
    try {
        String result = apiInstance.mmsCampaignsSendPost(campaign);
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling MmsCampaignApi#mmsCampaignsSendPost");
        e.printStackTrace();
    }

  }
}

Body parameter

{
  "schedule": 0,
  "list_id": 1234,
  "name": "name",
  "from": "from",
  "body": "body",
  "subject": "subject",
  "media_file": "media_file_url"
}

Response

{
    "http_code": 200,
    "response_code": "SUCCESS",
    "response_msg": "MMS campaign has been created.",
    "data": {
        "mms_campaign_id": 96,
        "name": "Koala Campaign",
        "user_id": 20807,
        "subaccount_id": 15,
        "list_id": 85262,
        "from": "0451919865",
        "subject": "New MMS campaign test",
        "file_name": "8EA5FA8C-3216-4A5D-86EA-6BE78050E439.jpg",
        "body": "Hey (First Name), I want to ask if this is your lastname: (Last Name)? Also, do you like koalas? Visit http://smsu.io/xxxxx for more details.",
        "schedule": 1531800743,
        "status": "Queued",
        "date_added": 1531800745,
        "_total_count": 1,
        "_list_name": "test",
        "_media_file_url": "http://rest.clicksend.clicksend/files/8EA5FA8C-3216-4A5D-86EA-6BE78050E439.jpg"
    }
}

https://rest.clicksend.com/v3/mms-campaigns/send

Create mms campaign

Properties

Name Type Required Restrictions Description
list_id integer(int32) true none Your list id.
name string true none Your campaign name.
body string true none Your campaign message.
from string true yes Your sender id
schedule integer(int32) false none Your schedule timestamp.
subject string true none Subject of MMS campaign.
media_file string true none URL pointing to media file.

Refer to Status Codes for definitions of HTTP status code responses.

Calculate MMS Campaign Price

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
     --request POST \

     --header "Content-Type: application/json" \
     --data-binary "{
    \"list_id\":428,
    \"name\":\"My Campaign 1\",
    \"from\":\"+61353787448\",
    \"body\":\"(First Name), this is your new campaign message.\",
    \"subject\": \"test\",
    \"media_file\": \"http://yourdomain.com/tpLaX6A.gif\"
}" \
'https://rest.clicksend.com/v3/mms-campaigns/price'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\MmsCampaignApi(new GuzzleHttp\Client(),$config);
$campaign = new \ClickSend\Model\MmsCampaign(); // \ClickSend\Model\MmsCampaign | MmsCampaign model
$campaign->setListId(185161);
$campaign->setName("My Campaign 1");
$campaign->setBody("This is my new campaign message.");
$campaign->setFrom("+61353787448");
$campaign->setSchedule(1577013061);
$campaign->setSubject("test");
$campaign->setMediaFile("https://media.tenor.com/images/a3c2a6cf42e0ac49ebd7cd347d10fe94/tenor.gif");

try {
    $result = $apiInstance->mmsCampaignsPricePost($campaign);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling MmsCampaignApi->mmsCampaignsPricePost: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME,
    Password = API_KEY  
};
var mmsCampaignApi = new MmsCampaignApi(configuration);
var response = mmsCampaignApi.MmsCampaignsPricePost(new MmsCampaign() {
    ListId =  LIST_ID,
    Name = "Name",
    Body = "This is test body",
    From = "+11231231234",
    Schedule = TimeStamp,
    Subject = "Test subject",
    MediaFile = "https://yourdomain.com/file.jpg"
});
var api = require('./api.js');

var mmsCampaignApi = new api.MmsCampaignApi("USERNAME", "API_KEY");

var campaign = new api.MmsCampaign();

campaign.listId = 185161;
campaign.name = "My Campaign 1";
campaign.body = "This is my new campaign message.";
campaign.from = "+61353787448";
campaign.subject = "subject";
campaign.mediaFile = "https://thumbs.gfycat.com/BelatedComplexJerboa-small.gif";

mmsCampaignApi.mmsCampaignsPricePost(campaign).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::MmsCampaignApi.new

# MmsCampaign | MmsCampaign model
campaign = ClickSendClient::MmsCampaign.new(
  "schedule": 0,
  "list_id": 1234,
  "name": "name",
  "from": "from",
  "body": "body",
  "subject": "subject",
  "media_file": "media_file_url"
)

begin
  # Calculate price for mms campaign
  result = api_instance.mms_campaigns_price_post(campaign)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling MmsCampaignApi->mms_campaigns_price_post: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.MmsCampaignApi(clicksend_client.ApiClient(configuration))
# MmsCampaign | MmsCampaign model
campaign = clicksend_client.MmsCampaign(
            list_id=185161,
            name="My Campaign 1",
            _from="+61353787448",
            body="This is my new campaign message.",
            schedule=1444821615,
            subject="test",
            media_file="http://yourdomain.com/tpLaX6A.gif")

try:
    # Calculate price for mms campaign
    api_response = api_instance.mms_campaigns_price_post(campaign)
    print(api_response)
except ApiException as e:
    print("Exception when calling MmsCampaignApi->mms_campaigns_price_post: %s\n" % e)
use WWW::ClickSendClient::MmsCampaignApi;
use WWW::ClickSendClient::Object::MmsCampaign;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::MmsCampaignApi->new(username => $username, password => $password);

my %params = (
    'list_id'    => 'list_id',
    'name'       => 'name',
    'body'       => 'body',
    'from'       => 'from',
    'schedule'   => 'schedule',
    'subject'    => 'subject',
    'media_file' => 'media_file_url'
);

my $mms_obj = WWW::ClickSendClient::Object::MmsCampaign->new(%params);
my $json_output = $api->mms_campaigns_price_post('campaign' => $mms_obj);

print $json_output;
#import "CSMmsCampaign.h"
#import "CSDefaultConfiguration.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
// Configure HTTP basic authorization (authentication scheme: BasicAuth)
[apiConfig setUsername:@"USERNAME"];
[apiConfig setPassword:@"PASSWORD"];

CSMmsCampaign *campaign = [[CSMmsCampaign alloc] init];
campaign.listId = @(428);
campaign.name = @"name";
campaign.body = @"body";
campaign.from = @"+61353787448";
campaign.subject = @"subject";
campaign.mediaFile = @"http://yourdomain.com/tpLaX6A.gif";

CSMmsCampaignApi *mmsCampaignApi = [[CSMmsCampaignApi alloc] init];
[mmsCampaignApi mmsCampaignsPricePostWithCampaign:campaign completionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire
if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}

let mmsCampaign = MmsCampaign(listId: 428, name: "name", body: "body", from: "+61353787448", schedule: nil, subject: "subject", mediaFile: "http://yourdomain.com/tpLaX6A.gif")

MmsCampaignAPI.mmsCampaignsPricePost(campaign: mmsCampaign) { (dataString, error) in
    if let error = error {
        print(error)
    } else {
        if let data = dataString!.data(using: String.Encoding.utf8) {
            do {
                if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                    print(dictonary)
                } else {
                    print("Cannot convert the String value to JSON")
                }
            } catch let error as NSError {
                print(error)
            }
        }
    }
}
    Coming Soon
package ClickSend;

import ClickSend.Api.MmsCampaignApi;
import ClickSend.Model.MmsCampaign;

public class calculate_mms_campaign_price {
  public static void main(String[] args) {
    ApiClient defaultClient = new ApiClient();
    defaultClient.setUsername("USERNAME");
    defaultClient.setPassword("API_KEY");
    MmsCampaignApi apiInstance = new MmsCampaignApi(defaultClient);
    MmsCampaign campaign = new MmsCampaign(); // MmsCampaign | MmsCampaign model
    campaign.listId(new Integer(185161));
    campaign.name("My Campaign 1");
    campaign.body("This is my new campaign message.");
    campaign.from("+61353787448");
    campaign.schedule(new Integer(1545477071));
    campaign.subject("test");
    campaign.mediaFile("http://yourdomain.com/tpLaX6A.gif");
    try {
        String result = apiInstance.mmsCampaignsPricePost(campaign);
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling MmsCampaignApi#mmsCampaignsPricePost");
        e.printStackTrace();
    }
  }
}

Body parameter

{
  "schedule": 0,
  "list_id": 1234,
  "name": "name",
  "from": "from",
  "body": "body",
  "subject": "subject",
  "media_file": "media_file_url"
}

Response

{
    "http_code": 200,
    "response_code": "SUCCESS",
    "response_msg": "Here is your result.",
    "data": {
        "total_count": 1,
        "total_price": "0.429",
        "data": {
            "from": "+61411111111",
            "schedule": 1577833200,
            "body": "Hey test, I want to ask if this is your lastname: ? Also, do you like koalas?"
        },
        "_currency": {
            "currency_name_short": "AUD",
            "currency_prefix_d": "$",
            "currency_prefix_c": "c",
            "currency_name_long": "Australian Dollars"
        }
    }
}

https://rest.clicksend.com/v3/mms-campaigns/price

Calculate price for mms campaign

Properties

Name Type Required Restrictions Description
list_id integer(int32) true none Your list id.
name string true none Your campaign name.
body string true none Your campaign message.
from string true yes Your sender id
schedule integer(int32) false none Your schedule timestamp.
subject string true none Subject of MMS campaign.
media_file string true none URL pointing to media file.

Refer to Status Codes for definitions of HTTP status code responses.

Update MMS Campaign

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
     --request PUT \

     --header "Content-Type: application/json" \
     --data-binary "{
    \"list_id\":428,
    \"name\":\"Awesome campaign.\",
    \"from\":\"+61353787447\",
    \"body\":\"his is an awesome message.\",
    \"schedule\":1444821615,
    \"subject\": \"test\",
    \"media_file\": \"http://yourdomain.com/tpLaX6A.gif\"
}" \
'https://rest.clicksend.com/v3/mms-campaigns/{mms_campaign_id}'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\MmsCampaignApi(new GuzzleHttp\Client(),$config);
$mms_campaign_id = 2492; // int | ID of MMS campaign to update
$campaign = new \ClickSend\Model\MmsCampaign(); // \ClickSend\Model\MmsCampaign | MmsCampaign model
$campaign->setListId(185161);
$campaign->setName("My Campaign 1");
$campaign->setBody("This is my new campaign message.");
$campaign->setFrom("+61353787448");
$campaign->setSchedule(1577013061);
$campaign->setSubject("test");
$campaign->setMediaFile("https://media.tenor.com/images/a3c2a6cf42e0ac49ebd7cd347d10fe94/tenor.gif");

try {
    $result = $apiInstance->mmsCampaignsByMmsCampaignIdPut($mms_campaign_id, $campaign);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling MmsCampaignApi->mmsCampaignsByMmsCampaignIdPut: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME,
    Password = API_KEY  
};
var mmsCampaignApi = new MmsCampaignApi(configuration);
var response = mmsCampaignApi.MmsCampaignsByMmsCampaignIdPut(CAMPAIGN_ID,new MmsCampaign() {
    ListId =  LIST_ID,
    Name = "Name",
    Body = "This is test body",
    From = "+11231231234",
    Schedule = TimeStamp,
    Subject = "Test subject",
    MediaFile = "https://yourdomain.com/file.jpg"
});
var api = require('./api.js');

var mmsCampaignApi = new api.MmsCampaignApi("USERNAME", "API_KEY");

var mmsCampaignId = 2277;

var campaign = new api.MmsCampaign();

campaign.listId = 185161;
campaign.name = "My Campaign 1";
campaign.body = "This is my new campaign message.";
campaign.from = "+61353787448";
campaign.subject = "subject";
campaign.mediaFile = "https://thumbs.gfycat.com/BelatedComplexJerboa-small.gif";

mmsCampaignApi.mmsCampaignsByMmsCampaignIdPut(mmsCampaignId, campaign).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::MmsCampaignApi.new

mms_campaign_id = 56 # Integer | ID of MMS campaign to update

# MmsCampaign | MmsCampaign model
campaign = ClickSendClient::MmsCampaign.new(
  "schedule": 0,
  "list_id": 1234,
  "name": "name",
  "from": "from",
  "body": "body",
  "subject": "subject",
  "media_file": "media_file_url"
)

begin
  # Update mms campaign
  result = api_instance.mms_campaigns_by_mms_campaign_id_put(mms_campaign_id, campaign)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling MmsCampaignApi->mms_campaigns_by_mms_campaign_id_put: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.MmsCampaignApi(clicksend_client.ApiClient(configuration))
mms_campaign_id = 1641 # int | ID of MMS campaign to update
# MmsCampaign | MmsCampaign model
campaign = clicksend_client.MmsCampaign(
            list_id=185161,
            name="My Campaign 1",
            _from="+61353787448",
            body="This is my new campaign message.",
            schedule=1542884932,
            subject="test",
            media_file="http://yourdomain.com/tpLaX6A.gif")

try:
    # Update mms campaign
    api_response = api_instance.mms_campaigns_by_mms_campaign_id_put(mms_campaign_id, campaign)
    print(api_response)
except ApiException as e:
    print("Exception when calling MmsCampaignApi->mms_campaigns_by_mms_campaign_id_put: %s\n" % e)
use WWW::ClickSendClient::MmsCampaignApi;
use WWW::ClickSendClient::Object::MmsCampaign;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::MmsCampaignApi->new(username => $username, password => $password);

my %params = (
    'list_id'    => 'list_id',
    'name'       => 'name',
    'body'       => 'body',
    'from'       => 'from',
    'schedule'   => 'schedule',
    'subject'    => 'subject',
    'media_file' => 'media_file_url'
);

my $mms_obj = WWW::ClickSendClient::Object::MmsCampaign->new(%params);
my $json_output = $api->mms_campaigns_by_mms_campaign_id_put('campaign' => $mms_obj ,'mms_campaign_id' => '12345' );

print $json_output;
#import "CSMmsCampaign.h"
#import "CSDefaultConfiguration.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
// Configure HTTP basic authorization (authentication scheme: BasicAuth)
[apiConfig setUsername:@"USERNAME"];
[apiConfig setPassword:@"PASSWORD"];

CSMmsCampaign *campaign = [[CSMmsCampaign alloc] init];
campaign.listId = @(428);
campaign.name = @"name";
campaign.body = @"body";
campaign.from = @"+61353787448";
campaign.subject = @"subject";
campaign.mediaFile = @"http://yourdomain.com/tpLaX6A.gif";

CSMmsCampaignApi *mmsCampaignApi = [[CSMmsCampaignApi alloc] init];
[mmsCampaignApi mmsCampaignsByMmsCampaignIdPutWithMmsCampaignId:@(428) campaign:campaign completionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire
if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}

let mmsCampaign = MmsCampaign(
                    listId: 428,
                    name: "name",
                    body: "body",
                    from: "+61353787448",
                    schedule: nil,
                    subject: "subject",
                    mediaFile: "http://yourdomain.com/tpLaX6A.gif"
                )

MmsCampaignAPI.mmsCampaignsByMmsCampaignIdPut(mmsCampaignId: 428, campaign: mmsCampaign) { (dataString, error) in
    if let error = error {
        print(error)
    } else {
        if let data = dataString!.data(using: String.Encoding.utf8) {
            do {
                if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                    print(dictonary)
                } else {
                    print("Cannot convert the String value to JSON")
                }
            } catch let error as NSError {
                print(error)
            }
        }
    }
}
    Coming Soon
package ClickSend;

import ClickSend.Api.MmsCampaignApi;
import ClickSend.Model.MmsCampaign;

public class update_mms_campaign {
  public static void main(String[] args) {
    ApiClient defaultClient = new ApiClient();
    defaultClient.setUsername("USERNAME");
    defaultClient.setPassword("API_KEY");
    MmsCampaignApi apiInstance = new MmsCampaignApi(defaultClient);
    Integer mmsCampaignId = 1845; // Integer | ID of MMS campaign to update
    MmsCampaign campaign = new MmsCampaign(); // MmsCampaign | MmsCampaign model
    campaign.listId(new Integer(185161));
    campaign.name("name");
    campaign.body("body");
    campaign.from("+6135378744");
    campaign.schedule(new Integer(1478523369));
    campaign.subject("subject");
    campaign.mediaFile("http://yourdomain.com/tpLaX6A.gif");
    try {
        String result = apiInstance.mmsCampaignsByMmsCampaignIdPut(mmsCampaignId, campaign);
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling MmsCampaignApi#mmsCampaignsByMmsCampaignIdPut");
        e.printStackTrace();
    }
  }
}

Body parameter

{
  "schedule": 0,
  "list_id": 1234,
  "name": "name",
  "from": "from",
  "body": "body",
  "subject": "subject",
  "media_file": "media_file_url"
}

Response

{
    "http_code": 200,
    "response_code": "SUCCESS",
    "response_msg": "MMS campaign has been updated.",
    "data": {
        "mms_campaign_id": 97,
        "name": "My Campaign",
        "user_id": 1,
        "subaccount_id": 15,
        "list_id": "76468",
        "from": "+61411111111",
        "subject": "New MMS campaign test",
        "file_name": "CEF2DB1E-784F-4505-A293-02007BD81885.jpg",
        "body": "Hey (First Name), I want to ask if this is your lastname: (Last Name)?",
        "schedule": 1588061400,
        "status": "Scheduled",
        "date_added": 1531801333,
        "custom_string": null,
        "country": null,
        "unsubscribe_link": 0,
        "_total_count": 0,
        "_list_name": "",
        "_media_file_url": "http://rest.clicksend.clicksend/files/CEF2DB1E-784F-4505-A293-02007BD81885.jpg"
    }
}

https://rest.clicksend.com/v3/mms-campaigns/{mms_campaign_id}

Update mms campaign

Parameters

Parameter In Type Required Description
mms_campaign_id path integer(int32) true ID of MMS campaign to update

Properties

Name Type Required Restrictions Description
list_id integer(int32) true none Your list id.
name string true none Your campaign name.
body string true none Your campaign message.
from string true yes Your sender id
schedule integer(int32) false none Your schedule timestamp.
subject string true none Subject of MMS campaign.
media_file string true none URL pointing to media file.

Refer to Status Codes for definitions of HTTP status code responses.

Cancel MMS Campaign

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
     --request PUT \

'https://rest.clicksend.com/v3/mms-campaigns/{mms_campaign_id}/cancel'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\MmsCampaignApi(new GuzzleHttp\Client(),$config);
$mms_campaign_id = 2491; // int | ID of MMS Campaign to cancel

try {
    $result = $apiInstance->mmsCampaignsCancelByMmsCampaignIdPut($mms_campaign_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling MmsCampaignApi->mmsCampaignsCancelByMmsCampaignIdPut: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME,
    Password = API_KEY  
};
var mmsCampaignApi = new MmsCampaignApi(configuration);
var response = mmsCampaignApi.MmsCampaignsCancelByMmsCampaignIdPut(CAMPAIGN_ID);
var api = require('./api.js');

var mmsCampaignApi = new api.MmsCampaignApi("USERNAME", "API_KEY");

var mmsCampaignId = 2277;

mmsCampaignApi.mmsCampaignsCancelByMmsCampaignIdPut(mmsCampaignId).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::MmsCampaignApi.new

mms_campaign_id = 56 # Integer | ID of MMS Campaign to cancel

begin
  # Cancel mms campaign
  result = api_instance.mms_campaigns_cancel_by_mms_campaign_id_put(mms_campaign_id)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling MmsCampaignApi->mms_campaigns_cancel_by_mms_campaign_id_put: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.MmsCampaignApi(clicksend_client.ApiClient(configuration))
mms_campaign_id = 1642 # int | ID of MMS Campaign to cancel

try:
    # Cancel mms campaign
    api_response = api_instance.mms_campaigns_cancel_by_mms_campaign_id_put(mms_campaign_id)
    print(api_response)
except ApiException as e:
    print("Exception when calling MmsCampaignApi->mms_campaigns_cancel_by_mms_campaign_id_put: %s\n" % e)
use WWW::ClickSendClient::MmsCampaignApi;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::MmsCampaignApi->new(username => $username, password => $password);

my %params = (
    'list_id'    => 'list_id',
    'name'       => 'name',
    'body'       => 'body',
    'from'       => 'from',
    'schedule'   => 'schedule',
    'subject'    => 'subject',
    'media_file' => 'media_file_url'
);

my $json_output = $api->mms_campaigns_cancel_by_mms_campaign_id_put('mms_campaign_id' => '12345' );

print $json_output;
#import "CSMmsCampaign.h"
#import "CSDefaultConfiguration.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
// Configure HTTP basic authorization (authentication scheme: BasicAuth)
[apiConfig setUsername:@"USERNAME"];
[apiConfig setPassword:@"PASSWORD"];

CSMmsCampaignApi *mmsCampaignApi = [[CSMmsCampaignApi alloc] init];
[mmsCampaignApi mmsCampaignsCancelByMmsCampaignIdPutWithMmsCampaignId:@(428) completionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire

if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}

let mmsCampaign = MmsCampaign(
                    listId: 428,
                    name: "name",
                    body: "body",
                    from: "+61353787448",
                    schedule: nil,
                    subject: "subject",
                    mediaFile: "http://yourdomain.com/tpLaX6A.gif"
                )

MmsCampaignAPI.mmsCampaignsCancelByMmsCampaignIdPut(mmsCampaignId: 428) { (dataString, error) in
    if let error = error {
        print(error)
    } else {
        if let data = dataString!.data(using: String.Encoding.utf8) {
            do {
                if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                    print(dictonary)
                } else {
                    print("Cannot convert the String value to JSON")
                }
            } catch let error as NSError {
                print(error)
            }
        }
    }
}
    Coming Soon
package ClickSend;

import ClickSend.Api.MmsCampaignApi;
import ClickSend.Model.MmsCampaign;

public class cancel_mms_campaign {
  public static void main(String[] args) {
    ApiClient defaultClient = new ApiClient();
    defaultClient.setUsername("USERNAME");
    defaultClient.setPassword("API_KEY");
    MmsCampaignApi apiInstance = new MmsCampaignApi(defaultClient);
    Integer mmsCampaignId = 1846; // Integer | ID of MMS Campaign to cancel
    try {
        String result = apiInstance.mmsCampaignsCancelByMmsCampaignIdPut(mmsCampaignId);
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling MmsCampaignApi#mmsCampaignsCancelByMmsCampaignIdPut");
        e.printStackTrace();
    }
  }
}

Response

{
    "http_code": 200,
    "response_code": "SUCCESS",
    "response_msg": "Scheduled MMS campaign has been cancelled.",
    "data": {
        "mms_campaign_id": 97,
        "name": "My Campaign",
        "user_id": 1,
        "subaccount_id": 15,
        "list_id": 76468,
        "from": "+61411111111",
        "subject": "New MMS campaign test",
        "file_name": "CEF2DB1E-784F-4505-A293-02007BD81885.jpg",
        "body": "Hey (First Name), I want to ask if this is your lastname: (Last Name)?",
        "schedule": 1588061400,
        "status": "Cancelled",
        "date_added": 1531801333,
        "custom_string": null,
        "country": null,
        "unsubscribe_link": 0,
        "_total_count": 0,
        "_list_name": "",
        "_media_file_url": "http://rest.clicksend.clicksend/files/CEF2DB1E-784F-4505-A293-02007BD81885.jpg"
    }
}

https://rest.clicksend.com/v3/mms-campaigns/{mms_campaign_id}/cancel

Cancel mms campaign

Parameters

Parameter In Type Required Description
mms_campaign_id path integer(int32) true ID of MMS Campaign to cancel

Refer to Status Codes for definitions of HTTP status code responses.

View All MMS Campaigns

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \

'https://rest.clicksend.com/v3/mms-campaigns'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\MmsCampaignApi(new GuzzleHttp\Client(),$config);
$page = 1; // int | Page number
$limit = 10; // int | Number of records per page

try {
    $result = $apiInstance->mmsCampaignsGet($page, $limit);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling MmsCampaignApi->mmsCampaignsGet: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME,
    Password = API_KEY  
};
var mmsCampaignApi = new MmsCampaignApi(configuration);
var response = mmsCampaignApi.MmsCampaignsGet();
var api = require('./api.js');

var mmsCampaignApi = new api.MmsCampaignApi("USERNAME", "API_KEY");

var page = 1;
var limit = 10;

mmsCampaignApi.mmsCampaignsGet(page, limit).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::MmsCampaignApi.new

opts = {
  page: 1,  # Integer | Page number
  limit: 10 # Integer | Number of records per page
}

begin
  # Get list of mms campaigns
  result = api_instance.mms_campaigns_get(opts)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling MmsCampaignApi->mms_campaigns_get: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.MmsCampaignApi(clicksend_client.ApiClient(configuration))
page = 1 # int | Page number (optional) (default to 1)
limit = 10 # int | Number of records per page (optional) (default to 10)

try:
    # Get list of mms campaigns
    api_response = api_instance.mms_campaigns_get(page=page, limit=limit)
    print(api_response)
except ApiException as e:
    print("Exception when calling MmsCampaignApi->mms_campaigns_get: %s\n" % e)
use WWW::ClickSendClient::MmsCampaignApi;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::MmsCampaignApi->new(username => $username, password => $password);

my $json_output = $api->mms_campaigns_get('page'=> '1', 'limit' => '10');

print $json_output;
#import "CSMmsCampaign.h"
#import "CSDefaultConfiguration.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
// Configure HTTP basic authorization (authentication scheme: BasicAuth)
[apiConfig setUsername:@"USERNAME"];
[apiConfig setPassword:@"PASSWORD"];

CSMmsCampaignApi *mmsCampaignApi = [[CSMmsCampaignApi alloc] init];
[mmsCampaignApi mmsCampaignsGetWithPage:@(1) limit:@(15) completionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire
if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}

MmsCampaignAPI.mmsCampaignsGet { (dataString, error) in
    if let error = error {
        print(error)
    } else {
        if let data = dataString!.data(using: String.Encoding.utf8) {
            do {
                if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                    print(dictonary)
                } else {
                    print("Cannot convert the String value to JSON")
                }
            } catch let error as NSError {
            print(error)
            }
        }
    }
}
    Coming Soon
package ClickSend;

import ClickSend.Api.MmsCampaignApi;

public class view_all_mms_campaign {
  public static void main(String[] args) {
    ApiClient defaultClient = new ApiClient();
    defaultClient.setUsername("USERNAME");
    defaultClient.setPassword("API_KEY");
    MmsCampaignApi apiInstance = new MmsCampaignApi(defaultClient);
    Integer page = 1; // Integer | Page number
    Integer limit = 10; // Integer | Number of records per page
    try {
        String result = apiInstance.mmsCampaignsGet(page, limit);
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling MmsCampaignApi#mmsCampaignsGet");
        e.printStackTrace();
    }
  }
}

Response

{
    "total": 1,
    "per_page": 15,
    "current_page": 1,
    "last_page": 1,
    "next_page_url": null,
    "prev_page_url": null,
    "from": 1,
    "to": 12,
    "data": [
        {
            "mms_campaign_id": 97,
            "name": "My Campaign",
            "user_id": 1,
            "subaccount_id": 15,
            "list_id": 76468,
            "from": "+61411111111",
            "subject": "New MMS campaign test",
            "file_name": "CEF2DB1E-784F-4505-A293-02007BD81885.jpg",
            "body": "Hey (First Name), I want to ask if this is your lastname: (Last Name)?",
            "schedule": 1588061400,
            "status": "Cancelled",
            "date_added": 1531801333,
            "custom_string": null,
            "country": null,
            "unsubscribe_link": 0,
            "_total_count": 0,
            "_list_name": "",
            "_media_file_url": "http://rest.clicksend.clicksend/files/CEF2DB1E-784F-4505-A293-02007BD81885.jpg"
        }
    ]
}

https://rest.clicksend.com/v3/mms-campaigns

Get list of mms campaigns

Parameters

Parameter In Type Required Description
page query integer(int32) false Page number
limit query integer(int32) false Number of records per page

Refer to Status Codes for definitions of HTTP status code responses.

View MMS Campaign

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \

'https://rest.clicksend.com/v3/mms-campaigns/{mms_campaign_id}'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\MmsCampaignApi(new GuzzleHttp\Client(),$config);
$mms_campaign_id = 2492; // int | ID of MMS campaign to retrieve

try {
    $result = $apiInstance->mmsCampaignByMmsCampaignIdGet($mms_campaign_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling MmsCampaignApi->mmsCampaignByMmsCampaignIdGet: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME,
    Password = API_KEY  
};
var mmsCampaignApi = new MmsCampaignApi(configuration);
var response = mmsCampaignApi.MmsCampaignByMmsCampaignIdGet(CAMPAIGN_ID);
var api = require('./api.js');

var mmsCampaignApi = new api.MmsCampaignApi("USERNAME", "API_KEY");

var mmsCampaignId = 1637;

mmsCampaignApi.mmsCampaignByMmsCampaignIdGet(mmsCampaignId).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::MmsCampaignApi.new

mms_campaign_id = 56 # Integer | ID of MMS campaign to retrieve

begin
  # Get specific mms campaign
  result = api_instance.mms_campaign_by_mms_campaign_id_get(mms_campaign_id)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling MmsCampaignApi->mms_campaign_by_mms_campaign_id_get: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.MmsCampaignApi(clicksend_client.ApiClient(configuration))
mms_campaign_id = 1637 # int | ID of MMS campaign to retrieve

try:
    # Get specific mms campaign
    api_response = api_instance.mms_campaign_by_mms_campaign_id_get(mms_campaign_id)
    print(api_response)
except ApiException as e:
    print("Exception when calling MmsCampaignApi->mms_campaign_by_mms_campaign_id_get: %s\n" % e)
use WWW::ClickSendClient::MmsCampaignApi;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::MmsCampaignApi->new(username => $username, password => $password);

my $json_output = my $json_output = $api->mms_campaign_by_mms_campaign_id_get('mms_campaign_id'  => '1234');

print $json_output;
#import "CSMmsCampaign.h"
#import "CSDefaultConfiguration.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
// Configure HTTP basic authorization (authentication scheme: BasicAuth)
[apiConfig setUsername:@"USERNAME"];
[apiConfig setPassword:@"PASSWORD"];

CSMmsCampaignApi *mmsCampaignApi = [[CSMmsCampaignApi alloc] init];
[mmsCampaignApi mmsCampaignByMmsCampaignIdGetWithMmsCampaignId:@(428) completionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire

if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}

MmsCampaignAPI.mmsCampaignByMmsCampaignIdGet(mmsCampaignId: 428) { (dataString, error) in
    if let error = error {
        print(error)
    } else {
        if let data = dataString!.data(using: String.Encoding.utf8) {
            do {
                if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                    print(dictonary)
                } else {
                    print("Cannot convert the String value to JSON")
                }
            } catch let error as NSError {
                print(error)
            }
        }
    }
}
    Coming Soon
package ClickSend;

import ClickSend.Api.MmsCampaignApi;

public class view_specific_mms_campaign {
  public static void main(String[] args) {
    ApiClient defaultClient = new ApiClient();
    defaultClient.setUsername("USERNAME");
    defaultClient.setPassword("API_KEY");
    MmsCampaignApi apiInstance = new MmsCampaignApi(defaultClient);
    Integer mmsCampaignId = 1910; // Integer | ID of MMS campaign to retrieve
    try {
        String result = apiInstance.mmsCampaignByMmsCampaignIdGet(mmsCampaignId);
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling MmsCampaignApi#mmsCampaignByMmsCampaignIdGet");
        e.printStackTrace();
    }
  }
}

Response

{
    "http_code": 200,
    "response_code": "SUCCESS",
    "response_msg": "Here is your result.",
    "data": {
        "mms_campaign_id": 97,
        "name": "My Campaign",
        "user_id": 1,
        "subaccount_id": 15,
        "list_id": 76468,
        "from": "+6141111111",
        "subject": "New MMS campaign test",
        "file_name": "CEF2DB1E-784F-4505-A293-02007BD81885.jpg",
        "body": "Hey (First Name), I want to ask if this is your lastname: (Last Name)?",
        "schedule": 1588061400,
        "status": "Sent",
        "date_added": 1531801333,
        "custom_string": null,
        "country": null,
        "unsubscribe_link": 0,
        "_total_count": 0,
        "_list_name": "",
        "_media_file_url": "http://rest.clicksend.clicksend/files/CEF2DB1E-784F-4505-A293-02007BD81885.jpg"
    }
}

https://rest.clicksend.com/v3/mms-campaign/{mms_campaign_id}

Get specific mms campaign

Parameters

Parameter In Type Required Description
mms_campaign_id path integer(int32) true ID of MMS campaign to retrieve

Refer to Status Codes for definitions of HTTP status code responses.

Number

Everything about purchasing dedicated numbers

View Your Numbers

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \

'https://rest.clicksend.com/v3/numbers'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\NumberApi(new GuzzleHttp\Client(),$config);
$page = 1; // int | Page number
$limit = 10; // int | Number of records per page

try {
    $result = $apiInstance->numbersGet($page, $limit);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling NumberApi->numbersGet: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME, 
    Password = API_KEY  
};
var numberApi = new NumberApi(configuration);
var response = numberApi.NumbersGet();
var api = require('./api.js');

var numberApi = new api.NumberApi("USERNAME", "API_KEY");

var page = 1;
var limit = 10;

numberApi.numbersGet(page, limit).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::NumberApi.new

opts = {
  page: 1,  # Integer | Page number
  limit: 10 # Integer | Number of records per page
}

begin
  # Get all available dedicated numbers
  result = api_instance.numbers_get(opts)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling NumberApi->numbers_get: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.NumberApi(clicksend_client.ApiClient(configuration))
page = 1 # int | Page number (optional) (default to 1)
limit = 10 # int | Number of records per page (optional) (default to 10)

try:
    # Get all available dedicated numbers_get
    api_response = api_instance.numbers_get(page=page, limit=limit)
    print(api_response)
except ApiException as e:
    print("Exception when calling NumberApi->numbers_get: %s\n" % e)
use WWW::ClickSendClient::NumberApi;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::NumberApi->new(username => $username, password => $password);

my $json_output = $api->numbers_get('page' => '1', 'limit' => '10');

print $json_output;
#import "CSNumberApi.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
[apiConfig setUsername:@"USERNAME"];
[apiConfig setPassword:@"PASSWORD"];

NSNumber *page = [[NSNumber alloc] initWithInt:1];
NSNumber *limit = [[NSNumber alloc] initWithInt:15];

CSNumberApi *numberApiInstance = [[CSNumberApi alloc] init];
[numberApiInstance numbersGetWithPage:page limit:limit completionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire

if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}

NumberAPI.numbersGet(page: nil, limit: nil) { (dataString, error) in
    guard let dataString = dataString else {
        print(error!)
        return
    }
    if let data = dataString.data(using: String.Encoding.utf8) {
        do {
            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                print(dictonary)
            } else {
                print("Cannot convert the String value to JSON")
            }
        } catch let error as NSError {
            print(error)
        }
    }
}
    Coming Soon
package ClickSend;

import ClickSend.Api.NumberApi;

public class view_numbers {
  public static void main(String[] args) {
    ApiClient defaultClient = new ApiClient();
    defaultClient.setUsername("USERNAME");
    defaultClient.setPassword("API_KEY");
    NumberApi apiInstance = new NumberApi(defaultClient);
    Integer page = 1; // Integer | Page number
    Integer limit = 10; // Integer | Number of records per page
    try {
        String result = apiInstance.numbersGet(page, limit);
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling NumberApi#numbersGet");
        e.printStackTrace();
    }
  }
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "Here are you dedicated numbers.",
  "data": {
    "total": 2,
    "per_page": 15,
    "current_page": 1,
    "last_page": 1,
    "next_page_url": "https://rest.clicksend.com/v3/numbers/?page=2",
    "prev_page_url": null,
    "from": 1,
    "to": 15,
    "data": [
      {
        "dedicated_number": "+61411111111",
        "country": "AU",
        "price": "18.59",
        "_country_name": "Australia"
      },
      {
        "dedicated_number": "+61422222222",
        "country": "AU",
        "price": "18.59",
        "_country_name": "Australia"
      }
    ]
  }
}

https://rest.clicksend.com/v3/numbers

Get all available dedicated numbers

Parameters

Parameter In Type Required Description
page query integer(int32) false Page number
limit query integer(int32) false Number of records per page

Refer to Status Codes for definitions of HTTP status code responses.

Purchase Dedicated Number

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
     --request POST \

'https://rest.clicksend.com/v3/numbers/buy/{dedicated_number}'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\NumberApi(new GuzzleHttp\Client(),$config);
$dedicated_number = "phone_number"; // string | Phone number to purchase

try {
    $result = $apiInstance->numbersBuyByDedicatedNumberPost($dedicated_number);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling NumberApi->numbersBuyByDedicatedNumberPost: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME, 
    Password = API_KEY  
};
var numberApi = new NumberApi(configuration);
var response = numberApi.NumbersBuyByDedicatedNumberPost("+11231231234");
var api = require('./api.js');

var numberApi = new api.NumberApi("USERNAME", "API_KEY");

var dedicatedNumber = "dedicated_number";

numberApi.numbersBuyByDedicatedNumberPost(dedicatedNumber).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::NumberApi.new

dedicated_number = "dedicated_number" # String | Phone number to purchase

begin
  # Buy dedicated number
  result = api_instance.numbers_buy_by_dedicated_number_post(dedicated_number)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling NumberApi->numbers_buy_by_dedicated_number_post: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.NumberApi(clicksend_client.ApiClient(configuration))
dedicated_number = 'xxx-xxx-xxxx' # str | Phone number to purchase

try:
    # Buy dedicated number
    api_response = api_instance.numbers_buy_by_dedicated_number_post(dedicated_number)
    print(api_response)
except ApiException as e:
    print("Exception when calling NumberApi->numbers_buy_by_dedicated_number_post: %s\n" % e)
use WWW::ClickSendClient::NumberApi;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::NumberApi->new(username => $username, password => $password);

my $json_output = $api->numbers_buy_by_dedicated_number_post('dedicated_number'=> '+8615555555555');

print $json_output;
#import "CSNumberApi.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
[apiConfig setUsername:@"USERNAME"];
[apiConfig setPassword:@"PASSWORD"];

CSNumberApi *numberApiInstance = [[CSNumberApi alloc] init];
[numberApiInstance numbersBuyByDedicatedNumberPostWithDedicatedNumber:@"dedicated_number" completionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire

if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}

NumberAPI.numbersBuyByDedicatedNumberPost(dedicatedNumber: "dedicated_number") { (dataString, error) in
    guard let dataString = dataString else {
        print(error!)
        return
    }
    if let data = dataString.data(using: String.Encoding.utf8) {
        do {
            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                print(dictonary)
            } else {
                print("Cannot convert the String value to JSON")
            }
        } catch let error as NSError {
            print(error)
        }
    }
}
    Coming Soon
package ClickSend;

import ClickSend.Api.NumberApi;

public class buy_dedicated_number {
  public static void main(String[] args) {
    ApiClient defaultClient = new ApiClient();
    defaultClient.setUsername("USERNAME");
    defaultClient.setPassword("API_KEY");
    NumberApi apiInstance = new NumberApi(defaultClient);
    String dedicatedNumber = "xxx-xxx-xxxx"; // String | Phone number to purchase
    try {
        String result = apiInstance.numbersBuyByDedicatedNumberPost(dedicatedNumber);
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling NumberApi#numbersBuyByDedicatedNumberPost");
        e.printStackTrace();
    }
  }
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "Here is your new number.",
  "data": {
    "dedicated_number": "+12282060576",
    "country": "US",
    "price_total": "8.98",
    "_price_setup": "22.22",
    "_price_monthly": "11.11",
    "_currency": {
      "currency_name_short": "USD",
      "currency_prefix_d": "$",
      "currency_prefix_c": "¢",
      "currency_name_long": "US Dollars"
    }
  }
}

https://rest.clicksend.com/v3/numbers/buy/{dedicated_number}

Buy dedicated number

Parameters

Parameter In Type Required Description
dedicated_number path string true Phone number to purchase

Refer to Status Codes for definitions of HTTP status code responses.

View Available Numbers

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \

'https://rest.clicksend.com/v3/numbers/search/{country}'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\NumberApi(new GuzzleHttp\Client(),$config);
$country = "US"; // string | Country code to search
$search = ""; // string | Your search pattern or query.
$search_type = 56; // int | Your strategy for searching, 0 = starts with, 1 = anywhere, 2 = ends with.
$page = 1; // int | Page number
$limit = 10; // int | Number of records per page

try {
    $result = $apiInstance->numbersSearchByCountryGet($country, $search, $search_type, $page, $limit);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling NumberApi->numbersSearchByCountryGet: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME, 
    Password = API_KEY  
};
var numberApi = new NumberApi(configuration);
var response = numberApi.NumbersSearchByCountryGet("CA");
var api = require('./api.js');

var numberApi = new api.NumberApi("USERNAME", "API_KEY");

var country = "US";
var search = "";
var searchType = 1;
var page = 1;
var limit = 10;

numberApi.numbersSearchByCountryGet(country, search, searchType, page, limit).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::NumberApi.new

country = "US"    # String | Country code to search

opts = {
  "search": "88",   # String | Your search pattern or query.
  "search_type": 1, # Integer | Your strategy for searching,
                  # 0 = starts with, 1 = anywhere, 2 = ends with.
  "page": 1,        # Integer | Page number
  "limit": 10       # Integer | Number of records per page
}

begin
  # Get all dedicated numbers by country
  result = api_instance.numbers_search_by_country_get(country, opts)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling NumberApi->numbers_search_by_country_get: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.NumberApi(clicksend_client.ApiClient(configuration))
country = 'country_example' # str | Country code to search
search = 'search_example' # str | Your search pattern or query. (optional)
search_type = 56 # int | Your strategy for searching, 0 = starts with, 1 = anywhere, 2 = ends with. (optional)
page = 1 # int | Page number (optional) (default to 1)
limit = 10 # int | Number of records per page (optional) (default to 10)

try:
    # Get all dedicated numbers by country
    api_response = api_instance.numbers_search_by_country_get(country, search=search, search_type=search_type, page=page, limit=limit)
    print(api_response)
except ApiException as e:
    print("Exception when calling NumberApi->numbers_search_by_country_get: %s\n" % e)
use WWW::ClickSendClient::NumberApi;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::NumberApi->new(username => $username, password => $password);

my $json_output = $api->numbers_search_by_country_get('country' => 'AU' ,'search' => '' ,'search_type'  => '', 'page' => '','limit' => '' );

print $json_output;
#import "CSNumberApi.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
[apiConfig setUsername:@"USERNAME"];
[apiConfig setPassword:@"PASSWORD"];

NSNumber *searchType = [[NSNumber alloc] initWithInt:1];
NSNumber *page = [[NSNumber alloc] initWithInt:1];
NSNumber *limit = [[NSNumber alloc] initWithInt:15];

CSNumberApi *numberApiInstance = [[CSNumberApi alloc] init];
[numberApiInstance numbersSearchByCountryGetWithCountry: @"country" search:@"search" searchType:searchType page:page limit:limit completionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire

if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}

NumberAPI.numbersSearchByCountryGet(country: "country", search: "search", searchType: nil, page: 1, limit: 15) { (dataString, error) in
    guard let dataString = dataString else {
        print(error!)
        return
    }
    if let data = dataString.data(using: String.Encoding.utf8) {
        do {
            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                print(dictonary)
            } else {
                print("Cannot convert the String value to JSON")
            }
        } catch let error as NSError {
            print(error)
        }
    }
}
    Coming Soon
package ClickSend;

import ClickSend.Api.NumberApi;

public class view_available_numbers {
  public static void main(String[] args) {
    ApiClient defaultClient = new ApiClient();
    defaultClient.setUsername("USERNAME");
    defaultClient.setPassword("API_KEY");
    NumberApi apiInstance = new NumberApi(defaultClient);
    String country = "US"; // String | Country code to search
    String search = ""; // String | Your search pattern or query.
    Integer searchType = 1; // Integer | Your strategy for searching, 0 = starts with, 1 = anywhere, 2 = ends with.
    Integer page = 1; // Integer | Page number
    Integer limit = 10; // Integer | Number of records per page
    try {
        String result = apiInstance.numbersSearchByCountryGet(country, search, searchType, page, limit);
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling NumberApi#numbersSearchByCountryGet");
        e.printStackTrace();
    }
  }
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "Here are some numbers.",
  "data": {
    "total": 2,
    "per_page": 15,
    "current_page": 1,
    "last_page": 1,
    "next_page_url": "/?page=1",
    "prev_page_url": null,
    "from": 1,
    "to": 15,
    "data": [
      {
        "country": "US",
        "country_name": "United States of America",
        "dedicated_number": "+12132633745",
        "price_setup": "0.0000",
        "price_monthly": "20.7100",
        "price_total": "20.7100"
      },
      {
        "country": "US",
        "country_name": "United States of America",
        "dedicated_number": "+12134657532",
        "price_setup": "0.0000",
        "price_monthly": "20.7100",
        "price_total": "20.7100"
      }
    ],
     "_currency": {
         "currency_name_short": "USD",
         "currency_prefix_d": "$",
         "currency_prefix_c": "c",
         "currency_name_long": "US Dollars"
     }
  }
}

https://rest.clicksend.com/v3/numbers/search/{country}

Get all dedicated numbers by country

Parameters

Parameter In Type Required Description
country path string true Country code to search
search query string false Your search pattern or query.
search_type query integer(int32) false Your strategy for searching, 0 = starts with, 1 = anywhere, 2 = ends with.
page query integer(int32) false Page number
limit query integer(int32) false Number of records per page

Refer to Status Codes for definitions of HTTP status code responses.

Letter

Send Letter

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
     --request POST \

     --header "Content-Type: application/json" \
     --data-binary "{
  \"file_url\": \"http://yourdomain.com/file.pdf\",
  \"template_used\": 1,
  \"colour\": 1,
  \"duplex\": 0,
  \"priority_post\": 0,
  \"recipients\": [
    {
      \"address_name\": \"My Home Address\",
      \"address_line_1\": \"Address 1\",
      \"address_line_2\": \"Address 2\",
      \"address_city\": \"CITY\",
      \"address_state\": \"State\",
      \"address_postal_code\": 123456,
      \"address_country\": \"AU\",
      \"return_address_id\": 1,
      \"custom_string\": \"Custom kn0ChLhwn6\",
      \"schedule\": 1449573604
    }
  ]
}" \
'https://rest.clicksend.com/v3/post/letters/send'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\PostLetterApi(new GuzzleHttp\Client(),$config);
$post_recipient= new \ClickSend\Model\PostRecipient();
$post_recipient->setAddressName("My Home Address");
$post_recipient->setAddressLine1("Address 1");
$post_recipient->setAddressLine2("Address 2");
$post_recipient->setAddressCity("city");
$post_recipient->setAddressState("state");
$post_recipient->setAddressPostalCode("code");
$post_recipient->setAddressCountry("country");
$post_recipient->setReturnAddressId(1);
$post_letter = new \ClickSend\Model\PostLetter(); // \ClickSend\Model\PostLetter | PostLetter model
$post_letter->setFileUrl("http://www.africau.edu/images/default/sample.pdf");
$post_letter->setPriorityPost(0);
$post_letter->setRecipients([$post_recipient]);
$post_letter->setTemplateUsed(1);
$post_letter->setDuplex(0);
$post_letter->setColour(1);

try {
    $result = $apiInstance->postLettersSendPost($post_letter);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling PostLetterApi->postLettersSendPost: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME, 
    Password = API_KEY  
};
var postLetterApi = new PostLetterApi(configuration);
var listOfRecipients = new List<PostRecipient>();
listOfRecipients.Add(new PostRecipient(
    addressName: "House Address",
    addressLine1: "Address 1",
    addressLine2: "Address 2",
    addressCity: "City",
    addressState: "State",
    addressPostalCode: "Postal Code",
    addressCountry: "US",
    returnAddressId: RETURN_ADDRESS_ID,
    schedule: TimeStamp
));
var response = postLetterApi.PostLettersSendPost(new PostLetter(
    fileUrl: "https://www.yourdomain.com/file.pdf",
    recipients: listOfRecipients,
    templateUsed: 0,
    colour: 0,
    duplex: 0,
    source: "sdk"
));
var api = require('./api.js');

var letterApi = new api.PostLetterApi("USERNAME", "API_KEY");

var recipient = new api.PostRecipient();

recipient.addressName = "My Home Address";
recipient.addressLine1 = "Address 1";
recipient.addressLine2 = "Address 2";
recipient.addressCity = "addressCity";
recipient.addressState = "addressState";
recipient.addressPostalCode = "code";
recipient.addressCountry = "country";
recipient.returnAddressId = 1;

var postLetter = new api.PostLetter();

postLetter.fileUrl = "http://www.africau.edu/images/default/sample.pdf";
postLetter.priorityPost = 0;
postLetter.recipients = [recipient];
postLetter.templateUsed = 1;
postLetter.duplex = 0;
postLetter.colour = 1;
postLetter.source = "source";

letterApi.postLettersSendPost(postLetter).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::PostLetterApi.new

# PostLetter | PostLetter model
post_letter = ClickSendClient::PostLetter.new(
  "file_url": "file_url",
  "colour": 0,
  "recipients": [
    {
      "return_address_id": 0,
      "schedule": 0,
      "address_postal_code": "address_postal_code",
      "address_country": "address_country",
      "address_line_1": "address_line_1",
      "address_state": "address_state",
      "address_name": "address_name",
      "address_line_2": "address_line_2",
      "address_city": "address_city"
    }
  ],
  "template_used": 0,
  "duplex": 0,
  "priority_post": 0,
  "source": "sdk"
)

begin
  # Send post letter
  result = api_instance.post_letters_send_post(post_letter)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling PostLetterApi->post_letters_send_post: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException
from clicksend_client import PostRecipient

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.PostLetterApi(clicksend_client.ApiClient(configuration))
post_recipient=PostRecipient(
              address_name="My Home Address",
              address_line_1="Address 1",
              address_line_2="Address 2",
              address_city="CITY",
              address_state="State",
              address_postal_code=123456,
              address_country="AU",
              return_address_id=1,
              schedule=1449573604)
# PostLetter | PostLetter model
post_letter = clicksend_client.PostLetter(
              file_url="http://www.africau.edu/images/default/sample.pdf",
              template_used= 1,
              colour=1,
              duplex=0,
              recipients=[post_recipient]) 

try:
    # Send post letter
    api_response = api_instance.post_letters_send_post(post_letter)
    print(api_response)
except ApiException as e:
    print("Exception when calling PostLetterApi->post_letters_send_post: %s\n" % e)
use WWW::ClickSendClient::PostLetterApi;
use WWW::ClickSendClient::Object::PostLetter;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::PostLetterApi->new(username => $username, password => $password);

my %params = (
    'file_url'   => 'https://<file_url>',
    'recipients' => [
        {
            'return_address_id'   => 0,
            'schedule'            => 0,
            'address_postal_code' => 'address_postal_code',
            'address_country'     => 'AU',
            'address_line_1'      => 'address_line_1',
            'address_state'       => 'address_state',
            'address_name'        => 'address_name',
            'address_line_2'      => 'address_line_2',
            'address_city'        => 'address_city'
        }
    ],
    'template_used' => '0',
    'duplex'        => '0',
    'colour'        => '0',
    'source'        => 'perl-sdk'
);

my $post_letter_obj = WWW::ClickSendClient::Object::PostLetter->new(%params);
my $json_output = $api->post_letters_send_post('post_letter'=> $post_letter_obj);

print $json_output;
#import "CSPostLetterApi.h"
#import "CSDefaultConfiguration.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
[apiConfig setUsername:@"USERNAME"];
[apiConfig setPassword:@"PASSWORD"];

CSPostRecipient *recipient =[[CSPostRecipient alloc] init];
recipient.addressName = @"address_name";
recipient.addressLine1 = @"address_line1";
recipient.addressLine2 = @"address_line2";
recipient.addressCity = @"address_city";
recipient.addressState = @"address_state";
recipient.addressPostalCode = @"address_postalcode";
recipient.addressCountry = @"address_country";
recipient.returnAddressId = @(1);
recipient.schedule = @(0);

CSPostLetter *postLetter = [[CSPostLetter alloc] init];
postLetter.fileUrl = @"file_url";
postLetter.priorityPost = 0;
postLetter.templateUsed = 0;
postLetter.duplex = 0;
postLetter.colour = 0;
postLetter.source = @"objc";
postLetter.recipients = [NSArray arrayWithObjects:recipient, nil];

CSPostLetterApi *postLetterApiInstance = [[CSPostLetterApi alloc] init];
[postLetterApiInstance postLettersSendPostWithPostLetter:postLetter completionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire

let recipients = PostRecipient(addressName: "address_name",
                               addressLine1: "address_line1",
                               addressLine2: "address_line@",
                               addressCity: "address_city",
                               addressState: "address_State",
                               addressPostalCode: "address_postalcode",
                               addressCountry: "address_Country",
                               returnAddressId: 1,
                               schedule: nil)

let postLetter = PostLetter(fileUrl: "file_url",
                            priorityPost: nil,
                            recipients: [recipients],
                            templateUsed: nil,
                            duplex: nil,
                            colour: nil,
                            source: "swift")

PostLetterAPI.postLettersSendPost(postLetter: postLetter) { (dataString, error) in
    guard let dataString = dataString else {
        print(error!)
        return
    }
    if let data = dataString.data(using: String.Encoding.utf8) {
        do {
            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                print(dictonary)
            } else {
                print("Cannot convert the String value to JSON")
            }
        } catch let error as NSError {
        print(error)
        }
    }
}
    Coming Soon
package ClickSend;

import java.util.Arrays;
import java.util.List;
import ClickSend.Api.PostLetterApi;
import ClickSend.Model.PostLetter;
import ClickSend.Model.PostRecipient;

public class send_letter {
  public static void main(String[] args) {
    ApiClient defaultClient = new ApiClient();
    defaultClient.setUsername("USERNAME");
    defaultClient.setPassword("API_KEY");
    PostLetterApi apiInstance = new PostLetterApi(defaultClient);
    PostRecipient recipient= new PostRecipient(); 
    recipient.addressName("name");
    recipient.addressLine1("line1");
    recipient.addressLine2("line2");
    recipient.addressCity("city");
    recipient.addressState("state");
    recipient.addressPostalCode("code");
    recipient.addressCountry("country");
    recipient.returnAddressId(new Integer(1));
    recipient.schedule(new Integer(147852369));
    List<PostRecipient> recipientList=Arrays.asList(recipient);
    PostLetter postLetter = new PostLetter(); // PostLetter | PostLetter model
    postLetter.fileUrl("http://www.africau.edu/images/default/sample.pdf");
    postLetter.templateUsed(new Integer(1));
    postLetter.duplex(new Integer(0));
    postLetter.colour(new Integer(1));
    postLetter.source("source");
    postLetter.recipients(recipientList);
    try {
        String result = apiInstance.postLettersSendPost(postLetter);
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling PostLetterApi#postLettersSendPost");
        e.printStackTrace();
    }
  }
}

Body parameter

{
  "file_url": "file_url",
  "colour": 0,
  "recipients": [
    {
      "return_address_id": 0,
      "schedule": 0,
      "address_postal_code": "address_postal_code",
      "address_country": "address_country",
      "address_line_1": "address_line_1",
      "address_state": "address_state",
      "address_name": "address_name",
      "address_line_2": "address_line_2",
      "address_city": "address_city"
    }
  ],
  "template_used": 0,
  "duplex": 0,
  "priority_post": 0,
  "source": "sdk"
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "Letters queued for delivery.",
  "data": {
    "total_price": 13.42,
    "total_count": 1,
    "queued_count": 1,
    "recipients": [
      {
        "user_id": 1,
        "subaccount_id": 1,
        "message_id": "A00A1066-BBAE-432B-9B2D-E88969B12C46",
        "address_name": "John Smith",
        "address_line_1": "Address 1",
        "address_line_2": "",
        "address_city": "CITY",
        "address_state": "State",
        "address_postal_code": "123456",
        "address_country": "AU",
        "return_address_id": 1,
        "custom_string": "kn0ChLhwn6",
        "schedule": 1449573604,
        "source": ".rest.v3",
        "colour": 1,
        "duplex": 0,
        "post_pages": 7,
        "post_price": "13.4200",
        "priority_post": 0,
        "date_added": 1459131623,
        "status": "SUCCESS",
        "_file_url": "http://yourdomain.com/file.pdf",
        "_return_address": {
          "return_address_id": 1,
          "user_id": 1,
          "address_name": "John Smith",
          "address_line_1": "Maritime Avenue",
          "address_line_2": "",
          "address_city": "Flynn",
          "address_state": "WA",
          "address_postal_code": "6302",
          "address_country": "AU"
        },
        "_api_username": "my_api_username"
      }
    ],
    "_currency": {
      "currency_name_short": "AUD",
      "currency_prefix_d": "$",
      "currency_prefix_c": "c",
      "currency_name_long": "Australian Dollars"
    }
  }
}

https://rest.clicksend.com/v3/post/letters/send

Send letter

Supported File Types

We support pdf, docx and doc files. Contact us to add support for any other file type. If you're using docx or doc files, you'll need to convert the file first using our uploads endpoint with the querystring parameter convert=post e.g. POST https://rest.clicksend.com/v3/uploads?convert=post. This will return a URL to the converted pdf file that can be used in the /post/letters/send endpoint.

Letter Specification Guide

Follow our Letter specification guide to ensure correct sending and letter template information.

Letter File Options

Use existing URL

With this option, you can use an existing URL to a pdf document. For example, you might generate the pdf on your server.

When using an existing url make sure that it is publicly accessible as it will not work if it is private.

Upload File to Our Server

With this option, you can use the /uploads endpoint to upload the document. The /uploads endpoint returns a URL that can be used in the /post/letters/send endpoint.

Properties

Name Type Required Restrictions Description
file_url string true none URL of file to send
address_name string true none Name of address
address_line_1 string true none First line of address
address_line_2 string true none Second line of address
address_city string true none City
address_state string true none State
address_postal_code string true none Postal code
address_country string true none Country
return_address_id integer(int32) true none ID of return address to use
schedule integer(int32) false none When to send letter (0/null=now)
template_used integer(int1) false none Whether using our letter template. Flag value must be 1 for yes or 0 for no.
duplex integer(int1) false none Whether letter is duplex. Flag value must be 1 for yes or 0 for no.
colour integer(int1) false none Whether letter is in colour. Flag value must be 1 for yes or 0 for no.
priority_post integer(int1) false none Whether letter is priority, Flag value must be 1 for yes or 0 for no.
source string false none Source being sent from

Refer to Status Codes for definitions of HTTP status code responses.

Calculate Letter Price

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
     --request POST \

     --header "Content-Type: application/json" \
     --data-binary "{
  \"file_url\": \"http://yourdomain.com/file.pdf\",
  \"template_used\": 1,
  \"colour\": 1,
  \"duplex\": 0,
  \"priority_post\": 0,
  \"recipients\": [
    {
      \"address_name\": \"My Home Address\",
      \"address_line_1\": \"Address 1\",
      \"address_line_2\": \"Address 2\",
      \"address_city\": \"CITY\",
      \"address_state\": \"State\",
      \"address_postal_code\": 123456,
      \"address_country\": \"AU\",
      \"return_address_id\": 1,
      \"custom_string\": \"Custom kn0ChLhwn6\",
      \"schedule\": 1449573604
    }
  ]
}" \
'https://rest.clicksend.com/v3/post/letters/price'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\PostLetterApi(new GuzzleHttp\Client(),$config);
$post_recipient= new \ClickSend\Model\PostRecipient();
$post_recipient->setAddressName("My Home Address");
$post_recipient->setAddressLine1("Address 1");
$post_recipient->setAddressLine2("Address 2");
$post_recipient->setAddressCity("city");
$post_recipient->setAddressState("state");
$post_recipient->setAddressPostalCode("code");
$post_recipient->setAddressCountry("country");
$post_recipient->setReturnAddressId(1);
$post_letter = new \ClickSend\Model\PostLetter(); // \ClickSend\Model\PostLetter | PostLetter model
$post_letter->setFileUrl("http://www.africau.edu/images/default/sample.pdf");
$post_letter->setPriorityPost(0);
$post_letter->setRecipients([$post_recipient]);
$post_letter->setTemplateUsed(1);
$post_letter->setDuplex(0);
$post_letter->setColour(1);

try {
    $result = $apiInstance->postLettersPricePost($post_letter);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling PostLetterApi->postLettersPricePost: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME, 
    Password = API_KEY  
};
var postLetterApi = new PostLetterApi(configuration);
var listOfRecipients = new List<PostRecipient>();
listOfRecipients.Add(new PostRecipient(
    addressName: "House Address",
    addressLine1: "Address 1",
    addressLine2: "Address 2",
    addressCity: "City",
    addressState: "State",
    addressPostalCode: "Postal Code",
    addressCountry: "US",
    returnAddressId: RETURN_ADDRESS_ID,
    schedule: TimeStamp
));
var response = postLetterApi.PostLettersPricePost(new PostLetter(
    fileUrl: "https://www.yourdomain.com/file.pdf",
    recipients: listOfRecipients,
    templateUsed: 0,
    colour: 0,
    duplex: 0,
    source: "sdk"
));
var api = require('./api.js');

var letterApi = new api.PostLetterApi("USERNAME", "API_KEY");

var recipient = new api.PostRecipient();

recipient.addressName = "My Home Address";
recipient.addressLine1 = "Address 1";
recipient.addressLine2 = "Address 2";
recipient.addressCity = "addressCity";
recipient.addressState = "addressState";
recipient.addressPostalCode = "code";
recipient.addressCountry = "country";
recipient.returnAddressId = 1;

var postLetter = new api.PostLetter();

postLetter.fileUrl = "http://www.africau.edu/images/default/sample.pdf";
postLetter.priorityPost = 0;
postLetter.recipients = [recipient];
postLetter.templateUsed = 1;
postLetter.duplex = 0;
postLetter.colour = 1;
postLetter.source = "source";

letterApi.postLettersPricePost(postLetter).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::PostLetterApi.new

# PostLetter | PostLetter model
post_letter = ClickSendClient::PostLetter.new(
  "file_url": "file_url",
  "colour": 0,
  "recipients": [
    {
      "return_address_id": 0,
      "schedule": 0,
      "address_postal_code": "address_postal_code",
      "address_country": "address_country",
      "address_line_1": "address_line_1",
      "address_state": "address_state",
      "address_name": "address_name",
      "address_line_2": "address_line_2",
      "address_city": "address_city"
    }
  ],
  "template_used": 0,
  "duplex": 0,
  "priority_post": 0,
  "source": "sdk"
)

begin
  # Calculate post letter price
  result = api_instance.post_letters_price_post(post_letter)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling PostLetterApi->post_letters_price_post: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException
from clicksend_client import PostRecipient

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.PostLetterApi(clicksend_client.ApiClient(configuration))
post_recipient=PostRecipient(
                address_name="My Home Address",
                address_line_1="Address 1",
                address_line_2="Address 2",
                address_city="CITY",
                address_state="State",
                address_postal_code=123456,
                address_country="AU",
                return_address_id=1,
                schedule=1449573604)
# PostLetter | PostLetter model
post_letter = clicksend_client.PostLetter(
                file_url="http://www.africau.edu/images/default/sample.pdf",
                template_used= 1,
                colour=1,
                duplex=0,
                recipients=[post_recipient]) 

try:
    # Calculate post letter price
    api_response = api_instance.post_letters_price_post(post_letter)
    print(api_response)
except ApiException as e:
    print("Exception when calling PostLetterApi->post_letters_price_post: %s\n" % e)
use WWW::ClickSendClient::PostLetterApi;
use WWW::ClickSendClient::Object::PostLetter;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::PostLetterApi->new(username => $username, password => $password);

my %params = (
    'file_url'   => 'https://<file_url>',
    'recipients' => [
        {
            'return_address_id'   => 0,
            'schedule'            => 0,
            'address_postal_code' => '123456',
            'address_country'     => 'AU',
            'address_line_1'      => 'address_line_1',
            'address_state'       => 'address_state',
            'address_name'        => 'address_name',
            'address_line_2'      => 'address_line_2',
            'address_city'        => 'address_city'
        }
    ],
    'template_used' => '0',
    'duplex'        => '0',
    'colour'        => '0',
    'source'        => 'perl-sdk'
);

my $post_letter_obj = WWW::ClickSendClient::Object::PostLetter->new(%params);
my $json_output = $api->post_letters_price_post('post_letter'=> $post_letter_obj);

print $json_output;
#import "CSPostLetterApi.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
[apiConfig setUsername:@"USERNAME"];
[apiConfig setPasswor

CSPostRecipient *recipient =[[CSPostRecipient alloc] init];
recipient.addressName = @"address_name";
recipient.addressLine1 = @"address_line1";
recipient.addressLine2 = @"address_line2";
recipient.addressCity = @"address_city";
recipient.addressState = @"address_state";
recipient.addressPostalCode = @"address_postalcode";
recipient.addressCountry = @"address_country";
recipient.returnAddressId =nil;
recipient.schedule =nil;

CSPostLetter *postLetter = [[CSPostLetter alloc] init];
postLetter.fileUrl = @"file_url";
postLetter.priorityPost = 0;
postLetter.templateUsed = 0;
postLetter.duplex = 0;
postLetter.colour = 0;
postLetter.source = @"objc";
postLetter.recipients = [NSArray arrayWithObjects:recipient, nil];

CSPostLetterApi *postLetterApiInstance = [[CSPostLetterApi alloc] init];
[postLetterApiInstance postLettersPricePostWithPostLetter:postLetter completionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire

if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}

let recipients = PostRecipient(addressName: "address_name",
                               addressLine1: "address_line1",
                               addressLine2: "address_line@",
                               addressCity: "address_city",
                               addressState: "address_State",
                               addressPostalCode: "address_postalcode",
                               addressCountry: "address_Country",
                               returnAddressId: 1, schedule: nil)

let postLetter = PostLetter(fileUrl: "file_url",
                            priorityPost: nil,
                            recipients: [recipients],
                            templateUsed: nil,
                            duplex: nil,
                            colour: nil,
                            source: "swift")

PostLetterAPI.postLettersPricePost(postLetter: postLetter) { (dataString, error) in
    guard let dataString = dataString else {
        print(error!)
        return
    }
    if let data = dataString.data(using: String.Encoding.utf8) {
        do {
            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                print(dictonary)
            } else {
                print("Cannot convert the String value to JSON")
            }
        } catch let error as NSError {
            print(error)
        }
    }
}
    Coming Soon
package ClickSend;

import java.util.Arrays;
import java.util.List;
import ClickSend.Api.PostLetterApi;
import ClickSend.Model.PostLetter;
import ClickSend.Model.PostRecipient;

public class calculate_letter_price {
  public static void main(String[] args) {
    ApiClient defaultClient = new ApiClient();
    defaultClient.setUsername("USERNAME");
    defaultClient.setPassword("API_KEY");
    PostLetterApi apiInstance = new PostLetterApi(defaultClient);
    PostRecipient recipient= new PostRecipient(); 
    recipient.addressName("name");
    recipient.addressLine1("line1");
    recipient.addressLine2("line2");
    recipient.addressCity("city");
    recipient.addressState("state");
    recipient.addressPostalCode("code");
    recipient.addressCountry("country");
    recipient.returnAddressId(new Integer(1));
    recipient.schedule(new Integer(147852369));
    List<PostRecipient> recipientList=Arrays.asList(recipient);
    PostLetter postLetter = new PostLetter(); // PostLetter | PostLetter model
    postLetter.fileUrl("http://www.africau.edu/images/default/sample.pdf");
    postLetter.templateUsed(new Integer(1));
    postLetter.duplex(new Integer(0));
    postLetter.colour(new Integer(1));
    postLetter.source("source");
    postLetter.recipients(recipientList);
    try {
        String result = apiInstance.postLettersPricePost(postLetter);
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling PostLetterApi#postLettersPricePost");
        e.printStackTrace();
    }
  }
}

Body parameter

{
  "file_url": "file_url",
  "colour": 0,
  "recipients": [
    {
      "return_address_id": 0,
      "schedule": 0,
      "address_postal_code": "address_postal_code",
      "address_country": "address_country",
      "address_line_1": "address_line_1",
      "address_state": "address_state",
      "address_name": "address_name",
      "address_line_2": "address_line_2",
      "address_city": "address_city"
    }
  ],
  "template_used": 0,
  "duplex": 0,
  "source": "sdk"
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "Here are some results.",
  "data": {
    "total_price": 1.87,
    "total_cost": 1,
    "recipients": [
      {
        "user_id": 1,
        "subaccount_id": 1,
        "message_id": "06FAD39C-78FD-4D2F-B606-9846D1979F35",
        "address_name": "John Smith",
        "address_line_1": "131",
        "address_line_2": "Scheuvront Drive",
        "address_city": "DENVER",
        "address_state": "CO",
        "address_postal_code": "80202",
        "address_country": "AU",
        "return_address_id": 1,
        "schedule": 1449573604,
        "post_pages": 3,
        "post_price": "1.8700",
        "priority_post": 0,
        "date_added": 1449662203,
        "status": "SUCCESS"
      }
    ]
  }
}

https://rest.clicksend.com/v3/post/letters/price

Calculate letter price

Properties

Name Type Required Restrictions Description
file_url string true none URL of file to send
address_name string true none Name of address
address_line_1 string true none First line of address
address_line_2 string true none Second line of address
address_city string true none City
address_state string true none State
address_postal_code string true none Postal code
address_country string true none Country
return_address_id integer(int32) true none ID of return address to use
schedule integer(int32) false none When to send letter (0/null=now)
template_used integer(int1) false none Whether using our letter template. Flag value must be 1 for yes or 0 for no.
duplex integer(int1) false none Whether letter is duplex. Flag value must be 1 for yes or 0 for no.
colour integer(int1) false none Whether letter is in colour. Flag value must be 1 for yes or 0 for no.
priority_post integer(int1) false none Whether letter is priority. Flag value must be 1 for yes or 0 for no.
source string false none Source being sent from

Refer to Status Codes for definitions of HTTP status code responses.

Cancel Scheduled Letter

Code samples

    Coming Soon
    Coming Soon
    Coming Soon
    Coming Soon
    Coming Soon
    Coming Soon
    Coming Soon
    Coming Soon
    Coming Soon
    Coming Soon
    Coming Soon

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "Scheduled letter has been cancelled.",
  "data": true
}

https://rest.clicksend.com/v3/post/letters/{message_id}/cancel

Cancel scheduled letter

Parameters

Parameter In Type Required Description
message_id query string true Message ID of the scheduled letter that is to be cancelled.

Refer to Status Codes for definitions of HTTP status code responses.

View Letter History

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \

'https://rest.clicksend.com/v3/post/letters/history'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\PostLetterApi(new GuzzleHttp\Client(),$config);
$page = 1; // int | Page number
$limit = 10; // int | Number of records per page

try {
    $result = $apiInstance->postLettersHistoryGet($page, $limit);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling PostLetterApi->postLettersHistoryGet: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME, 
    Password = API_KEY  
};
var postLetterApi = new PostLetterApi(configuration);
var response = postLetterApi.PostLettersHistoryGet();
var api = require('./api.js');

var letterApi = new api.PostLetterApi("USERNAME", "API_KEY");

var page = 1;
var limit = 10;

letterApi.postLettersHistoryGet(page, limit).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::PostLetterApi.new

opts = {
  page: 1, # Integer | Page number
  limit: 10 # Integer | Number of records per page
}

begin
  # Get all post letter history
  result = api_instance.post_letters_history_get(opts)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling PostLetterApi->post_letters_history_get: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.PostLetterApi(clicksend_client.ApiClient(configuration))
page = 1 # int | Page number (optional) (default to 1)
limit = 10 # int | Number of records per page (optional) (default to 10)

try:
    # Get all post letter history
    api_response = api_instance.post_letters_history_get(page=page, limit=limit)
    print(api_response)
except ApiException as e:
    print("Exception when calling PostLetterApi->post_letters_history_get: %s\n" % e)
use WWW::ClickSendClient::PostLetterApi;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::PostLetterApi->new(username => $username, password => $password);

my $json_output = $api->post_letters_history_get('page' => '1' ,'limit' => '');

print $json_output;
#import "CSPostLetterApi.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
[apiConfig setUsername:@"USERNAME"];
[apiConfig setPassword:@"PASSWORD"];

NSNumber *page = [[NSNumber alloc] initWithInt:1];
NSNumber *limit = [[NSNumber alloc] initWithInt:15];

CSPostLetterApi *postLetterApiInstance = [[CSPostLetterApi alloc] init];
[postLetterApiInstance postLettersHistoryGetWithPage:page limit:limit completionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire

if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}

PostLetterAPI.postLettersHistoryGet(page: 1, limit: 15) { (dataString, error) in
    guard let dataString = dataString else {
        print(error!)
        return
    }
    if let data = dataString.data(using: String.Encoding.utf8) {
        do {
            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                print(dictonary)
            } else {
                print("Cannot convert the String value to JSON")
            }
        } catch let error as NSError {
            print(error)
        }
    }
}
    Coming Soon
package ClickSend;

import ClickSend.Api.PostLetterApi;

public class view_letter_history {
  public static void main(String[] args) {
    ApiClient defaultClient = new ApiClient();
    defaultClient.setUsername("USERNAME");
    defaultClient.setPassword("API_KEY");
    PostLetterApi apiInstance = new PostLetterApi(defaultClient);
    Integer page = 1; // Integer | Page number
    Integer limit = 10; // Integer | Number of records per page
    try {
        String result = apiInstance.postLettersHistoryGet(page, limit);
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling PostLetterApi#postLettersHistoryGet");
        e.printStackTrace();
    }
  }
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "Here is your history.",
  "data": {
    "total": 1,
    "per_page": 15,
    "current_page": 1,
    "last_page": 1,
    "next_page_url": null,
    "prev_page_url": null,
    "from": 1,
    "to": 1,
    "data": [
      {
        "user_id": 1,
        "subaccount_id": 1,
        "list_id": null,
        "message_id": "7C0CF79F-F6E0-471D-8CC8-D7AB34A4D423",
        "address_name": "John Smith",
        "address_line_1": "130 Scheuvront Drive",
        "address_line_2": null,
        "address_city": "DENVER",
        "address_state": "CO",
        "address_postal_code": "80202",
        "address_country": "AU",
        "return_address_id": 4,
        "custom_string": null,
        "schedule": null,
        "source": null,
        "colour": 0,
        "duplex": 0,
        "post_pages": 1,
        "post_price": "1.100000",
        "status": "Queued:Stamped",
        "status_code": "",
        "status_text": "",
        "date_added": 1447642486
      }
    ]
  }
}

https://rest.clicksend.com/v3/post/letters/history

Get all letter history

Parameters

Parameter In Type Required Description
page query integer(int32) false Page number
limit query integer(int32) false Number of records per page

Refer to Status Codes for definitions of HTTP status code responses.

Export Letter History

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \

'https://rest.clicksend.com/v3/post/letters/history/export?filename={filename}'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
->setUsername('USERNAME')
->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\PostLetterApi(new GuzzleHttp\Client(),$config);
$filename = "filename_example"; // string | Filename to download history as

try {
$result = $apiInstance->postLettersHistoryExportGet($filename);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling PostLetterApi->PostLettersHistoryExportGet: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME, 
    Password = API_KEY  
};
var postLetterApi = new PostLetterApi(configuration);
var response = postLetterApi.PostLettersExportGet("filename");
var api = require('./api.js');

var letterApi = new api.PostLetterApi("USERNAME", "API_KEY");

var filename = "filename";

letterApi.postLettersExportGet(filename).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::PostLetterApi.new

filename = "filename_example" # String | Filename to export to

begin
  # export post letter history
  result = api_instance.post_letters_export_get(filename)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling PostLetterApi->post_letters_export_get: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.PostLetterApi(clicksend_client.ApiClient(configuration))
filename = 'filename_example' # str | Filename to export to

try:
    # export post letter history
    api_response = api_instance.post_letters_export_get(filename)
    print(api_response)
except ApiException as e:
    print("Exception when calling PostLetterApi->post_letters_export_get: %s\n" % e)
use WWW::ClickSendClient::PostLetterApi;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::PostLetterApi->new(username => $username, password => $password);

my $json_output = $api->post_letters_export_get('filename' => 'filename');

print $json_output;
#import "CSPostLetterApi.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
[apiConfig setUsername:@"USERNAME"];
[apiConfig setPassword:@"PASSWORD"];

CSPostLetterApi *postLetterApiInstance = [[CSPostLetterApi alloc] init];
[postLetterApiInstance postLettersExportGetWithFilename:@"file_name" completionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire

if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}

PostLetterAPI.postLettersExportGet(filename: "filename") { (dataString, error) in
    guard let dataString = dataString else {
        print(error!)
        return
    }
    if let data = dataString.data(using: String.Encoding.utf8) {
        do {
            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                print(dictonary)
            } else {
                print("Cannot convert the String value to JSON")
            }
        } catch let error as NSError {
            print(error)
        }
    }
}
    Coming Soon
package ClickSend;

import ClickSend.Api.PostLetterApi;

public class export_letter_history {
  public static void main(String[] args) {
    ApiClient defaultClient = new ApiClient();
    defaultClient.setUsername("USERNAME");
    defaultClient.setPassword("API_KEY");
    PostLetterApi apiInstance = new PostLetterApi(defaultClient);
    String filename = "filename_example"; // String | Filename to export to
    try {
        String result = apiInstance.postLettersExportGet(filename);
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling PostLetterApi#postLettersExportGet");
        e.printStackTrace();
    }
  }
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "Download your file here.",
  "data": {
    "url": "https://rest.clicksend.com/files/22D55AF9-6CF0-476D-A8B3-82A998FD2738?filename=export.csv"
  }
}

https://rest.clicksend.com/v3/post/letters/export

export letter history

Parameters

Parameter In Type Required Description
filename query string true Filename to export to

Refer to Status Codes for definitions of HTTP status code responses.

Postcard

Send Postcard

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
     --request POST \

     --header "Content-Type: application/json" \
     --data-binary "{
    \"file_urls\":[
         \"https://s3-ap-southeast-2.amazonaws.com/clicksend-api-downloads/_public/_examples/a5_front.pdf\",
         \"https://s3-ap-southeast-2.amazonaws.com/clicksend-api-downloads/_public/_examples/a5_back.pdf\"
    ],
    \"recipients\":[
        {
            \"address_name\":\"John Smith\",
            \"address_line_1\":\"Address 1\",
            \"address_line_2\":\"\",
            \"address_city\":\"City\",
            \"address_state\":\"State\",
            \"address_postal_code\":\"123456\",
            \"address_country\":\"AU\",
            \"return_address_id\":1,
            \"custom_string\": \"Custom abc123\"
        }
    ]
}" \
'https://rest.clicksend.com/v3/post/postcards/send'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\PostPostcardApi(new GuzzleHttp\Client(),$config);
$post_recipient = new \ClickSend\Model\PostRecipient();
$post_recipient->setAddressName("My Home Address");
$post_recipient->setAddressLine1("Address 1");
$post_recipient->setAddressLine2("Address 2");
$post_recipient->setaddressCity("city");
$post_recipient->setaddressState("state");
$post_recipient->setAddressPostalCode("code");
$post_recipient->setAddressCountry("country");
$post_recipient->setReturnAddressId(1);
$post_recipient->setSchedule(1577013071);
$post_postcards = new \ClickSend\Model\PostPostcard(); // \ClickSend\Model\PostPostcard | PostPostcard model
$post_postcards->setFileUrls(["https://s3-ap-southeast-2.amazonaws.com/clicksend-api-downloads/_public/_examples/a5_front.pdf",
         "https://s3-ap-southeast-2.amazonaws.com/clicksend-api-downloads/_public/_examples/a5_back.pdf"]);
$post_postcards->setRecipients([$post_recipient]);
try {
    $result = $apiInstance->postPostcardsSendPost($post_postcards);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling PostPostcardApi->postPostcardsSendPost: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME, 
    Password = API_KEY  
};
var postPostcardApi = new PostPostcardApi(configuration);
var listOfFileUrls = new List<string>();
listOfFileUrls.Add("https://s3-ap-southeast-2.amazonaws.com/clicksend-api-downloads/_public/_examples/a5_front.pdf");
listOfFileUrls.Add("https://s3-ap-southeast-2.amazonaws.com/clicksend-api-downloads/_public/_examples/a5_back.pdf");
var listOfRecipients = new List<PostRecipient>();
listOfRecipients.Add(new PostRecipient(
    addressName: "John Smith",
    addressLine1: "Address 1",
    addressLine2: "Address 2",
    addressCity: "City",
    addressState: "State",
    addressPostalCode: "Postal Code",
    addressCountry: "US",
    returnAddressId:  RETURN_ADDRESS_ID,
    schedule: TimeStamp
));
var response = postPostcardApi.PostPostcardsSendPost(new PostPostcard(
    fileUrls:  listOfFileUrls,
    recipients: listOfRecipients
));
var api = require('./api.js');

var postcardApi = new api.PostPostcardApi("USERNAME", "API_KEY");

var recipient = new api.PostRecipient();

recipient.addressName = "John Smith";
recipient.addressLine1 = "Address 1";
recipient.addressLine2 = "";
recipient.addressCity = "city";
recipient.addressState = "state";
recipient.addressPostalCode = "123456";
recipient.addressCountry = "country";
recipient.returnAddressId = 1;

var postPostcards = new api.PostPostcard();

postPostcards.fileUrls = ["https://s3-ap-southeast-2.amazonaws.com/clicksend-api-downloads/_public/_examples/a5_front.pdf",
         "https://s3-ap-southeast-2.amazonaws.com/clicksend-api-downloads/_public/_examples/a5_back.pdf"]
postPostcards.recipients = [recipient]

postcardApi.postPostcardsSendPost(postPostcards).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::PostPostcardApi.new

# PostPostcard | PostPostcard model
post_postcards = ClickSendClient::PostPostcard.new(
  "file_urls": ["file_urls", "file_urls"],
  "recipients": [
    ClickSendClient::PostRecipient.new(
      "address_name": "address_name",
      "address_line_1": "address_line_1",
      "address_line_2": "address_line_2",
      "address_postal_code": "address_postal_code",
      "address_city": "address_city",
      "address_state": "address_state",
      "address_country": "address_country",
      "return_address_id": 0,
      "schedule": 0
    )
  ]
)

begin
  # Send one or more postcards
  result = api_instance.post_postcards_send_post(post_postcards)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling PostPostcardApi->post_postcards_send_post: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client import PostRecipient
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.PostPostcardApi(clicksend_client.ApiClient(configuration))

recipient=PostRecipient(address_name="John Smith",
                        address_line_1="Address 1",
                        address_line_2="",
                        address_city="City",
                        address_state="State",
                        address_postal_code="123456",
                        address_country="AU",
                        return_address_id=1)
file_url_list=["https://s3-ap-southeast-2.amazonaws.com/clicksend-api-downloads/_public/_examples/a5_front.pdf",
         "https://s3-ap-southeast-2.amazonaws.com/clicksend-api-downloads/_public/_examples/a5_back.pdf"]
# PostPostcard | PostPostcard model
post_postcards = clicksend_client.PostPostcard(file_urls=file_url_list,recipients=[recipient]) 
try:
    # Send one or more postcards
    api_response = api_instance.post_postcards_send_post(post_postcards)
    print(api_response)
except ApiException as e:
    print("Exception when calling PostPostcardApi->post_postcards_send_post: %s\n" % e)
use WWW::ClickSendClient::PostPostcardApi;
use WWW::ClickSendClient::Object::PostPostcard;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::PostPostcardApi->new(username => $username, password => $password);

my %params = (
    'file_urls' => [
        'https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf',
        'https://yourdomain.com/pdf/dummy.pdf',
    ],
    'recipients' => [
        {
            'return_address_id'   => 0,
            'schedule'            => 0,
            'address_postal_code' => '12345',
            'address_country'     => 'address_country',
            'address_line_1'      => 'address_line_1',
            'address_state'       => 'address_state',
            'address_name'        => 'address_name',
            'address_line_2'      => 'address_line_2',
            'address_city'        => 'address_city'
        }
    ]
);

my $post_postcards_obj = WWW::ClickSendClient::Object::PostPostcard->new(%params);

my $json_output = $api->post_postcards_send_post('post_postcards' => $post_postcards_obj);

print $json_output;
#import "CSPostPostcardApi.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
[apiConfig setUsername:@"USERNAME"];
[apiConfig setPassword:@"PASSWORD"];

CSPostPostcard *postPostcards = [[CSPostPostcard alloc] init];

CSPostRecipient *postRecipient = [[CSPostRecipient alloc] init];
postRecipient.addressName = @"address_name";
postRecipient.addressLine1 = @"address_line1";
postRecipient.addressLine2 = @"address_line2";
postRecipient.addressCity = @"address_city";
postRecipient.addressState = @"addressState";
postRecipient.addressPostalCode = @"address_postalcode";
postRecipient.addressCountry = @"address_country";
postRecipient.returnAddressId = 0;
postRecipient.schedule = 0;

CSPostPostcardApi *postPostcardApiInstance = [[CSPostPostcardApi alloc] init];
[postPostcardApiInstance postPostcardsPricePostWithPostPostcards:postPostcards completionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire

if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}

let postRecipient1 = PostRecipient(addressName: "address_name",
                                   addressLine1: "address_line1",
                                   addressLine2: "address_line2",
                                   addressCity: "address_city",
                                   addressState: "address_state",
                                   addressPostalCode: "address_postalcode",
                                   addressCountry: "address_country",
                                   returnAddressId: 1,
                                   schedule: nil)

let postRecipients = [postRecipient1]
let postPostcards =  PostPostcard(fileUrls: ["fileUrls"], recipients: postRecipients)

PostPostcardAPI.postPostcardsSendPost(postPostcards: postPostcards) { (dataString, error) in
    guard let dataString = dataString else {
        print(error!)
        return
    }
    if let data = dataString.data(using: String.Encoding.utf8) {
        do {
            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                print(dictonary)
            } else {
                print("Cannot convert the String value to JSON")
            }
        } catch let error as NSError {
            print(error)
        }
    }
}
    Coming Soon
package ClickSend;

import java.util.Arrays;
import java.util.List;
import ClickSend.Api.PostPostcardApi;
import ClickSend.Model.PostPostcard;
import ClickSend.Model.PostRecipient;

public class send_postcard {
  public static void main(String[] args) {
    ApiClient defaultClient = new ApiClient();
    defaultClient.setUsername("USERNAME");
    defaultClient.setPassword("API_KEY");
    PostPostcardApi apiInstance = new PostPostcardApi(defaultClient);
    PostRecipient recipient= new PostRecipient(); 
    recipient.addressName("name");
    recipient.addressLine1("line1");
    recipient.addressLine2("line2");
    recipient.addressCity("city");
    recipient.addressState("state");
    recipient.addressPostalCode("code");
    recipient.addressCountry("country");
    recipient.returnAddressId(new Integer(1));
    recipient.schedule(new Integer(1545477071));
    List<PostRecipient> recipientList=Arrays.asList(recipient);
    List<String> fileUrlList = Arrays.asList("https://s3-ap-southeast-2.amazonaws.com/clicksend-api-downloads/_public/_examples/a5_front.pdf", 
      "https://s3-ap-southeast-2.amazonaws.com/clicksend-api-downloads/_public/_examples/a5_back.pdf");
    PostPostcard postPostcards = new PostPostcard(); // PostPostcard | PostPostcard model
    postPostcards.fileUrls(fileUrlList);
    postPostcards.recipients(recipientList);
    try {
        String result = apiInstance.postPostcardsSendPost(postPostcards);
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling PostPostcardApi#postPostcardsSendPost");
        e.printStackTrace();
    }
  }
}

Body parameter

{
  "recipients": [
    {
      "return_address_id": 0,
      "schedule": 0,
      "address_postal_code": "address_postal_code",
      "address_country": "address_country",
      "address_line_1": "address_line_1",
      "address_state": "address_state",
      "address_name": "address_name",
      "address_line_2": "address_line_2",
      "address_city": "address_city"
    }
  ],
  "file_urls": [
    "file_urls",
    "file_urls"
  ]
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "Postcard queued for delivery.",
  "data": {
    "total_price": 11,
    "total_count": 1,
    "queued_count": 1,
    "recipients": [
      {
        "user_id": 1,
        "subaccount_id": 13,
        "message_id": "C8CAA97A-905A-4A31-99CB-A92C7BA05A97",
        "address_name": "John Smith",
        "address_line_1": "Address 1",
        "address_line_2": "",
        "address_city": "CITY",
        "address_state": "State",
        "address_postal_code": "123456",
        "address_country": "AU",
        "return_address_id": 1,
        "letter_file_name": "6A559A74-486D-4012-84D7-F3FE11904CB1.pdf",
        "schedule": 1482473172,
        "ip_address": "127.0.0.1",
        "source": ".rest.v3",
        "post_price": 11,
        "priority": 32,
        "status": "SUCCESS",
        "date_added": 1482473172,
        "_file_url": "https://rest.clicksend.com/files/6A559A74-486D-4012-84D7-F3FE11904CB1.pdf",
        "_return_address": {
          "return_address_id": 1,
          "user_id": 1,
          "address_name": "John Doe",
          "address_line_1": "123 Test St",
          "address_line_2": "",
          "address_city": "Perth",
          "address_state": "WA",
          "address_postal_code": "6000",
          "address_country": "AU"
        },
        "_api_username": "johndoe"
      }
    ],
    "_currency": {
      "currency_name_short": "AUD",
      "currency_prefix_d": "$",
      "currency_prefix_c": "c",
      "currency_name_long": "Australian Dollars"
    }
  }
}

https://rest.clicksend.com/v3/post/postcards/send

Send one or more postcards

Supported File Types

We support PDF, docx, doc, jpg, gif, png, and bmp. Contact us to add support for any other file type. If you're using docx, doc, jpg, gif, png, or bmp files, you'll need to convert the file first using our uploads endpoint with the querystring parameter ?convert=postcard. e.g. POST /uploads?convert=postcard. This will return a URL to the converted pdf file that can be used in the /post/postcards/send endpoint.

Postcard Specification Guide

Follow our Postcard specification guide to ensure correct sending and postcard template information.

Postcard File Options

Use existing URL

With this option, you can use an existing URL to a pdf document. For example, you might generate the pdf on your server.

When using an existing url make sure that it is publicly accessible as it will not work if it is private.

For file_urls field. You can attach at least 1 and max of 2 PDF file urls.

Upload File to Our Server

With this option, you can use the /uploads endpoint to upload the document. The /uploads endpoint returns a URL that can be used in the /post/postcards/send endpoint.

Properties

Name Type Required Restrictions Description
file_urls [string] true none Postcard file URLs
address_name string true none Name of address
address_line_1 string true none First line of address
address_line_2 string true none Second line of address
address_city string true none City
address_state string true none State
address_postal_code string true none Postal code
address_country string true none Country
return_address_id integer(int32) true none ID of return address to use
schedule integer(int32) false none When to send letter (0/null=now)

Refer to Status Codes for definitions of HTTP status code responses.

Calculate Postcard Price

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
     --request POST \

     --header "Content-Type: application/json" \
     --data-binary "{
    \"file_urls\":[
        \"https://s3-ap-southeast-2.amazonaws.com/clicksend-api-downloads/_public/_examples/a5_front.pdf\",
        \"https://s3-ap-southeast-2.amazonaws.com/clicksend-api-downloads/_public/_examples/a5_back.pdf\"
    ],
    \"recipients\":[
        {
            \"address_name\":\"John Smith\",
            \"address_line_1\":\"Address 1\",
            \"address_line_2\":\"\",
            \"address_city\":\"City\",
            \"address_state\":\"State\",
            \"address_postal_code\":\"123456\",
            \"address_country\":\"AU\",
            \"custom_string\":\"Custom abc123\",
            \"return_address_id\":1
        }
    ]
}" \
'https://rest.clicksend.com/v3/post/postcards/price'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\PostPostcardApi(new GuzzleHttp\Client(),$config);
$post_recipient = new \ClickSend\Model\PostRecipient();
$post_recipient->setAddressName("My Home Address");
$post_recipient->setAddressLine1("Address 1");
$post_recipient->setAddressLine2("Address 2");
$post_recipient->setaddressCity("city");
$post_recipient->setaddressState("state");
$post_recipient->setAddressPostalCode("code");
$post_recipient->setAddressCountry("country");
$post_recipient->setReturnAddressId(1);
$post_recipient->setSchedule(1577013071);
$post_postcards = new \ClickSend\Model\PostPostcard(); // \ClickSend\Model\PostPostcard | PostPostcard model
$post_postcards->setFileUrls(["https://s3-ap-southeast-2.amazonaws.com/clicksend-api-downloads/_public/_examples/a5_front.pdf",
         "https://s3-ap-southeast-2.amazonaws.com/clicksend-api-downloads/_public/_examples/a5_back.pdf"]);
$post_postcards->setRecipients([$post_recipient]);

try {
    $result = $apiInstance->postPostcardsPricePost($post_postcards);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling PostPostcardApi->postPostcardsPricePost: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME, 
    Password = API_KEY  
};
var postPostcardApi = new PostPostcardApi(configuration);
var listOfFileUrls = new List<string>();
listOfFileUrls.Add("https://s3-ap-southeast-2.amazonaws.com/clicksend-api-downloads/_public/_examples/a5_front.pdf");
listOfFileUrls.Add("https://s3-ap-southeast-2.amazonaws.com/clicksend-api-downloads/_public/_examples/a5_back.pdf");
var listOfRecipients = new List<PostRecipient>();
listOfRecipients.Add(new PostRecipient(
    addressName: "John Smith",
    addressLine1: "Address 1",
    addressLine2: "Address 2",
    addressCity: "City",
    addressState: "State",
    addressPostalCode: "Postal Code",
    addressCountry: "US",
    returnAddressId:  RETURN_ADDRESS_ID,
    schedule: TimeStamp
));
var response = postPostcardApi.PostPostcardsPricePost(new PostPostcard(
    fileUrls:  listOfFileUrls,
    recipients: listOfRecipients
));
var api = require('./api.js');

var postcardApi = new api.PostPostcardApi("USERNAME", "API_KEY");

var recipient = new api.PostRecipient();

recipient.addressName = "John Smith";
recipient.addressLine1 = "Address 1";
recipient.addressLine2 = "";
recipient.addressCity = "city";
recipient.addressState = "state";
recipient.addressPostalCode = "123456";
recipient.addressCountry = "country";
recipient.returnAddressId = 1;

var postPostcards = new api.PostPostcard();

postPostcards.fileUrls = ["https://s3-ap-southeast-2.amazonaws.com/clicksend-api-downloads/_public/_examples/a5_front.pdf",
         "https://s3-ap-southeast-2.amazonaws.com/clicksend-api-downloads/_public/_examples/a5_back.pdf"]
postPostcards.recipients = [recipient]

postcardApi.postPostcardsPricePost(postPostcards).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::PostPostcardApi.new

# PostPostcard | PostPostcard model
post_postcards = ClickSendClient::PostPostcard.new(
  "file_urls": [
    "file_urls",
    "file_urls"
  ],
  "recipients": [
    ClickSendClient::PostRecipient.new(
      "address_name": "address_name",
      "address_line_1": "address_line_1",
      "address_line_2": "address_line_2",
      "address_postal_code": "11111",
      "address_city": "address_city",
      "address_state": "address_state",
      "address_country": "US",
      "return_address_id": 0,
      "schedule": 0
    )
  ]
)

begin
  # Calculate price for sending one or more postcards
  result = api_instance.post_postcards_price_post(post_postcards)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling PostPostcardApi->post_postcards_price_post: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client import PostRecipient
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.PostPostcardApi(clicksend_client.ApiClient(configuration))
recipient=PostRecipient(address_name="John Smith",
                        address_line_1="Address 1",
                        address_line_2="",
                        address_city="City",
                        address_state="State",
                        address_postal_code="123456",
                        address_country="AU",
                        return_address_id=1)
file_url_list=["https://s3-ap-southeast-2.amazonaws.com/clicksend-api-downloads/_public/_examples/a5_front.pdf",
         "https://s3-ap-southeast-2.amazonaws.com/clicksend-api-downloads/_public/_examples/a5_back.pdf"]
# PostPostcard | PostPostcard model 
post_postcards = clicksend_client.PostPostcard(file_urls=file_url_list,recipients=[recipient]) 

try:
    # Calculate price for sending one or more postcards
    api_response = api_instance.post_postcards_price_post(post_postcards)
    print(api_response)
except ApiException as e:
    print("Exception when calling PostPostcardApi->post_postcards_price_post: %s\n" % e)
use WWW::ClickSendClient::PostPostcardApi;
use WWW::ClickSendClient::Object::PostPostcard;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::PostPostcardApi->new(username => $username, password => $password);

my %params = (
    'file_urls' => [
        'https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf',
        'https://yourdomain.com/pdf/dummy.pdf',
    ],
    'recipients' => [
        {
            'return_address_id'   => 0,
            'schedule'            => 0,
            'address_postal_code' => '12345',
            'address_country'     => 'address_country',
            'address_line_1'      => 'address_line_1',
            'address_state'       => 'address_state',
            'address_name'        => 'address_name',
            'address_line_2'      => 'address_line_2',
            'address_city'        => 'address_city'
        }
    ]
);

my $post_postcards_obj = WWW::ClickSendClient::Object::PostPostcard->new(%params);

my $json_output = $api->post_postcards_price_post('post_postcards' => $post_postcards_obj);

print $json_output;
#import "CSPostPostcardApi.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
[apiConfig setUsername:@"USERNAME"];
[apiConfig setPassword:@"PASSWORD"];

CSPostPostcard *postPostcards = [[CSPostPostcard alloc] init];

CSPostRecipient *postRecipient = [[CSPostRecipient alloc] init];
postRecipient.addressName = @"address_name";
postRecipient.addressLine1 = @"address_line1";
postRecipient.addressLine2 = @"address_line2";
postRecipient.addressCity = @"address_city";
postRecipient.addressState = @"address_state";
postRecipient.addressPostalCode = @"address_postalcode";
postRecipient.addressCountry = @"address_country";
postRecipient.returnAddressId = 0;
postRecipient.schedule = 0;

CSPostPostcardApi *postPostcardApiInstance = [[CSPostPostcardApi alloc] init];
[postPostcardApiInstance postPostcardsPricePostWithPostPostcards:postPostcards completionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire

if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}

let PostRecipient1 = PostRecipient(addressName: "addressName",
                                   addressLine1: "addressLine1",
                                   addressLine2: "addressLine2",
                                   addressCity: "addressCity",
                                   addressState: "addressStete",
                                   addressPostalCode: "addressPostalCode",
                                   addressCountry: "addressCountry",
                                   returnAddressId: 1,
                                   schedule: nil)

let PostRecipients = [PostRecipient1]

let postPostcards = PostPostcard(fileUrls: ["fileUrls"], recipients: PostRecipients)
PostPostcardAPI.postPostcardsPricePost(postPostcards:postPostcards) { (dataString, error) in
    guard let dataString = dataString else {
        print(error!)
        return
    }
    if let data = dataString.data(using: String.Encoding.utf8) {
        do {
            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                print(dictonary)
            } else {
                print("Cannot convert the String value to JSON")
            }
        } catch let error as NSError {
            print(error)
        }
    }
}
    Coming Soon
package ClickSend;

import java.util.Arrays;
import java.util.List;
import ClickSend.Api.PostPostcardApi;
import ClickSend.Model.PostPostcard;
import ClickSend.Model.PostRecipient;

public class calculate_postcard_price {
  public static void main(String[] args) {
    ApiClient defaultClient = new ApiClient();
    defaultClient.setUsername("USERNAME");
    defaultClient.setPassword("API_KEY");
    PostPostcardApi apiInstance = new PostPostcardApi(defaultClient);
    PostRecipient recipient= new PostRecipient(); 
    recipient.addressName("name");
    recipient.addressLine1("line1");
    recipient.addressLine2("line2");
    recipient.addressCity("city");
    recipient.addressState("state");
    recipient.addressPostalCode("code");
    recipient.addressCountry("country");
    recipient.returnAddressId(new Integer(1));
    recipient.schedule(new Integer(1545477071));
    List<PostRecipient> recipientList=Arrays.asList(recipient);
    List<String> fileUrlList = Arrays.asList("https://s3-ap-southeast-2.amazonaws.com/clicksend-api-downloads/_public/_examples/a5_front.pdf", 
      "https://s3-ap-southeast-2.amazonaws.com/clicksend-api-downloads/_public/_examples/a5_back.pdf");
    // PostPostcard | PostPostcard model
    PostPostcard postPostcards = new PostPostcard(); 
    postPostcards.fileUrls(fileUrlList);
    postPostcards.recipients(recipientList);
    try {
        String result = apiInstance.postPostcardsPricePost(postPostcards);
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling PostPostcardApi#postPostcardsPricePost");
        e.printStackTrace();
    }
  }
}

Body parameter

{
  "recipients": [
    {
      "return_address_id": 0,
      "schedule": 0,
      "address_postal_code": "address_postal_code",
      "address_country": "address_country",
      "address_line_1": "address_line_1",
      "address_state": "address_state",
      "address_name": "address_name",
      "address_line_2": "address_line_2",
      "address_city": "address_city"
    }
  ],
  "file_urls": [
    "file_urls",
    "file_urls"
  ]
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "Here is some pricing.",
  "data": {
    "total_price": 11,
    "total_count": 1,
    "queued_count": 1,
    "recipients": [
      {
        "user_id": 1,
        "subaccount_id": 13,
        "message_id": "C8CAA97A-905A-4A31-99CB-A92C7BA05A97",
        "address_name": "John Smith",
        "address_line_1": "Address 1",
        "address_line_2": "",
        "address_city": "CITY",
        "address_state": "State",
        "address_postal_code": "123456",
        "address_country": "AU",
        "return_address_id": 1,
        "letter_file_name": "6A559A74-486D-4012-84D7-F3FE11904CB1.pdf",
        "schedule": 1482473172,
        "ip_address": "127.0.0.1",
        "source": ".rest.v3",
        "post_price": 11,
        "priority": 32,
        "status": "SUCCESS",
        "date_added": 1482473172,
        "_file_url": "https://rest.clicksend.com/files/6A559A74-486D-4012-84D7-F3FE11904CB1.pdf",
        "_return_address": {
          "return_address_id": 1,
          "user_id": 1,
          "address_name": "John Doe",
          "address_line_1": "123 Test St",
          "address_line_2": "",
          "address_city": "Perth",
          "address_state": "WA",
          "address_postal_code": "6000",
          "address_country": "AU"
        },
        "_api_username": "johndoe"
      }
    ],
    "_currency": {
      "currency_name_short": "AUD",
      "currency_prefix_d": "$",
      "currency_prefix_c": "c",
      "currency_name_long": "Australian Dollars"
    }
  }
}

https://rest.clicksend.com/v3/post/postcards/price

Calculate price for sending one or more postcards

For file_urls field. You can attach at least 1 and max of 2 PDF file urls.

Properties

Name Type Required Restrictions Description
file_urls [string] true none Postcard file URLs
address_name string true none Name of address
address_line_1 string true none First line of address
address_line_2 string true none Second line of address
address_city string true none City
address_state string true none State
address_postal_code string true none Postal code
address_country string true none Country
return_address_id integer(int32) true none ID of return address to use
schedule integer(int32) false none When to send letter (0/null=now)

Refer to Status Codes for definitions of HTTP status code responses.

Cancel Scheduled Postcard

Code samples

    curl --include \
         --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
         --request PUT \

    'https://rest.clicksend.com/v3/post/postcards/{message_id}/cancel'
    Coming Soon
    Coming Soon
    Coming Soon
    Coming Soon
    Coming Soon
    Coming Soon
    Coming Soon
    Coming Soon
    Coming Soon
    Coming Soon

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "Scheduled postcard has been cancelled.",
  "data": true
}

https://rest.clicksend.com/v3/post/postcards/{message_id}/cancel

Cancel scheduled postcard

Parameters

Parameter In Type Required Description
message_id query string true Message ID of the scheduled postcard that is to be cancelled.

Refer to Status Codes for definitions of HTTP status code responses.

View Postcard History

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \

'https://rest.clicksend.com/v3/post/postcards/history'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\PostPostcardApi(new GuzzleHttp\Client(),$config);
$page = 1; // int | Page number
$limit = 10; // int | Number of records per page

try {
    $result = $apiInstance->postPostcardsHistoryGet($page, $limit);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling PostPostcardApi->postPostcardsHistoryGet: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME, 
    Password = API_KEY  
};
var postPostcardApi = new PostPostcardApi(configuration);
var response = postPostcardApi.PostPostcardsHistoryGet();
var api = require('./api.js');

var postcardApi = new api.PostPostcardApi("USERNAME", "API_KEY");

var page = 1;
var limit = 10;

postcardApi.postPostcardsHistoryGet(page, limit).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::PostPostcardApi.new

opts = {
  page: 1, # Integer | Page number
  limit: 10 # Integer | Number of records per page
}

begin
  # Retrieve the history of postcards sent or scheduled
  result = api_instance.post_postcards_history_get(opts)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling PostPostcardApi->post_postcards_history_get: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.PostPostcardApi(clicksend_client.ApiClient(configuration))
page = 1 # int | Page number (optional) (default to 1)
limit = 10 # int | Number of records per page (optional) (default to 10)

try:
    # Retrieve the history of postcards sent or scheduled
    api_response = api_instance.post_postcards_history_get(page=page, limit=limit)
    print(api_response)
except ApiException as e:
    print("Exception when calling PostPostcardApi->post_postcards_history_get: %s\n" % e)
use WWW::ClickSendClient::PostPostcardApi;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::PostPostcardApi->new(username => $username, password => $password);

my $json_output = $api->post_postcards_history_get('page'  => 1 ,'limit' => '5') ;

print $json_output;
#import "CSPostPostcardApi.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
[apiConfig setUsername:@"USERNAME"];
[apiConfig setPassword:@"PASSWORD"];

NSNumber *page = [[NSNumber alloc] init];
NSNumber *limit = [[NSNumber alloc] init];

CSPostPostcardApi *postPostcardApiInstance = [[CSPostPostcardApi alloc] init];
[postPostcardApiInstance postPostcardsHistoryGetWithPage:page limit:limit completionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire

if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}
PostPostcardAPI.postPostcardsHistoryGet(page: 1, limit: 15) { (dataString, error) in
    guard let dataString = dataString else {
        print(error!)
        return
    }
    if let data = dataString.data(using: String.Encoding.utf8) {
        do {
            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                print(dictonary)
            } else {
                print("Cannot convert the String value to JSON")
            }
        } catch let error as NSError {
            print(error)
        }
    }
}
    Coming Soon
package ClickSend;

import ClickSend.Api.PostPostcardApi;

public class view_postcard_history {
  public static void main(String[] args) {
    ApiClient defaultClient = new ApiClient();
    defaultClient.setUsername("USERNAME");
    defaultClient.setPassword("API_KEY");
    PostPostcardApi apiInstance = new PostPostcardApi(defaultClient);
    Integer page = 1; // Integer | Page number
    Integer limit = 10; // Integer | Number of records per page
    try {
        String result = apiInstance.postPostcardsHistoryGet(page, limit);
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling PostPostcardApi#postPostcardsHistoryGet");
        e.printStackTrace();
    }
  }
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "Here is your history.",
  "data": {
    "total": 1,
    "per_page": 15,
    "current_page": 1,
    "last_page": 1,
    "next_page_url": "https://rest.clicksend.com/v3/post/postcards/history?page=2",
    "prev_page_url": null,
    "from": 1,
    "to": 1,
    "data": [
      {
        "user_id": 1,
        "subaccount_id": 13,
        "list_id": null,
        "message_id": "909D6F4F-FC88-4BB8-AD96-D2F4B3139301",
        "message_id_supplier": "2RXWRVFFG3G8D6TB6V6P6VX7RHR7",
        "address_name": "John Smith",
        "address_line_1": "Address 1",
        "address_line_2": "",
        "address_city": "CITY",
        "address_state": "State",
        "address_postal_code": "123456",
        "address_country": "AU",
        "return_address_id": 1,
        "letter_file_name": "65889986-E306-4309-B229-FD9215EE1013A.pdf",
        "custom_string": null,
        "schedule": "1482308357",
        "ip_address": "127.0.0.1",
        "source": ".rest.v3",
        "post_price": "1.710000",
        "post_price_supplier": "0.000000",
        "priority": 32,
        "status": "Sent",
        "date_added": 1482308357,
        "_file_url": "https://rest.clicksend.com/files/65889986-E306-4309-B229-FD9215EE1013A.pdf",
        "_return_address": {
          "return_address_id": 1,
          "user_id": 1,
          "address_name": "John Doe",
          "address_line_1": "123 Test St",
          "address_line_2": "",
          "address_city": "Perth",
          "address_state": "WA",
          "address_postal_code": "6000",
          "address_country": "AU"
        },
        "_api_username": "johndoe"
      }
    ]
  }
}

https://rest.clicksend.com/v3/post/postcards/history

Retrieve the history of postcards sent or scheduled

Parameters

Parameter In Type Required Description
page query integer(int32) false Page number
limit query integer(int32) false Number of records per page

Refer to Status Codes for definitions of HTTP status code responses.

Export Postcard History

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \

'https://rest.clicksend.com/v3/post/postcards/export?filename={filename}'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\PostPostcardApi(new GuzzleHttp\Client(),$config);
$filename = "filename_example"; // string | Filename to export to

try {
    $result = $apiInstance->postPostcardsHistoryExportGet($filename);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling PostPostcardApi->postPostcardsHistoryExportGet: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME, 
    Password = API_KEY  
};
var postPostcardApi = new PostPostcardApi(configuration);
var response = postPostcardApi.PostPostcardsHistoryExportGet("FileName");
var api = require('./api.js');

var postcardApi = new api.PostPostcardApi("USERNAME", "API_KEY");

var filename = "filename";

postcardApi.postPostcardsHistoryExportGet(filename).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::PostPostcardApi.new

filename = "filename_example.csv" # String | Filename to export to

begin
  # Export postcard history to a CSV file
  result = api_instance.post_postcards_history_export_get(filename)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling PostPostcardApi->post_postcards_history_export_get: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.PostPostcardApi(clicksend_client.ApiClient(configuration))
filename = 'filename_example' # str | Filename to export to

try:
    # Export postcard history to a CSV file
    api_response = api_instance.post_postcards_history_export_get(filename)
    print(api_response)
except ApiException as e:
    print("Exception when calling PostPostcardApi->post_postcards_history_export_get: %s\n" % e)
use WWW::ClickSendClient::PostPostcardApi;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::PostPostcardApi->new(username => $username, password => $password);

my $json_output = $api->post_postcards_history_export_get('filename' => 'test filename') ;

print $json_output;
#import "CSPostPostcardApi.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
[apiConfig setUsername:@"USERNAME"];
[apiConfig setPassword:@"PASSWORD"];

CSPostPostcardApi *postPostcardApiInstance = [[CSPostPostcardApi alloc] init];
[postPostcardApiInstance postPostcardsHistoryExportGetWithFilename:@"filename" completionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire

if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}
PostPostcardAPI.postPostcardsHistoryExportGet(filename: "filename") { (dataString, error) in
    guard let dataString = dataString else {
        print(error!)
        return
    }
    if let data = dataString.data(using: String.Encoding.utf8) {
        do {
            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                print(dictonary)
            } else {
                print("Cannot convert the String value to JSON")
            }
        } catch let error as NSError {
            print(error)
        }
    }
}
    Coming Soon
package ClickSend;

import ClickSend.Api.PostPostcardApi;

public class export_postcard_history {
  public static void main(String[] args) {
    ApiClient defaultClient = new ApiClient();
    defaultClient.setUsername("USERNAME");
    defaultClient.setPassword("API_KEY");
    PostPostcardApi apiInstance = new PostPostcardApi(defaultClient);
    String filename = "filename_example"; // String | Filename to export to
    try {
        String result = apiInstance.postPostcardsHistoryExportGet(filename);
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling PostPostcardApi#postPostcardsHistoryExportGet");
        e.printStackTrace();
    }
  }
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "Download your file here.",
  "data": {
    "url": "https://rest.clicksend.com/files/705F80D0-D044-4F85-8617-081988B398E5?filename=myexport.csv"
  }
}

https://rest.clicksend.com/v3/post/postcards/history/export

Export postcard history to a CSV file

Parameters

Parameter In Type Required Description
filename query string true Filename to export to

Refer to Status Codes for definitions of HTTP status code responses.

Detect Address

Everything about Detect Address

Detect Address

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
     --request POST \
     --header "Content-Type: application/json" \
     --data-binary "{
    \"content\": \"Q29udGVudHMgb2YgZmlsZQ==\"
}" \
'https://rest.clicksend.com/v3/post/letters/detect-address'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\DetectAddressApi(new GuzzleHttp\Client(),$config);
$upload_file = new \ClickSend\Model\UploadFile(); // \ClickSend\Model\UploadFile | Your file to be uploaded
$upload_file->setContent("Q29udGVudHMgb2YgZmlsZQ==");

try {
    $result = $apiInstance->detectAddressPost($upload_file);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling DetectAddressApi->detectAddressPost: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME, 
    Password = API_KEY  
};
var detectAddressApi = new DetectAddressApi(configuration);
var content = System.Convert.ToBase64String(
        System.IO.File.ReadAllBytes("TestAddressFile.pdf")
    );
var response = detectAddressApi.DetectAddressPost(new UploadFile(content));
var api = require('./api.js');

var detectAddressApi = new api.DetectAddressApi("USERNAME", "API_KEY");

var uploadFile = new api.UploadFile();

uploadFile.content = "Q29udGVudHMgb2YgZmlsZQ=="

detectAddressApi.detectAddressPost(uploadFile).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::DetectAddressApi.new

# UploadFile | Your file to be uploaded
upload_file = ClickSendClient::UploadFile.new(
  content: "Q29udGVudHMgb2YgZmlsZQ=="
)

begin
  # Detects address in uploaded file.
  result = api_instance.detect_address_post(upload_file)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling DetectAddressApi->detect_address_post: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.DetectAddressApi(clicksend_client.ApiClient(configuration))
content = 'Q29udGVudHMgb2YgZmlsZQ==' # str | Base64-encoded file contents
upload_file = clicksend_client.UploadFile(content = content)
try:
    # Detects address in uploaded file.
    api_response = api_instance.detect_address_post(upload_file)
    print(api_response)
except ApiException as e:
    print("Exception when calling DetectAddressApi->detect_address_post: %s\n" % e)
use WWW::ClickSendClient::DetectAddressApi;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::DetectAddressApi->new(username => $username, password => $password);

my $json_output = $api->detect_address_post('content' => 'Q29udGVudHMgb2YgZmlsZQ=='); #Base64-encoded file contents

print $json_output;
#import "CSDetectAddressApi.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
[apiConfig setUsername:@"USERNAME"];
[apiConfig setPassword:@"PASSWORD"];

CSUploadFile *uploadFile = [[CSUploadFile alloc] init];
uploadFile.content = @"content";

CSDetectAddressApi *detectAddressApiInstance = [[CSDetectAddressApi alloc] init];
[detectAddressApiInstance detectAddressPostWithUploadFile:uploadFile completionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire

if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}

let uploadFile = UploadFile(content: "content")
DetectAddressAPI.detectAddressPost(uploadFile: uploadFile) { (dataString, error) in
    guard let dataString = dataString else {
        print(error!)
        return
    }
    if let data = dataString.data(using: String.Encoding.utf8) {
        do {
            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                print(dictonary)
            } else {
                print("Cannot convert the String value to JSON")
            }
        } catch let error as NSError {
            print(error)
        }
    }
}
    Coming Soon
package ClickSend;

import ClickSend.Api.DetectAddressApi;
import ClickSend.Model.UploadFile;

public class detect_address {
  public static void main(String[] args) {
    ApiClient defaultClient = new ApiClient();
    defaultClient.setUsername("USERNAME");
    defaultClient.setPassword("API_KEY");
    DetectAddressApi apiInstance = new DetectAddressApi(defaultClient);
    UploadFile uploadFile = new UploadFile(); // UploadFile | Your file to be uploaded
    uploadFile.content("Q29udGVudHMgb2YgZmlsZQ==");
    try {
        String result = apiInstance.detectAddressPost(uploadFile);
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling DetectAddressApi#detectAddressPost");
        e.printStackTrace();
    }
  }
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "Here is your result.",
  "data": {
    "address_name": "John Doe",
    "address_line_1": "123 Main Street",
    "address_line_2": "",
    "address_city": "Perth",
    "address_state": "WA",
    "address_postal_code": "6000",
    "address_country": "AU"
  }
}

https://rest.clicksend.com/v3/detect-address

Detects address in uploaded file.

The detect-address endpoint accepts either a letter in PDF format or an address string and attempts to convert it to a standard address format. Note that the PDF should be in standard address format, having the recipient's name and address listed at the top.

The endpoint accepts two types of data: 1. A PDF file in base64 encoding. In this case, submit the base64-encoded PDF file contents in the content field of the request body. 2. An address string. In this case, submit the address in a string using the address field of the request body.

Parameters

Parameter In Type Required Description
convert query string true none
content body string true Base64-encoded file contents

Refer to Status Codes for definitions of HTTP status code responses.

Post Return Address

Everything about Post Return Addresses

View Your Return Addresses

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \

'https://rest.clicksend.com/v3/post/return-addresses'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\PostReturnAddressApi(new GuzzleHttp\Client(),$config);
$page = 1; // int | Page number
$limit = 10; // int | Number of records per page

try {
    $result = $apiInstance->postReturnAddressesGet($page, $limit);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling PostReturnAddressApi->postReturnAddressesGet: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME, 
    Password = API_KEY  
};
var postReturnAddressApi = new PostReturnAddressApi(configuration);
var response = postReturnAddressApi.PostReturnAddressesGet();
var api = require('./api.js');

var returnAddressApi = new api.PostReturnAddressApi("USERNAME", "API_KEY");

var page = 1;
var limit = 10;

returnAddressApi.postReturnAddressesGet(page, limit).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::PostReturnAddressApi.new

opts = {
  page: 1,  # Integer | Page number
  limit: 10 # Integer | Number of records per page
}

begin
  # Get list of post return addresses
  result = api_instance.post_return_addresses_get(opts)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling PostReturnAddressApi->post_return_addresses_get: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.PostReturnAddressApi(clicksend_client.ApiClient(configuration))
page = 1 # int | Page number (optional) (default to 1)
limit = 10 # int | Number of records per page (optional) (default to 10)

try:
    # Get list of post return addresses
    api_response = api_instance.post_return_addresses_get(page=page, limit=limit)
    print(api_response)
except ApiException as e:
    print("Exception when calling PostReturnAddressApi->post_return_addresses_get: %s\n" % e)
use WWW::ClickSendClient::PostReturnAddressApi;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::PostReturnAddressApi->new(username => $username, password => $password);

my $json_output = $api->post_return_addresses_get('page' => '1','limit' => '10') ;

print $json_output;
#import "CSPostReturnAddressApi.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
[apiConfig setUsername:@"USERNAME"];
[apiConfig setPassword:@"PASSWORD"];

NSNumber *page = [[NSNumber alloc] initWithInt:1];
NSNumber *limit = [[NSNumber alloc] initWithInt:15];

CSPostReturnAddressApi *postReturnAddressApiInstance = [[CSPostReturnAddressApi alloc] init];
[postReturnAddressApiInstance postReturnAddressesGetWithPage:page limit:limit completionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire

if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}

PostReturnAddressAPI.postReturnAddressesGet(page: 1, limit: 15) { (dataString, error) in
    guard let dataString = dataString else {
        print(error!)
        return
    }
    if let data = dataString.data(using: String.Encoding.utf8) {
        do {
            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                print(dictonary)
            } else {
                print("Cannot convert the String value to JSON")
            }
        } catch let error as NSError {
            print(error)
        }
    }
}
    Coming Soon
package ClickSend;

import ClickSend.Api.PostReturnAddressApi;

public class view_all_return_address {
   public static void main(String[] args) {
      ApiClient defaultClient = new ApiClient();
      defaultClient.setUsername("USERNAME");
      defaultClient.setPassword("API_KEY");
      PostReturnAddressApi apiInstance = new PostReturnAddressApi(defaultClient);
      Integer page = 1; // Integer | Page number
      Integer limit = 10; // Integer | Number of records per page
      try {
          String result = apiInstance.postReturnAddressesGet(page, limit);
          System.out.println(result);
      } catch (ApiException e) {
          System.err.println("Exception when calling PostReturnAddressApi#postReturnAddressesGet");
          e.printStackTrace();
      }
  }
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "Here are your records.",
  "data": {
    "total": 1,
    "per_page": 15,
    "current_page": 1,
    "last_page": 1,
    "next_page_url": null,
    "prev_page_url": null,
    "from": 1,
    "to": 1,
    "data": [
      {
        "return_address_id": 4,
        "user_id": 1,
        "address_name": "My Address",
        "address_line_1": "Maritime Avenue",
        "address_line_2": "",
        "address_city": "Flynn",
        "address_state": "WA",
        "address_postal_code": "6302",
        "address_country": "AU"
      }
    ]
  }
}

https://rest.clicksend.com/v3/post/return-addresses

Get list of post return addresses

Parameters

Parameter In Type Required Description
page query integer(int32) false Page number
limit query integer(int32) false Number of records per page

Refer to Status Codes for definitions of HTTP status code responses.

Create Return Address

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
     --request POST \

     --header "Content-Type: application/json" \
     --data-binary "{
    \"address_name\":\"John Smith\",
    \"address_line_1\":\"Maritime Avenue\",
    \"address_line_2\":\"\",
    \"address_city\":\"Flynn\",
    \"address_state\":\"WA\",
    \"address_postal_code\":6302,
    \"address_country\":\"AU\"
}" \
'https://rest.clicksend.com/v3/post/return-addresses'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\PostReturnAddressApi(new GuzzleHttp\Client(),$config);
$return_address = new \ClickSend\Model\Address(); // \ClickSend\Model\Address | Address model
$return_address->setAddressName("John Smith");
$return_address->setAddressLine1("Maritime Avenue");
$return_address->setAddressCity("Flynn");
$return_address->setAddressPostalCode("6302");
$return_address->setAddressCountry("AU");
$return_address->setAddressLine2("");
$return_address->setAddressState("WA");

try {
    $result = $apiInstance->postReturnAddressesPost($return_address);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling PostReturnAddressApi->postReturnAddressesPost: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME, 
    Password = API_KEY  
};
var postReturnAddressApi = new PostReturnAddressApi(configuration);
var response = postReturnAddressApi.PostReturnAddressesPost(new Address(
    addressName: "Address Name",
    addressLine1: "Address Line 1",
    addressCity: "City",
    addressPostalCode: "Postal Code",
    addressCountry: "CA",
    addressLine2: "Address Line 2",
    addressState: "State"
));
var api = require('./api.js');

var returnAddressApi = new api.PostReturnAddressApi("USERNAME", "API_KEY");

var returnAddress = new api.Address();

returnAddress.addressName = "John Smith";
returnAddress.addressLine1 = "Maritime Avenue";
returnAddress.addressCity = "Flynn";
returnAddress.addressPostalCode = "6302";
returnAddress.addressCountry = "AU";
returnAddress.addressLine2 = "";
returnAddress.addressState = "WA";

returnAddressApi.postReturnAddressesPost(returnAddress).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::PostReturnAddressApi.new

# Address | Address model
return_address = ClickSendClient::Address.new(
  "address_postal_code": "address_postal_code",
  "address_country": "address_country",
  "address_line_1": "address_line_1",
  "address_state": "address_state",
  "address_name": "address_name",
  "address_line_2": "address_line_2",
  "address_city": "address_city"
)

begin
  # Create post return address
  result = api_instance.post_return_addresses_post(return_address)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling PostReturnAddressApi->post_return_addresses_post: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.PostReturnAddressApi(clicksend_client.ApiClient(configuration))
return_address = clicksend_client.Address(
                address_name="John Smith",
                address_line_1="Maritime Avenue",
                address_line_2="",
                address_city="Flynn",
                address_state="WA",
                address_postal_code=6302,
                address_country="AU") # Address | Address model

try:
    # Create post return address
    api_response = api_instance.post_return_addresses_post(return_address)
    print(api_response)
except ApiException as e:
    print("Exception when calling PostReturnAddressApi->post_return_addresses_post: %s\n" % e)
use WWW::ClickSendClient::PostReturnAddressApi;
use WWW::ClickSendClient::Object::Address;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::PostReturnAddressApi->new(username => $username, password => $password);

my %params = (
    'address_name'        => 'address_name',
    'address_line_1'      => 'address_line_1',
    'address_city'        => 'address_city',
    'address_postal_code' => '12345',
    'address_country'     => 'AU',
    'address_line_2'      => 'address_line_2',
    'address_state'       => 'address_state'
);

my $address_obj = WWW::ClickSendClient::Object::Address->new(%params);

my $json_output = $api->post_return_addresses_post('return_address' => $address_obj);

print $json_output;
#import "CSPostReturnAddressApi.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
[apiConfig setUsername:@"USERNAME"];
[apiConfig setPassword:@"PASSWORD"];

CSAddress *address = [[CSAddress alloc] init];
address.addressName = @"adress_name";
address.addressLine1 = @"address_line_1";
address.addressCity = @"address_city";
address.addressPostalCode = @"address_postal_code";
address.addressCountry = @"address_country";
address.addressLine2 = @"address_line_2";
address.addressState = @"address_state";

CSPostReturnAddressApi *postReturnAddressApiInstance = [[CSPostReturnAddressApi alloc] init];
[postReturnAddressApiInstance postReturnAddressesPostWithReturnAddress:address completionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire

if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}

let returnAddress = Address(addressName: "address_name",
                            addressLine1: "address_line_1",
                            addressCity: "address_city",
                            addressPostalCode: "adress_postal_code",
                            addressCountry: "address_country",
                            addressLine2: nil,
                            addressState: "state")

PostReturnAddressAPI.postReturnAddressesPost(returnAddress: returnAddress) { (dataString, error) in
    guard let dataString = dataString else {
        print(error!)
        return
    }
    if let data = dataString.data(using: String.Encoding.utf8) {
        do {
            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                print(dictonary)
            } else {
                print("Cannot convert the String value to JSON")
            }
        } catch let error as NSError {
            print(error)
        }
    }
}
    Coming Soon
package ClickSend;

import ClickSend.Api.PostReturnAddressApi;
import ClickSend.Model.Address;

public class create_return_address {
   public static void main(String[] args) {
      ApiClient defaultClient = new ApiClient();
      defaultClient.setUsername("USERNAME");
      defaultClient.setPassword("API_KEY");
      PostReturnAddressApi apiInstance = new PostReturnAddressApi(defaultClient);
      Address returnAddress = new Address(); // Address | Address model
      returnAddress.addressName("John Smith");
      returnAddress.addressLine1("Maritime Avenue");
      returnAddress.addressCity("Flynn");
      returnAddress.addressPostalCode("6302");
      returnAddress.addressCountry("AU");
      returnAddress.addressLine2("");
      returnAddress.addressState("WA");
      try {
          String result = apiInstance.postReturnAddressesPost(returnAddress);
          System.out.println(result);
      } catch (ApiException e) {
          System.err.println("Exception when calling PostReturnAddressApi#postReturnAddressesPost");
          e.printStackTrace();
      }
  }
}

Body parameter

{
  "address_postal_code": "address_postal_code",
  "address_country": "address_country",
  "address_line_1": "address_line_1",
  "address_state": "address_state",
  "address_name": "address_name",
  "address_line_2": "address_line_2",
  "address_city": "address_city"
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "New return address has been added.",
  "data": {
    "return_address_id": 14,
    "user_id": 1,
    "address_name": "John Smith",
    "address_line_1": "Maritime Avenue",
    "address_line_2": "",
    "address_city": "Flynn",
    "address_state": "WA",
    "address_postal_code": "6302",
    "address_country": "AU"
  }
}

https://rest.clicksend.com/v3/post/return-addresses

Create post return address

Properties

Name Type Required Restrictions Description
address_name string true none Your address name.
address_line_1 string true none Your address line 1
address_city string true none Your city
address_postal_code string true none Your postal code
address_country string true none Your country
address_line_2 string false none Your address line 2
address_state string false none Your state

Refer to Status Codes for definitions of HTTP status code responses.

View Specific Return Address

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \

'https://rest.clicksend.com/v3/post/return-addresses/{return_address_id}'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\PostReturnAddressApi(new GuzzleHttp\Client(),$config);
$return_address_id = 67384; // int | Return address ID

try {
    $result = $apiInstance->postReturnAddressesByReturnAddressIdGet($return_address_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling PostReturnAddressApi->postReturnAddressesByReturnAddressIdGet: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME, 
    Password = API_KEY  
};
var postReturnAddressApi = new PostReturnAddressApi(configuration);
var response = postReturnAddressApi.PostReturnAddressesByReturnAddressIdGet(RETURN_ADDRESS_ID);
var api = require('./api.js');

var returnAddressApi = new api.PostReturnAddressApi("USERNAME", "API_KEY");

var returnAddressId = 66814;

returnAddressApi.postReturnAddressesByReturnAddressIdGet(returnAddressId).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::PostReturnAddressApi.new

return_address_id = 56 # Integer | Return address ID

begin
  # Get specific post return address
  result = api_instance.post_return_addresses_by_return_address_id_get(return_address_id)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling PostReturnAddressApi->post_return_addresses_by_return_address_id_get: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.PostReturnAddressApi(clicksend_client.ApiClient(configuration))
return_address_id = 66757 # int | Return address ID

try:
    # Get specific post return address
    api_response = api_instance.post_return_addresses_by_return_address_id_get(return_address_id)
    print(api_response)
except ApiException as e:
    print("Exception when calling PostReturnAddressApi->post_return_addresses_by_return_address_id_get: %s\n" % e)
use WWW::ClickSendClient::PostReturnAddressApi;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::PostReturnAddressApi->new(username => $username, password => $password);

my $json_output = $api->post_return_addresses_by_return_address_id_get('return_address_id' => '123456' );

print $json_output;
#import "CSPostReturnAddressApi.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
[apiConfig setUsername:@"USERNAME"];
[apiConfig setPassword:@"PASSWORD"];

NSNumber *returnAddressId = [[NSNumber alloc] initWithInt:1];

CSPostReturnAddressApi *postReturnAddressApiInstance = [[CSPostReturnAddressApi alloc] init];
[postReturnAddressApiInstance postReturnAddressesByReturnAddressIdGetWithReturnAddressId:returnAddressId completionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire

if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}

PostReturnAddressAPI.postReturnAddressesByReturnAddressIdGet(returnAddressId: 1) { (dataString, error) in
    guard let dataString = dataString else {
        print(error!)
        return
    }
    if let data = dataString.data(using: String.Encoding.utf8) {
        do {
            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                print(dictonary)
            } else {
                print("Cannot convert the String value to JSON")
            }
        } catch let error as NSError {
            print(error)
        }
    }
}
    Coming Soon
package ClickSend;

import ClickSend.Api.PostReturnAddressApi;

public class view_specific_return_address {
   public static void main(String[] args) {
      ApiClient defaultClient = new ApiClient();
      defaultClient.setUsername("USERNAME");
      defaultClient.setPassword("API_KEY");
      PostReturnAddressApi apiInstance = new PostReturnAddressApi(defaultClient);
      Integer returnAddressId = 66963; // Integer | Return address ID
      try {
          String result = apiInstance.postReturnAddressesByReturnAddressIdGet(returnAddressId);
          System.out.println(result);
      } catch (ApiException e) {
          System.err.println("Exception when calling PostReturnAddressApi#postReturnAddressesByReturnAddressIdGet");
          e.printStackTrace();
      }
  }
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "Here is your data.",
  "data": {
    "return_address_id": 14,
    "user_id": 1,
    "address_name": "John Smith",
    "address_line_1": "Maritime Avenue",
    "address_line_2": "",
    "address_city": "Flynn",
    "address_state": "WA",
    "address_postal_code": "6302",
    "address_country": "AU"
  }
}

https://rest.clicksend.com/v3/post/return-addresses/{return_address_id}

Get specific post return address

Parameters

Parameter In Type Required Description
return_address_id path integer(int32) true Return address ID

Refer to Status Codes for definitions of HTTP status code responses.

Update Return Address

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
     --request PUT \

     --header "Content-Type: application/json" \
     --data-binary "{
    \"address_name\":\"John Smith\",
    \"address_line_1\":\"Maritime Avenue\",
    \"address_line_2\":\"\",
    \"address_city\":\"Flynn\",
    \"address_state\":\"WA\",
    \"address_postal_code\":6302,
    \"address_country\":\"AU\"
}" \
'https://rest.clicksend.com/v3/post/return-addresses/{return_address_id}'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\PostReturnAddressApi(new GuzzleHttp\Client(),$config);
$return_address_id = 67384; // int | Return address ID
$return_address = new \ClickSend\Model\Address(); // \ClickSend\Model\Address | Address model
$return_address->setAddressName("John Smith");
$return_address->setAddressLine1("Maritime Avenue");
$return_address->setAddressCity("Flynn");
$return_address->setAddressPostalCode("6302");
$return_address->setAddressCountry("AU");
$return_address->setAddressLine2("");
$return_address->setAddressState("WA");

try {
    $result = $apiInstance->postReturnAddressesByReturnAddressIdPut($return_address_id, $return_address);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling PostReturnAddressApi->postReturnAddressesByReturnAddressIdPut: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME, 
    Password = API_KEY  
};
var postReturnAddressApi = new PostReturnAddressApi(configuration);
var response = postReturnAddressApi.PostReturnAddressesByReturnAddressIdPut(ADDRESS_ID, new Address(
    addressName: "Address Name",
    addressLine1: "Address Line 1",
    addressCity: "City",
    addressPostalCode: "Postal Code",
    addressCountry: "CA",
    addressLine2: "Address Line 2",
    addressState: "State"
));
var api = require('./api.js');

var returnAddressApi = new api.PostReturnAddressApi("USERNAME", "API_KEY");

var returnAddressId = 67182;

var returnAddress = new api.Address();

returnAddress.addressName = "John Smith";
returnAddress.addressLine1 = "Maritime Avenue";
returnAddress.addressCity = "Flynn";
returnAddress.addressPostalCode = "6302";
returnAddress.addressCountry = "AU";
returnAddress.addressLine2 = "";
returnAddress.addressState = "WA";

returnAddressApi.postReturnAddressesByReturnAddressIdPut(returnAddressId, returnAddress).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::PostReturnAddressApi.new

return_address_id = 56 # Integer | Return address ID

# Address | Address model
return_address = ClickSendClient::Address.new(
  "address_postal_code": "address_postal_code",
  "address_country": "address_country",
  "address_line_1": "address_line_1",
  "address_state": "address_state",
  "address_name": "address_name",
  "address_line_2": "address_line_2",
  "address_city": "address_city"
)

begin
  # Update post return address
  result = api_instance.post_return_addresses_by_return_address_id_put(return_address_id, return_address)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling PostReturnAddressApi->post_return_addresses_by_return_address_id_put: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.PostReturnAddressApi(clicksend_client.ApiClient(configuration))
return_address_id = 66757 # int | Return address ID
return_address = clicksend_client.Address(
                  address_name="John Smith1",
                  address_line_1="Maritime Avenue1",
                  address_line_2="",
                  address_city="Flynn",
                  address_state="WA",
                  address_postal_code=6302,
                  address_country="AU") # Address | Address model

try:
    # Update post return address
    api_response = api_instance.post_return_addresses_by_return_address_id_put(return_address_id, return_address)
    print(api_response)
except ApiException as e:
    print("Exception when calling PostReturnAddressApi->post_return_addresses_by_return_address_id_put: %s\n" % e)
use WWW::ClickSendClient::PostReturnAddressApi;
use WWW::ClickSendClient::Object::Address;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::PostReturnAddressApi->new(username => $username, password => $password);

my %params = (
    'address_name'        => 'address_name',
    'address_line_1'      => 'address_line_1',
    'address_city'        => 'address_city',
    'address_postal_code' => '12345',
    'address_country'     => 'AU',
    'address_line_2'      => 'address_line_2',
    'address_state'       => 'address_state'
);

my $address_obj = WWW::ClickSendClient::Object::Address->new(%params);

my $json_output = $api->post_return_addresses_by_return_address_id_put('return_address_id' => '123456' ,'return_address' => $address_obj );

print $json_output;
#import "CSPostReturnAddressApi.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
[apiConfig setUsername:@"USERNAME"];
[apiConfig setPassword:@"PASSWORD"];

NSNumber *returnAddressId = [[NSNumber alloc] initWithInt:1];

CSAddress *address = [[CSAddress alloc] init];
address.addressName = @"address_name";
address.addressLine1 = @"address_line_1";
address.addressCity = @"address_city";
address.addressPostalCode = @"address_postal_cade";
address.addressCountry = @"country";
address.addressLine2 = @"address_line_2";
address.addressState = @"address_state";

CSPostReturnAddressApi *postReturnAddressApiInstance = [[CSPostReturnAddressApi alloc] init];
[postReturnAddressApiInstance postReturnAddressesByReturnAddressIdPutWithReturnAddressId:returnAddressId returnAddress:address completionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire

if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}

let returnAddress = Address(addressName: "address_name",
                            addressLine1: "address_line_1",
                            addressCity: "address_city",
                            addressPostalCode: "address_postal_code",
                            addressCountry: "address_country",
                            addressLine2: nil,
                            addressState: nil)

PostReturnAddressAPI.postReturnAddressesByReturnAddressIdPut(returnAddressId: 1, returnAddress:returnAddress) { (dataString, error) in
    guard let dataString = dataString else {
        print(error!)
        return
    }
    if let data = dataString.data(using: String.Encoding.utf8) {
        do {
            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                print(dictonary)
            } else {
                print("Cannot convert the String value to JSON")
            }
        } catch let error as NSError {
            print(error)
        }
    }
}
    Coming Soon
package ClickSend;

import ClickSend.Api.PostReturnAddressApi;
import ClickSend.Model.Address;
import ClickSend.auth.HttpBasicAuth;

public class update_return_address {
  public static void main(String[] args) {
    ApiClient defaultClient = new ApiClient();
    defaultClient.setUsername("USERNAME");
    defaultClient.setPassword("API_KEY");
    PostReturnAddressApi apiInstance = new PostReturnAddressApi(defaultClient);
    Integer returnAddressId = 66963; // Integer | Return address ID
    Address returnAddress = new Address(); // Address | Address model
    returnAddress.addressName("John Smith");
    returnAddress.addressLine1("Maritime Avenue");
    returnAddress.addressCity("Flynn");
    returnAddress.addressPostalCode("6302");
    returnAddress.addressCountry("AU");
    returnAddress.addressLine2("");
    returnAddress.addressState("WA");
    try {
        String result = apiInstance.postReturnAddressesByReturnAddressIdPut(returnAddressId, returnAddress);
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling PostReturnAddressApi#postReturnAddressesByReturnAddressIdPut");
        e.printStackTrace();
    }
  }
}

Body parameter

{
  "address_postal_code": "address_postal_code",
  "address_country": "address_country",
  "address_line_1": "address_line_1",
  "address_state": "address_state",
  "address_name": "address_name",
  "address_line_2": "address_line_2",
  "address_city": "address_city"
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "Your return address has been updated.",
  "data": {
    "return_address_id": 14,
    "user_id": 1,
    "address_name": "John Smith",
    "address_line_1": "Maritime Avenue",
    "address_line_2": "",
    "address_city": "Flynn",
    "address_state": "WA",
    "address_postal_code": 6302,
    "address_country": "AU"
  }
}

https://rest.clicksend.com/v3/post/return-addresses/{return_address_id}

Update post return address

Parameters

Parameter In Type Required Description
return_address_id path integer(int32) true Return address ID

Properties

Name Type Required Restrictions Description
address_name string true none Your address name.
address_line_1 string true none Your address line 1
address_city string true none Your city
address_postal_code string true none Your postal code
address_country string true none Your country
address_line_2 string false none Your address line 2
address_state string false none Your state

Refer to Status Codes for definitions of HTTP status code responses.

Delete Return Address

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
     --request DELETE \

'https://rest.clicksend.com/v3/post/return-addresses/{return_address_id}'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\PostReturnAddressApi(new GuzzleHttp\Client(),$config);
$return_address_id = 67384; // int | Return address ID

try {
    $result = $apiInstance->postReturnAddressesByReturnAddressIdDelete($return_address_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling PostReturnAddressApi->postReturnAddressesByReturnAddressIdDelete: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME, 
    Password = API_KEY  
};
var postReturnAddressApi = new PostReturnAddressApi(configuration);
var response = postReturnAddressApi.PostReturnAddressesByReturnAddressIdDelete(RETURN_ADDRESS_ID);
var api = require('./api.js');

var returnAddressApi = new api.PostReturnAddressApi("USERNAME", "API_KEY");

var returnAddressId = 66814;

returnAddressApi.postReturnAddressesByReturnAddressIdDelete(returnAddressId).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::PostReturnAddressApi.new

return_address_id = 56 # Integer | Return address ID

begin
  # Delete specific post return address
  result = api_instance.post_return_addresses_by_return_address_id_delete(return_address_id)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling PostReturnAddressApi->post_return_addresses_by_return_address_id_delete: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.PostReturnAddressApi(clicksend_client.ApiClient(configuration))
return_address_id = 66757 # int | Return address ID

try:
    # Delete specific post return address
    api_response = api_instance.post_return_addresses_by_return_address_id_delete(return_address_id)
    print(api_response)
except ApiException as e:
    print("Exception when calling PostReturnAddressApi->post_return_addresses_by_return_address_id_delete: %s\n" % e)
use WWW::ClickSendClient::PostReturnAddressApi;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::PostReturnAddressApi->new(username => $username, password => $password);

my $json_output = $api->post_return_addresses_by_return_address_id_delete('return_address_id' => '123456' );

print $json_output;
#import "CSPostReturnAddressApi.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
[apiConfig setUsername:@"USERNAME"];
[apiConfig setPassword:@"PASSWORD"];

NSNumber *returnAddressId = [[NSNumber alloc] initWithInt:1];


CSPostReturnAddressApi *postReturnAddressApiInstance = [[CSPostReturnAddressApi alloc] init];
[postReturnAddressApiInstance postReturnAddressesByReturnAddressIdDeleteWithReturnAddressId:returnAddressId completionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire

 if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
 }

 PostReturnAddressAPI.postReturnAddressesByReturnAddressIdDelete(returnAddressId: 1) { (dataString, error) in
     guard let dataString = dataString else {
         print(error!)
         return
     }
     if let data = dataString.data(using: String.Encoding.utf8) {
         do {
             if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                print(dictonary)
             } else {
                print("Cannot convert the String value to JSON")
             }
         } catch let error as NSError {
            print(error)
         }
     }
 }
    Coming Soon
package ClickSend;

import ClickSend.Api.PostReturnAddressApi;

public class delete_return_address {
   public static void main(String[] args) {
      ApiClient defaultClient = new ApiClient();
      defaultClient.setUsername("USERNAME");
      defaultClient.setPassword("API_KEY");
      PostReturnAddressApi apiInstance = new PostReturnAddressApi(defaultClient);
      Integer returnAddressId = 66963; // Integer | Return address ID
      try {
          String result = apiInstance.postReturnAddressesByReturnAddressIdDelete(returnAddressId);
          System.out.println(result);
      } catch (ApiException e) {
          System.err.println("Exception when calling PostReturnAddressApi#postReturnAddressesByReturnAddressIdDelete");
          e.printStackTrace();
      }
   }
}


Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "Your return address has been deleted.",
  "data": []
}

https://rest.clicksend.com/v3/post/return-addresses/{return_address_id}

Delete specific post return address

Parameters

Parameter In Type Required Description
return_address_id path integer(int32) true Return address ID

Refer to Status Codes for definitions of HTTP status code responses.

Referral Account

Everything about viewing referred accounts

View Referral Accounts

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \

'https://rest.clicksend.com/v3/referral/accounts'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\ReferralAccountApi(new GuzzleHttp\Client(),$config);
$page = 1; // int | Page number
$limit = 10; // int | Number of records per page

try {
    $result = $apiInstance->referralAccountsGet($page, $limit);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ReferralAccountApi->referralAccountsGet: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME, 
    Password = API_KEY  
};
var referralAccountApi = new ReferralAccountApi(configuration);
var response = referralAccountApi.ReferralAccountsGet();
var api = require('./api.js');

var referralApi = new api.ReferralAccountApi("USERNAME", "API_KEY");

var page = 1;
var limit = 10;

referralApi.referralAccountsGet(page, limit).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::ReferralAccountApi.new

opts = {
  page: 1,  # Integer | Page number
  limit: 10 # Integer | Number of records per page
}

begin
  # Get all referral accounts
  result = api_instance.referral_accounts_get(opts)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling ReferralAccountApi->referral_accounts_get: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.ReferralAccountApi(clicksend_client.ApiClient(configuration))
page = 1 # int | Page number (optional) (default to 1)
limit = 10 # int | Number of records per page (optional) (default to 10)

try:
    # Get all referral accounts
    api_response = api_instance.referral_accounts_get(page=page, limit=limit)
    print(api_response)
except ApiException as e:
    print("Exception when calling ReferralAccountApi->referral_accounts_get: %s\n" % e)
use  WWW::ClickSendClient::ReferralAccountApi;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::ReferralAccountApi->new(username => $username, password => $password);

my $json_output = $api->referral_accounts_get('page' => '1' ,'limit' => '10');

print $json_output;
#import "CSReferralAccountApi.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
[apiConfig setUsername:@"USERNAME"];
[apiConfig setPassword:@"PASSWORD"];

NSNumber *page = [[NSNumber alloc] initWithInt:1];
NSNumber *limit = [[NSNumber alloc] initWithInt:15];

CSReferralAccountApi *referralAccountApiInstance = [[CSReferralAccountApi alloc] init];
[referralAccountApiInstance referralAccountsGetWithPage:page limit:limit completionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire

if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}

ReferralAccountAPI.referralAccountsGet(page: 1, limit: 15) { (dataString, error) in
    guard let dataString = dataString else {
        print(error!)
        return
    }
    if let data = dataString.data(using: String.Encoding.utf8) {
        do {
            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                print(dictonary)
            } else {
                print("Cannot convert the String value to JSON")
            }
        } catch let error as NSError {
            print(error)
        }
    }
}
    Coming Soon
package ClickSend;

import ClickSend.Api.ReferralAccountApi;

public class view_referral_account {
  public static void main(String[] args) {
    ApiClient defaultClient = new ApiClient();
    defaultClient.setUsername("USERNAME");
    defaultClient.setPassword("API_KEY");
    ReferralAccountApi apiInstance = new ReferralAccountApi(defaultClient);
    Integer page = 1; // Integer | Page number
    Integer limit = 10; // Integer | Number of records per page
    try {
        String result = apiInstance.referralAccountsGet(page, limit);
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling ReferralAccountApi#referralAccountsGet");
        e.printStackTrace();
    }
  }
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "Here are your referrals.",
  "data": {
    "total": 2,
    "per_page": 15,
    "current_page": 1,
    "last_page": 1,
    "next_page_url": null,
    "prev_page_url": null,
    "from": 1,
    "to": 2,
    "data": [
      {
        "referral_rule_id": 1,
        "refered_user_id": 24,
        "date_referred": 1438260940,
        "percentage_referral": 5
      },
      {
        "referral_rule_id": 2,
        "refered_user_id": 25,
        "date_referred": 1438260989,
        "percentage_referral": 5
      }
    ]
  }
}

https://rest.clicksend.com/v3/referral/accounts

Get all referral accounts

Parameters

Parameter In Type Required Description
page query integer(int32) false Page number
limit query integer(int32) false Number of records per page

Refer to Status Codes for definitions of HTTP status code responses.

Reseller Account

Everything about viewing creating and modifying clients accounts.

View Client Accounts

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \

'https://rest.clicksend.com/v3/reseller/accounts'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\ResellerAccountApi(new GuzzleHttp\Client(),$config);
$page = 1; // int | Page number
$limit = 10; // int | Number of records per page

try {
    $result = $apiInstance->resellerAccountsGet($page, $limit);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ResellerAccountApi->resellerAccountsGet: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME, 
    Password = API_KEY  
};
var resellerAccountApi = new ResellerAccountApi(configuration);
var response = resellerAccountApi.ResellerAccountsGet();
var api = require('./api.js');

var resellerApi = new api.ResellerAccountApi("USERNAME", "API_KEY");

var page = 1;
var limit = 10;

resellerApi.resellerAccountsGet(page, limit).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::ResellerAccountApi.new

opts = {
  page: 1,  # Integer | Page number
  limit: 10 # Integer | Number of records per page
}

begin
  # Get list of reseller accounts
  result = api_instance.reseller_accounts_get(opts)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling ResellerAccountApi->reseller_accounts_get: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.ResellerAccountApi(clicksend_client.ApiClient(configuration))
page = 1 # int | Page number (optional) (default to 1)
limit = 10 # int | Number of records per page (optional) (default to 10)

try:
    # Get list of reseller accounts
    api_response = api_instance.reseller_accounts_get(page=page, limit=limit)
    print(api_response)
except ApiException as e:
    print("Exception when calling ResellerAccountApi->reseller_accounts_get: %s\n" % e)
use WWW::ClickSendClient::ResellerAccountApi;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::ResellerAccountApi->new(username => $username, password => $password);

my $json_output = $api->reseller_accounts_get('page' => '1' ,'limit' => '10');

print $json_output;
#import "CSResellerAccountApi.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
[apiConfig setUsername:@"USERNAME"];
[apiConfig setPassword:@"PASSWORD"];

NSNumber *page = [[NSNumber alloc] initWithInt:1];
NSNumber *limit = [[NSNumber alloc] initWithInt:15];

CSResellerAccountApi *resellerAccountApiInstance = [[CSResellerAccountApi alloc] init];
[resellerAccountApiInstance resellerAccountsGetWithPage:page limit:limit completionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire

if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}

ResellerAccountAPI.resellerAccountsGet(page: nil, limit: nil) { (dataString, error) in
    guard let dataString = dataString else {
        print(error!)
        return
    }
    if let data = dataString.data(using: String.Encoding.utf8) {
        do {
            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                print(dictonary)
            } else {
                print("Cannot convert the String value to JSON")
            }
        } catch let error as NSError {
            print(error)
        }
    }
}
    Coming Soon
package ClickSend;

import ClickSend.Api.ResellerAccountApi;

public class view_client_account {
  public static void main(String[] args) {
    ApiClient defaultClient = new ApiClient();
    defaultClient.setUsername("USERNAME");
    defaultClient.setPassword("API_KEY");
    ResellerAccountApi apiInstance = new ResellerAccountApi(defaultClient);
    Integer page = 1; // Integer | Page number
    Integer limit = 10; // Integer | Number of records per page
    try {
        String result = apiInstance.resellerAccountsGet(page, limit);
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling ResellerAccountApi#resellerAccountsGet");
        e.printStackTrace();
    }
  }
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "Here are you data.",
  "data": {
    "total": 1,
    "per_page": 15,
    "current_page": 1,
    "last_page": 1,
    "next_page_url": null,
    "prev_page_url": null,
    "from": 1,
    "to": 1,
    "data": [
      {
        "user_id": 24,
        "username": "username75897",
        "user_email": "email86363@gmail.com",
        "active": 1,
        "banned": 0,
        "balance": "115.000000",
        "user_phone": "+61261063776",
        "reply_to": "originalemail",
        "delivery_to": "+61261086832",
        "user_first_name": "Firstname30529",
        "user_last_name": "Lastname83402",
        "account": 0,
        "account_name": "Johnn99YH",
        "account_billing_email": "AIYkwXgB2c@CzrJB.com",
        "account_billing_mobile": "+61353787961",
        "country": "AU",
        "default_country_sms": "AU",
        "unsubscribe_mail": 1,
        "auto_recharge": 0,
        "auto_recharge_amount": "20.00",
        "low_credit_amount": "1.50",
        "setting_unicode_sms": 1,
        "setting_beta": 1,
        "setting_email_sms_subject": 0,
        "setting_fix_sender_id": 26979,
        "setting_sms_message_char_limit": 140,
        "_currency": {
          "currency_name_short": "AUD",
          "currency_prefix_d": "$",
          "currency_prefix_c": "c",
          "currency_name_long": "Australian Dollars"
        },
        "_subaccount": {
          "subaccount_id": 54,
          "api_username": "Y3c5zm7z97",
          "email": "oNEDu5ffl8@BP8lY.com",
          "phone_number": "+61353787526",
          "first_name": "JohnNyZWy",
          "last_name": "Doe8ozHX",
          "api_key": "D683D2C1-8AAE-881A-78FF-E8577D7BED2D",
          "access_users": 1,
          "access_billing": 1,
          "access_reporting": 1,
          "access_contacts": 0,
          "access_settings": 1,
          "access_sms": 1,
          "access_email": 0,
          "access_voice": 0,
          "access_fax": 0,
          "access_post": 0,
          "access_reseller": 0
        }
      }
    ]
  }
}

https://rest.clicksend.com/v3/reseller/accounts

Get list of reseller accounts

Parameters

Parameter In Type Required Description
page query integer(int32) false Page number
limit query integer(int32) false Number of records per page

Refer to Status Codes for definitions of HTTP status code responses.

Create Reseller Account

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
     --request POST \

     --header "Content-Type: application/json" \
     --data-binary "    {
        \"username\":\"johndoe2\",
        \"user_email\":\"johndoe2@awesome.com\",
        \"user_phone\":\"518-481-1002\",
        \"user_first_name\":\"John\",
        \"user_last_name\":\"Doe\",
        \"country\":\"US\",
        \"password\":\"pass\",
        \"account_name\":\"The Awesome Company\"
    }" \
'https://rest.clicksend.com/v3/reseller/accounts'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\ResellerAccountApi(new GuzzleHttp\Client(),$config);
 // \ClickSend\Model\ResellerAccount | ResellerAccount model
$reseller_account = new \ClickSend\Model\ResellerAccount();
$reseller_account->setUsername("johndoe2");
$reseller_account->setPassword("passQ1!");
$reseller_account->setUserEmail("johndoe2@awesome.com");
$reseller_account->setUserPhone("518-481-1002");
$reseller_account->setUserFirstName("John");
$reseller_account->setUserLastName("Doe");
$reseller_account->setAccountName("The Awesome Company");
$reseller_account->setCountry("US");

try {
    $result = $apiInstance->resellerAccountsPost($reseller_account);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ResellerAccountApi->resellerAccountsPost: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME, 
    Password = API_KEY  
};
var resellerAccountApi = new ResellerAccountApi(configuration);
var response = resellerAccountApi.ResellerAccountsPost(new ResellerAccount(
    username: "USERNAME",
    password: "password",
    userEmail: "john@doe.com",
    userPhone: "+11231231234",
    userFirstName: "John",
    userLastName: "Doe",
    accountName: "Account Name",
    country: "US"
});
var api = require('./api.js');

var resellerApi = new api.ResellerAccountApi("USERNAME", "API_KEY");

var resellerAccount = new api.ResellerAccount();

resellerAccount.username = "johndoe2";
resellerAccount.password = "passA!1";
resellerAccount.userEmail = "johndoe2@awesome.com";
resellerAccount.userPhone = "518-481-1002";
resellerAccount.userFirstName = "John";
resellerAccount.userLastName = "Doe";
resellerAccount.accountName = "The Awesome Company";
resellerAccount.country = "US";

resellerApi.resellerAccountsPost(resellerAccount).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::ResellerAccountApi.new

# ResellerAccount | ResellerAccount model
reseller_account = ClickSendClient::ResellerAccount.new(
  "username": "username",
  "password": "password",
  "user_email": "user_email",
  "user_phone": "user_phone",
  "user_first_name": "user_first_name",
  "user_last_name": "user_last_name",
  "account_name": "account_name",
  "country": "country"
)

begin
  # Create reseller account
  result = api_instance.reseller_accounts_post(reseller_account)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling ResellerAccountApi->reseller_accounts_post: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.ResellerAccountApi(clicksend_client.ApiClient(configuration))
# ResellerAccount | ResellerAccount model
reseller_account = clicksend_client.ResellerAccount(
                  username="username",
                  user_email="xxx@gmail.com",
                  user_phone="000-000-000",
                  user_first_name="firstname",
                  user_last_name="lastname",
                  country="country",
                  password="pass",
                  account_name="account_name") 

try:
    # Create reseller account
    api_response = api_instance.reseller_accounts_post(reseller_account)
    print(api_response)
except ApiException as e:
    print("Exception when calling ResellerAccountApi->reseller_accounts_post: %s\n" % e)
use WWW::ClickSendClient::ResellerAccountApi;
use WWW::ClickSendClient::Object::ResellerAccount;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::ResellerAccountApi->new(username => $username, password => $password);

my %params = (
    'username'        => 'username_test',
    'password'        => 'password',
    'user_email'      => 'test1@test.com',
    'user_phone'      => '+61261111111',
    'user_first_name' => 'user_first_name',
    'user_last_name'  => 'user_last_name',
    'account_name'    => 'account_name',
    'country'         => 'AU'
);

my $reseller_obj = WWW::ClickSendClient::Object::ResellerAccount->new(%params);

my $json_output = $api->reseller_accounts_post('reseller_account' => $reseller_obj);

print $json_output;
#import "CSResellerAccountApi.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
[apiConfig setUsername:@"USERNAME"];
[apiConfig setPassword:@"PASSWORD"];

CSResellerAccount *resellerAccount = [[CSResellerAccount alloc] init];
resellerAccount.username = @"user_name";
resellerAccount.password = @"password";
resellerAccount.userEmail = @"user_email";
resellerAccount.userPhone = @"user_phone";
resellerAccount.userFirstName =@"user_firstname";
resellerAccount.userLastName = @"user_lastname";
resellerAccount.accountName = @"account_name";
resellerAccount.country = @"country";

CSResellerAccountApi *resellerAccountApiInstance = [[CSResellerAccountApi alloc] init];
[resellerAccountApiInstance resellerAccountsPostWithResellerAccount:resellerAccount completionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire

if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}

let resellerAccount = ResellerAccount(username: "user_name",
                                      password: "password",
                                      userEmail: "user_email",
                                      userPhone: "user_phone",
                                      userFirstName: "user_firstname",
                                      userLastName: "user_lastname",
                                      accountName: "account_name",
                                      country: "country")

ResellerAccountAPI.resellerAccountsPost(resellerAccount:resellerAccount) { (dataString, error) in
    guard let dataString = dataString else {
        print(error!)
        return
    }
    if let data = dataString.data(using: String.Encoding.utf8) {
        do {
            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                print(dictonary)
            } else {
                print("Cannot convert the String value to JSON")
            }
        } catch let error as NSError {
            print(error)
        }
    }
}
    Coming Soon
package ClickSend;

import ClickSend.Api.ResellerAccountApi;
import ClickSend.Model.ResellerAccount;

public class create_reseller_account {
  public static void main(String[] args) {
    ApiClient defaultClient = new ApiClient();
    defaultClient.setUsername("USERNAME");
    defaultClient.setPassword("API_KEY");
    ResellerAccountApi apiInstance = new ResellerAccountApi(defaultClient);
    // ResellerAccount | ResellerAccount model
    ResellerAccount resellerAccount = new ResellerAccount(); 
    resellerAccount.accountName("account");
    resellerAccount.username("username");
    resellerAccount.password("pwd!1q");
    resellerAccount.country("country");
    resellerAccount.userEmail("xxx@gmail.com");
    resellerAccount.userPhone("000-000-0000");
    resellerAccount.userFirstName("first");
    resellerAccount.userLastName("last");
    try {
        String result = apiInstance.resellerAccountsPost(resellerAccount);
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling ResellerAccountApi#resellerAccountsPost");
        e.printStackTrace();
    }
  }
}

Body parameter

{
  "country": "country",
  "password": "password",
  "user_email": "user_email",
  "user_first_name": "user_first_name",
  "user_last_name": "user_last_name",
  "account_name": "account_name",
  "user_phone": "user_phone",
  "username": "username"
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "New reseller has been added.",
  "data": {
    "user_id": 117,
    "username": "johndoe2",
    "user_email": "johndoe2@awesome.com",
    "active": 0,
    "banned": 0,
    "balance": "0.000000",
    "user_phone": "+15184811002",
    "reply_to": "originalemail",
    "delivery_to": null,
    "user_first_name": "John",
    "user_last_name": "Doe",
    "account": 0,
    "account_name": "The Awesome Company",
    "account_billing_email": "johndoe2@awesome.com",
    "account_billing_mobile": "+15184811002",
    "country": "US",
    "default_country_sms": "US",
    "auto_recharge": 0,
    "auto_recharge_amount": "20.00",
    "low_credit_amount": "0.00",
    "setting_unicode_sms": 0,
    "setting_email_sms_subject": 0,
    "setting_fix_sender_id": 0,
    "setting_sms_message_char_limit": 6,
    "old_dashboard": 0,
    "balance_commission": "0.299954",
    "timezone": "Australia/Melbourne",
    "_currency": {
      "currency_name_short": "USD",
      "currency_prefix_d": "$",
      "currency_prefix_c": "¢",
      "currency_name_long": "US Dollars"
    },
    "_subaccount": {
      "subaccount_id": 127,
      "api_username": "johndoe2",
      "email": "johndoe2@awesome.com",
      "phone_number": "+15184811002",
      "first_name": "John",
      "last_name": "Doe",
      "api_key": "A724C6A4-1D1A-93E8-5FB8-62DC1D153CE4",
      "access_users": 1,
      "access_billing": 1,
      "access_reporting": 1,
      "access_contacts": 0,
      "access_settings": 1,
      "access_sms": 0,
      "access_email": 0,
      "access_voice": 0,
      "access_fax": 0,
      "access_post": 0,
      "access_reseller": 0
    }
  }
}

https://rest.clicksend.com/v3/reseller/accounts

Create reseller account

Properties

Name Type Required Restrictions Description
username string true none Account username
password string true none Account password (unhashed)
user_email string true none Account email
user_phone string true none Account phone number
user_first_name string true none Account owner first name
user_last_name string true none Account owner last name
account_name string true none Account name (usually company name)
country string true none Country of account holder

Refer to Status Codes for definitions of HTTP status code responses.

View Specific Client Account

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \

'https://rest.clicksend.com/v3/reseller/accounts/{client_user_id}'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\ResellerAccountApi(new GuzzleHttp\Client(),$config);
$client_user_id = 56; // int | User ID of client

try {
    $result = $apiInstance->resellerAccountsByClientUserIdGet($client_user_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ResellerAccountApi->resellerAccountsByClientUserIdGet: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME, 
    Password = API_KEY  
};
var resellerAccountApi = new ResellerAccountApi(configuration);
var response = resellerAccountApi.ResellerAccountsByClientUserIdGet(RESELLER_CLIENT_ID);
var api = require('./api.js');

var resellerApi = new api.ResellerAccountApi("USERNAME", "API_KEY");

var clientUserId = "client_user_id";

resellerApi.resellerAccountsByClientUserIdGet(clientUserId).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::ResellerAccountApi.new

client_user_id = 56 # Integer | User ID of client

begin
  # Get Reseller clients Account
  result = api_instance.reseller_accounts_by_client_user_id_get(client_user_id)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling ResellerAccountApi->reseller_accounts_by_client_user_id_get: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.ResellerAccountApi(clicksend_client.ApiClient(configuration))
client_user_id = 56 # int | User ID of client

try:
    # Get Reseller clients Account
    api_response = api_instance.reseller_accounts_by_client_user_id_get(client_user_id)
    print(api_response)
except ApiException as e:
    print("Exception when calling ResellerAccountApi->reseller_accounts_by_client_user_id_get: %s\n" % e)
use WWW::ClickSendClient::ResellerAccountApi;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::ResellerAccountApi->new(username => $username, password => $password);

my $json_output = $api->reseller_accounts_by_client_user_id_get('client_user_id'  => '12345');

print $json_output;
#import "CSResellerAccountApi.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
[apiConfig setUsername:@"USERNAME"];
[apiConfig setPassword:@"PASSWORD"];

NSNumber *clientUserId = [[NSNumber alloc] initWithInt:1];

CSResellerAccountApi *resellerAccountApiInstance = [[CSResellerAccountApi alloc] init];
[resellerAccountApiInstance resellerAccountsByClientUserIdGetWithClientUserId:clientUserId completionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire

if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}
ResellerAccountAPI.resellerAccountsByClientUserIdGet(clientUserId: 1) { (dataString, error) in
    guard let dataString = dataString else {
        print(error!)
        return
    }
    if let data = dataString.data(using: String.Encoding.utf8) {
        do {
            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                print(dictonary)
            } else {
                print("Cannot convert the String value to JSON")
            }
        } catch let error as NSError {
            print(error)
        }
    }
}
    Coming Soon
package ClickSend;

import ClickSend.Api.ResellerAccountApi;

public class view_specific_client_account {
  public static void main(String[] args) {
    ApiClient defaultClient = new ApiClient();
    defaultClient.setUsername("USERNAME");
    defaultClient.setPassword("API_KEY");
    ResellerAccountApi apiInstance = new ResellerAccountApi(defaultClient);
    Integer clientUserId = 56; // Integer | User ID of client
    try {
        String result = apiInstance.resellerAccountsByClientUserIdGet(clientUserId);
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling ResellerAccountApi#resellerAccountsByClientUserIdGet");
        e.printStackTrace();
    }
  }
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "Here are your data.",
  "data": {
    "user_id": 24,
    "username": "username75897",
    "user_email": "email86363@gmail.com",
    "active": 1,
    "banned": 0,
    "balance": "115.000000",
    "user_phone": "+61261063776",
    "reply_to": "originalemail",
    "delivery_to": "+61261086832",
    "user_first_name": "Firstname30529",
    "user_last_name": "Lastname83402",
    "account": 0,
    "account_name": "Johnn99YH",
    "account_billing_email": "AIYkwXgB2c@CzrJB.com",
    "account_billing_mobile": "+61353787961",
    "country": "AU",
    "default_country_sms": "AU",
    "unsubscribe_mail": 1,
    "auto_recharge": 0,
    "auto_recharge_amount": "20.00",
    "low_credit_amount": "1.50",
    "setting_unicode_sms": 1,
    "setting_beta": 1,
    "setting_email_sms_subject": 0,
    "setting_fix_sender_id": 26979,
    "setting_sms_message_char_limit": 140,
    "_currency": {
      "currency_name_short": "AUD",
      "currency_prefix_d": "$",
      "currency_prefix_c": "c",
      "currency_name_long": "Australian Dollars"
    },
    "_subaccount": {
      "subaccount_id": 54,
      "api_username": "Y3c5zm7z97",
      "email": "oNEDu5ffl8@BP8lY.com",
      "phone_number": "+61353787526",
      "first_name": "JohnNyZWy",
      "last_name": "Doe8ozHX",
      "api_key": "D683D2C1-8AAE-881A-78FF-E8577D7BED2D",
      "access_users": 1,
      "access_billing": 1,
      "access_reporting": 1,
      "access_contacts": 0,
      "access_settings": 1,
      "access_sms": 1,
      "access_email": 0,
      "access_voice": 0,
      "access_fax": 0,
      "access_post": 0,
      "access_reseller": 0
    }
  }
}

https://rest.clicksend.com/v3/reseller/accounts/{client_user_id}

Get Reseller clients Account

Parameters

Parameter In Type Required Description
client_user_id path integer(int32) true User ID of client

Refer to Status Codes for definitions of HTTP status code responses.

Update Client Account

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
     --request PUT \

     --header "Content-Type: application/json" \
     --data-binary "    {
        \"username\":\"johndoe2\",
        \"user_email\":\"johndoe2@awesome.com\",
        \"user_phone\":\"518-481-1002\",
        \"user_first_name\":\"John\",
        \"user_last_name\":\"Doe\",
        \"country\":\"US\",
        \"password\":\"pass\",
        \"account_name\":\"The Awesome Company\"
    }" \
'https://rest.clicksend.com/v3/reseller/accounts/{client_user_id}'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\ResellerAccountApi(new GuzzleHttp\Client(),$config);
$client_user_id = 56; // int | User ID of client
// \ClickSend\Model\ResellerAccount | ResellerAccount model
$reseller_account = new \ClickSend\Model\ResellerAccount();
$reseller_account->setUsername("johndoe2");
$reseller_account->setPassword("passQ1!");
$reseller_account->setUserEmail("johndoe2@awesome.com");
$reseller_account->setUserPhone("518-481-1002");
$reseller_account->setUserFirstName("John");
$reseller_account->setUserLastName("Doe");
$reseller_account->setAccountName("The Awesome Company");
$reseller_account->setCountry("US");

try {
    $result = $apiInstance->resellerAccountsByClientUserIdPut($client_user_id, $reseller_account);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ResellerAccountApi->resellerAccountsByClientUserIdPut: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME, 
    Password = API_KEY  
};
var resellerAccountApi = new ResellerAccountApi(configuration);
var response = resellerAccountApi.ResellerAccountsByClientUserIdPut(RESELLER_CLIENT_ID, new ResellerAccount( 
    username: "USERNAME",
    password: "password",
    userEmail: "john@doe.com",
    userPhone: "+11231231234",
    userFirstName: "John",
    userLastName: "Doe",
    accountName: "Account Name",
    country: "US"
});
var api = require('./api.js');

var resellerApi = new api.ResellerAccountApi("USERNAME", "API_KEY");

var clientUserId = 12;

var resellerAccount = new api.ResellerAccount();

resellerAccount.username = "johndoe2";
resellerAccount.password = "pass";
resellerAccount.userEmail = "johndoe2@awesome.com";
resellerAccount.userPhone = "518-481-1002";
resellerAccount.userFirstName = "John";
resellerAccount.userLastName = "Doe";
resellerAccount.accountName = "The Awesome Company";
resellerAccount.country = "US";

resellerApi.resellerAccountsByClientUserIdPut(clientUserId, resellerAccount).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::ResellerAccountApi.new

client_user_id = 56 # Integer | User ID of client

# ResellerAccount | ResellerAccount model
reseller_account = ClickSendClient::ResellerAccount.new(
  "username": "username",
  "password": "password",
  "user_email": "user_email",
  "user_phone": "user_phone",
  "user_first_name": "user_first_name",
  "user_last_name": "user_last_name",
  "account_name": "account_name",
  "country": "country"
)

begin
  # Update Reseller clients Account
  result = api_instance.reseller_accounts_by_client_user_id_put(client_user_id, reseller_account)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling ResellerAccountApi->reseller_accounts_by_client_user_id_put: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.ResellerAccountApi(clicksend_client.ApiClient(configuration))
client_user_id = 56 # int | User ID of client
# ResellerAccount | ResellerAccount model
reseller_account = clicksend_client.ResellerAccount(
                  username="username",
                  user_email="xxx@gmail.com",
                  user_phone="000-000-000",
                  user_first_name="firstname",
                  user_last_name="lastname",
                  country="country",
                  password="pass",
                  account_name="account_name") 

try:
    # Update Reseller clients Account
    api_response = api_instance.reseller_accounts_by_client_user_id_put(client_user_id, reseller_account)
    print(api_response)
except ApiException as e:
    print("Exception when calling ResellerAccountApi->reseller_accounts_by_client_user_id_put: %s\n" % e)
use WWW::ClickSendClient::ResellerAccountApi;
use WWW::ClickSendClient::Object::ResellerAccount;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::ResellerAccountApi->new(username => $username, password => $password);

my %params = (
    'username'        => 'username',
    'password'        => 'password',
    'user_email'      => 'test1@test.com',
    'user_phone'      => '+447777777777',
    'user_first_name' => 'user_first_name',
    'user_last_name'  => 'user_last_name',
    'account_name'    => 'account_name',
    'country'         => 'AU'
);

my $reseller_obj = WWW::ClickSendClient::Object::ResellerAccount->new(%params);

my $json_output = $api->reseller_accounts_by_client_user_id_put('client_user_id' => 1234, 'reseller_account' => $reseller_obj);

print $json_output;
#import "CSResellerAccountApi.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
[apiConfig setUsername:@"USERNAME"];
[apiConfig setPassword:@"PASSWORD"];

NSNumber *clientUserId = [[NSNumber alloc] initWithInt:1];

CSResellerAccount *resellerAccount = [[CSResellerAccount alloc] init];
resellerAccount.username = @"username";
resellerAccount.password = @"password";
resellerAccount.userEmail = @"user_email";
resellerAccount.userPhone = @"user_phone";
resellerAccount.userFirstName =@"user_firstname";
resellerAccount.userLastName = @"user_lastname";
resellerAccount.accountName = @"account_name";
resellerAccount.country = @"country";

CSResellerAccountApi *resellerAccountApiInstance = [[CSResellerAccountApi alloc] init];
[resellerAccountApiInstance resellerAccountsByClientUserIdPutWithClientUserId:clientUserId resellerAccount:resellerAccount completionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire

if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}

let resellerAccount = ResellerAccount(username: "user_name",
                                      password: "password",
                                      userEmail: "user_email",
                                      userPhone: "user_phone",
                                      userFirstName: "user_firstname",
                                      userLastName: "user_lastname",
                                      accountName: "account_name",
                                      country: "country")

ResellerAccountAPI.resellerAccountsByClientUserIdPut(clientUserId: 1, resellerAccount: resellerAccount) { (dataString, error) in
    guard let dataString = dataString else {
        print(error!)
        return
    }
    if let data = dataString.data(using: String.Encoding.utf8) {
        do {
            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                print(dictonary)
            } else {
                print("Cannot convert the String value to JSON")
            }
        } catch let error as NSError {
            print(error)
        }
    }
}
    Coming Soon
package ClickSend;

import ClickSend.Api.ResellerAccountApi;
import ClickSend.Model.ResellerAccount;

public class update_client_account {
  public static void main(String[] args) {
    ApiClient defaultClient = new ApiClient();
    defaultClient.setUsername("USERNAME");
    defaultClient.setPassword("API_KEY");
    ResellerAccountApi apiInstance = new ResellerAccountApi(defaultClient);
    Integer clientUserId = 56; // Integer | User ID of client
    // ResellerAccount | ResellerAccount model
    ResellerAccount resellerAccount = new ResellerAccount(); 
    resellerAccount.accountName("account");
    resellerAccount.username("username");
    resellerAccount.password("pwd!1q");
    resellerAccount.country("country");
    resellerAccount.userEmail("xxx@gmail.com");
    resellerAccount.userPhone("000-000-0000");
    resellerAccount.userFirstName("first");
    resellerAccount.userLastName("last");
    try {
        String result = apiInstance.resellerAccountsByClientUserIdPut(clientUserId, resellerAccount);
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling ResellerAccountApi#resellerAccountsByClientUserIdPut");
        e.printStackTrace();
    }
  }
}

Body parameter

{
  "country": "country",
  "password": "password",
  "user_email": "user_email",
  "user_first_name": "user_first_name",
  "user_last_name": "user_last_name",
  "account_name": "account_name",
  "user_phone": "user_phone",
  "username": "username"
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "Reseller account has been updated.",
  "data": {
    "user_id": 117,
    "username": "johndoe2",
    "user_email": "johndoe2@awesome.com",
    "active": 0,
    "banned": 0,
    "balance": "199.997000",
    "user_phone": "518-481-1002",
    "reply_to": "originalemail",
    "delivery_to": null,
    "user_first_name": "John",
    "user_last_name": "Doe",
    "account": 0,
    "account_name": "The Awesome Company",
    "account_billing_email": "johndoe2@awesome.com",
    "account_billing_mobile": "+15184811002",
    "country": "US",
    "default_country_sms": "US",
    "auto_recharge": 0,
    "auto_recharge_amount": "20.00",
    "low_credit_amount": "0.00",
    "setting_unicode_sms": 0,
    "setting_email_sms_subject": 0,
    "setting_fix_sender_id": 0,
    "setting_sms_message_char_limit": 6,
    "old_dashboard": 0,
    "balance_commission": "0.299954",
    "timezone": "Australia/Melbourne",
    "_currency": {
      "currency_name_short": "USD",
      "currency_prefix_d": "$",
      "currency_prefix_c": "¢",
      "currency_name_long": "US Dollars"
    },
    "_subaccount": null
  }
}

https://rest.clicksend.com/v3/reseller/accounts/{client_user_id}

Update Reseller clients Account

Parameters

Parameter In Type Required Description
client_user_id path integer(int32) true User ID of client

Properties

Name Type Required Restrictions Description
username string true none Account username
password string true none Account password (unhashed)
user_email string true none Account email
user_phone string true none Account phone number
user_first_name string true none Account owner first name
user_last_name string true none Account owner last name
account_name string true none Account name (usually company name)
country string true none Country of account holder

Refer to Status Codes for definitions of HTTP status code responses.

Reseller Transfer Credit

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
     --request PUT \
     --header "Content-Type: application/json" \

     --data-binary "    {
        \"client_user_id\":60,
        \"balance\":12,
        \"currency\":\"USD\"
    }" \
'https://rest.clicksend.com/v3/reseller/transfer-credit'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\TransferCreditApi(new GuzzleHttp\Client(),$config);
$reseller_account_transfer_credit = new \ClickSend\Model\ResellerAccountTransferCredit(); // \ClickSend\Model\ResellerAccountTransferCredit | ResellerAccountTransferCredit model
$reseller_account_transfer_credit->setClientUserId(60);
$reseller_account_transfer_credit->setBalance(12);
$reseller_account_transfer_credit->setCurrency("USD");

try {
    $result = $apiInstance->resellerTransferCreditPut($reseller_account_transfer_credit);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling TransferCreditApi->resellerTransferCreditPut: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME, 
    Password = API_KEY  
};
var transferCreditApi = new TransferCreditApi(configuration);
var response = transferCreditApi.ResellerTransferCreditPut(new ResellerAccountTransferCredit(
    clientUserId:  RESELLER_CLIENT_ID,
    balance:  AMOUNT_TO_TRANSFER,
    currency: "CURRENCY_CODE"
));
var api = require('./api.js');

var transferCreditApi = new api.TransferCreditApi("USERNAME", "API_KEY");

var resellerAccountTransferCredit = new api.ResellerAccountTransferCredit();

resellerAccountTransferCredit.clientUserId = 63;
resellerAccountTransferCredit.balance = 12;
resellerAccountTransferCredit.currency = "USD";

transferCreditApi.resellerTransferCreditPut(resellerAccountTransferCredit).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::TransferCreditApi.new

# ResellerAccountTransferCredit | ResellerAccountTransferCredit model
reseller_account_transfer_credit = ClickSendClient::ResellerAccountTransferCredit.new(
  "client_user_id": 0,
  "balance": 6,
  "currency": "currency"
)

begin
  # Transfer Credit
  result = api_instance.reseller_transfer_credit_put(reseller_account_transfer_credit)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling TransferCreditApi->reseller_transfer_credit_put: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.TransferCreditApi(clicksend_client.ApiClient(configuration))
# ResellerAccountTransferCredit | ResellerAccountTransferCredit model
reseller_account_transfer_credit = clicksend_client.ResellerAccountTransferCredit(
                                    client_user_id=60,
                                    balance=12,
                                    currency="USD") 

try:
    # Transfer Credit
    api_response = api_instance.reseller_transfer_credit_put(reseller_account_transfer_credit)
    print(api_response)
except ApiException as e:
    print("Exception when calling TransferCreditApi->reseller_transfer_credit_put: %s\n" % e)

use WWW::ClickSendClient::Object::ResellerAccountTransferCredit;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::ResellerAccountApi->new(username => $username, password => $password);

my %params = (
    'client_user_id' => '64777',
    'balance'        => '10',
    'currency'       => 'INR'
);

my $reseller_account_transfer_credit_obj = WWW::ClickSendClient::Object::ResellerAccountTransferCredit->new(%params);

my $json_output = $api->reseller_transfer_credit_put('reseller_account_transfer_credit' => $reseller_account_transfer_credit_obj);

print $json_output;
#import "CSResellerAccountApi.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
[apiConfig setUsername:@"USERNAME"];
[apiConfig setPassword:@"PASSWORD"];

NSNumber *clientUserId = [[NSNumber alloc] initWithInt:1];

CSResellerAccount *resellerAccount = [[CSResellerAccount alloc] init];
resellerAccount.username = @"string";
resellerAccount.password = @"string";
resellerAccount.userEmail = @"string";
resellerAccount.userPhone = @"string";
resellerAccount.userFirstName =@"user_firstname";
resellerAccount.userLastName = @"user_lastname";
resellerAccount.accountName = @"account_name";
resellerAccount.country = @"country";

CSResellerAccountApi *resellerAccountApiInstance = [[CSResellerAccountApi alloc] init];
[resellerAccountApiInstance resellerAccountsByClientUserIdPutWithClientUserId:clientUserId resellerAccount:resellerAccount completionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire

if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}

let resellerAccount = ResellerAccount(username: "user_name",
                                      password: "password",
                                      userEmail: "user_email",
                                      userPhone: "user_Phone",
                                      userFirstName: "user_firstname",
                                      userLastName: "user_lastname",
                                      accountName: "account_Name",
                                      country: "country")

ResellerAccountAPI.resellerAccountsByClientUserIdPut(clientUserId: 1, resellerAccount:resellerAccount) { (dataString, error) in
    guard let dataString = dataString else {
        print(error!)
        return
    }
    if let data = dataString.data(using: String.Encoding.utf8) {
        do {
            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                print(dictonary)
            } else {
                print("Cannot convert the String value to JSON")
            }
        } catch let error as NSError {
            print(error)
        }
    }
}
    Coming Soon
package ClickSend;

import ClickSend.Api.TransferCreditApi;
import ClickSend.Model.ResellerAccountTransferCredit;

public class reseller_transfer_credit {
  public static void main(String[] args) {
    ApiClient defaultClient = new ApiClient();
    defaultClient.setUsername("USERNAME");
    defaultClient.setPassword("API_KEY");
    TransferCreditApi apiInstance = new TransferCreditApi(defaultClient);
    // ResellerAccountTransferCredit | ResellerAccountTransferCredit model
    ResellerAccountTransferCredit resellerAccountTransferCredit = new ResellerAccountTransferCredit();
    resellerAccountTransferCredit.balance(new Integer(12));
    resellerAccountTransferCredit.clientUserId(new Integer(60));
    resellerAccountTransferCredit.currency("USD");

    try {
        String result = apiInstance.resellerTransferCreditPut(resellerAccountTransferCredit);
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling TransferCreditApi#resellerTransferCreditPut");
        e.printStackTrace();
    }
  }
}

Body parameter

{
  "balance": 6,
  "client_user_id": 0,
  "currency": "currency"
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "Your balance has been successfully transferred.",
  "data": {
    "user_id": 60,
    "username": "FHJatAkKXD",
    "user_email": "MEynjL6C3A@2YtIn.com",
    "active": 0,
    "banned": 0,
    "balance": "170.728701",
    "user_phone": "+61353787971",
    "reply_to": "originalemail",
    "delivery_to": "I1hq9xrvmcNO24sf",
    "user_first_name": "JohnjRk3I",
    "user_last_name": "Doe1uWR5",
    "account": 0,
    "account_name": "JohnkMJLv",
    "account_billing_email": "fZpbUQfzE0@NQ9Nt.com",
    "account_billing_mobile": "+61353787898",
    "country": "AU",
    "default_country_sms": "AU",
    "unsubscribe_mail": 0,
    "auto_recharge": 0,
    "auto_recharge_amount": "20.00",
    "low_credit_amount": "1.50",
    "setting_unicode_sms": 0,
    "setting_beta": 0,
    "setting_email_sms_subject": 0,
    "setting_fix_sender_id": 0,
    "setting_sms_message_char_limit": 140,
    "_currency": {
      "currency_name_short": "AUD",
      "currency_prefix_d": "$",
      "currency_prefix_c": "c",
      "currency_name_long": "Australian Dollars"
    },
    "_subaccount": {
      "subaccount_id": 70,
      "api_username": "a4CQgqG4lS",
      "email": "fZpbUQfzE0@NQ9Nt.com",
      "phone_number": "+61353787898",
      "first_name": "John19k46",
      "last_name": "DoexkI6a",
      "api_key": "C9B4AFBA-BDBA-E343-950B-2C63BF6E7901",
      "access_users": 1,
      "access_billing": 1,
      "access_reporting": 1,
      "access_contacts": 0,
      "access_settings": 1,
      "access_sms": 0,
      "access_email": 0,
      "access_voice": 0,
      "access_fax": 0,
      "access_post": 0,
      "access_reseller": 0
    }
  }
}

https://rest.clicksend.com/v3/reseller/transfer-credit

Transfer Credit

Properties

Name Type Required Restrictions Description
client_user_id integer(int32) true none User ID of client
balance integer(int32) true none Balance to transfer
currency string true none Currency of balance to transfer

Refer to Status Codes for definitions of HTTP status code responses.

Search

Everything about searching contact lists

View Contact Lists

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \

'https://rest.clicksend.com/v3/search/contacts-lists?q={q}'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\SearchApi(new GuzzleHttp\Client(),$config);
$q = "q_example"; // string | Your keyword or query.
$page = 1; // int | Page number
$limit = 10; // int | Number of records per page

try {
    $result = $apiInstance->searchContactsListsGet($q, $page, $limit);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling SearchApi->searchContactsListsGet: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME, 
    Password = API_KEY  
};
var searchApi = new SearchApi(configuration);
var response = searchApi.SearchContactsListsGet("QUERY");
var api = require('./api.js');

var searchApi = new api.SearchApi("USERNAME", "API_KEY");

var q = "q_example";
var page = 1;
var limit = 10;

searchApi.searchContactsListsGet(q, page, limit).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::SearchApi.new

q = "q_example" # String | Your keyword or query.

opts = {
  page: 1,  # Integer | Page number
  limit: 10 # Integer | Number of records per page
}

begin
  # Get list of searched contact list
  result = api_instance.search_contacts_lists_get(q, opts)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling SearchApi->search_contacts_lists_get: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.SearchApi(clicksend_client.ApiClient(configuration))
q = 'q_example' # str | Your keyword or query.
page = 1 # int | Page number (optional) (default to 1)
limit = 10 # int | Number of records per page (optional) (default to 10)

try:
    # Get list of searched contact list
    api_response = api_instance.search_contacts_lists_get(q, page=page, limit=limit)
    print(api_response)
except ApiException as e:
    print("Exception when calling SearchApi->search_contacts_lists_get: %s\n" % e)
use WWW::ClickSendClient::SearchApi;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::SearchApi->new(username => $username, password => $password);

my $json_output = $api->search_contacts_lists_get('page'  => 1, 'q' => '' ,'limit' => '');

print $json_output;
#import "CSSearchApi.h"
#import "CSDefaultConfiguration.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
// Configure HTTP basic authorization (authentication scheme: BasicAuth)
[apiConfig setUsername:@"USERNAME"];
[apiConfig setPassword:@"PASSWORD"];

CSSearchApi *searchApi = [[CSSearchApi alloc] init];
[searchApi searchContactsListsGetWithQ:@"q" page:@(1) limit:@(15) completionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire
if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}

SearchAPI.searchContactsListsGet(q: "q") { (dataString, error) in
    if let error = error {
        print(error)
    } else {
        if let data = dataString!.data(using: String.Encoding.utf8) {
            do {
                if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                    print(dictonary)
                } else {
                    print("Cannot convert the String value to JSON")
                }
            } catch let error as NSError {
                print(error)
            }
        }
    }
}
    Coming Soon
package ClickSend;

import ClickSend.Api.SearchApi;

public class view_contact_list {
   public static void main(String[] args) {
      ApiClient defaultClient = new ApiClient();
      defaultClient.setUsername("USERNAME");
      defaultClient.setPassword("API_KEY");
      SearchApi apiInstance = new SearchApi(defaultClient);
      String q = "q_example"; // String | Your keyword or query.
      Integer page = 1; // Integer | Page number
      Integer limit = 10; // Integer | Number of records per page
      try {
          String result = apiInstance.searchContactsListsGet(q, page, limit);
          System.out.println(result);
      } catch (ApiException e) {
          System.err.println("Exception when calling SearchApi#searchContactsListsGet");
          e.printStackTrace();
      }
  }
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "Here are some search result.",
  "data": {
    "total": 2,
    "per_page": 15,
    "current_page": 1,
    "last_page": 1,
    "next_page_url": null,
    "prev_page_url": null,
    "from": 1,
    "to": 2,
    "data": [
      {
        "id": 552807,
        "name": "Gorne",
        "contact": "+16783270696",
        "type": "contact",
        "contacts_count": null
      },
      {
        "id": 428,
        "name": "Gorne",
        "contact": "GHPAJCCVGMTD9BLA",
        "type": "list",
        "contacts_count": 3
      }
    ]
  }
}

https://rest.clicksend.com/v3/search/contacts-lists

Get list of searched contact list

Parameters

Parameter In Type Required Description
q query string true Your keyword or query.
page query integer(int32) false Page number
limit query integer(int32) false Number of records per page

Refer to Status Codes for definitions of HTTP status code responses.

Sender Registration

Request Alpha Tag

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
     --request POST \
     --header "Content-Type: application/json" \
     --data-binary "    {
        \"alpha_tag\": \"Abc123+\",
        \"reason\": \"Sole Trader Name\"
    }" \
'https://rest.clicksend.com/v3/alpha-tags'
coming soon
coming soon
coming soon
coming soon
coming soon
coming soon
coming soon
coming soon
coming soon
coming soon

Body parameter

{
  "alpha_tag": "Abc123+",
  "reason": "Sole Trader Name"
}

Response

{
  "id": "db630385-cb76-457d-8f16-76df1b394257",
  "account_id": "85edb794-ee6d-4a38-9f63-c5fa8acf0d79",
  "workspace_id": "85edb794-ee6d-4a38-9f63-c5fa8acf0d79",
  "user_id": "85edb794-ee6d-4a38-9f63-c5fa8acf0d79",
  "alpha_tag": "Abc123",
  "status": "PENDING",
  "reason": "Sole Trader Name",
  "created_timestamp": "2021-05-11T01:00:00.123Z",
  "updated_timestamp": "2021-05-11T01:05:00.123Z"
}

https://rest.clicksend.com/v3/alpha-tags

Request to register an alpha tag. After requested, the alpha tag will be reviewed by ClickSend and either approved or rejected.

Properties

Name Type Required Restrictions Description
alpha_tag string true yes The alpha tag name. Length must be between 3 - 11 characters, can only contain a-z A-Z 0-9 + and must contain at least one non numeric.
reason string false none Must be one of the following: Sole Trader Name, Company Name, Partnership Name, Registered Trust Name, Co-Operative Name, Indigenous Corporation Name, Registered Organisation Name, Personal Name, Trademark, Government Agency or Entity, Product or Service Name, Acronym/Initialism, Contraction of Name, Third Party. In case of Third Party, we will contact you to collect the relevant information.

Refer to Status Codes for definitions of HTTP status code responses.

List Alpha Tags

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
'https://rest.clicksend.com/v3/alpha-tags'
coming soon
coming soon
coming soon
coming soon
coming soon
coming soon
coming soon
coming soon
coming soon
coming soon

Response

{
  "alpha_tags": [
    {
      "id": "db630385-cb76-457d-8f16-76df1b394257",
      "account_id": "85edb794-ee6d-4a38-9f63-c5fa8acf0d79",
      "workspace_id": "85edb794-ee6d-4a38-9f63-c5fa8acf0d79",
      "user_id": "85edb794-ee6d-4a38-9f63-c5fa8acf0d79",
      "alpha_tag": "Abc123",
      "status": "PENDING",
      "reason": "Sole Trader Name",
      "created_timestamp": "2021-05-11T01:00:00.123Z",
      "updated_timestamp": "2021-05-11T01:05:00.123Z"
    }
  ],
  "_metadata": {
    "pagination": {
      "self": "https://rest.clicksend.com/v3/alpha-tags?offset=f99872cc-11a6-48ba-a9f2-bcfb6dd1e3d4#8fa5ebc2-777b-45db-a448-ec76a40d4384&page_size=10",
      "next": "https://rest.clicksend.com/v3/alpha-tags?offset=f99872cc-11a6-48ba-a9f2-bcfb6dd1e3d4#8fa5ebc2-777b-45db-a448-ec76a40d4384&page_size=10",
      "page_size": 10
    }
  }
}

https://rest.clicksend.com/v3/alpha-tags

List alpha tags.

Parameters

Parameter In Type Required Description
offset query uuid false Page(offset) to be used for pagination. Example: offset=f99872cc-11a6-48ba-a9f2-bcfb6dd1e3d4#8fa5ebc2-777b-45db-a448-ec76a40d4384
page_size query integer false Number of records per page. Default: 10. Range [1..500]
filter[alpha_tag] query string false Filter by alpha_tag, search by alpha_tag name partial match. Max length: 11
filter[status][] query string false Filter by statuses. Value must be in enum [PENDING, APPROVED, REJECTED]. For example: filter[status][0]=PENDING&filter[status][1]=APPROVED .
sort_by query string false Sort by parameter. Default: alpha_tag
sort_direction query string false Direction of sorting. Default: asc. Value must be in enum [asc, desc].

Refer to Status Codes for definitions of HTTP status code responses.

Get Alpha Tag

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
'https://rest.clicksend.com/v3/alpha-tags/db630385-cb76-457d-8f16-76df1b394257'
coming soon
coming soon
coming soon
coming soon
coming soon
coming soon
coming soon
coming soon
coming soon
coming soon

Response

{
  "id": "db630385-cb76-457d-8f16-76df1b394257",
  "account_id": "85edb794-ee6d-4a38-9f63-c5fa8acf0d79",
  "workspace_id": "85edb794-ee6d-4a38-9f63-c5fa8acf0d79",
  "user_id": "85edb794-ee6d-4a38-9f63-c5fa8acf0d79",
  "alpha_tag": "Abc123",
  "status": "PENDING",
  "reason": "Sole Trader Name",
  "created_timestamp": "2021-05-11T01:00:00.123Z",
  "updated_timestamp": "2021-05-11T01:05:00.123Z"
}

https://rest.clicksend.com/v3/alpha-tags/{alpha_tag_id}

Get a specific alpha tag.

Parameters

Parameter In Type Required Description
alpha_tag_id path uuid true ID of the alpha tag

Refer to Status Codes for definitions of HTTP status code responses.

Delete Alpha Tag

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
     --request DELETE \
'https://rest.clicksend.com/v3/alpha-tags/db630385-cb76-457d-8f16-76df1b394257'
coming soon
coming soon
coming soon
coming soon
coming soon
coming soon
coming soon
coming soon
coming soon
coming soon

Response

204 No Content

https://rest.clicksend.com/v3/alpha-tags/{alpha_tag_id}

Delete a specific alpha tag.

Parameters

Parameter In Type Required Description
alpha_tag_id path uuid true ID of the alpha tag

Refer to Status Codes for definitions of HTTP status code responses.

List Own Numbers

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
     --request GET \

'https://rest.clicksend.com/v3/own-numbers?page_size=50&filter[status][0]=PENDING&filter[status][1]=APPROVED&sort_by=created_timestamp&sort_direction=asc'
coming soon
coming soon
coming soon
coming soon
coming soon
coming soon
coming soon
coming soon
coming soon
coming soon

Response

{
  "own_numbers": [
    {
      "id": "8fa5ebc2-777b-45db-a448-ec76a40d4384",
      "account_id": "85edb794-ee6d-4a38-9f63-c5fa8acf0d79",
      "workspace_id": "85edb794-ee6d-4a38-9f63-c5fa8acf0d79",
      "user_id": "85edb794-ee6d-4a38-9f63-c5fa8acf0d79",
      "phone_number": "+61412345678",
      "country": "AU",
      "label": "My phone number",
      "status": "APPROVED",
      "verified_timestamp": "2023-08-31T12:00:00Z",
      "created_timestamp": "2023-08-25T08:00:00Z",
      "updated_timestamp": "2023-08-25T08:30:00Z"
    }
  ],
  "_metadata": {
    "pagination": {
      "self": "https://rest.clicksend.com/v3/own-numbers?offset=f99872cc-11a6-48ba-a9f2-bcfb6dd1e3d4#8fa5ebc2-777b-45db-a448-ec76a40d4384&page_size=10",
      "next": "https://rest.clicksend.com/v3/own-numbers?offset=f99872cc-11a6-48ba-a9f2-bcfb6dd1e3d4#8fa5ebc2-777b-45db-a448-ec76a40d4384&page_size=10",
      "page_size": 10
    }
  }
}

https://rest.clicksend.com/v3/own-numbers

List own numbers.

Parameters

Parameter In Type Required Description
offset query uuid false Page(offset) to be used for pagination. Example: offset=f99872cc-11a6-48ba-a9f2-bcfb6dd1e3d4#8fa5ebc2-777b-45db-a448-ec76a40d4384
page_size query integer false Number of records per page. Default: 10. Range [1..500]
filter[status][] query string false Filter by statuses. Value must be in enum [PENDING, APPROVED, REJECTED]. For example: filter[status][0]=PENDING&filter[status][1]=APPROVED .
sort_by query string false Sort by parameter. Default: created_timestamp
sort_direction query string false Direction of sorting. Default: asc. Value must be in enum [asc, desc].

Refer to Status Codes for definitions of HTTP status code responses.

Get Own Number Detail

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
     --request GET \

'https://rest.clicksend.com/v3/own-numbers/60b34fe9-1b45-43f8-b9ef-06b7fdb3a9f5'
coming soon
coming soon
coming soon
coming soon
coming soon
coming soon
coming soon
coming soon
coming soon
coming soon

Response

{
  "id": "8fa5ebc2-777b-45db-a448-ec76a40d4384",
  "label": "My phone number",
  "account_id": "85edb794-ee6d-4a38-9f63-c5fa8acf0d79",
  "phone_number": "+61412345678",
  "country": "AU",
  "status": "APPROVED",
  "verified_timestamp": "2023-08-31T12:00:00Z",
  "created_timestamp": "2023-08-25T08:00:00Z",
  "updated_timestamp": "2023-08-25T08:30:00Z"
}

https://rest.clicksend.com/v3/own-numbers/{own_number_id}

Get a specific own numbers.

Parameters

Parameter In Type Required Description
own_number_id path uuid true ID of the own number

Refer to Status Codes for definitions of HTTP status code responses.

Update Own Number

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
     --request PATCH \
     --data-binary "    {
        \"label\": \"My phone number\"
    }" \

'https://rest.clicksend.com/v3/own-numbers/60b34fe9-1b45-43f8-b9ef-06b7fdb3a9f5'
coming soon
coming soon
coming soon
coming soon
coming soon
coming soon
coming soon
coming soon
coming soon
coming soon

Response

{
  "id": "8fa5ebc2-777b-45db-a448-ec76a40d4384",
  "label": "My phone number",
  "account_id": "85edb794-ee6d-4a38-9f63-c5fa8acf0d79",
  "phone_number": "+61412345678",
  "country": "AU",
  "status": "APPROVED",
  "verified_timestamp": "2023-08-31T12:00:00Z",
  "created_timestamp": "2023-08-25T08:00:00Z",
  "updated_timestamp": "2023-08-25T08:30:00Z"
}

https://rest.clicksend.com/v3/own-numbers/{own_number_id}

Update details of a specific own numbers.

Parameters

Parameter In Type Required Description
own_number_id path uuid true ID of the own number

Properties

Name Type Required Restrictions Description
label string false none Custom label for phone number. Length must be between 1 - 200 characters.

Refer to Status Codes for definitions of HTTP status code responses.

Delete Own Number

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
     --request DELETE \

'https://rest.clicksend.com/v3/own-numbers/60b34fe9-1b45-43f8-b9ef-06b7fdb3a9f5'
coming soon
coming soon
coming soon
coming soon
coming soon
coming soon
coming soon
coming soon
coming soon
coming soon

Response

{
  "id": "8fa5ebc2-777b-45db-a448-ec76a40d4384",
  "label": "My phone number",
  "account_id": "85edb794-ee6d-4a38-9f63-c5fa8acf0d79",
  "phone_number": "+61412345678",
  "country": "AU",
  "status": "APPROVED",
  "verified_timestamp": "2023-08-31T12:00:00Z",
  "created_timestamp": "2023-08-25T08:00:00Z",
  "updated_timestamp": "2023-08-25T08:30:00Z"
}

https://rest.clicksend.com/v3/own-numbers/{own_number_id}

Delete a specific own numbers.

Parameters

Parameter In Type Required Description
own_number_id path uuid true ID of the own number

Refer to Status Codes for definitions of HTTP status code responses.

Request Own Number Verification OTP

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
     --request POST \
     --data-binary "    {
        \"label\": \"My phone number\",
        \"phone_number\": \"+61412345678\",
        \"country\": \"AU\"
    }" \

'https://rest.clicksend.com/v3/own-numbers/verifications'
coming soon
coming soon
coming soon
coming soon
coming soon
coming soon
coming soon
coming soon
coming soon
coming soon

Body parameter

{
  "label": "My phone number",
  "phone_number": "+61412345678",
  "country": "AU"
}

Response

{
  "id": "db630385-cb76-457d-8f16-76df1b394257",
  "own_number_id": "db630385-cb76-457d-8f16-76df1b394257",
  "status": "APPROVED",
  "expires_timestamp": "2023-08-31T12:00:00Z",
  "remaining_attempts": 2,
  "created_timestamp": "2023-08-25T08:00:00Z",
  "updated_timestamp": "2023-08-25T08:10:00Z"
}

https://rest.clicksend.com/v3/own-numbers/verifications

Request to generate own number verification OTP

Properties

Name Type Required Restrictions Description
label string false none Custom label for phone number. Length must be between 1 - 200 characters.
phone_number string true none Phone number.
country string false none Country code.

Refer to Status Codes for definitions of HTTP status code responses.

Verify Own Number OTP

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
     --request POST \
     --data-binary "    {
        \"code\": \"428312\",
        \"phone_number\": \"+61437887111\",
        \"country\": \"AU\"
    }" \

'https://rest.clicksend.com/v3/own-numbers/verifications/e9bcb7cc-d42b-47cd-ad1f-8677307d4040/verify'
coming soon
coming soon
coming soon
coming soon
coming soon
coming soon
coming soon
coming soon
coming soon
coming soon

Body parameter

{
  "country": "AU",
  "phone_number":"+61437887111",
  "code": "428312",
}

Response

{
  "id": "db630385-cb76-457d-8f16-76df1b394257",
  "own_number_id": "db630385-cb76-457d-8f16-76df1b394257",
  "status": "APPROVED",
  "expires_timestamp": "2023-08-31T12:00:00Z",
  "remaining_attempts": 1,
  "error_code": null,
  "created_timestamp": "2023-08-25T08:00:00Z",
  "updated_timestamp": "2023-08-25T08:15:00Z"
}

https://rest.clicksend.com/v3/own-numbers/verifications/{verification_id}/verify

Request to verify an OTP for Own Number verification

Parameters

Parameter In Type Required Description
verification_id path uuid true ID of the Own Number verification

Properties

Name Type Required Restrictions Description
code string true none OTP code. Length must be 6 characters
phone_number string true none Phone number.
country string false none Country code.

Refer to Status Codes for definitions of HTTP status code responses.

SMS

Send SMS

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
     --request POST \
     --header "Content-Type: application/json" \

     --data-binary "    {
        \"messages\":[
            {
                \"source\":\"php\",
                \"body\":\"Jelly liquorice marshmallow candy carrot cake 4Eyffjs1vL.\",
                \"to\":\"+61411111111\"
            },
            {
                \"source\":\"php\",
                \"body\":\"Chocolate bar icing icing oat cake carrot cake jelly cotton MWEvciEPIr.\",
                \"to\":\"+61422222222\"
            }
        ]
    }" \
'https://rest.clicksend.com/v3/sms/send'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\SMSApi(new GuzzleHttp\Client(),$config);
$msg = new \ClickSend\Model\SmsMessage();
$msg->setBody("test body"); 
$msg->setTo("0451111111");
$msg->setSource("sdk");

// \ClickSend\Model\SmsMessageCollection | SmsMessageCollection model
$sms_messages = new \ClickSend\Model\SmsMessageCollection(); 
$sms_messages->setMessages([$msg]);

try {
    $result = $apiInstance->smsSendPost($sms_messages);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling SMSApi->smsSendPost: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME, 
    Password = API_KEY  
};
var smsApi = new SMSApi(configuration);

var listOfSms = new List<SmsMessage>
{
    new SmsMessage(
        to: "+61411111111", 
        body: "test message", 
        source: "sdk"
    )
};

var smsCollection = new SmsMessageCollection(listOfSms);
var response = smsApi.SmsSendPost(smsCollection);
var api = require('./api.js');

var smsApi = new api.SMSApi("USERNAME", "API_KEY");

var smsMessage = new api.SmsMessage();

smsMessage.source = "sdk";
smsMessage.to = "+0451111111";
smsMessage.body = "test message";

var smsCollection = new api.SmsMessageCollection();

smsCollection.messages = [smsMessage];

smsApi.smsSendPost(smsCollection).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::SMSApi.new

# SmsMessageCollection | SmsMessageCollection model
sms_messages = ClickSendClient::SmsMessageCollection.new

sms_messages.messages = [
  ClickSendClient::SmsMessage.new(
    "to": "+61411111111",
    "source": "sdk",
    "body": "body"
  ),
  ClickSendClient::SmsMessage.new(
    "to": "+61422222222",
    "source": "sdk",
    "body": "body"
  )
]

begin
  # Send sms message(s)
  result = api_instance.sms_send_post(sms_messages)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling SMSApi->sms_send_post: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client import SmsMessage
from clicksend_client.rest import ApiException


# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.SMSApi(clicksend_client.ApiClient(configuration))

# If you want to explictly set from, add the key _from to the message.
sms_message = SmsMessage(source="php",
                        body="Jelly liquorice marshmallow candy carrot cake 4Eyffjs1vL.",
                        to="+61411111111",
                        schedule=1436874701)

sms_messages = clicksend_client.SmsMessageCollection(messages=[sms_message])

try:
    # Send sms message(s)
    api_response = api_instance.sms_send_post(sms_messages)
    print(api_response)
except ApiException as e:
    print("Exception when calling SMSApi->sms_send_post: %s\n" % e)
use WWW::ClickSendClient::SMSApi;
use WWW::ClickSendClient::Object::SmsMessageCollection;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::SMSApi->new(username => $username, password => $password);

my %params = (
    'messages' => [
        {
            'source'        => 'perl',
            'body'          => 'Jelly liquorice marshmallow candy carrot cake 4Eyffjs1vL.',
            'to'            => '+61411111111'
        },
        {
            'source'        => 'perl',
            'body'          => 'Chocolate bar icing icing oat cake carrot cake jelly cotton MWEvciEPIr.',
            'to'            => '+61422222222'
        }
    ]
);

#You can post up to 1000 messages

my $messages_obj = WWW::ClickSendClient::Object::SmsMessageCollection->new(%params);
my $json_output = $api->sms_send_post('sms_messages' => $messages_obj);

print $json_output;
#import "CSSMSApi.h"
#import "CSSmsMessage.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
// Configure HTTP basic authorization (authentication scheme: BasicAuth)
[apiConfig setUsername:@"YOUR_USERNAME"];
[apiConfig setPassword:@"YOUR_PASSWORD"];

CSSmsMessage *smsMessage1 = [[CSSmsMessage alloc] init];
smsMessage1.to = @"+0451111111";
smsMessage1.source = @"objc";
smsMessage1.body = @"Chocolate bar icing icing oat cake carrot cake jelly cotton MWEvciEPIr.";

CSSmsMessage *smsMessage2 = [[CSSmsMessage alloc] init];
smsMessage2.listId = @"1234";
smsMessage2.source = @"objc";
smsMessage2.body = @"Chocolate bar icing icing oat cake carrot cake jelly cotton MWEvciEPIr.";


CSSmsMessageCollection *smsMessageCollection = [[CSSmsMessageCollection alloc] init];
smsMessageCollection.messages = (NSArray<CSSmsMessage> *) @[smsMessage1, smsMessage2];

CSSMSApi *smsAPI = [[CSSMSApi alloc] init];
[smsAPI smsSendPostWithSmsMessages:smsMessageCollection completionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire

if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}

let message1 = SmsMessage(body: "Chocolate bar icing icing oat cake carrot cake jelly cotton MWEvciEPIr.", 
                        to: "+0451111111", 
                        source: "swift")

let message2 = SmsMessage(body: "Chocolate bar icing icing oat cake carrot cake jelly cotton MWEvciEPIr.", 
                        source: "swift", 
                        listId: 1234)

let smsCollection = SmsMessageCollection(messages: [message1, message2])
SMSAPI.smsSendPost(smsMessages: smsCollection) { (dataString, error) in

    guard let dataString = dataString else {
        print(error!)
        return
    }

    if let data = dataString.data(using: String.Encoding.utf8) {
        do {
            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                print(dictonary)
            } else {
                print("bad json")
            }
        } catch let error as NSError {
            print(error)
        }
    }
}
    Coming Soon
package ClickSend;

import java.util.Arrays;
import java.util.List;
import ClickSend.Api.SmsApi;
import ClickSend.Model.SmsMessage;
import ClickSend.Model.SmsMessageCollection;

public class send_sms {
  public static void main(String[] args) {
    ApiClient defaultClient = new ApiClient();
    defaultClient.setUsername("USERNAME");
    defaultClient.setPassword("API_KEY");
    SmsApi apiInstance = new SmsApi(defaultClient);

    SmsMessage smsMessage=new SmsMessage();
    smsMessage.body("body");
    smsMessage.to("to");
    smsMessage.source("source");

    List<SmsMessage> smsMessageList=Arrays.asList(smsMessage);
    // SmsMessageCollection | SmsMessageCollection model
    SmsMessageCollection smsMessages = new SmsMessageCollection();
    smsMessages.messages(smsMessageList);
    try {
        String result = apiInstance.smsSendPost(smsMessages);
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling SmsApi#smsSendPost");
        e.printStackTrace();
    }
  }
}

Body parameter

{
  "messages": [
    {
      "to": "+61411111111",
      "source": "sdk",
      "body": "body"
    },
    {
      "to": "+61422222222",
      "source": "sdk",
      "body": "body"
    }
  ]
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "Here are your data.",
  "data": {
    "total_price": 0.28,
    "total_count": 2,
    "queued_count": 2,
    "messages": [
      {
        "direction": "out",
        "date": 1436871253,
        "to": "+61411111111",
        "body": "Jelly liquorice marshmallow candy carrot cake 4Eyffjs1vL.",
        "from": "sendmobile",
        "schedule": 1436874701,
        "message_id": "BF7AD270-0DE2-418B-B606-71D527D9C1AE",
        "message_parts": 1,
        "message_price": 0.07,
        "custom_string": "this is a test",
        "user_id": 1,
        "subaccount_id": 1,
        "country": "AU",
        "carrier": "Telstra",
        "status": "SUCCESS"
      },
      {
        "direction": "out",
        "date": 1436871253,
        "to": "+61411111111",
        "body": "Chocolate bar icing icing oat cake carrot cake jelly cotton MWEvciEPIr.",
        "from": "sendlist",
        "schedule": 1436876011,
        "message_id": "D0C273EE-816D-4DF2-8E9D-9D9C65F168F3",
        "message_parts": 1,
        "message_price": 0.07,
        "custom_string": "this is a test",
        "user_id": 1,
        "subaccount_id": 1,
        "country": "AU",
        "carrier": "Telstra",
        "status": "SUCCESS"
      }
    ],
    "_currency": {
      "currency_name_short": "USD",
      "currency_prefix_d": "$",
      "currency_prefix_c": "¢",
      "currency_name_long": "US Dollars"
    }
  }
}

https://rest.clicksend.com/v3/sms/send

Send sms message(s)

How many messages can I send?

You can post up to 1000 messages with each API call. You can send to a mix of contacts and contact lists, as long as the total number of recipients is up to 1000. The response contains a status and details for each recipient.

Refer to Application Status Codes for the possible response message status strings.

SMS Campaign Endpoint

You can post to a list with up to 20000 recipients with each API call. You can only send to a single list containing up to 20,000 recipients. The response is far less detailed than the normal Send SMS endpoint.

How many characters can I send in a message?

A standard SMS message has a maximum of 160 characters. Longer messages are definitely possible, however please be aware that exceeding 160 characters will constitute a ‘second’ message. The end user will see this as 1 long message on their handset. When a message is longer than 160 characters, this is referred to as a multi-part message as it contains multiple messages (or multiple-parts). The total SMS limit then becomes 153 characters per ‘part’ as the 7 characters are used up by invisible headers and footers which denote which part of the message is being sent (i.e. Part 1 of 2). For example: If a message is longer than 6 message parts, it will be truncated (see below). If a message contains any characters that aren't in the GSM 03.38 character set, the message type will be treated as unicode. (https://en.wikipedia.org/wiki/GSM_03.38)

Standard English Characters:

Number of Characters Message Credits
1 - 160 1
161 - 306 2
307 - 459 3
460 - 612 4
613 - 765 5
766 - 918 6
919 - 1071 7
1072 - 1224 8

Non-GSM (Unicode) characters:

Number of Characters Message Credits
1 - 70 1
71 - 134 2
135 - 201 3
202 - 268 4
269 - 335 5
336 - 402 6
403 - 469 7
470 - 536 8

Properties

Name Type Required Restrictions Description
from string true yes Your sender id
body string true none Your message.
to string true none Recipient phone number in E.164 format.
source string false none Your method of sending e.g. 'wordpress', 'php', 'c#'.
schedule integer(int32) false none Leave blank for immediate delivery. Your schedule time in unix format http://help.clicksend.com/what-is-a-unix-timestamp
custom_string string false none Your reference. Will be passed back with all replies and delivery reports.
list_id integer(int32) false none Your list ID if sending to a whole list. Can be used instead of 'to'.
country string false none ISO alpha-2 character country code e.g. 'US', we use this to format the recipient number if it's not in international format.
from_email string false none An email address where the reply should be emailed to. If omitted, the reply will be emailed back to the user who sent the outgoing SMS.

Refer to Status Codes for definitions of HTTP status code responses.

Calculate SMS Price

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
     --request POST \
     --header "Content-Type: application/json" \

     --data-binary "    {
        \"messages\":[
            {
                \"source\":\"php\",
                \"body\":\"Jelly liquorice marshmallow candy carrot cake 4Eyffjs1vL.\",
                \"to\":\"+61411111111\"
            },
            {
                \"source\":\"php\",
                \"body\":\"Chocolate bar icing icing oat cake carrot cake jelly cotton MWEvciEPIr.\",
                \"to\":"+61422222222"
            }
        ]
    }" \
'https://rest.clicksend.com/v3/sms/price'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\SMSApi(new GuzzleHttp\Client(),$config);
$msg = new \ClickSend\Model\SmsMessage();

$msg->setBody("test body"); 
$msg->setTo("0451111111"); 
$msg->setSource("php-sdk");

// \ClickSend\Model\SmsMessageCollection | SmsMessageCollection model
$sms_messages = new \ClickSend\Model\SmsMessageCollection(); 
$sms_messages->setMessages([$msg]);

try {
    $result = $apiInstance->smsPricePost($sms_messages);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling SMSApi->smsPricePost: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME, 
    Password = API_KEY  
};
var smsApi = new SMSApi(configuration);

var listOfSms = new List<SmsMessage>
{
    new SmsMessage(
        to: "+61411111111", 
        body: "test message", 
        source: "sdk"
    )
};

var smsCollection = new SmsMessageCollection(listOfSms);
var response = smsApi.SmsPricePost(smsCollection);
var api = require('./api.js');

var smsApi = new api.SMSApi("USERNAME", "API_KEY");

var smsMessage = new api.SmsMessage();

smsMessage.from = "myNumber";
smsMessage.to = "+0451111111";
smsMessage.body = "test message";

var smsCollection = new api.SmsMessageCollection();

smsCollection.messages = [smsMessage];

smsApi.smsPricePost(smsCollection).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::SMSApi.new

sms_messages = ClickSendClient::SmsMessageCollection.new # SmsMessageCollection | SmsMessageCollection model

sms_messages.messages = [
  ClickSendClient::SmsMessage.new(
    "source": "sdk",
    "to": "+61411111111",
    "body": "body"
  ),
  ClickSendClient::SmsMessage.new(
    "source": "sdk",
    "to": "+61422222222",
    "body": "body"
  )
]

begin
  # Calculate sms price
  result = api_instance.sms_price_post(sms_messages)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling SMSApi->sms_price_post: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client import SmsMessage
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.SMSApi(
  clicksend_client.ApiClient(configuration))
sms_message = SmsMessage(source="php",
                        body="Jelly liquorice marshmallow candy carrot cake 4Eyffjs1vL.",
                        to="+61411111111")
# SmsMessageCollection | SmsMessageCollection model
sms_messages = clicksend_client.SmsMessageCollection(messages=[sms_message]) 

try:
    # Calculate sms price
    api_response = api_instance.sms_price_post(sms_messages)
    print(api_response)
except ApiException as e:
    print("Exception when calling SMSApi->sms_price_post: %s\n" % e)
use WWW::ClickSendClient::SMSApi;
use WWW::ClickSendClient::Object::SmsMessageCollection;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::SMSApi->new(username => $username, password => $password);

my %params = (
    'messages' => [
        {
            'source'        => 'perl',
            'body'          => 'Jelly liquorice marshmallow candy carrot cake 4Eyffjs1vL.',
            'to'            => '+61411111111'
        },
        {
            'source'        => 'perl',
            'body'          => 'Chocolate bar icing icing oat cake carrot cake jelly cotton MWEvciEPIr.',
            'to'            => '+61422222222'
        }
    ]
);

my $messages_obj = WWW::ClickSendClient::Object::SmsMessageCollection->new(%params);
my $json_output = $api->sms_price_post('sms_messages' => $messages_obj);

print $json_output;
#import "CSSMSApi.h"
#import "CSSmsMessage.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
// Configure HTTP basic authorization (authentication scheme: BasicAuth)
[apiConfig setUsername:@"YOUR_USERNAME"];
[apiConfig setPassword:@"YOUR_PASSWORD"];

CSSmsMessage *smsMessage1 = [[CSSmsMessage alloc] init];
smsMessage1.to = @"+0451111111";
smsMessage1.source = @"objc";
smsMessage1.body = @"Chocolate bar icing icing oat cake carrot cake jelly cotton MWEvciEPIr.";

CSSmsMessage *smsMessage2 = [[CSSmsMessage alloc] init];
smsMessage2.listId = @"1234";
smsMessage2.source = @"objc";
smsMessage2.body = @"Chocolate bar icing icing oat cake carrot cake jelly cotton MWEvciEPIr.";


CSSmsMessageCollection *smsMessageCollection = [[CSSmsMessageCollection alloc] init];
smsMessageCollection.messages = (NSArray<CSSmsMessage> *) @[smsMessage1, smsMessage2];

CSSMSApi *smsAPI = [[CSSMSApi alloc] init];
[smsAPI smsPricePostWithSmsMessages:smsMessageCollection completionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire

if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}

let message1 = SmsMessage(
    body: "Chocolate bar icing icing oat cake carrot cake jelly cotton MWEvciEPIr.", 
    to: "+0451111111", 
    source: "swift"
)

let message2 = SmsMessage(
    body: "Chocolate bar icing icing oat cake carrot cake jelly cotton MWEvciEPIr.", 
    source: "swift", 
    listId: 1234, 
)

let smsCollection = SmsMessageCollection(messages: [message1, message2])

SMSAPI.smsPricePost(smsMessages: smsCollection) { (dataString, error) in
    guard let dataString = dataString else {
        print(error!)
        return
    }

    if let data = dataString.data(using: String.Encoding.utf8) {
        do {
            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                print(dictonary)
            } else {
                print("bad json")
            }
        } catch let error as NSError {
            print(error)
        }
    }
}
    Coming Soon
package ClickSend;

import java.util.Arrays;
import java.util.List;
import ClickSend.Api.SmsApi;
import ClickSend.Model.SmsMessage;
import ClickSend.Model.SmsMessageCollection;

public class calculate_sms_price {
  public static void main(String[] args) {
    ApiClient defaultClient = new ApiClient();
    defaultClient.setUsername("USERNAME");
    defaultClient.setPassword("API_KEY");
    SmsApi apiInstance = new SmsApi(defaultClient);
    SmsMessage smsMessage=new SmsMessage();
    smsMessage.body("body");
    smsMessage.to("to");
    smsMessage.source("source");

    List<SmsMessage> smsMessageList=Arrays.asList(smsMessage);
    // SmsMessageCollection | SmsMessageCollection model
    SmsMessageCollection smsMessages = new SmsMessageCollection();
    smsMessages.messages(smsMessageList);
    try {
        String result = apiInstance.smsPricePost(smsMessages);
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling SmsApi#smsPricePost");
        e.printStackTrace();
    }
  }
}

Body parameter

{
  "messages": [
    {
      "to": "+61411111111",
      "source": "sdk",
      "body": "body"
    },
    {
      "to": "+61422222222",
      "source": "sdk",
      "body": "body"
    }
  ]
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "Here are your data.",
  "data": {
    "total_price": 0.2264,
    "total_count": 1,
    "queued_count": 1,
    "messages": [
      {
        "to": "+61411111111",
        "body": "Jelly liquorice marshmallow candy carrot cake 4Eyffjs1vL.",
        "from": "sendmobile",
        "schedule": 1436874701,
        "message_parts": 1,
        "message_price": "0.0566",
        "custom_string": "this is a test",
        "country": "AU",
        "status": "SUCCESS"
      }
    ]
  }
}  

https://rest.clicksend.com/v3/sms/price

Calculate sms price

Properties

Name Type Required Restrictions Description
from string true yes Your sender id
body string true none Your message.
to string true none Recipient phone number in E.164 format.
source string false none Your method of sending e.g. 'wordpress', 'php', 'c#'.
schedule integer(int32) false none Leave blank for immediate delivery. Your schedule time in unix format http://help.clicksend.com/what-is-a-unix-timestamp
custom_string string false none Your reference. Will be passed back with all replies and delivery reports.
list_id integer(int32) false none Your list ID if sending to a whole list. Can be used instead of 'to'.
country string false none ISO alpha-2 character country code e.g. 'US', we use this to format the recipient number if it's not in international format.
from_email string false none An email address where the reply should be emailed to. If omitted, the reply will be emailed back to the user who sent the outgoing SMS.

Refer to Status Codes for definitions of HTTP status code responses.

Create Test SMS Receipt

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
     --request POST \

     --header "Content-Type: application/json" \
     --data-binary "    {
        \"url\":\"http://yourdomain.com\"
    }" \
'https://rest.clicksend.com/v3/sms/receipts'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\SMSApi(new GuzzleHttp\Client(),$config);
$url = new \ClickSend\Model\Url(); // \ClickSend\Model\Url | Url model
$url->setUrl("http://example.com");

try {
    $result = $apiInstance->smsReceiptsPost($url);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling SMSApi->smsReceiptsPost: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME, 
    Password = API_KEY  
};
var smsApi = new SMSApi(configuration);
var response = smsApi.SmsReceiptsPost(new Url("http://domain.com"));
var api = require('./api.js');

var smsApi = new api.SMSApi("USERNAME", "API_KEY");

var payload = new api.Url;

payload.url = "http://example.com";

smsApi.smsReceiptsPost(payload).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::SMSApi.new

# Url | Url model
url = ClickSendClient::Url.new(
  url: "http://yourdomain.com"
)

begin
  # Add a delivery receipt
  result = api_instance.sms_receipts_post(url)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling SMSApi->sms_receipts_post: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.SMSApi(clicksend_client.ApiClient(configuration))
url = 'https://www.example.com' # str | Your url

try:
    # Add a delivery receipt
    api_response = api_instance.sms_receipts_post({"url" : url})
    print(api_response)
except ApiException as e:
    print("Exception when calling SMSApi->sms_receipts_post: %s\n" % e)
use WWW::ClickSendClient::SMSApi;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::SMSApi->new(username => $username, password => $password);

my $url = WWW::ClickSendClient::Object::Url->new('http://yourdomain.com');

my $json_output = $api->sms_receipts_post($url);

print $json_output;
#import "CSSMSApi.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
// Configure HTTP basic authorization (authentication scheme: BasicAuth)
[apiConfig setUsername:@"YOUR_USERNAME"];
[apiConfig setPassword:@"YOUR_PASSWORD"];

CSSMSApi *smsAPI = [[CSSMSApi alloc] init];
CSUrl *csUrl = [[CSUrl alloc] init];
csUrl.url = @"https://rest.clicksend.com/v3/sms/receipts";

[smsAPI smsReceiptsPostWithUrl:csUrl completionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire

if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}

let url = Url(url: "https://rest.clicksend.com/v3/sms/receipts")
SMSAPI.smsReceiptsPost(url: url) { (dataString, error) in
    guard let dataString = dataString else {
        print(error!)
        return
    }

    if let data = dataString.data(using: String.Encoding.utf8) {
        do {
            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                print(dictonary)
            } else {
                print("bad json")
            }
        } catch let error as NSError {
            print(error)
        }
    }
}
    Coming Soon
package ClickSend;

import ClickSend.Api.SmsApi;
import ClickSend.Model.Url;

public class create_sms_receipt {
  public static void main(String[] args) {
    ApiClient defaultClient = new ApiClient();
    defaultClient.setUsername("USERNAME");
    defaultClient.setPassword("API_KEY");
    SmsApi apiInstance = new SmsApi(defaultClient);
    Url url = new Url(); // Url | Url model
    url.url("http://www.example.com");
    try {
        String result = apiInstance.smsReceiptsPost(url);
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling SmsApi#smsReceiptsPost");
        e.printStackTrace();
    }
  }
}

Body parameter

{
  "url":"http://yourdomain.com"
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "Receipt has been added",
  "data": {
    "timestamp": "1441958441",
    "message_id": "493FFB41-9733-4641-985F-BD79A067B58F",
    "status_code": "201",
    "status_text": "Success: Message received on handset.",
    "error_code": null,
    "error_text": null,
    "custom_string": null
  }
}

https://rest.clicksend.com/v3/sms/receipts

Add a delivery receipt

Properties

Name Type Required Restrictions Description
url string true none Your URL that you want to forward to.

Refer to Status Codes for definitions of HTTP status code responses.

View SMS Receipts

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \

'https://rest.clicksend.com/v3/sms/receipts'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\SMSApi(new GuzzleHttp\Client(),$config);
$page = 1; // int | Page number
$limit = 10; // int | Number of records per page

try {
    $result = $apiInstance->smsReceiptsGet($page, $limit);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling SMSApi->smsReceiptsGet: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME, 
    Password = API_KEY  
};
var smsApi = new SMSApi(configuration);
var response = smsApi.SmsReceiptsGet();
var api = require('./api.js');

var smsApi = new api.SMSApi("USERNAME", "API_KEY");

var page = 1;
var limit = 10;

smsApi.smsReceiptsGet(page, limit).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

ClickSendClient.configure do |config|
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::SMSApi.new

opts = {
  page: 1,  # Integer | Page number
  limit: 10 # Integer | Number of records per page
}

begin
  # Get all delivery receipts
  result = api_instance.sms_receipts_get(opts)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling SMSApi->sms_receipts_get: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.SMSApi(clicksend_client.ApiClient(configuration))
page = 1 # int | Page number (optional) (default to 1)
limit = 10 # int | Number of records per page (optional) (default to 10)

try:
    # Get all delivery receipts
    api_response = api_instance.sms_receipts_get(page=page, limit=limit)
    print(api_response)
except ApiException as e:
    print("Exception when calling SMSApi->sms_receipts_get: %s\n" % e)
use WWW::ClickSendClient::SMSApi;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::SMSApi->new(username => $username, password => $password);

my $json_output = $api->sms_receipts_get('page' => '1', 'limit' => '1');

print $json_output;
#import "CSSMSApi.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
// Configure HTTP basic authorization (authentication scheme: BasicAuth)
[apiConfig setUsername:@"YOUR_USERNAME"];
[apiConfig setPassword:@"YOUR_PASSWORD"];

CSSMSApi *smsAPI = [[CSSMSApi alloc] init];
[smsAPI smsReceiptsGetWithPage:@(1) limit:@(15) completionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire

if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}

SMSAPI.smsReceiptsGet(page: 1, limit: 15) { (dataString, error) in
    guard let dataString = dataString else {
        print(error!)
        return
    }

    if let data = dataString.data(using: String.Encoding.utf8) {
        do {
            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                print(dictonary)
            } else {
                print("bad json")
            }
        } catch let error as NSError {
            print(error)
        }
    }
}
    Coming Soon
package ClickSend;

import ClickSend.Api.SmsApi;

public class view_all_sms_receipt {
  public static void main(String[] args) {
    ApiClient defaultClient = new ApiClient();
    defaultClient.setUsername("USERNAME");
    defaultClient.setPassword("API_KEY");
    SmsApi apiInstance = new SmsApi(defaultClient);
    Integer page = 1; // Integer | Page number
    Integer limit = 10; // Integer | Number of records per page
    try {
        String result = apiInstance.smsReceiptsGet(page, limit);
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling SmsApi#smsReceiptsGet");
        e.printStackTrace();
    }
  }
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "Here are your delivery receipts.",
  "data": {
    "total": 3,
    "per_page": 15,
    "current_page": 1,
    "last_page": 1,
    "next_page_url": null,
    "prev_page_url": null,
    "from": 1,
    "to": 3,
    "data": [
      {
        "timestamp_send": "1442381791",
        "timestamp": "1442381791",
        "message_id": "31BC271B-1E0C-45F6-9E7E-97186C46BB82",
        "status_code": "201",
        "status_text": "Success: Message received on handset.",
        "error_code": null,
        "error_text": null,
        "custom_string": null,
        "_message_type": "sms"
      },
      {
        "timestamp_send": "1442381829",
        "timestamp": "1442381829",
        "message_id": "23C8ADA3-FD8B-420B-801A-F829BB87AC6F",
        "status_code": "201",
        "status_text": "Success: Message received on handset.",
        "error_code": null,
        "error_text": null,
        "custom_string": null,
        "_message_type": "sms"
      },
      {
        "timestamp_send": "1442381861",
        "timestamp": "1442381861",
        "message_id": "3BD22FAD-A5D3-4D99-B4C0-16BF65BE052C",
        "status_code": "201",
        "status_text": "Success: Message received on handset.",
        "error_code": null,
        "error_text": null,
        "custom_string": null,
        "_message_type": "sms"
      }
    ]
  }
}

https://rest.clicksend.com/v3/sms/receipts

Get all delivery receipts

Push Delivery Receipts

If you prefer, we can push message replies to your server as they arrive with us.

  1. Log into your account.
  2. Click on your profile on the top right.
  3. Then click on the Messaging Settings option.
  4. Click on SMS & MMS then Delivery Report Rules.
  5. Click the 'Add New Rule' button.
  6. Select the 'URL' action.
  7. Enter the URL and click 'Save'.

The following variables will be posted to the URL specified:

Variable Description
timestamp_send Timestamp of the original send request in UNIX format. e.g 1439173980
timestamp Timestamp of delivery report in UNIX format. e.g 1439173981
message_id Message ID, returned when originally sending the message.
status Delivered or Undelivered
status_code Status code. Refer to 'SMS Delivery Status Codes' in docs.
status_text Status text.
error_code Error code.
error_text Error text.
custom_string A custom string used when sending the original message.
user_id The user ID of the user who sent the message.
subaccount_id The subaccount ID of the user who sent the message.
message_type 'sms' (constant).

Pull Delivery Receipts

Receive delivery reports by polling. You can poll our server and retrieve delivery reports at a time that suits you.

After pulling your unread SMS delivery receipts from your inbox you will need to call the Mark SMS Delivery Receipt As Read endpoint in order to continue viewing your unread delivery receipts.

  1. Log into your account.
  2. Click on your profile on the top right.
  3. Then click on the Messaging Settings option.
  4. Click on SMS & MMS then Delivery Report Rules.
  5. Click the 'Add New Rule' button.
  6. Select the 'Poll' action.
  7. Then click 'Save'.

Parameters

Parameter In Type Required Description
page query integer(int32) false Page number
limit query integer(int32) false Number of records per page

Refer to Status Codes for definitions of HTTP status code responses.

View Specific SMS Receipt

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \

'https://rest.clicksend.com/v3/sms/receipts/{message_id}'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\SMSApi(new GuzzleHttp\Client(),$config);
$message_id = "messageId_example"; // string | Message ID

try {
    $result = $apiInstance->smsReceiptsByMessageIdGet($message_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling SMSApi->smsReceiptsByMessageIdGet: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME, 
    Password = API_KEY  
};
var smsApi = new SMSApi(configuration);
var response = smsApi.SmsReceiptsByMessageIdGet("MESSAGE_ID");
var api = require('./api.js');

var smsApi = new api.SMSApi("USERNAME", "API_KEY");

var messageId = "message_id";

smsApi.smsReceiptsByMessageIdGet(messageId).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::SMSApi.new

message_id = "56A3964A-DC7D-4455-B56C-101F7A0D86DF" # String | Message ID

begin
  # Get a Specific Delivery Receipt
  result = api_instance.sms_receipts_by_message_id_get(message_id)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling SMSApi->sms_receipts_by_message_id_get: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.SMSApi(clicksend_client.ApiClient(configuration))
message_id = 'message_id' # str | Message ID

try:
    # Get a Specific Delivery Receipt
    api_response = api_instance.sms_receipts_by_message_id_get(message_id)
    print(api_response)
except ApiException as e:
    print("Exception when calling SMSApi->sms_receipts_by_message_id_get: %s\n" % e)
use WWW::ClickSendClient::SMSApi;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::SMSApi->new(username => $username, password => $password);

my $json_output = $api->sms_receipts_by_message_id_get('message_id' => 'XXX-XXXXXXX-XXXXX-XXXXX-XXXXXX');

print $json_output;
#import "CSSMSApi.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
// Configure HTTP basic authorization (authentication scheme: BasicAuth)
[apiConfig setUsername:@"YOUR_USERNAME"];
[apiConfig setPassword:@"YOUR_PASSWORD"];


CSSMSApi *smsAPI = [[CSSMSApi alloc] init];
[apiInstance smsReceiptsByMessageIdGetWithMessageId:@"{message_id}" completionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire

if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}

SMSAPI.smsReceiptsByMessageIdGet(messageId: "{message_id}") { (dataString, error) in
    guard let dataString = dataString else {
        print(error!)
        return
    }

    if let data = dataString.data(using: String.Encoding.utf8) {
        do {
            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                print(dictonary)
            } else {
                print("bad json")
            }
        } catch let error as NSError {
            print(error)
        }
    }
}
    Coming Soon
package ClickSend;

import ClickSend.Api.SmsApi;

public class view_specific_sms_receipt {
  public static void main(String[] args) {
    ApiClient defaultClient = new ApiClient();
    defaultClient.setUsername("USERNAME");
    defaultClient.setPassword("API_KEY");
    SmsApi apiInstance = new SmsApi(defaultClient);
    String messageId = "message_id"; // String | Message ID
    try {
        String result = apiInstance.smsReceiptsByMessageIdGet(messageId);
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling SmsApi#smsReceiptsByMessageIdGet");
        e.printStackTrace();
    }
  }
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "Your receipt.",
  "data": {
    "timestamp_send": "1450854013",
    "timestamp": "1451200622",
    "message_id": "88AB118E-EB1B-478C-98CE-6C73ABA23F67",
    "status_code": "Completed",
    "status_text": "statustext",
    "error_code": "errorcode",
    "error_text": "errortext",
    "custom_string": "",
    "message_type": "sms"
  }
}

https://rest.clicksend.com/v3/sms/receipts/{message_id}

Get a Specific Delivery Receipt

Parameters

Parameter In Type Required Description
message_id path string true Message ID

Refer to Status Codes for definitions of HTTP status code responses.

Mark SMS Receipt As Read

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
     --request PUT \

     --header "Content-Type: application/json" \
     --data-binary "{
    \"date_before\": 1441958441
}" \
'https://rest.clicksend.com/v3/sms/receipts-read'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\SMSApi(new GuzzleHttp\Client(),$config);
// \ClickSend\Model\DateBefore | DateBefore model
$date_before = new \ClickSend\Model\DateBefore(); 
$date_before->setDateBefore("2018-01-01");

try {
    $result = $apiInstance->smsReceiptsReadPut($date_before);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling SMSApi->smsReceiptsReadPut: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME, 
    Password = API_KEY  
};
var smsApi = new SMSApi(configuration);
var response = smsApi.SmsReceiptsReadPut(new DateBefore(TIME_STAMP));
var api = require('./api.js');

var smsApi = new api.SMSApi("USERNAME", "API_KEY");

var dateBefore = new api.DateBefore();

dateBefore.dateBefore = 1545477061;

smsApi.smsReceiptsReadPut(dateBefore).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::SMSApi.new

opts = {
  "date_before": "1543604472" # String | Mark all as read before this timestamp
}

begin
  # Mark delivery receipts as read
  result = api_instance.sms_receipts_read_put(opts)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling SMSApi->sms_receipts_read_put: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.SMSApi(clicksend_client.ApiClient(configuration))
# str | Mark all as read before this timestamp (optional)
date_before = 'date_before_example' 

try:
    # Mark delivery receipts as read
    api_response = api_instance.sms_receipts_read_put(date_before=date_before)
    print(api_response)
except ApiException as e:
    print("Exception when calling SMSApi->sms_receipts_read_put: %s\n" % e)
use WWW::ClickSendClient::SMSApi;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::SMSApi->new(username => $username, password => $password);

my $json_output = $api->sms_receipts_read_put(WWW::ClickSendClient::Object::DateBefore->new(TIME_STAMP));

print $json_output;
#import "CSSMSApi.h"
#import "CSDateBefore.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
// Configure HTTP basic authorization (authentication scheme: BasicAuth)
[apiConfig setUsername:@"YOUR_USERNAME"];
[apiConfig setPassword:@"YOUR_PASSWORD"];

CSSMSApi *smsAPI = [[CSSMSApi alloc] init];

CSDateBefore *dateBefore = [[CSDateBefore alloc] init];

[smsAPI smsReceiptsReadPutWithDateBefore:dateBefore completionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire

if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}

SMSAPI.smsReceiptsReadPut(dateBefore: nil) { (dataString, error) in
guard let dataString = dataString else {
    print(error!)
    return
}

if let data = dataString.data(using: String.Encoding.utf8) {
    do {
        if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
            print(dictonary)
        } else {
            print("bad json")
        }
        } catch let error as NSError {
            print(error)
        }
    }
}
    Coming Soon
package ClickSend;

import java.math.BigDecimal;
import ClickSend.Api.SmsApi;
import ClickSend.Model.DateBefore;

public class mark_sms_receipt_as_read {
  public static void main(String[] args) {
    ApiClient defaultClient = new ApiClient();
    defaultClient.setUsername("USERNAME");
    defaultClient.setPassword("API_KEY");
    SmsApi apiInstance = new SmsApi(defaultClient);
    DateBefore dateBefore = new DateBefore(); // DateBefore | DateBefore model
    dateBefore.dateBefore(new BigDecimal(1441958441));
    try {
        String result = apiInstance.smsReceiptsReadPut(dateBefore);

        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling SmsApi#smsReceiptsReadPut");
        e.printStackTrace();
    }
  }
}


Body parameter

{
  "date_before": 1441958441
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "Receipts has been marked as read.",
  "data": []
}

https://rest.clicksend.com/v3/sms/receipts-read

Mark delivery receipts as read

Parameters

Parameter In Type Required Description
date_before body integer(int32) false Mark all as read before this timestamp

Refer to Status Codes for definitions of HTTP status code responses.

Create Test Inbound SMS

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
     --request POST \

     --header "Content-Type: application/json" \
     --data-binary "    {
        \"url\":\"http://yourdomain.com\"
    }" \
'https://rest.clicksend.com/v3/sms/inbound'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\SMSApi(new GuzzleHttp\Client(),$config);
$url = new \ClickSend\Model\Url(); // \ClickSend\Model\Url | Url model
$url->setUrl("http://example.com");

try {
    $result = $apiInstance->smsInboundPost($url);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling SMSApi->smsInboundPost: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME, 
    Password = API_KEY  
};
var smsApi = new SMSApi(configuration);
var response = smsApi.SmsInboundPost(new Url("https://yourdomain.com"));
var api = require('./api.js');

var smsApi = new api.SMSApi("USERNAME", "API_KEY");

var payload = new api.Url;

payload.url = "http://example.com";

smsApi.smsInboundPost(payload).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::SMSApi.new

# Url | Url model
url = ClickSendClient::Url.new(
  url: "http://yourdomain.com"
)

begin
  # Create inbound sms
  result = api_instance.sms_inbound_post(url)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling SMSApi->sms_inbound_post: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.SMSApi(clicksend_client.ApiClient(configuration))
url = 'http://www.example.com' # str | Your url
payload = {"url" : url}

try:
    # Create inbound sms
    api_response = api_instance.sms_inbound_post(payload)
    print(api_response)
except ApiException as e:
    print("Exception when calling SMSApi->sms_inbound_post: %s\n" % e)
use WWW::ClickSendClient::SMSApi;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::SMSApi->new(username => $username, password => $password);

my $json_output = $api->sms_inbound_post('url' => 'http://yourdomain.com');

print $json_output;
#import "CSSMSApi.h"
#import "CSUrl.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
// Configure HTTP basic authorization (authentication scheme: BasicAuth)
[apiConfig setUsername:@"YOUR_USERNAME"];
[apiConfig setPassword:@"YOUR_PASSWORD"];

CSSMSApi *smsAPI = [[CSSMSApi alloc] init];

CSUrl *csUrl = [[CSUrl alloc] init];
csUrl.url = @"http://yourdomain.com";

[smsAPI smsInboundPostWithUrl:csUrl completionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire

if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}

let url = Url(url: "https://yourdomiansample.com")
SMSAPI.smsInboundPost(url: url) { (dataString, error) in
    guard let dataString = dataString else {
        print(error!)
        return
    }

    if let data = dataString.data(using: String.Encoding.utf8) {
        do {
            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                print(dictonary)
            } else {
                print("bad json")
            }
        } catch let error as NSError {
            print(error)
        }
    }
}
    Coming Soon
package ClickSend;

import ClickSend.Api.SmsApi;
import ClickSend.Model.Url;

public class create_inbound_sms {
  public static void main(String[] args) {
    ApiClient defaultClient = new ApiClient();
    defaultClient.setUsername("USERNAME");
    defaultClient.setPassword("API_KEY");
    SmsApi apiInstance = new SmsApi(defaultClient);
    Url url = new Url(); // Url | Url model
    url.url("http://www.example.com");
    try {
        String result = apiInstance.smsInboundPost(url);
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling SmsApi#smsInboundPost");
        e.printStackTrace();
    }
  }
}

Body parameter

{
  "url":"http://yourdomain.com"
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "Here are your incoming messages.",
  "data": {
    "timestamp": "1442398236",
    "from": "+61468460249",
    "body": "This is a test incoming SMS. 5IHHOWWZTB.",
    "original_body": "This is the original message. AA4NN45X7J.",
    "original_message_id": "F35B6DF1-0C9E-488F-954E-2F603B6192F5",
    "to": "+61411111111",
    "custom_string": null,
    "message_id": "C557B56E-83C0-4070-A74C-9BF05474B418",
    "_keyword": "this"
  }
}

https://rest.clicksend.com/v3/sms/inbound

Create inbound sms

Properties

Name Type Required Restrictions Description
url string true none Your URL that you want to forward to.

Refer to Status Codes for definitions of HTTP status code responses.

View Inbound SMS

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \

'https://rest.clicksend.com/v3/sms/inbound'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\SMSApi(new GuzzleHttp\Client(),$config);
$q = "q_example"; // string | Your keyword or query.
$page = 1; // int | Page number
$limit = 10; // int | Number of records per page

try {
    $result = $apiInstance->smsInboundGet($q, $page, $limit);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling SMSApi->smsInboundGet: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME, 
    Password = API_KEY  
};

var smsApi = new SMSApi(configuration);

var q = "q_example";
var page = 1;
var limit = 10;

var response = smsApi.SmsInboundGet(q, page, limit);
var api = require('./api.js');

var smsApi = new api.SMSApi("USERNAME", "API_KEY");

var q = "q_example";
var page = 1;
var limit = 10;

smsApi.smsInboundGet(q, page, limit).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::SMSApi.new

opts = {
  page: 1,  # Integer | Page number
  limit: 10 # Integer | Number of records per page
}

begin
  # Get all inbound sms
  result = api_instance.sms_inbound_get(opts)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling SMSApi->sms_inbound_get: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.SMSApi(clicksend_client.ApiClient(configuration))
page = 1 # int | Page number (optional) (default to 1)
limit = 10 # int | Number of records per page (optional) (default to 10)

try:
    # Get all inbound sms
    api_response = api_instance.sms_inbound_get(page=page, limit=limit)
    print(api_response)
except ApiException as e:
    print("Exception when calling SMSApi->sms_inbound_get: %s\n" % e)
use WWW::ClickSendClient::SMSApi;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::SMSApi->new(username => $username, password => $password);

my $json_output = $api->sms_inbound_get('page' => '1', 'limit' => '3');

print $json_output;
#import "CSSMSApi.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
// Configure HTTP basic authorization (authentication scheme: BasicAuth)
[apiConfig setUsername:@"YOUR_USERNAME"];
[apiConfig setPassword:@"YOUR_PASSWORD"];

CSSMSApi *smsAPI = [[CSSMSApi alloc] init];

[smsAPI smsInboundGetWithQ:@"" page:@(1) limit:@(15) completionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire

if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}

SMSAPI.smsInboundGet { (dataString, error) in
    guard let dataString = dataString else {
        print(error!)
        return
    }

    if let data = dataString.data(using: String.Encoding.utf8) {
        do {
            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                print(dictonary)
            } else {
                print("bad json")
            }
        } catch let error as NSError {
            print(error)
        }
    }
}
    Coming Soon
package ClickSend;

import ClickSend.Api.SmsApi;

public class view_inbound_sms {
  public static void main(String[] args) {
    ApiClient defaultClient = new ApiClient();
    defaultClient.setUsername("USERNAME");
    defaultClient.setPassword("API_KEY");
    SmsApi apiInstance = new SmsApi(defaultClient);
    String q = "q_example"; // String | Your keyword or query
    Integer page = 1; // Integer | Page number
    Integer limit = 10; // Integer | Number of records per page
    try {
      String result = apiInstance.smsInboundGet(q, page, limit);
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling SmsApi#smsInboundGet");
        e.printStackTrace();
    }
  }
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "Here are your data.",
  "data": {
    "total": 3,
    "per_page": 15,
    "current_page": 1,
    "last_page": 1,
    "next_page_url": null,
    "prev_page_url": null,
    "from": 1,
    "to": 3,
    "data": [
      {
        "timestamp": "1436174407",
        "from": "+61411111111",
        "body": "Liquorice sweet roll fruitcake gummies. ",
        "original_body": "Liquorice sweet roll fruitcake gummies. ",
        "original_message_id": "C557B56E-83C0-4070-A74C-9BF05474B418",
        "to": "+61422222222",
        "custom_string": "22PKU978RF",
        "message_id": "C557B56E-83C0-4070-A74C-9BF05474B418",
        "_keyword": "liquorice"
      },
      {
        "timestamp": "1436174406",
        "from": "+61422222222",
        "body": "Lemon drops brownie pie chocolate bar pie sweet jelly-o chocolate.",
        "original_body": "Lemon drops brownie pie chocolate bar pie sweet jelly-o chocolate.",
        "original_message_id": "373F7121-8089-42FA-8F5C-8F8F7C18DFAA",
        "to": "+61411111111",
        "custom_string": "2ATQKLETYX",
        "message_id": "C557B56E-83C0-4070-A74C-9BF05474B418",
        "_keyword": "lemon"
      },
      {
        "timestamp": "1436174405",
        "from": "+61433333333",
        "body": "Jelly beans jelly cupcake bear claw gummies.",
        "original_body": "Jelly beans jelly cupcake bear claw gummies.",
        "original_message_id": "A9F3863C-D88E-4A54-BEF1-BD73A6E42E2E",
        "to": "+61411111111",
        "custom_string": "0PZCOGJP0A",
        "message_id": "C557B56E-83C0-4070-A74C-9BF05474B418",
        "_keyword": "jelly"
      }
    ]
  }
}

https://rest.clicksend.com/v3/sms/inbound

Get all inbound sms

Push Inbound SMS

If you prefer, we can push message replies to your server as they arrive with us.

  1. Log into your account.
  2. Click on your profile on the top right.
  3. Then click on the Messaging Settings option.
  4. Click on SMS & MMS then Inbound Rules.
  5. Click the 'Add New Rule' button.
  6. Select the 'URL' action.
  7. Enter the URL and click 'Save'.

The following variables will be posted to the URL specified:

Variable Description
timestamp Timestamp in UNIX format. e.g 1439173981
to Number that the SMS was sent to (your Dedicated or shared number).
from Recipient Mobile Number that sent the reply message.
body Inbound message body.
original_body Original outgoing SMS message body.
original_message_id Original SMS message ID. Returned when originally sending the message.
custom_string A custom string used when sending the original message.
user_id The user ID of the user who sent the message.
subaccount_id The subaccount ID of the user who sent the message.
message_id The Message ID for the inbound message.

Note: HTTP POST is used to send the variables (not GET or query-string). More Info.

Your URL should respond with a 200 OK HTTP status code. If we receive a non-200 response or your URL is down/times out, we will continue to retry every 10 minutes (with a timeout of 30 seconds) until we reach 10 retries. After 10 attempts, we'll mark it as completed. If your server is down for a long period of time, we can manually re-queue the data.

Pull Inbound SMS

Receive SMS by polling your Inbox. You can poll our server and retrieve new Messages at a time that suits you.

After pulling an inbound SMS from your inbox you will need to call the Mark Inbound SMS As Read endpoint in order to continue viewing your unread inbound messages.

  1. Log into your account.
  2. Click on your profile on the top right.
  3. Then click on the Messaging Settings option.
  4. Click on SMS & MMS then Inbound Rules.
  5. Click the 'Add New Rule' button.
  6. Select the 'Poll' action.
  7. Then click 'Save'.

Parameters

Parameter In Type Required Description
page query integer(int32) false Page number
limit query integer(int32) false Number of records per page

Refer to Status Codes for definitions of HTTP status code responses.

Mark Inbound SMS As Read

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
     --request PUT \

     --header "Content-Type: application/json" \
     --data-binary "    {
        \"date_before\":1442398100
    }" \
'https://rest.clicksend.com/v3/sms/inbound-read'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\SMSApi(new GuzzleHttp\Client(),$config);
// \ClickSend\Model\DateBefore | DateBefore model
$date_before = new \ClickSend\Model\DateBefore(); 
$date_before->setDateBefore("2019-01-01");

try {
    $result = $apiInstance->smsInboundReadPut($date_before);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling SMSApi->smsInboundReadPut: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME, 
    Password = API_KEY  
};
var smsApi = new SMSApi(configuration);
var response = smsApi.SmsInboundReadPut(TIME_STAMP);
var api = require('./api.js');

var smsApi = new api.SMSApi("USERNAME", "API_KEY");

var messageId = "message_id";

smsApi.smsInboundReadByMessageIdPut(messageId).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::SMSApi.new

opts = {
  # Integer | An optional timestamp - mark all as read before this timestamp.
  # If not given, all messages will be marked as read.
  "date_before": "1543606584"
}

begin
  # Mark inbound SMS as read
  result = api_instance.sms_inbound_read_put(opts)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling SMSApi->sms_inbound_read_put: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.SMSApi(clicksend_client.ApiClient(configuration))
date_before = 'date_before_example' 
# str | An optional timestamp - mark all as read before this timestamp.
# If not given, all messages will be marked as read. (optional)

try:
    # Mark inbound SMS as read
    api_response = api_instance.sms_inbound_read_put(date_before=date_before)
    print(api_response)
except ApiException as e:
    print("Exception when calling SMSApi->sms_inbound_read_put: %s\n" % e)
use WWW::ClickSendClient::SMSApi;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::SMSApi->new(username => $username, password => $password);

my $json_output = $api->sms_inbound_read_put('date_before' => 1442398100);

print $json_output;
#import "CSSMSApi.h"
#import "CSDateBefore.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
// Configure HTTP basic authorization (authentication scheme: BasicAuth)
[apiConfig setUsername:@"YOUR_USERNAME"];
[apiConfig setPassword:@"YOUR_PASSWORD"];


CSSMSApi *smsAPI = [[CSSMSApi alloc] init];

CSDateBefore *dateBefore = [[CSDateBefore alloc] init];

[smsAPI smsInboundReadPutWithDateBefore:dateBefore completionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire

if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}

SMSAPI.smsInboundReadPut { (dataString, error) in
    guard let dataString = dataString else {
        print(error!)
        return
    }

    if let data = dataString.data(using: String.Encoding.utf8) {
        do {
            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                print(dictonary)
            } else {
                print("bad json")
            }
        } catch let error as NSError {
            print(error)
        }
    }
}
    Coming Soon
package ClickSend;

import java.math.BigDecimal;
import ClickSend.Api.SmsApi;
import ClickSend.Model.DateBefore;

public class mark_inbound_sms_as_read {
  public static void main(String[] args) {
    ApiClient defaultClient = new ApiClient();
    defaultClient.setUsername("USERNAME");
    defaultClient.setPassword("API_KEY");
    SmsApi apiInstance = new SmsApi(defaultClient);
    DateBefore dateBefore = new DateBefore(); // DateBefore | DateBefore model
    dateBefore.dateBefore(new BigDecimal(1441958441));
    try {
        String result = apiInstance.smsInboundReadPut(dateBefore);
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling SmsApi#smsInboundReadPut");
        e.printStackTrace();
    } 
  }
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "Inbound messages have been marked as read.",
  "data": []
}

https://rest.clicksend.com/v3/sms/inbound-read

Mark inbound SMS as read

Mark all inbound SMS as read optionally before a certain date

Parameters

Parameter In Type Required Description
date_before body integer(int32) false An optional timestamp - mark all as read before this timestamp. If not given, all messages will be marked as read.

Refer to Status Codes for definitions of HTTP status code responses.

Mark Specific Inbound SMS Message As Read

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
     --request PUT \
'https://rest.clicksend.com/v3/sms/inbound-read/{message_id}'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\SMSApi(new GuzzleHttp\Client(),$config);

$message_id = "{message_id}";

try {
    $result = $apiInstance->smsInboundReadByMessageIdPut($message_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling SMSApi->smsInboundReadByMessageIdPut: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME, 
    Password = API_KEY  
};
var messageId = 'message_id';
var smsApi = new SMSApi(configuration);
var response = smsApi.SmsInboundReadByMessageIdPut(messageId);
var api = require('./api.js');

var smsApi = new api.SMSApi("USERNAME", "API_KEY");

smsApi.smsInboundReadByMessageIdPut(messageId).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::SMSApi.new

message_id = 'message_id';

begin
  # Mark an inbound sms as read
  result = api_instance.sms_inbound_read_by_message_id_put(message_id)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling SMSApi->sms_inbound_read_by_message_id_put: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.SMSApi(clicksend_client.ApiClient(configuration))

message_id = 'message_id' 

try:
    # Mark specific inbound sms as read
    api_response = api_instance.sms_inbound_read_by_message_id_put(message_id)
    print(api_response)
except ApiException as e:
    print("Exception when calling SMSApi->sms_inbound_read_by_message_id_put: %s\n" % e)
use WWW::ClickSendClient::SMSApi;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::SMSApi->new(username => $username, password => $password);

my $message_id = 'message_id';

my $json_output = $api->sms_inbound_read_by_message_id_put($message_id);

print $json_output;
#import "CSSMSApi.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
// Configure HTTP basic authorization (authentication scheme: BasicAuth)
[apiConfig setUsername:@"YOUR_USERNAME"];
[apiConfig setPassword:@"YOUR_PASSWORD"];

CSSMSApi *smsAPI = [[CSSMSApi alloc] init];

[smsAPI smsInboundReadByMessageIdPutWithMessageId:@"message_id" completionHandler:^(NSString *output, NSError *error) {
   if (error) {
       NSLog(@"Error: %@", error);
   } else {
       NSLog(@"%@", output);
   }
}];
import Alamofire

if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}

SMSAPI.smsInboundReadByMessageIdPut(messageId: "message_id") { (dataString, error) in
guard let dataString = dataString else {
    print(error!)
    return
}

if let data = dataString.data(using: String.Encoding.utf8) {
    do {
        if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
            print(dictonary)
        } else {
            print("bad json")
        }
        } catch let error as NSError {
            print(error)
        }
    }
}
    Coming Soon
package ClickSend;

import java.math.BigDecimal;
import ClickSend.Api.SmsApi;

public class mark_specific_inbound_sms_as_read {
  public static void main(String[] args) {
    ApiClient defaultClient = new ApiClient();
    defaultClient.setUsername("USERNAME");
    defaultClient.setPassword("API_KEY");
    SmsApi apiInstance = new SmsApi(defaultClient);

    try {
        String result = apiInstance.smsInboundReadByMessageIdPut(messageId);

        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling SmsApi#smsInboundReadByMessageIdPut");
        e.printStackTrace();
    }
  }
}


Body parameter


Response

{
    "http_code": 200,
    "response_code": "SUCCESS",
    "response_msg": "Receipt have been marked as read.",
    "data": 1
}

https://rest.clicksend.com/v3/sms/inbound-read/{message_id}

Mark specific inbound sms as read

Parameters

Parameter In Type Required Description
message_id path String true Mark this message as read

Refer to Status Codes for definitions of HTTP status code responses.

Cancel SMS

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
     --request PUT \

'https://rest.clicksend.com/v3/sms/{message_id}/cancel'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\SMSApi(new GuzzleHttp\Client(),$config);
$message_id = "messageId_example"; // string | The message ID you want to cancel

try {
    $result = $apiInstance->smsCancelByMessageIdPut($message_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling SMSApi->smsCancelByMessageIdPut: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME, 
    Password = API_KEY  
};
var smsApi = new SMSApi(configuration);
var response = smsApi.SmsCancelByMessageIdPut("MESSAGE_ID");
var api = require('./api.js');

var smsApi = new api.SMSApi("USERNAME", "API_KEY");

var messageId = "message_id";

smsApi.smsCancelByMessageIdPut(messageId).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'
# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::SMSApi.new

message_id = "307EF035-B7CE-4321-93CD-0753597B7293" # String | The message ID you want to cancel

begin
  # Update scheduled message as cancelled
  result = api_instance.sms_cancel_by_message_id_put(message_id)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling SMSApi->sms_cancel_by_message_id_put: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.SMSApi(clicksend_client.ApiClient(configuration))
message_id = 'F2E5C026-24C2-4D9F-B87C-6E78E0E8535D' # str | The message ID you want to cancel

try:
    # Update scheduled message as cancelled
    api_response = api_instance.sms_cancel_by_message_id_put(message_id)
    print(api_response)
except ApiException as e:
    print("Exception when calling SMSApi->sms_cancel_by_message_id_put: %s\n" % e)
use WWW::ClickSendClient::SMSApi;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::SMSApi->new(username => $username, password => $password);

my $json_output = $api->sms_cancel_by_message_id_put('message_id' => 'XXXXXXXXX-XX-XX-XX-XXXXXX');

print $json_output;
#import "CSSMSApi.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
// Configure HTTP basic authorization (authentication scheme: BasicAuth)
[apiConfig setUsername:@"YOUR_USERNAME"];
[apiConfig setPassword:@"YOUR_PASSWORD"];

CSSMSApi *smsAPI = [[CSSMSApi alloc] init];
[smsAPI smsCancelByMessageIdPutWithMessageId:@"{message_id}" completionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire

if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}

SMSAPI.smsCancelByMessageIdPut(messageId: "{message_id}") { (dataString, error) in
    guard let dataString = dataString else {
        print(error!)
        return
    }

    if let data = dataString.data(using: String.Encoding.utf8) {
        do {
            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                print(dictonary)
            } else {
                print("bad json")
            }
        } catch let error as NSError {
            print(error)
        }
    }
}
    Coming Soon
package ClickSend;

import ClickSend.Api.SmsApi;

public class cancel_sms {
  public static void main(String[] args) {
    ApiClient defaultClient = new ApiClient();
    defaultClient.setUsername("USERNAME");
    defaultClient.setPassword("API_KEY");
    SmsApi apiInstance = new SmsApi(defaultClient);
    // String | The message ID you want to cancel
    String messageId = "messageId_example"; 
    try {
        String result = apiInstance.smsCancelByMessageIdPut(messageId);
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling SmsApi#smsCancelByMessageIdPut");
        e.printStackTrace();
    }
  }
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "Message 307EF035-B7CE-4321-93CD-0753597B7293 has been cancelled.",
  "data": []
}

https://rest.clicksend.com/v3/sms/{message_id}/cancel

Update scheduled message as cancelled

Parameters

Parameter In Type Required Description
message_id path string true The message ID you want to cancel

Refer to Status Codes for definitions of HTTP status code responses.

Cancel All SMS

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
     --request PUT \

'https://rest.clicksend.com/v3/sms/cancel-all'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\SMSApi(new GuzzleHttp\Client(),$config);

try {
    $result = $apiInstance->smsCancelAllPut();
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling SMSApi->smsCancelAllPut: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME, 
    Password = API_KEY  
};
var smsApi = new SMSApi(configuration);
var response = smsApi.SmsCancelAllPut();
var api = require('./api.js');

var smsApi = new api.SMSApi("USERNAME", "API_KEY");

smsApi.smsCancelAllPut().then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::SMSApi.new

begin
  # Update all scheduled message as cancelled
  result = api_instance.sms_cancel_all_put
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling SMSApi->sms_cancel_all_put: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.SMSApi(clicksend_client.ApiClient(configuration))

try:
    # Update all scheduled message as cancelled
    api_response = api_instance.sms_cancel_all_put()
    print(api_response)
except ApiException as e:
    print("Exception when calling SMSApi->sms_cancel_all_put: %s\n" % e)
use WWW::ClickSendClient::SMSApi;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::SMSApi->new(username => $username, password => $password);

my $json_output = $api->sms_cancel_all_put();

print $json_output;
#import "CSSMSApi.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
// Configure HTTP basic authorization (authentication scheme: BasicAuth)
[apiConfig setUsername:@"YOUR_USERNAME"];
[apiConfig setPassword:@"YOUR_PASSWORD"];

CSSMSApi *smsAPI = [[CSSMSApi alloc]init];
[smsAPI smsCancelAllPutWithCompletionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire

if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}

SMSAPI.smsCancelAllPut { (dataString, error) in
    guard let dataString = dataString else {
        print(error!)
        return
    }

    if let data = dataString.data(using: String.Encoding.utf8) {
        do {
            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                print(dictonary)
            } else {
                print("bad json")
            }
        } catch let error as NSError {
            print(error)
        }
    }
}
    Coming Soon
package ClickSend;

import ClickSend.Api.SmsApi;

public class cancel_all_sms {
  public static void main(String[] args) {
    ApiClient defaultClient = new ApiClient();
    defaultClient.setUsername("USERNAME");
    defaultClient.setPassword("API_KEY");
    SmsApi apiInstance = new SmsApi(defaultClient);
    try {
        String result = apiInstance.smsCancelAllPut();
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling SmsApi#smsCancelAllPut");
        e.printStackTrace();
    }
  }
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "5 messages has been cancelled.",
  "data": {
    "count": 5
  }
}

https://rest.clicksend.com/v3/sms/cancel-all

Update all scheduled message as cancelled

Refer to Status Codes for definitions of HTTP status code responses.

View SMS Templates

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \

'https://rest.clicksend.com/v3/sms/templates'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\SMSApi(new GuzzleHttp\Client(),$config);
$page = 1; // int | Page number
$limit = 10; // int | Number of records per page

try {
    $result = $apiInstance->smsTemplatesGet($page, $limit);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling SMSApi->smsTemplatesGet: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME, 
    Password = API_KEY  
};
var smsApi = new SMSApi(configuration);
var response = smsApi.SmsTemplatesGet();
var api = require('./api.js');

var smsApi = new api.SMSApi("USERNAME", "API_KEY");

var page = 1;
var limit = 10;

smsApi.smsTemplatesGet(page, limit).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::SMSApi.new

opts = {
  page: 1,  # Integer | Page number
  limit: 10 # Integer | Number of records per page
}

begin
  # Get lists of all sms templates
  result = api_instance.sms_templates_get(opts)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling SMSApi->sms_templates_get: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.SMSApi(clicksend_client.ApiClient(configuration))
page = 1 # int | Page number (optional) (default to 1)
limit = 10 # int | Number of records per page (optional) (default to 10)

try:
    # Get lists of all sms templates
    api_response = api_instance.sms_templates_get(page=page, limit=limit)
    print(api_response)
except ApiException as e:
    print("Exception when calling SMSApi->sms_templates_get: %s\n" % e)
use WWW::ClickSendClient::SMSApi;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::SMSApi->new(username => $username, password => $password);

my $json_output = $api->sms_templates_get('page' => '1', 'limit' => '2');

print $json_output;
#import "CSSMSApi.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
// Configure HTTP basic authorization (authentication scheme: BasicAuth)
[apiConfig setUsername:@"YOUR_USERNAME"];
[apiConfig setPassword:@"YOUR_PASSWORD"];

CSSMSApi *smsAPI = [[CSSMSApi alloc]init];
[smsAPI smsTemplatesGetWithPage:@(1) limit:@(15) completionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire

if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}

SMSAPI.smsTemplatesGet { (dataString, error) in
    guard let dataString = dataString else {
        print(error!)
        return
    }

    if let data = dataString.data(using: String.Encoding.utf8) {
        do {
            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                print(dictonary)
            } else {
                print("bad json")
            }
        } catch let error as NSError {
            print(error)
        }
    }
}
    Coming Soon
package ClickSend;

import ClickSend.Api.SmsApi;

public class view_sms_template {
  public static void main(String[] args) {
    ApiClient defaultClient = new ApiClient();
    defaultClient.setUsername("USERNAME");
    defaultClient.setPassword("API_KEY");
    SmsApi apiInstance = new SmsApi(defaultClient);
    Integer page = 1; // Integer | Page number
    Integer limit = 10; // Integer | Number of records per page
    try {
        String result = apiInstance.smsTemplatesGet(page, limit);
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling SmsApi#smsTemplatesGet");
        e.printStackTrace();
    }
  }
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "Here are your data.",
  "data": {
    "total": 2,
    "per_page": 15,
    "current_page": 1,
    "last_page": 1,
    "next_page_url": null,
    "prev_page_url": null,
    "from": 1,
    "to": 2,
    "data": [
      {
        "template_id": 1,
        "body": "This is a sample template.",
        "template_name": "My Awesome Template"
      },
      {
        "template_id": 2,
        "body": "This is my second sample template.",
        "template_name": "My Awesome Template 2"
      }
    ]
  }
}

https://rest.clicksend.com/v3/sms/templates

Get lists of all sms templates

Parameters

Parameter In Type Required Description
page query integer(int32) false Page number
limit query integer(int32) false Number of records per page

Refer to Status Codes for definitions of HTTP status code responses.

Create SMS Template

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
     --request POST \
     --header "Content-Type: application/json" \

     --data-binary "    {
        \"template_name\":\"Template 501916\",
        \"body\":\"This is a sample content: H7YI68B3yk for this template.\"
    }" \
'https://rest.clicksend.com/v3/sms/templates'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\SMSApi(new GuzzleHttp\Client(),$config);
$sms_template = new \ClickSend\Model\SmsTemplate(); // \ClickSend\Model\SmsTemplate | SmsTemplate model
$sms_template->setTemplateName("Template 501916");
$sms_template->setBody("This is a sample content: H7YI68B3yk for this template.");

try {
    $result = $apiInstance->smsTemplatesPost($sms_template);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling SMSApi->smsTemplatesPost: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME, 
    Password = API_KEY  
};
var smsApi = new SMSApi(configuration);
var response = smsApi.SmsTemplatesPost(new SmsTemplate(
    templateName: "Template Name",
    body: "This is body"
));
var api = require('./api.js');

var smsApi = new api.SMSApi("USERNAME", "API_KEY");

var smsTemplate = new api.SmsTemplate();

smsTemplate.templateName = "Template 501916";
smsTemplate.body = "template body";

smsApi.smsTemplatesPost(smsTemplate).then(function(response) {
console.log(response.body);
}).catch(function(err){
console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::SMSApi.new

# SmsTemplate | SmsTemplate model
sms_template = ClickSendClient::SmsTemplate.new(
  "template_name": "template_name",
  "body": "body"
)

begin
  # Create sms template
  result = api_instance.sms_templates_post(sms_template)
  p result
rescue ClickSendClient::ApiError => e
  puts "Exception when calling SMSApi->sms_templates_post: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.SMSApi(clicksend_client.ApiClient(configuration))
# SmsTemplate | SmsTemplate model
sms_template = clicksend_client.SmsTemplate(
                  template_name="Template 501916",
                  body="This is a sample content: H7YI68B3yk for this template.") 

try:
    # Create sms template
    api_response = api_instance.sms_templates_post(sms_template)
    print(api_response)
except ApiException as e:
    print("Exception when calling SMSApi->sms_templates_post: %s\n" % e)
use WWW::ClickSendClient::SMSApi;
use WWW::ClickSendClient::Object::SmsTemplate;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::SMSApi->new(username => $username, password => $password);
my %params = (
    'template_name' => 'template_name',
    'body'          => 'body'
);

my $sms_template_obj = WWW::ClickSendClient::Object::SmsTemplate->new(%params);
my $json_output = $api->sms_templates_post('sms_template' => $sms_template_obj);

print $json_output;
#import "CSSMSApi.h"
#import "CSSmsTemplate.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
// Configure HTTP basic authorization (authentication scheme: BasicAuth)
[apiConfig setUsername:@"YOUR_USERNAME"];
[apiConfig setPassword:@"YOUR_PASSWORD"];

CSSMSApi *smsAPI = [[CSSMSApi alloc] init];
CSSmsTemplate *smsTemplate =  [[CSSmsTemplate alloc] init];
smsTemplate.templateName = @"Template Chocolate";
smsTemplate.body = @"Chocolate bar icing icing oat cake carrot cake jelly cotton MWEvciEPIr.";

[smsAPI smsTemplatesPostWithSmsTemplate:smsTemplate completionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire

if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}

SMSAPI.smsTemplatesPost(smsTemplate: smsTemplate) { (dataString, error) in
    guard let dataString = dataString else {
        print(error!)
        return
    }

    if let data = dataString.data(using: String.Encoding.utf8) {
        do {
            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                print(dictonary)
            } else {
                print("bad json")
            }
        } catch let error as NSError {
            print(error)
        }
    }
}
    Coming Soon
package ClickSend;

import ClickSend.Api.SmsApi;
import ClickSend.Model.SmsTemplate;

public class create_sms_template {
  public static void main(String[] args) {
    ApiClient defaultClient = new ApiClient();
    defaultClient.setUsername("USERNAME");
    defaultClient.setPassword("API_KEY");
    SmsApi apiInstance = new SmsApi(defaultClient);
    SmsTemplate smsTemplate = new SmsTemplate(); // SmsTemplate | SmsTemplate model
    smsTemplate.body("body");
    smsTemplate.templateName("name");
    try {
        String result = apiInstance.smsTemplatesPost(smsTemplate);
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling SmsApi#smsTemplatesPost");
        e.printStackTrace();
    }
  }
}

Body parameter

{
  "template_name": "template_name",
  "body": "body"
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "New template has been saved.",
  "data": {
    "template_id": 25,
    "body": "This is a sample content: H7YI68B3yk for this template.",
    "template_name": "Template 501916"
  }
}

https://rest.clicksend.com/v3/sms/templates

Create sms template

Properties

Name Type Required Restrictions Description
template_name string true none Name of template
body string true none Body of template

Refer to Status Codes for definitions of HTTP status code responses.

Update SMS Template

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
     --request PUT \
     --header "Content-Type: application/json" \

     --data-binary "    {
        \"template_name\":\"I am updated\",
        \"body\":\"This is a sample content: Sc0KNWgSMG for this template.\"
    }" \
'https://rest.clicksend.com/v3/sms/templates/{template_id}'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\SMSApi(new GuzzleHttp\Client(),$config);
$template_id = 26030; // int | Template id
$sms_template = new \ClickSend\Model\SmsTemplate(); // \ClickSend\Model\SmsTemplate | Template item
$sms_template->setTemplateName("Template 501916");
$sms_template->setBody("This is a sample content: H7YI68B3yk for this template.");

try {
    $result = $apiInstance->smsTemplatesByTemplateIdPut($template_id, $sms_template);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling SMSApi->smsTemplatesByTemplateIdPut: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME, 
    Password = API_KEY  
};
var smsApi = new SMSApi(configuration);
var response = smsApi.SmsTemplatesByTemplateIdPut(TEMPLATE_ID,new SmsTemplate(
    templateName: "Template Name",
    body: "This is body"
));
var api = require('./api.js');

var smsApi = new api.SMSApi("USERNAME", "API_KEY");

var smsTemplate = new api.SmsTemplate();

smsTemplate.template_name = "Template 501916";
smsTemplate.body = "template body";

templateId = 25411;

smsApi.smsTemplatesByTemplateIdPut(templateId, smsTemplate).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::SMSApi.new

template_id = 56 # Integer | Template id

# SmsTemplate | SmsTemplate model
sms_template = ClickSendClient::SmsTemplate.new(
  "template_name": "template_name",
  "body": "body"
)

begin
  # Update sms template
  result = api_instance.sms_templates_by_template_id_put(template_id, sms_template)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling SMSApi->sms_templates_by_template_id_put: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.SMSApi(clicksend_client.ApiClient(configuration))
template_id = 24140 # int | Template id
sms_template = clicksend_client.SmsTemplate(
                template_name="I am updated",
                body="This is a sample content: Sc0KNWgSMG for this template.") # SmsTemplate | Template item

try:
    # Update sms template
    api_response = api_instance.sms_templates_by_template_id_put(template_id, sms_template)
    print(api_response)
except ApiException as e:
    print("Exception when calling SMSApi->sms_templates_by_template_id_put: %s\n" % e)
use WWW::ClickSendClient::SMSApi;
use WWW::ClickSendClient::Object::SmsTemplate;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::SMSApi->new(username => $username, password => $password);
my %params = (
    'template_name' => 'template_name',
    'body'          => 'body'
);

my $sms_template_obj = WWW::ClickSendClient::Object::SmsTemplate->new(%params);
my $json_output = $api->sms_templates_by_template_id_put('sms_template' => $sms_template_obj ,'template_id' => '12345');

print $json_output;
#import "CSSMSApi.h"
#import "CSSmsTemplate.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
// Configure HTTP basic authorization (authentication scheme: BasicAuth)
[apiConfig setUsername:@"YOUR_USERNAME"];
[apiConfig setPassword:@"YOUR_PASSWORD"];


CSSMSApi *smsAPI = [[CSSMSApi alloc] init];

NSNumber *templateId = [NSNumber numberWithInt:0];

CSSmsTemplate *smsTemplate =  [[CSSmsTemplate alloc] init];
smsTemplate.templateName = @"Template Chocolate";
smsTemplate.body = @"Chocolate bar icing icing oat cake carrot cake jelly cotton MWEvciEPIr.";

[smsAPI smsTemplatesByTemplateIdPutWithTemplateId:templateId smsTemplate:smsTemplate completionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire

if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}

let smsTemplate = SmsTemplate(
    templateName: "Template Chocolate", 
    body: "Chocolate bar icing icing oat cake carrot cake jelly cotton MWEvciEPIr."
)

SMSAPI.smsTemplatesByTemplateIdPut(templateId: 25212, smsTemplate: smsTemplate) { (dataString, error) in
    guard let dataString = dataString else {
        print(error!)
        return
    }

    if let data = dataString.data(using: String.Encoding.utf8) {
        do {
            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                print(dictonary)
            } else {
                print("bad json")
            }
        } catch let error as NSError {
            print(error)
        }
    }
}
    Coming Soon
package ClickSend;

import ClickSend.Api.SmsApi;
import ClickSend.Model.SmsTemplate;

public class update_sms_template {
  public static void main(String[] args) {
    ApiClient defaultClient = new ApiClient();
    defaultClient.setUsername("USERNAME");
    defaultClient.setPassword("API_KEY");
    SmsApi apiInstance = new SmsApi(defaultClient);
    Integer templateId = 24868; // Integer | Template id
    SmsTemplate smsTemplate = new SmsTemplate(); // SmsTemplate | Template item
    smsTemplate.body("template body");
    smsTemplate.templateName("template name");
    try {
        String result = apiInstance.smsTemplatesByTemplateIdPut(templateId, smsTemplate);
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling SmsApi#smsTemplatesByTemplateIdPut");
        e.printStackTrace();
    }
  }
}

Body parameter

{
  "template_name": "template_name",
  "body": "body"
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "Your template has been updated.",
  "data": {
    "template_id": 25,
    "body": "This is a sample content: Sc0KNWgSMG for this template.",
    "template_name": "I am updated"
  }
}

https://rest.clicksend.com/v3/sms/templates/{template_id}

Update sms template

Parameters

Parameter In Type Required Description
template_id path integer(int32) true Template id

Properties

Name Type Required Restrictions Description
template_name string true none Name of template
body string true none Body of template

Refer to Status Codes for definitions of HTTP status code responses.

Delete SMS Template

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
     --request DELETE \

'https://rest.clicksend.com/v3/sms/templates/{template_id}'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\SMSApi(new GuzzleHttp\Client(),$config);
$template_id = 24140; // int | Template id

try {
    $result = $apiInstance->smsTemplatesByTemplateIdDelete($template_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling SMSApi->smsTemplatesByTemplateIdDelete: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME, 
    Password = API_KEY  
};
var smsApi = new SMSApi(configuration);
var response = smsApi.SmsTemplatesByTemplateIdDelete(TEMPLATE_ID);
var api = require('./api.js');

var smsApi = new api.SMSApi("USERNAME", "API_KEY");

templateId = 25411;

smsApi.smsTemplatesByTemplateIdDelete(templateId).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::SMSApi.new

template_id = 25 # Integer | Template id

begin
  # Delete sms template
  result = api_instance.sms_templates_by_template_id_delete(template_id)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling SMSApi->sms_templates_by_template_id_delete: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.SMSApi(clicksend_client.ApiClient(configuration))
template_id = 24490 # int | Template id

try:
    # Delete sms template
    api_response = api_instance.sms_templates_by_template_id_delete(template_id)
    print(api_response)
except ApiException as e:
    print("Exception when calling SMSApi->sms_templates_by_template_id_delete: %s\n" % e)
use WWW::ClickSendClient::SMSApi;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::SMSApi->new(username => $username, password => $password);

my $json_output = $api->sms_templates_by_template_id_delete('template_id' => '12345');

print $json_output;
#import "CSSMSApi.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
// Configure HTTP basic authorization (authentication scheme: BasicAuth)
[apiConfig setUsername:@"YOUR_USERNAME"];
[apiConfig setPassword:@"YOUR_PASSWORD"];


CSSMSApi *smsAPI = [[CSSMSApi alloc] init];

NSNumber *templateId = [NSNumber numberWithInt:0];

[smsAPI smsTemplatesByTemplateIdDeleteWithTemplateId:templateId completionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire

if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}

SMSAPI.smsTemplatesByTemplateIdDelete(templateId: 25212) { (dataString, error) in
    guard let dataString = dataString else {
        print(error!)
        return
    }

    if let data = dataString.data(using: String.Encoding.utf8) {
        do {
            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                print(dictonary)
            } else {
                print("bad json")
            }
        } catch let error as NSError {
            print(error)
        }
    }
}
    Coming Soon
package ClickSend;

import ClickSend.Api.SmsApi;

public class delete_sms_template {
  public static void main(String[] args) {
    ApiClient defaultClient = new ApiClient();
    defaultClient.setUsername("USERNAME");
    defaultClient.setPassword("API_KEY");
    SmsApi apiInstance = new SmsApi(defaultClient);
    Integer templateId = 24868; // Integer | Template id
    try {
        String result = apiInstance.smsTemplatesByTemplateIdDelete(templateId);
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling SmsApi#smsTemplatesByTemplateIdDelete");
        e.printStackTrace();
    }
  }
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "Your template has been deleted.",
  "data": []
}

https://rest.clicksend.com/v3/sms/templates/{template_id}

Delete sms template

Parameters

Parameter In Type Required Description
template_id path integer(int32) true Template id

Refer to Status Codes for definitions of HTTP status code responses.

View SMS History

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \

'https://rest.clicksend.com/v3/sms/history?date_from=&date_to='
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\SMSApi(new GuzzleHttp\Client(),$config);
$q = "q_example"; // string | Custom query Example: from:{number},status_code:201.
$date_from = '1436879372'; // int | Start date
$date_to = '1436879372'; // int | End date
$page = 1; // int | Page number
$limit = 10; // int | Number of records per page

try {
    $result = $apiInstance->smsHistoryGet($q, $date_from, $date_to, $page, $limit);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling SMSApi->smsHistoryGet: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME, 
    Password = API_KEY  
};
var smsApi = new SMSApi(configuration);

var q = "q_example";
var dateFrom = '1436879372';
var dateTo = '1436879372';
var page = 1;
var limit = 10;

var response = smsApi.SmsHistoryGet(q, dateFrom, dateTo, page, limit);
var api = require('./api.js');

var smsApi = new api.SMSApi("USERNAME", "API_KEY");

var q = "q_example";
var dateFrom = '1436879372';
var dateTo = '1436879372';
var page = 1;
var limit = 10;

smsApi.smsHistoryGet(q, dateFrom, dateTo, page, limit).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::SMSApi.new

opts = {
  date_from: 1436849372, # Integer | Start date
  date_to: 1436879372,   # Integer | End date
  page: 1,       # Integer | Page number
  limit: 10      # Integer | Number of records per page
}

begin
  # Get all sms history
  result = api_instance.sms_history_get(opts)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling SMSApi->sms_history_get: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.SMSApi(clicksend_client.ApiClient(configuration))
date_from = 1436879372 # int | Start date (optional)
date_to = 1436879372 # int | End date (optional)
page = 1 # int | Page number (optional) (default to 1)
limit = 10 # int | Number of records per page (optional) (default to 10)

try:
    # Get all sms history
    api_response = api_instance.sms_history_get(date_from=date_from, date_to=date_to, page=page, limit=limit)
    print(api_response)
except ApiException as e:
    print("Exception when calling SMSApi->sms_history_get: %s\n" % e)
use WWW::ClickSendClient::SMSApi;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::SMSApi->new(username => $username, password => $password);

my $json_output = $api->sms_history_get('date_from' => '1436879372','date_to' => '1446879372' , 'page'  => '1','limit'=> '20');

print $json_output;
#import "CSSMSApi.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
// Configure HTTP basic authorization (authentication scheme: BasicAuth)
[apiConfig setUsername:@"YOUR_USERNAME"];
[apiConfig setPassword:@"YOUR_PASSWORD"];


CSSMSApi *smsAPI = [[CSSMSApi alloc] init];

NSNumber *dateFromTimestamp = [NSNumber numberWithInt:1436849372];
NSNumber *dateToTimestamp = [NSNumber numberWithInt:1436879372];

[smsAPI smsHistoryGetWithQ:@"" dateFrom:dateFromTimestamp dateTo:dateToTimestamp page:@(1) limit:@(15) completionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire

if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}

SMSAPI.smsHistoryGet { (dataString, error) in
    guard let dataString = dataString else {
        print(error!)
        return
    }

    if let data = dataString.data(using: String.Encoding.utf8) {
        do {
            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                print(dictonary)
            } else {
                print("Cannot convert the String value to JSON")
            }
        } catch let error as NSError {
            print(error)
        }
    }
}
    Coming Soon
package ClickSend;

import ClickSend.Api.SmsApi;

public class view_sms_history {
  public static void main(String[] args) {
    ApiClient defaultClient = new ApiClient();
    defaultClient.setUsername("USERNAME");
    defaultClient.setPassword("API_KEY");
    SmsApi apiInstance = new SmsApi(defaultClient);
    // String | Custom query Example: from:{number},status_code:201.
    String q = "q_example"; 
    Integer dateFrom = 1436879372; // Integer | Start date
    Integer dateTo = 1436879372; // Integer | End date
    Integer page = 1; // Integer | Page number
    Integer limit = 10; // Integer | Number of records per page
    try {
      String result = apiInstance.smsHistoryGet(q, dateFrom, dateTo, page, limit);
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling SmsApi#smsHistoryGet");
        e.printStackTrace();
    }
  }
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "Here are your data.",
  "data": {
    "total": 1,
    "per_page": 15,
    "current_page": 1,
    "last_page": 1,
    "next_page_url": null,
    "prev_page_url": null,
    "from": 1,
    "to": 1,
    "data": [
      {
        "direction": "out",
        "date": "1436932432",
        "to": "+16783270696",
        "body": "Chocolate bar icing icing oat cake carrot cake jelly cotton 1iQByXxdLN.",
        "status": "Completed",
        "from": "sendlist",
        "schedule": "1436879372",
        "status_code": null,
        "status_text": null,
        "error_code": null,
        "error_text": null,
        "message_id": "4E90F4C3-43A3-489D-9AB8-DA1F4332A0C3",
        "message_parts": "1.00",
        "message_price": "0.070000",
        "from_email": null,
        "list_id": null,
        "custom_string": "this is a test",
        "contact_id": 0,
        "user_id": 1,
        "subaccount_id": 1,
        "country": "US",
        "carrier": "",
        "first_name": "John",
        "last_name": "Doe",
        "_api_username": "johndoe"
      }
    ]
  }
}

https://rest.clicksend.com/v3/sms/history

Get all sms history

Parameters

Parameter In Type Required Description
date_from query integer(int32) false Start date (Unix Timestamp e.g. 1436849372)
date_to query integer(int32) false End date (Unix Timestamp e.g. 1436879372)
page query integer(int32) false Page number
limit query integer(int32) false Number of records per page

Refer to Status Codes for definitions of HTTP status code responses.

Export SMS History

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \

'https://rest.clicksend.com/v3/sms/history/export?filename={filename}'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\SMSApi(new GuzzleHttp\Client(),$config);
$filename = "filename_example"; // string | Filename to download history as

try {
    $result = $apiInstance->smsHistoryExportGet($filename);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling SMSApi->smsHistoryExportGet: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME, 
    Password = API_KEY  
};
var smsApi = new SMSApi(configuration);
var response = smsApi.SmsHistoryExportGet("File Name");
var api = require('./api.js');

var smsApi = new api.SMSApi("USERNAME", "API_KEY");

var filename = "filename";

smsApi.smsHistoryExportGet(filename).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
  config.username = 'USERNAME'
  config.password = 'API_KEY'
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
end

api_instance = ClickSendClient::SMSApi.new

filename = "filename_example" # String | Filename to download history as

begin
  # Export all sms history
  result = api_instance.sms_history_export_get(filename)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling SMSApi->sms_history_export_get: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.SMSApi(clicksend_client.ApiClient(configuration))
filename = 'sms_history' # str | Filename to download history as

try:
    # Export all sms history
    api_response = api_instance.sms_history_export_get(filename)
    print(api_response)
except ApiException as e:
    print("Exception when calling SMSApi->sms_history_export_get: %s\n" % e)
use WWW::ClickSendClient::SMSApi;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::SMSApi->new(username => $username, password => $password);

my $json_output = $api->sms_history_export_get('filename' => 'test_file');

print $json_output;
#import "CSSMSApi.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
// Configure HTTP basic authorization (authentication scheme: BasicAuth)
[apiConfig setUsername:@"YOUR_USERNAME"];
[apiConfig setPassword:@"YOUR_PASSWORD"];

CSSMSApi *smsAPI = [[CSSMSApi alloc] init];
[smsAPI smsHistoryExportGetWithFilename:@"string" completionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire

if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}

SMSAPI.smsHistoryExportGet(filename: "test.csv") { (dataString, error) in
    guard let dataString = dataString else {
        print(error!)
        return
    }

    if let data = dataString.data(using: String.Encoding.utf8) {
        do {
            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                print(dictonary)
            } else {
                print("bad json")
            }
        } catch let error as NSError {
            print(error)
        }
    }
}
    Coming Soon
package ClickSend;

import ClickSend.Api.SmsApi;

public class export_sms_history {
  public static void main(String[] args) {
    ApiClient defaultClient = new ApiClient();
    defaultClient.setUsername("USERNAME");
    defaultClient.setPassword("API_KEY");
    SmsApi apiInstance = new SmsApi(defaultClient);
    // String | Filename to download history as
    String filename = "filename_example"; 
    try {
        String result = apiInstance.smsHistoryExportGet(filename);
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling SmsApi#smsHistoryExportGet");
        e.printStackTrace();
    }
  }
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "Download your file here.",
  "data": {
    "url": "https://rest.clicksend.com/files/22D55AF9-6CF0-476D-A8B3-82A998FD2738?filename=export.csv"
  }
}

https://rest.clicksend.com/v3/sms/history/export

Export all sms history

Parameters

Parameter In Type Required Description
filename query string true Filename to download history as

Refer to Status Codes for definitions of HTTP status code responses.

SMS Campaign

Send SMS Campaign

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
     --request POST \

     --header "Content-Type: application/json" \
     --data-binary "{
    \"list_id\":428,
    \"name\":\"My Campaign 1\",
    \"body\":\"This is my new campaign message.\"
}" \
'https://rest.clicksend.com/v3/sms-campaigns/send'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\SmsCampaignApi(new GuzzleHttp\Client(),$config);
$campaign = new \ClickSend\Model\SmsCampaign(); // \ClickSend\Model\SmsCampaign | SmsCampaign model
$campaign->setListId(185161);
$campaign->setName("My Campaign 1");
$campaign->setBody("This is my new campaign message.");

try {
    $result = $apiInstance->smsCampaignsSendPost($campaign);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling SmsCampaignApi->smsCampaignsSendPost: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME,
    Password = API_KEY  
};
var smsCampaignApi = new SmsCampaignApi(configuration);

var response = smsCampaignApi.SmsCampaignsSendPost(new SmsCampaign(
    listId: LIST_ID,
    name: "Campaign Name",
    body: "Body"
));
var api = require('./api.js');

var smsCampaignApi = new api.SmsCampaignApi("USERNAME", "API_KEY");

var campaign = new api.SmsCampaign();

campaign.listId = 185161;
campaign.name = "My Campaign 1";
campaign.body = "This is my new campaign message";

smsCampaignApi.smsCampaignsSendPost(campaign).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::SmsCampaignApi.new

# SmsCampaign | SmsCampaign model
campaign = ClickSendClient::SmsCampaign.new(
  "list_id": 1234,
  "name": "name",
  "body": "body"
)

begin
  # Create sms campaign
  result = api_instance.sms_campaigns_send_post(campaign)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling SmsCampaignApi->sms_campaigns_send_post: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.SmsCampaignApi(clicksend_client.ApiClient(configuration))
campaign = clicksend_client.SmsCampaign(
            list_id=185161,
            name="My Campaign 1",
            body="This is my new campaign message."

try:
    # Create sms campaign
    api_response = api_instance.sms_campaigns_send_post(campaign)
    print(api_response)
except ApiException as e:
    print("Exception when calling SmsCampaignApi->sms_campaigns_send_post: %s\n" % e)
use WWW::ClickSendClient::SmsCampaignApi;
use WWW::ClickSendClient::Object::SmsCampaign;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::SmsCampaignApi->new(username => $username, password => $password);

my %params = (
    'list_id'  => 'contact_list_id',
    'name'     => 'name',
    'body'     => 'body'
);

my $campaign_obj = WWW::ClickSendClient::Object::SmsCampaign->new(%params);

my $json_output = $api->sms_campaigns_send_post('campaign' => $campaign_obj);

print $json_output;
#import "CSSmsCampaignApi.h"
#import "CSDefaultConfiguration.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
// Configure HTTP basic authorization (authentication scheme: BasicAuth)
[apiConfig setUsername:@"USERNAME"];
[apiConfig setPassword:@"PASSWORD"];

CSSmsCampaign *campaign = [[CSSmsCampaign alloc] init];
campaign.listId = @(258);
campaign.name = @"name";
campaign.body = @"body";

CSSmsCampaignApi *smsCampaign = [[CSSmsCampaignApi alloc] init];
[smsCampaign smsCampaignsSendPostWithCampaign:campaign completionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire
if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}

let campaign = SmsCampaign(
    listId: 258,
    name: "name",
    body: "body")

SmsCampaignAPI.smsCampaignsSendPost(campaign: campaign) { (dataString, error) in
    if let error = error {
        print(error)
    } else {
        if let data = dataString!.data(using: String.Encoding.utf8) {
            do {
                if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                    print(dictonary)
                } else {
                    print("Cannot convert the String value to JSON")
                }
            } catch let error as NSError {
                print(error)
            }
        }
    }
}
    Coming Soon
package ClickSend;

import ClickSend.Api.SmsCampaignApi;
import ClickSend.Model.SmsCampaign;

public class send_sms_campaign {
  public static void main(String[] args) {
    ApiClient defaultClient = new ApiClient();
    defaultClient.setUsername("USERNAME");
    defaultClient.setPassword("API_KEY");
    SmsCampaignApi apiInstance = new SmsCampaignApi(defaultClient);
    SmsCampaign campaign = new SmsCampaign(); // SmsCampaign | SmsCampaign model

    campaign.listId(new Integer(185161));
    campaign.name("campaign");
    campaign.body("campaign body");

    try {
        String result = apiInstance.smsCampaignsSendPost(campaign);
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling SmsCampaignApi#smsCampaignsSendPost");
        e.printStackTrace();
    }
  }
}

Body parameter

{
  "schedule": 0,
  "list_id": 1234,
  "name": "name",
  "body": "body"
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "Your new campaign has been added.",
  "data": {
    "sms_campaign_id": 7,
    "name": "My Campaign 1",
    "user_id": 1,
    "subaccount_id": 1,
    "list_id": 428,
    "from": "+61353787448",
    "body": "This is my new campaign message. StopMsg.me/xxxxx",
    "schedule": "1444821615",
    "status": "Queued",
    "date_added": "1444962630",
    "custom_string": null,
    "source": null
  }
}

https://rest.clicksend.com/v3/sms-campaigns/send

SMS Campaign Endpoint

You can post to a list with up to 20000 recipients with each API call. You can only send to a single list containing up to 20,000 recipients. The response is far less detailed than the normal Send SMS endpoint. Use the SMS Send endpoint if you would like to send to less than 1000 recipients at once.

You are required to add an opt-out message to the end of your message body if you are sending marketing message. This can be in the form of asking users to reply STOP to opt-out or by including StopMsg.me/xxxxx which is a placeholder that will add a link that can be clicked to out-out.

Properties

Name Type Required Restrictions Description
list_id integer(int32) true none Your list id.
name string true none Your campaign name.
body string true none Your campaign message.
from string true yes Your sender id
schedule integer(int32) false none Your schedule timestamp.

Refer to Status Codes for definitions of HTTP status code responses.

Calculate SMS Campaign Price

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
     --request POST \

     --header "Content-Type: application/json" \
     --data-binary "{
    \"list_id\":428,
    \"name\":\"My Campaign 1\",
    \"body\":\"(First Name), this is your new campaign message.\"
}" \
'https://rest.clicksend.com/v3/sms-campaigns/price'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\SmsCampaignApi(new GuzzleHttp\Client(),$config);
$campaign = new \ClickSend\Model\SmsCampaign(); // \ClickSend\Model\SmsCampaign | SmsCampaign model
$campaign->setListId(185161);
$campaign->setName("My Campaign 1");
$campaign->setBody("This is my new campaign message.");

try {
    $result = $apiInstance->smsCampaignsPricePost($campaign);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling SmsCampaignApi->smsCampaignsPricePost: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME,
    Password = API_KEY  
};
var smsCampaignApi = new SmsCampaignApi(configuration);

var response = smsCampaignApi.SmsCampaignsPricePost(new SmsCampaign(
    listId: 1234,
    name: "Campaign Name",
    body: "Body"
));
var api = require('./api.js');

var smsCampaignApi = new api.SmsCampaignApi("USERNAME", "API_KEY");

var campaign = new api.SmsCampaign();

campaign.listId = 185161;
campaign.name = "My Campaign 1";
campaign.body = "This is my new campaign message";

smsCampaignApi.smsCampaignsPricePost(campaign).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::SmsCampaignApi.new

# SmsCampaign | SmsCampaign model
campaign = ClickSendClient::SmsCampaign.new(
  "list_id": 1234,
  "name": "name",
  "body": "body"
)

begin
  # Calculate price for sms campaign
  result = api_instance.sms_campaigns_price_post(campaign)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling SmsCampaignApi->sms_campaigns_price_post: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.SmsCampaignApi(clicksend_client.ApiClient(configuration))
campaign = clicksend_client.SmsCampaign(
            list_id=185161,
            name="My Campaign 1",
            body="This is my new campaign message."

try:
    # Calculate price for sms campaign
    api_response = api_instance.sms_campaigns_price_post(campaign)
    print(api_response)
except ApiException as e:
    print("Exception when calling SmsCampaignApi->sms_campaigns_price_post: %s\n" % e)
use WWW::ClickSendClient::SmsCampaignApi;
use WWW::ClickSendClient::Object::SmsCampaign;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::SmsCampaignApi->new(username => $username, password => $password);

my %params = (
    'list_id'  => 'contact_list_id',
    'name'     => 'name',
    'body'     => 'body'
);

my $campaign_obj = WWW::ClickSendClient::Object::SmsCampaign->new(%params);

my $json_output = $api->sms_campaigns_price_post('campaign' => $campaign_obj);

print $json_output;
#import "CSSmsCampaignApi.h"
#import "CSDefaultConfiguration.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
// Configure HTTP basic authorization (authentication scheme: BasicAuth)
[apiConfig setUsername:@"USERNAME"];
[apiConfig setPassword:@"PASSWORD"];

CSSmsCampaign *campaign = [[CSSmsCampaign alloc] init];
campaign.listId = @(258);
campaign.name = @"name";
campaign.body = @"body";

CSSmsCampaignApi *smsCampaign = [[CSSmsCampaignApi alloc] init];
[smsCampaign smsCampaignsPricePostWithCampaign:campaign completionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire
if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}

let campaign = SmsCampaign(
                    listId: 258,
                    name: "name",
                    body: "body"
                )

SmsCampaignAPI.smsCampaignsPricePost(campaign: campaign) { (dataString, error) in
    if let error = error {
        print(error)
    } else {
        if let data = dataString!.data(using: String.Encoding.utf8) {
            do {
                if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                    print(dictonary)
                } else {
                    print("Cannot convert the String value to JSON")
                }
            } catch let error as NSError {
                print(error)
            }
        }
    }
}
    Coming Soon
package ClickSend;

import ClickSend.Api.SmsCampaignApi;
import ClickSend.Model.SmsCampaign;

public class calculate_sms_campaign_price {
  public static void main(String[] args) {
    ApiClient defaultClient = new ApiClient();
    defaultClient.setUsername("USERNAME");
    defaultClient.setPassword("API_KEY");
    SmsCampaignApi apiInstance = new SmsCampaignApi(defaultClient);
    SmsCampaign campaign = new SmsCampaign(); // SmsCampaign | SmsCampaign model
    campaign.listId(new Integer(185161));
    campaign.name("campaign");
    campaign.body("campaign body");
    try {
        String result = apiInstance.smsCampaignsPricePost(campaign);
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling SmsCampaignApi#smsCampaignsPricePost");
        e.printStackTrace();
    }
  }
}

Body parameter

{
  "list_id": 1234,
  "name": "name",
  "body": "body"
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "Here is your price for your SMS Campaign.",
  "data": {
    "total_count": 1,
    "total_price": "0.035",
    "data": {
      "from": "+61353787448",
      "body": "John, this is your new campaign message.",
      "schedule": 1444381346
    },
    "_currency": {
      "currency_name_short": "GBP",
      "currency_prefix_d": "£",
      "currency_prefix_c": "p",
      "currency_name_long": "British Pounds"
    }
  }
}

https://rest.clicksend.com/v3/sms-campaigns/price

Calculate price for sms campaign

Properties

Name Type Required Restrictions Description
list_id integer(int32) true none Your list id.
name string true none Your campaign name.
body string true none Your campaign message.
from string true yes Your sender id
schedule integer(int32) false none Your schedule timestamp.

Refer to Status Codes for definitions of HTTP status code responses.

Update SMS Campaign

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
     --request PUT \

     --header "Content-Type: application/json" \
     --data-binary "{
    \"list_id\":428,
    \"name\":\"Awesome campaign.\",
    \"body\":\"his is an awesome message.\"
}" \
'https://rest.clicksend.com/v3/sms-campaigns/{sms_campaign_id}'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\SmsCampaignApi(new GuzzleHttp\Client(),
    $config
);
$sms_campaign_id = 134574; // int | ID of SMS campaign to update
$campaign = new \ClickSend\Model\SmsCampaign(); // \ClickSend\Model\SmsCampaign | SmsCampaign model
$campaign->setListId(185161);
$campaign->setName("My Campaign 1");
$campaign->setBody("This is my new campaign message.");

try {
    $result = $apiInstance->smsCampaignsBySmsCampaignIdPut($sms_campaign_id, $campaign);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling SmsCampaignApi->smsCampaignsBySmsCampaignIdPut: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME,
    Password = API_KEY  
};
var smsCampaignApi = new SmsCampaignApi(configuration);

var response = smsCampaignApi.SmsCampaignsBySmsCampaignIdPut(CAMPAIGN_ID, new SmsCampaign(
    listId: LIST_ID,
    name: "Campaign Name",
    body: "Body"
));
var api = require('./api.js');

var smsCampaignApi = new api.SmsCampaignApi("USERNAME", "API_KEY");

var smsCampaignId = 129227;

var campaign = new api.SmsCampaign();

campaign.listId = 185161;
campaign.name = "My Campaign 1";
campaign.body = "This is my new campaign message";
campaign.from = "+61353787448";

smsCampaignApi.smsCampaignsBySmsCampaignIdPut(smsCampaignId, campaign).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::SmsCampaignApi.new

sms_campaign_id = 119000 # Integer | ID of SMS campaign to update

# SmsCampaign | SmsCampaign model
campaign = ClickSendClient::SmsCampaign.new(
  "list_id": 1234,
  "name": "name",
  "body": "body"
)

begin
  # Update sms campaign
  result = api_instance.sms_campaigns_by_sms_campaign_id_put(sms_campaign_id, campaign)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling SmsCampaignApi->sms_campaigns_by_sms_campaign_id_put: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.SmsCampaignApi(clicksend_client.ApiClient(configuration))
sms_campaign_id = 119317 # int | ID of SMS campaign to update
campaign = clicksend_client.SmsCampaign(
            list_id=185161,
            name="My Campaign updated",
            body="This is my new campaign message."

try:
    # Update sms campaign
    api_response = api_instance.sms_campaigns_by_sms_campaign_id_put(sms_campaign_id, campaign)
    print(api_response)
except ApiException as e:
    print("Exception when calling SmsCampaignApi->sms_campaigns_by_sms_campaign_id_put: %s\n" % e)
use WWW::ClickSendClient::SmsCampaignApi;
use WWW::ClickSendClient::Object::SmsCampaign;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::SmsCampaignApi->new(username => $username, password => $password);

my %params = (
    'list_id'  => 'contact_list_id',
    'name'     => 'name',
    'body'     => 'body'
);

my $campaign_obj = WWW::ClickSendClient::Object::SmsCampaign->new(%params);

my $json_output = $api->sms_campaigns_by_sms_campaign_id_put('campaign' => $campaign_obj , 'sms_campaign_id' => '1234');

print $json_output;
#import "CSSmsCampaignApi.h"
#import "CSDefaultConfiguration.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
// Configure HTTP basic authorization (authentication scheme: BasicAuth)
[apiConfig setUsername:@"USERNAME"];
[apiConfig setPassword:@"PASSWORD"];

CSSmsCampaign *campaign = [[CSSmsCampaign alloc] init];
campaign.listId = @(258);
campaign.name = @"name";
campaign.body = @"body";

CSSmsCampaignApi *smsCampaign = [[CSSmsCampaignApi alloc] init];
[smsCampaign smsCampaignsBySmsCampaignIdPutWithSmsCampaignId:@(1) campaign:campaign completionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire
if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}

let campaign = SmsCampaign(
                listId: 258,
                name: "name",
                body: "body"
            )

SmsCampaignAPI.smsCampaignsBySmsCampaignIdPut(smsCampaignId: 1, campaign: campaign) { (dataString, error) in
    if let error = error {
        print(error)
    } else {
        if let data = dataString!.data(using: String.Encoding.utf8) {
            do {
                if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                    print(dictonary)
                } else {
                    print("Cannot convert the String value to JSON")
                }
            } catch let error as NSError {
                print(error)
            }
        }
    }
}
    Coming Soon
package ClickSend;

import ClickSend.Api.SmsCampaignApi;
import ClickSend.Model.SmsCampaign;

public class update_sms_campaign {
  public static void main(String[] args) {
    ApiClient defaultClient = new ApiClient();
    defaultClient.setUsername("USERNAME");
    defaultClient.setPassword("API_KEY");
    SmsCampaignApi apiInstance = new SmsCampaignApi(defaultClient);
    Integer smsCampaignId = 121337; // Integer | ID of SMS campaign to update
    SmsCampaign campaign = new SmsCampaign(); // SmsCampaign | SmsCampaign model
    campaign.listId(new Integer(185161));
    campaign.name("campaign2");
    campaign.body("campaign body");
    try {
        String result = apiInstance.smsCampaignsBySmsCampaignIdPut(smsCampaignId, campaign);
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling SmsCampaignApi#smsCampaignsBySmsCampaignIdPut");
        e.printStackTrace();
    }
  }
}

Body parameter

{
  "list_id": 1234,
  "name": "name",
  "body": "body"
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "Your SMS Campaign has been updated.",
  "data": {
    "sms_campaign_id": 1,
    "name": "Awesome campaign.",
    "user_id": 1,
    "subaccount_id": 1,
    "list_id": 428,
    "from": "+61353787447",
    "body": "This is an awesome message.",
    "schedule": "1444821615",
    "status": "Queued",
    "date_added": "1444962803",
    "ip_address": "192.168.10.1",
    "custom_string": null,
    "source": null
  }
}

https://rest.clicksend.com/v3/sms-campaigns/{sms_campaign_id}

Update sms campaign

Parameters

Parameter In Type Required Description
sms_campaign_id path integer(int32) true ID of SMS campaign to update

Properties

Name Type Required Restrictions Description
list_id integer(int32) true none Your list id.
name string true none Your campaign name.
body string true none Your campaign message.
from string true yes Your sender id
schedule integer(int32) false none Your schedule timestamp.

Refer to Status Codes for definitions of HTTP status code responses.

Cancel SMS Campaign

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
     --request PUT \

'https://rest.clicksend.com/v3/sms-campaigns/{sms_campaign_id}/cancel'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\SmsCampaignApi(new GuzzleHttp\Client(),$config);
$sms_campaign_id = 134574; // int | ID of SMS Campaign to cancel

try {
    $result = $apiInstance->smsCampaignsCancelBySmsCampaignIdPut($sms_campaign_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling SmsCampaignApi->smsCampaignsCancelBySmsCampaignIdPut: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME,
    Password = API_KEY  
};
var smsCampaignApi = new SmsCampaignApi(configuration);
var response = smsCampaignApi.SmsCampaignsCancelBySmsCampaignIdPut(CAMPAIGN_ID);
var api = require('./api.js');

var smsCampaignApi = new api.SmsCampaignApi("USERNAME", "API_KEY");

var smsCampaignId = 129239;

smsCampaignApi.smsCampaignsCancelBySmsCampaignIdPut(smsCampaignId).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::SmsCampaignApi.new

sms_campaign_id = 119007 # Integer | ID of SMS Campaign to cancel

begin
  # Cancel sms campaign
  result = api_instance.sms_campaigns_cancel_by_sms_campaign_id_put(sms_campaign_id)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling SmsCampaignApi->sms_campaigns_cancel_by_sms_campaign_id_put: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.SmsCampaignApi(clicksend_client.ApiClient(configuration))
sms_campaign_id = 119316 # int | ID of SMS Campaign to cancel

try:
    # Cancel sms campaign
    api_response = api_instance.sms_campaigns_cancel_by_sms_campaign_id_put(sms_campaign_id)
    print(api_response)
except ApiException as e:
    print("Exception when calling SmsCampaignApi->sms_campaigns_cancel_by_sms_campaign_id_put: %s\n" % e)
use WWW::ClickSendClient::SmsCampaignApi;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::SmsCampaignApi->new(username => $username, password => $password);

my $json_output = $api->sms_campaigns_cancel_by_sms_campaign_id_put('sms_campaign_id' => '1234');

print $json_output;
#import "CSSmsCampaignApi.h"
#import "CSDefaultConfiguration.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
// Configure HTTP basic authorization (authentication scheme: BasicAuth)
[apiConfig setUsername:@"USERNAME"];
[apiConfig setPassword:@"PASSWORD"];

CSSmsCampaignApi *smsCampaign = [[CSSmsCampaignApi alloc] init];
[smsCampaign smsCampaignsCancelBySmsCampaignIdPutWithSmsCampaignId:@(1) completionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire

if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}

SmsCampaignAPI.smsCampaignsCancelBySmsCampaignIdPut(smsCampaignId: 1) { (dataString, error) in
    if let error = error {
        print(error)
    } else {
        if let data = dataString!.data(using: String.Encoding.utf8) {
            do {
                if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                    print(dictonary)
                } else {
                    print("Cannot convert the String value to JSON")
                }
            } catch let error as NSError {
                print(error)
            }
        }
    }
}
    Coming Soon
package ClickSend;

import ClickSend.Api.SmsCampaignApi;

public class cancel_sms_campaign {
  public static void main(String[] args) {
    ApiClient defaultClient = new ApiClient();
    defaultClient.setUsername("USERNAME");
    defaultClient.setPassword("API_KEY");
    SmsCampaignApi apiInstance = new SmsCampaignApi(defaultClient);
    Integer smsCampaignId = 121337; // Integer | ID of SMS Campaign to cancel
    try {
        String result = apiInstance.smsCampaignsCancelBySmsCampaignIdPut(smsCampaignId);
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling SmsCampaignApi#smsCampaignsCancelBySmsCampaignIdPut");
        e.printStackTrace();
    }
  }
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "Your SMS Campaign has been cancelled.",
  "data": {
    "sms_campaign_id": 1,
    "name": "Awesome campaign.",
    "user_id": 1,
    "subaccount_id": 1,
    "list_id": 428,
    "from": "+61353787447",
    "body": "This is an awesome message.",
    "schedule": "1444821615",
    "status": "Cancelled",
    "date_added": "1444959876",
    "ip_address": "192.168.10.1",
    "custom_string": null,
    "source": null
  }
}

https://rest.clicksend.com/v3/sms-campaigns/{sms_campaign_id}/cancel

Cancel sms campaign

Parameters

Parameter In Type Required Description
sms_campaign_id path integer(int32) true ID of SMS Campaign to cancel

Refer to Status Codes for definitions of HTTP status code responses.

View SMS Campaigns

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \

'https://rest.clicksend.com/v3/sms-campaigns'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\SmsCampaignApi(new GuzzleHttp\Client(),$config);
$page = 1; // int | Page number
$limit = 10; // int | Number of records per page

try {
    $result = $apiInstance->smsCampaignsGet($page, $limit);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling SmsCampaignApi->smsCampaignsGet: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME,
    Password = API_KEY  
};
var smsCampaignApi = new SmsCampaignApi(configuration);
var response = smsCampaignApi.SmsCampaignsGet();
var api = require('./api.js');

var smsCampaignApi = new api.SmsCampaignApi("USERNAME", "API_KEY");

var page = 1;
var limit = 10;

smsCampaignApi.smsCampaignsGet(page, limit).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::SmsCampaignApi.new

opts = {
  page: 1,  # Integer | Page number
  limit: 10 # Integer | Number of records per page
}

begin
  # Get list of sms campaigns
  result = api_instance.sms_campaigns_get(opts)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling SmsCampaignApi->sms_campaigns_get: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.SmsCampaignApi(clicksend_client.ApiClient(configuration))
page = 1 # int | Page number (optional) (default to 1)
limit = 10 # int | Number of records per page (optional) (default to 10)

try:
    # Get list of sms campaigns
    api_response = api_instance.sms_campaigns_get(page=page, limit=limit)
    print(api_response)
except ApiException as e:
    print("Exception when calling SmsCampaignApi->sms_campaigns_get: %s\n" % e)
use WWW::ClickSendClient::SmsCampaignApi;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::SmsCampaignApi->new(username => $username, password => $password);

my $json_output = $api->sms_campaigns_get('page' => '1','limit' => '30');

print $json_output;
#import "CSSmsCampaignApi.h"
#import "CSDefaultConfiguration.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
// Configure HTTP basic authorization (authentication scheme: BasicAuth)
[apiConfig setUsername:@"USERNAME"];
[apiConfig setPassword:@"PASSWORD"];

CSSmsCampaignApi *smsCampaign = [[CSSmsCampaignApi alloc] init];
[smsCampaign smsCampaignsGetWithPage:@(1) limit:@(15) completionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire
if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}

SmsCampaignAPI.smsCampaignsGet(page: 1, limit: 15) { (dataString, error) in
    if let error = error {
        print(error)
    } else {
        if let data = dataString!.data(using: String.Encoding.utf8) {
            do {
                if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                    print(dictonary)
                } else {
                    print("Cannot convert the String value to JSON")
                }
            } catch let error as NSError {
                print(error)
            }
        }
    }
}
    Coming Soon
package ClickSend;

import ClickSend.Api.SmsCampaignApi;

public class view_all_sms_campaign {
  public static void main(String[] args) {
    ApiClient defaultClient = new ApiClient();
    defaultClient.setUsername("USERNAME");
    defaultClient.setPassword("API_KEY");
    SmsCampaignApi apiInstance = new SmsCampaignApi(defaultClient);
    Integer page = 1; // Integer | Page number
    Integer limit = 10; // Integer | Number of records per page
    try {
        String result = apiInstance.smsCampaignsGet(page, limit);
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling SmsCampaignApi#smsCampaignsGet");
        e.printStackTrace();
    }
  }
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "Here are your SMS campaigns.",
  "data": {
    "total": 2,
    "per_page": 20,
    "current_page": 1,
    "last_page": 1,
    "next_page_url": null,
    "prev_page_url": null,
    "from": 1,
    "to": 2,
    "data": [
      {
        "sms_campaign_id": 1,
        "name": "This is my awesome campaign.",
        "user_id": 1,
        "subaccount_id": 1,
        "list_id": 428,
        "from": "+61353787447",
        "body": "This is my new campaign message.",
        "schedule": "1444821615",
        "status": "Cancelled",
        "date_added": "1444962803",
        "ip_address": "192.168.10.1",
        "custom_string": null,
        "source": null,
        "_total_count": 10
      },
      {
        "sms_campaign_id": 7,
        "name": "My Campaign 1",
        "user_id": 1,
        "subaccount_id": 1,
        "list_id": 428,
        "from": "+61353787448",
        "body": "This is my new campaign message.",
        "schedule": "1444821615",
        "status": "Queued",
        "date_added": "1444962630",
        "ip_address": "192.168.10.1",
        "custom_string": null,
        "source": null,
        "_total_count": 10
      }
    ]
  }
}

https://rest.clicksend.com/v3/sms-campaigns

Get list of sms campaigns

Parameters

Parameter In Type Required Description
page query integer(int32) false Page number
limit query integer(int32) false Number of records per page

Refer to Status Codes for definitions of HTTP status code responses.

View Specific SMS Campaign

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \

'https://rest.clicksend.com/v3/sms-campaigns/{sms_campaign_id}'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\SmsCampaignApi(new GuzzleHttp\Client(),$config);
$sms_campaign_id = 121918; // int | ID of SMS campaign to retrieve

try {
    $result = $apiInstance->smsCampaignBySmsCampaignIdGet($sms_campaign_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling SmsCampaignApi->smsCampaignBySmsCampaignIdGet: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME,
    Password = API_KEY  
};
var smsCampaignApi = new SmsCampaignApi(configuration);
var response = smsCampaignApi.SmsCampaignBySmsCampaignIdGet(CAMPAIGN_ID);
var api = require('./api.js');

var smsCampaignApi = new api.SmsCampaignApi("USERNAME", "API_KEY");

var smsCampaignId = 129227;

smsCampaignApi.smsCampaignBySmsCampaignIdGet(smsCampaignId).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::SmsCampaignApi.new

sms_campaign_id = 56 # Integer | ID of SMS campaign to retrieve

begin
  # Get specific sms campaign
  result = api_instance.sms_campaign_by_sms_campaign_id_get(sms_campaign_id)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling SmsCampaignApi->sms_campaign_by_sms_campaign_id_get: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.SmsCampaignApi(clicksend_client.ApiClient(configuration))
sms_campaign_id = 119321 # int | ID of SMS campaign to retrieve

try:
    # Get specific sms campaign
    api_response = api_instance.sms_campaign_by_sms_campaign_id_get(sms_campaign_id)
    print(api_response)
except ApiException as e:
    print("Exception when calling SmsCampaignApi->sms_campaign_by_sms_campaign_id_get: %s\n" % e)
use WWW::ClickSendClient::SmsCampaignApi;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::SmsCampaignApi->new(username => $username, password => $password);

my $json_output = $api->sms_campaign_by_sms_campaign_id_get('sms_campaign_id' => '1234');

print $json_output;
#import "CSSmsCampaignApi.h"
#import "CSDefaultConfiguration.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
// Configure HTTP basic authorization (authentication scheme: BasicAuth)
[apiConfig setUsername:@"USERNAME"];
[apiConfig setPassword:@"PASSWORD"];

CSSmsCampaignApi *smsCampaign = [[CSSmsCampaignApi alloc] init];
[smsCampaign smsCampaignBySmsCampaignIdGetWithSmsCampaignId:@(1) completionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
    NSLog(@"%@", output);
    }
}];
import Alamofire
if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}

SmsCampaignAPI.smsCampaignBySmsCampaignIdGet(smsCampaignId: 1) { (dataString, error) in
    if let error = error {
        print(error)
    } else {
        if let data = dataString!.data(using: String.Encoding.utf8) {
            do {
                if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                    print(dictonary)
                } else {
                    print("Cannot convert the String value to JSON")
                }
            } catch let error as NSError {
                print(error)
            }
        }
    }
}
    Coming Soon
package ClickSend;

import ClickSend.Api.SmsCampaignApi;

public class view_specific_sms_campaign {
  public static void main(String[] args) {
    ApiClient defaultClient = new ApiClient();
    defaultClient.setUsername("USERNAME");
    defaultClient.setPassword("API_KEY");
    SmsCampaignApi apiInstance = new SmsCampaignApi(defaultClient);
    Integer smsCampaignId = 121337; // Integer | ID of SMS campaign to retrieve
    try {
        String result = apiInstance.smsCampaignBySmsCampaignIdGet(smsCampaignId);
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling SmsCampaignApi#smsCampaignBySmsCampaignIdGet");
        e.printStackTrace();
    }
  }
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "Your SMS Campaign.",
  "data": {
    "sms_campaign_id": 2,
    "name": "My Campaign 1",
    "user_id": 1,
    "subaccount_id": 1,
    "list_id": 428,
    "from": "+61353787448",
    "body": "This is my new campaign message.",
    "schedule": "1444821615",
    "status": "Sent",
    "date_added": "1444882068",
    "ip_address": "192.168.10.1",
    "custom_string": null,
    "source": null,
    "_total_count": 10
  }
}

https://rest.clicksend.com/v3/sms-campaigns/{sms_campaign_id}

Get specific sms campaign

Parameters

Parameter In Type Required Description
sms_campaign_id path integer(int32) true ID of SMS campaign to retrieve

Refer to Status Codes for definitions of HTTP status code responses.

URL Shortening

We support URL shortening and subsequent link tracking within SMS campaigns. Your long URL will be replaced with smsu.io/xxxxx, where xxxxx is replaced with a randomly-generated, five-character code.

This allows you to not only save on message space when sending a long link (as ours is only 13 characters long), but also allows you to see which of your customers has visited the link and track specific details about your users, including:

  1. Their approximate geographical area and country.
  2. The device (e.g. phone), operating system (e.g. iOS) and browser (e.g. Safari) that they're using.
  3. The time they visited the link.
  4. How many times the link has been visited.

All of this is broken down into simple categorised statistics to give you a better idea of your customers' engagement.

To use Short URLs, all you need to do is:

  1. Insert smsu.io/xxxxx anywhere in the body of your campaign. Note that this is literally the string, including the xxxxx - which will be automatically replaced prior to sending.
  2. Include the attribute url_to_shorten specifying the long URL you want users to visit.

Note that if either of these two items are included without the other, an error will be returned.

This is functionally identical to the POST /sms-campaigns/send endpoint, other than adding the smsu.io/xxxxx string to the message body and the additional url_to_shorten parameter.

Inbound SMS Rules

Everything about Inbound SMS Rules

View SMS Inbound Automations

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
'https://rest.clicksend.com/v3/automations/sms/inbound'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\InboundSMSRulesApi(new GuzzleHttp\Client(),$config);
$q = "q_example"; // string | Your keyword or query.
$page = 1; // int | Page number
$limit = 10; // int | Number of records per page

try {
    $result = $apiInstance->smsInboundAutomationsGet($q, $page, $limit);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling InboundSMSRulesApi->smsInboundAutomationsGet: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME, 
    Password = API_KEY  
};
var inboundSMSRulesApi = new InboundSMSRulesApi(configuration);
var response = inboundSMSRulesApi.SmsInboundAutomationsGet();
var api = require('./api.js');

var inboundSmsRuleApi = new api.InboundSMSRulesApi("USERNAME", "API_KEY");

var q = "q_example";
var page = 1;
var limit = 10;

inboundSmsRuleApi.smsInboundAutomationsGet(q, page, limit).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::InboundSMSRulesApi.new

opts = {
  page: 1,  # Integer | Page number
  limit: 10 # Integer | Number of records per page
}

begin
  # Get all inbound sms automations
  result = api_instance.sms_inbound_automations_get(opts)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling InboundSMSRulesApi->sms_inbound_automations_get: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.InboundSMSRulesApi(clicksend_client.ApiClient(configuration))
page = 1 # int | Page number (optional) (default to 1)
limit = 10 # int | Number of records per page (optional) (default to 10)

try:
    # Get all inbound sms automations
    api_response = api_instance.sms_inbound_automations_get(page=page, limit=limit)
    print(api_response)
except ApiException as e:
    print("Exception when calling InboundSMSRulesApi->sms_inbound_automations_get: %s\n" % e)
use WWW::ClickSendClient::InboundSMSRulesApi;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::InboundSMSRulesApi->new(username => $username, password => $password);

my $json_output = $api->sms_inbound_automations_get('page' => '1','limit' => '10');

print $json_output;
#import "CSInboundSmsRulesApi.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
[apiConfig setUsername:@"USERNAME"];
[apiConfig setPassword:@"PASSWORD"];

NSNumber *page = [[NSNumber alloc] initWithInt:1];
NSNumber *limit = [[NSNumber alloc] initWithInt:15];

CSInboundSMSRulesApi *inboundSmsRulesApiInstance = [[CSInboundSMSRulesApi alloc] init];
[inboundSmsRulesApiInstance smsInboundAutomationsGetWithQ:@"q" page:page limit:limit completionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire

if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}

InboundSMSRulesAPI.smsInboundAutomationsGet { (dataString, error) in
    guard let dataString = dataString else {
        print(error!)
        return
    }
    if let data = dataString.data(using: String.Encoding.utf8) {
        do {
            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                print(dictonary)
            } else {
                print("Cannot convert the String value to JSON")
            }
        } catch let error as NSError {
            print(error)
        }
    }
}
    Coming Soon
package ClickSend;

import ClickSend.Api.InboundSmsRulesApi;

public class view_all_sms_inbound_automation {
  public static void main(String[] args) {
    ApiClient defaultClient = new ApiClient();
    defaultClient.setUsername("USERNAME");
    defaultClient.setPassword("API_KEY");
    InboundSmsRulesApi apiInstance = new InboundSmsRulesApi(defaultClient);
    String q = "q_example"; // String | Your keyword or query.
    Integer page = 1; // Integer | Page number
    Integer limit = 10; // Integer | Number of records per page
    try {
      String result = apiInstance.smsInboundAutomationsGet(q, page, limit);
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling InboundSmsRulesApi#smsInboundAutomationsGet");
        e.printStackTrace();
    }
  }
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "Your list of inbound rules.",
  "data": {
    "total": 2,
    "per_page": 15,
    "current_page": 1,
    "last_page": 1,
    "next_page_url": null,
    "prev_page_url": null,
    "from": 1,
    "to": 2,
    "data": [
      {
        "inbound_rule_id": 10,
        "dedicated_number": "+61298441484",
        "rule_name": "My Rule 10",
        "message_search_type": 3,
        "message_search_term": "My Search Term",
        "action": "CREATE_CONTACT_PLUS_EMAIL",
        "action_address": "430",
        "body": "test@test.com",
        "enabled": 1
      },
      {
        "inbound_rule_id": 9,
        "dedicated_number": "+61298441484",
        "rule_name": "My Rule 9",
        "message_search_type": 3,
        "message_search_term": "My Search Term",
        "action": "CREATE_CONTACT",
        "action_address": "john@doe.com",
        "body": null,
        "enabled": 1
      }
    ]
  }
}

https://rest.clicksend.com/v3/automations/sms/inbound

Get all inbound sms automations

Get all inbound sms automations

Parameters

Parameter In Type Required Description
page query integer(int32) false Page number
limit query integer(int32) false Number of records per page

Refer to Status Codes for definitions of HTTP status code responses.

Create SMS Inbound Automation

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
     --request POST \
     --header "Content-Type: application/json" \
     --data-binary "{
    \"dedicated_number\":\"+61298441484\",
    \"rule_name\":\"My Rule\",
    \"message_search_type\":3,
    \"message_search_term\":\"My Search Term\",
    \"action\":\"EMAIL_FIXED\",
    \"action_address\":\"john@doe.com\",
    \"enabled\":1,
    \"webhook_type\":\"json\"
}" \
'https://rest.clicksend.com/v3/automations/sms/inbound'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\InboundSMSRulesApi(new GuzzleHttp\Client(),$config);
// \ClickSend\Model\InboundSMSRule | Inbound sms rule model
$inbound_sms_rule = new \ClickSend\Model\InboundSMSRule();
$inbound_sms_rule->setDedicatedNumber("*");
$inbound_sms_rule->setRuleName("rule name");
$inbound_sms_rule->setMessageSearchType(3);
$inbound_sms_rule->setMessageSearchTerm("My Search Term");
$inbound_sms_rule->setAction("EMAIL_FIXED");
$inbound_sms_rule->setActionAddress("john@doe.com");
$inbound_sms_rule->setEnabled(1);

try {
    $result = $apiInstance->smsInboundAutomationPost($inbound_sms_rule);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling InboundSMSRulesApi->smsInboundAutomationPost: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME, 
    Password = API_KEY  
};
var inboundSMSRulesApi = new InboundSMSRulesApi(configuration);
var response = inboundSMSRulesApi.SmsInboundAutomationPost(new InboundSMSRule(
    dedicatedNumber: "+11231231234",
    ruleName: "NEW RULE",
    messageSearchType: 3,
    messageSearchTerm: "My Search Term",
    action: "EMAIL_FIXED",
    actionAddress: "john@doe.com",
    enabled: 1
));
var api = require('./api.js');

var inboundSmsRuleApi = new api.InboundSMSRulesApi("USERNAME", "API_KEY");

var inboundSmsRule = new api.InboundSMSRule();

inboundSmsRule.dedicatedNumber = "*";
inboundSmsRule.ruleName = "Rule Name";
inboundSmsRule.messageSearchType = 3;
inboundSmsRule.messageSearchTerm = "My Search Term";
inboundSmsRule.action = "URL";
inboundSmsRule.actionAddress = "https://john@doe.com";
inboundSmsRule.enabled = 1;
inboundSmsRule.webhookType = "post";

inboundSmsRuleApi.smsInboundAutomationPost(inboundSmsRule).then(function(response) {
console.log(response.body);
}).catch(function(err){
console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::InboundSMSRulesApi.new

# InboundSMSRule | Inbound sms rule model
inbound_sms_rule = ClickSendClient::InboundSMSRule.new(
  "message_search_type": 1,
  "message_search_term": "message_search_term",
  "action_address": "action_address",
  "dedicated_number": "dedicated_number",
  "rule_name": "rule_name",
  "action": "action",
  "enabled": 1
)

begin
  # Create new inbound sms automation
  result = api_instance.sms_inbound_automation_post(inbound_sms_rule)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling InboundSMSRulesApi->sms_inbound_automation_post: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.InboundSMSRulesApi(clicksend_client.ApiClient(configuration))
# InboundSMSRule | Inbound sms rule model
inbound_sms_rule = clicksend_client.InboundSMSRule(
                    dedicated_number="*",
                    rule_name="My Rule",
                    message_search_type=3,
                    message_search_term="My Search Term",
                    action="EMAIL_FIXED",
                    action_address="john@doe.com",
                    enabled=1) 

try:
    # Create new inbound sms automation
    api_response = api_instance.sms_inbound_automation_post(inbound_sms_rule)
    print(api_response)
except ApiException as e:
    print("Exception when calling InboundSMSRulesApi->sms_inbound_automation_post: %s\n" % e)
use WWW::ClickSendClient::InboundSMSRulesApi;
use WWW::ClickSendClient::Object::InboundSMSRule;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::InboundSMSRulesApi->new(username => $username, password => $password);

my %params = (
    'dedicated_number'    => '+111111111',
    'rule_name'           => 'rule_name',
    'message_search_type' => '1',
    'message_search_term' => 'message_search_term',
    'action'              => 'EMAIL_FIXED',
    'action_address'      => 'test1@test.com',  
    'enabled'             => '1'
);

my $inbound_sms_obj = WWW::ClickSendClient::Object::InboundSMSRule->new(%params);
my $json_output = $api->sms_inbound_automation_post('inbound_sms_rule' => $inbound_sms_obj);

print $json_output;
#import "CSInboundSmsRulesApi.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
[apiConfig setUsername:@"USERNAME"];
[apiConfig setPassword:@"PASSWORD"];

CSInboundSMSRule *inboundSmsRule = [[CSInboundSMSRule alloc] init];
inboundSmsRule.dedicatedNumber = @"dedicated_number";
inboundSmsRule.ruleName = @"rule_name";
inboundSmsRule.messageSearchType = @(0);
inboundSmsRule.messageSearchTerm = @"message_search_term";
inboundSmsRule.action = @"action";
inboundSmsRule.actionAddress = @"action_address";
inboundSmsRule.enabled = @(0);

CSInboundSMSRulesApi *inboundSmsRulesApiInstance = [[CSInboundSMSRulesApi alloc] init];
[inboundSmsRulesApiInstance smsInboundAutomationPostWithInboundSmsRule:inboundSmsRule completionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire

if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}

let inboundSmsRule = InboundSMSRule(dedicatedNumber: "dedicated_number",
                                    ruleName: "rule_name",
                                    messageSearchType: 0,
                                    messageSearchTerm: "message_search_term",
                                    action: "action",
                                    actionAddress: "action_address",
                                    enabled: 0)

InboundSMSRulesAPI.smsInboundAutomationPost(inboundSmsRule: inboundSmsRule) { (dataString, error) in
    guard let dataString = dataString else {
        print(error!)
        return
    }
    if let data = dataString.data(using: String.Encoding.utf8) {
        do {
            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                print(dictonary)
            } else {
                print("Cannot convert the String value to JSON")
            }
        } catch let error as NSError {
        print(error)
        }
    }
}
    Coming Soon
package ClickSend;

import java.math.BigDecimal;
import ClickSend.Api.InboundSmsRulesApi;
import ClickSend.Model.InboundSMSRule;

public class create_sms_inbound_automation {
  public static void main(String[] args) {
    ApiClient defaultClient = new ApiClient();
    defaultClient.setUsername("USERNAME");
    defaultClient.setPassword("API_KEY");
    InboundSmsRulesApi apiInstance = new InboundSmsRulesApi(defaultClient);
    // InboundSMSRule | Inbound sms rule model
    InboundSMSRule inboundSmsRule = new InboundSMSRule(); 
    inboundSmsRule.dedicatedNumber("*");
    inboundSmsRule.ruleName("rulename");
    inboundSmsRule.messageSearchTerm("messagesearchterm");
    inboundSmsRule.action("EMAIL_FIXED");
    inboundSmsRule.actionAddress("john@doe.com");
    inboundSmsRule.enabled(new BigDecimal(1));
    inboundSmsRule.messageSearchType(new BigDecimal(3));
    try {
        String result = apiInstance.smsInboundAutomationPost(inboundSmsRule);
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling InboundSmsRulesApi#smsInboundAutomationPost");
        e.printStackTrace();
    }
  }
}

Body parameter

{
  "message_search_type": 1,
  "message_search_term": "message_search_term",
  "action_address": "action_address",
  "dedicated_number": "dedicated_number",
  "rule_name": "rule_name",
  "action": "action",
  "enabled": 1,
  "webhook_type": "json"
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "Your record has been added.",
  "data": {
    "inbound_rule_id": 11,
    "dedicated_number": "+61298441484",
    "rule_name": "My Rule",
    "message_search_type": 3,
    "message_search_term": "My Search Term",
    "action": "EMAIL_FIXED",
    "action_address": "john@doe.com",
    "enabled": 1
  }
}

https://rest.clicksend.com/v3/automations/sms/inbound

Create new inbound sms automation

Create new inbound sms automation

Name Type Required Restrictions Description
dedicated_number string true none Decicated Number. Can be '*' to apply to all numbers.
rule_name string true none Rule Name.
message_search_type number true none Message Search Type: 0=Any message, 1=starts with, 2=contains, 3=does not contain.
message_search_term string true none Message search term.
action string true none Action to be taken (AUTO_REPLY, EMAIL_USER, EMAIL_FIXED, URL, SMS, POLL, GROUP_SMS, MOVE_CONTACT, CREATE_CONTACT, CREATE_CONTACT_PLUS_EMAIL, CREATE_CONTACT_PLUS_NAME_EMAIL CREATE_CONTACT_PLUS_NAME, SMPP, NONE).
action_address string true none Action address.
enabled number true none Enabled: Disabled=0 or Enabled=1.
webhook_type string false URL action only Set as post, get, or json to change the format of the request sent.

Refer to Status Codes for definitions of HTTP status code responses.

View SMS Inbound Automation

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
'https://rest.clicksend.com/v3/automations/sms/inbound/{inbound_rule_id}'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\InboundSMSRulesApi(new GuzzleHttp\Client(),$config);
$inbound_rule_id = 149731; // int | Inbound rule id

try {
    $result = $apiInstance->smsInboundAutomationGet($inbound_rule_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling InboundSMSRulesApi->smsInboundAutomationGet: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME, 
    Password = API_KEY  
};
var inboundSMSRulesApi = new InboundSMSRulesApi(configuration);
var response = inboundSMSRulesApi.SmsInboundAutomationGet(RULE_ID);
var api = require('./api.js');

var inboundSmsRuleApi = new api.InboundSMSRulesApi("USERNAME", "API_KEY");

var inboundRuleId = 134750;

inboundSmsRuleApi.smsInboundAutomationGet(inboundRuleId).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::InboundSMSRulesApi.new

inbound_rule_id = 56 # Integer | Inbound rule id

begin
  # Get specific inbound sms automation
  result = api_instance.sms_inbound_automation_get(inbound_rule_id)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling InboundSMSRulesApi->sms_inbound_automation_get: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.InboundSMSRulesApi(clicksend_client.ApiClient(configuration))
inbound_rule_id = 136887 # int | Inbound rule id

try:
    # Get specific inbound sms automation
    api_response = api_instance.sms_inbound_automation_get(inbound_rule_id)
    print(api_response)
except ApiException as e:
    print("Exception when calling InboundSMSRulesApi->sms_inbound_automation_get: %s\n" % e)
use WWW::ClickSendClient::InboundSMSRulesApi;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::InboundSMSRulesApi->new(username => $username, password => $password);

my $json_output = $api->sms_inbound_automation_get('inbound_rule_id' => '123456');

print $json_output;
#import "CSInboundSmsRulesApi.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
[apiConfig setUsername:@"USERNAME"];
[apiConfig setPassword:@"PASSWORD"];

NSNumber *ruleId =[[NSNumber alloc] initWithInt:1];

CSInboundSMSRulesApi *inboundSmsRulesApiInstance = [[CSInboundSMSRulesApi alloc] init];
[inboundSmsRulesApiInstance smsInboundAutomationGetWithInboundRuleId:ruleId completionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire

if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}

InboundSMSRulesAPI.smsInboundAutomationGet(inboundRuleId: 0) { (dataString, error) in
    guard let dataString = dataString else {
        print(error!)
        return
    }
    if let data = dataString.data(using: String.Encoding.utf8) {
        do {
            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                print(dictonary)
            } else {
                print("Cannot convert the String value to JSON")
            }
        } catch let error as NSError {
            print(error)
        }
    }
}
    Coming Soon
package ClickSend;

import ClickSend.Api.InboundSmsRulesApi;

public class view_specific_sms_inbound_automation {
  public static void main(String[] args) {
    ApiClient defaultClient = new ApiClient();
    defaultClient.setUsername("USERNAME");
    defaultClient.setPassword("API_KEY");
    InboundSmsRulesApi apiInstance = new InboundSmsRulesApi(defaultClient);
    Integer inboundRuleId = 139860; // Integer | Inbound rule id
    try {
        String result = apiInstance.smsInboundAutomationGet(inboundRuleId);
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling InboundSmsRulesApi#smsInboundAutomationGet");
        e.printStackTrace();
    }
  }
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "Your inbound rule.",
  "data": {
    "inbound_rule_id": 1,
    "dedicated_number": "+61298441484",
    "rule_name": "My Rule",
    "message_search_type": 3,
    "message_search_term": null,
    "action": "EMAIL_FIXED",
    "action_address": "john@doe.com",
    "body": null,
    "enabled": 1
  }
}

https://rest.clicksend.com/v3/automations/sms/inbound/{inbound_rule_id}

Get specific inbound sms automation

Get specific inbound sms automation

Parameters

Parameter In Type Required Description
inbound_rule_id path integer(int32) true Inbound rule id

Refer to Status Codes for definitions of HTTP status code responses.

Update SMS Inbound Automation

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
     --request PUT \
     --header "Content-Type: application/json" \
     --data-binary "{
    \"dedicated_number\":\"+61298441484\",
    \"rule_name\":\"My Rule\",
    \"message_search_type\":3,
    \"message_search_term\":\"My Search Term\",
    \"action\":\"EMAIL_FIXED\",
    \"action_address\":\"john@doe.com\",
    \"enabled\":1,
    \"webhook_type\":\"json\"
}" \
'https://rest.clicksend.com/v3/automations/sms/inbound/{inbound_rule_id}'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\InboundSMSRulesApi(new GuzzleHttp\Client(),$config);
$inbound_rule_id = 149731; // int | Inbound rule id
// \ClickSend\Model\InboundSMSRule | Inbound sms rule model
$inbound_sms_rule = new \ClickSend\Model\InboundSMSRule(); 
$inbound_sms_rule->setDedicatedNumber("*");
$inbound_sms_rule->setRuleName("rule name");
$inbound_sms_rule->setMessageSearchType(3);
$inbound_sms_rule->setMessageSearchTerm("My Search Term");
$inbound_sms_rule->setAction("EMAIL_FIXED");
$inbound_sms_rule->setActionAddress("john@doe.com");
$inbound_sms_rule->setEnabled(1);

try {
    $result = $apiInstance->smsInboundAutomationPut($inbound_rule_id, $inbound_sms_rule);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling InboundSMSRulesApi->smsInboundAutomationPut: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME, 
    Password = API_KEY  
};
var inboundSMSRulesApi = new InboundSMSRulesApi(configuration);
var response = inboundSMSRulesApi.SmsInboundAutomationPut(RULE_ID, new InboundSMSRule(
    dedicatedNumber: "+11231231234",
    ruleName: "NEW RULE",
    messageSearchType: 3,
    messageSearchTerm: "My Search Term",
    action: "EMAIL_FIXED",
    actionAddress: "john@doe.com",
    enabled: 1
));
var api = require('./api.js');

var inboundSmsRuleApi = new api.InboundSMSRulesApi("USERNAME", "API_KEY");

var inboundRuleId =  148061;

var inboundSmsRule = new api.InboundSMSRule();

inboundSmsRule.dedicatedNumber = "*";
inboundSmsRule.ruleName = "Rule Name";
inboundSmsRule.messageSearchType = 3;
inboundSmsRule.messageSearchTerm = "My Search Term";
inboundSmsRule.action = "URL";
inboundSmsRule.actionAddress = "https://john@doe.com";
inboundSmsRule.enabled = 1;
inboundSmsRule.webhookType = "post";

inboundSmsRuleApi.smsInboundAutomationPut(inboundRuleId, inboundSmsRule).then(function(response) {
console.log(response.body);
}).catch(function(err){
console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::InboundSMSRulesApi.new

inbound_rule_id = 56 # Integer | Inbound rule id

# InboundSMSRule | Inbound sms rule model
inbound_sms_rule = ClickSendClient::InboundSMSRule.new(
  "message_search_type": 1,
  "message_search_term": "message_search_term",
  "action_address": "action_address",
  "dedicated_number": "dedicated_number",
  "rule_name": "rule_name",
  "action": "action",
  "enabled": 1
)

begin
  # Update inbound sms automation
  result = api_instance.sms_inbound_automation_put(inbound_rule_id, inbound_sms_rule)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling InboundSMSRulesApi->sms_inbound_automation_put: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.InboundSMSRulesApi(clicksend_client.ApiClient(configuration))
inbound_rule_id = 136887 # int | Inbound rule id
inbound_sms_rule = clicksend_client.InboundSMSRule(
                    dedicated_number="*",
                    rule_name="My Rule",
                    message_search_type=3,
                    message_search_term="My Search Term",
                    action="EMAIL_FIXED",
                    action_address="abc@doe.com",
                    enabled=1) # InboundSMSRule | Inbound sms rule model

try:
    # Update inbound sms automation
    api_response = api_instance.sms_inbound_automation_put(inbound_rule_id, inbound_sms_rule)
    print(api_response)
except ApiException as e:
    print("Exception when calling InboundSMSRulesApi->sms_inbound_automation_put: %s\n" % e)
use WWW::ClickSendClient::InboundSMSRulesApi;
use WWW::ClickSendClient::Object::InboundSMSRule;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::InboundSMSRulesApi->new(username => $username, password => $password);

my %params = (
    'dedicated_number'    => '+1111111111',
    'rule_name'           => 'rule_name',
    'message_search_type' => '1',
    'message_search_term' => 'message_search_term',
    'action'              => 'EMAIL_FIXED',
    'action_address'      => 'test1@test.com',  
    'enabled'             => '1'
);

my $inbound_sms_obj = WWW::ClickSendClient::Object::InboundSMSRule->new(%params);
my $json_output = $api->sms_inbound_automation_put('inbound_rule_id' => '12345','inbound_sms_rule' => $inbound_sms_obj);

print $json_output;
#import "CSInboundSmsRulesApi.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
[apiConfig setUsername:@"USERNAME"];
[apiConfig setPassword:@"PASSWORD"];

NSNumber *ruleId = [[NSNumber alloc] initWithInt:1];

CSInboundSMSRule *inboundSmsRule = [[CSInboundSMSRule alloc] init];
inboundSmsRule.dedicatedNumber = @"dedicated_number";
inboundSmsRule.ruleName = @"rule_name";
inboundSmsRule.messageSearchTerm = @"message_search_term";
inboundSmsRule.action = @"action";
inboundSmsRule.actionAddress = @"action_address";
inboundSmsRule.enabled = @(0);

CSInboundSMSRulesApi *inboundSmsRulesApiInstance = [[CSInboundSMSRulesApi alloc] init];
[inboundSmsRulesApiInstance smsInboundAutomationPutWithInboundRuleId:ruleId inboundSmsRule:inboundSmsRule completionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire

if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}

let inboundSmsRule = InboundSMSRule(dedicatedNumber: "dedicated_number",
                                    ruleName: "rule_name",
                                    messageSearchType: 0,
                                    messageSearchTerm: "message_search_term",
                                    action: "action",
                                    actionAddress: "action_address",
                                    enabled: 0)

InboundSMSRulesAPI.smsInboundAutomationPut(inboundRuleId: 1, inboundSmsRule: inboundSmsRule) { (dataString, error) in
    guard let dataString = dataString else {
        print(error!)
        return
    }
    if let data = dataString.data(using: String.Encoding.utf8) {
        do {
            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                print(dictonary)
            } else {
                print("Cannot convert the String value to JSON")
            }
        } catch let error as NSError {
        print(error)
        }
    }
}
    Coming Soon
package ClickSend;

import java.math.BigDecimal;
import ClickSend.Api.InboundSmsRulesApi;
import ClickSend.Model.InboundSMSRule;

public class update_sms_inbound_automation {
  public static void main(String[] args) {
    ApiClient defaultClient = new ApiClient();
    defaultClient.setUsername("USERNAME");
    defaultClient.setPassword("API_KEY");
    InboundSmsRulesApi apiInstance = new InboundSmsRulesApi(defaultClient);
    Integer inboundRuleId = 140979; // Integer | Inbound rule id
    // InboundSMSRule | Inbound sms rule model
    InboundSMSRule inboundSmsRule = new InboundSMSRule(); 
    inboundSmsRule.dedicatedNumber("*");
    inboundSmsRule.ruleName("rulename");
    inboundSmsRule.messageSearchTerm("messagesearchterm");
    inboundSmsRule.action("EMAIL_FIXED");
    inboundSmsRule.actionAddress("john@doe.com");
    inboundSmsRule.enabled(new BigDecimal(1));
    inboundSmsRule.messageSearchType(new BigDecimal(3));
    try {
        String result = apiInstance.smsInboundAutomationPut(inboundRuleId, inboundSmsRule);
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling InboundSmsRulesApi#smsInboundAutomationPut");
        e.printStackTrace();
    }
  }
}

Body parameter

{
  "message_search_type": 1,
  "message_search_term": "message_search_term",
  "action_address": "action_address",
  "dedicated_number": "dedicated_number",
  "rule_name": "rule_name",
  "action": "action",
  "enabled": 1
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "Your record has been updated.",
  "data": {
    "inbound_rule_id": 1,
    "dedicated_number": "+61298441484",
    "rule_name": "My Rule",
    "message_search_type": 3,
    "message_search_term": null,
    "action": "EMAIL_FIXED",
    "action_address": "john@doe.com",
    "body": null,
    "enabled": 1
  }
}

https://rest.clicksend.com/v3/automations/sms/inbound/{inbound_rule_id}

Update inbound sms automation

Update inbound sms automation

Parameters

Parameter In Type Required Description
inbound_rule_id path integer(int32) true Inbound rule id

Properties

Name Type Required Restrictions Description
dedicated_number string true none Dedicated Number. Can be '*' to apply to all numbers.
rule_name string true none Rule Name.
message_search_type number true none Message Search Type: 0=Any message, 1=starts with, 2=contains, 3=does not contain.
message_search_term string true none Message search term.
action string true none Action to be taken (AUTO_REPLY, EMAIL_USER, EMAIL_FIXED, URL, SMS, POLL, GROUP_SMS, MOVE_CONTACT, CREATE_CONTACT, CREATE_CONTACT_PLUS_EMAIL, CREATE_CONTACT_PLUS_NAME_EMAIL CREATE_CONTACT_PLUS_NAME, SMPP, NONE).
action_address string true none Action address.
enabled number true none Enabled: Disabled=0 or Enabled=1.
webhook_type string false URL action only Set as post, get, or json to change the format of the request sent.

Refer to Status Codes for definitions of HTTP status code responses.

Delete SMS Inbound Automation

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
     --request DELETE \
'https://rest.clicksend.com/v3/automations/sms/inbound/{inbound_rule_id}'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\InboundSMSRulesApi(new GuzzleHttp\Client(),$config);
$inbound_rule_id = 149731; // int | Inbound rule id

try {
    $result = $apiInstance->smsInboundAutomationDelete($inbound_rule_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling InboundSMSRulesApi->smsInboundAutomationDelete: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME, 
    Password = API_KEY  
};
var inboundSMSRulesApi = new InboundSMSRulesApi(configuration);
var response = inboundSMSRulesApi.SmsInboundAutomationDelete(RULE_ID);
var api = require('./api.js');

var inboundSmsRuleApi = new api.InboundSMSRulesApi("USERNAME", "API_KEY");

var inboundRuleId = 134750;

inboundSmsRuleApi.smsInboundAutomationDelete(inboundRuleId).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::InboundSMSRulesApi.new

inbound_rule_id = 56 # Integer | Inbound rule id

begin
  # Delete inbound sms automation
  result = api_instance.sms_inbound_automation_delete(inbound_rule_id)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling InboundSMSRulesApi->sms_inbound_automation_delete: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.InboundSMSRulesApi(clicksend_client.ApiClient(configuration))
inbound_rule_id = 136887 # int | Inbound rule id

try:
    # Delete inbound sms automation
    api_response = api_instance.sms_inbound_automation_delete(inbound_rule_id)
    print(api_response)
except ApiException as e:
    print("Exception when calling InboundSMSRulesApi->sms_inbound_automation_delete: %s\n" % e)
use WWW::ClickSendClient::InboundSMSRulesApi;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::InboundSMSRulesApi->new(username => $username, password => $password);

my $json_output = $api->sms_inbound_automation_delete('inbound_rule_id' => '123456');

print $json_output;
#import "CSInboundSmsRulesApi.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
[apiConfig setUsername:@"USERNAME"];
[apiConfig setPassword:@"PASSWORD"];

NSNumber *ruleId = [[NSNumber alloc] initWithInt:1];

CSInboundSMSRulesApi *inboundSmsRulesApiInstance = [[CSInboundSMSRulesApi alloc] init];
[inboundSmsRulesApiInstance smsInboundAutomationDeleteWithInboundRuleId:ruleId completionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire

if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}

InboundSMSRulesAPI.smsInboundAutomationDelete(inboundRuleId: 1) { (dataString, error) in
    guard let dataString = dataString else {
        print(error!)
        return
    }
    if let data = dataString.data(using: String.Encoding.utf8) {
        do {
            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                print(dictonary)
            } else {
                print("Cannot convert the String value to JSON")
            }
        } catch let error as NSError {
        print(error)
        }
    }
}
    Coming Soon
package ClickSend;

import ClickSend.Api.InboundSmsRulesApi;

public class delete_sms_inbound_automation {
  public static void main(String[] args) {
    ApiClient defaultClient = new ApiClient();
    defaultClient.setUsername("USERNAME");
    defaultClient.setPassword("API_KEY");
    InboundSmsRulesApi apiInstance = new InboundSmsRulesApi(defaultClient);
    Integer inboundRuleId = 139860; // Integer | Inbound rule id
    try {
        String result = apiInstance.smsInboundAutomationDelete(inboundRuleId);
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling InboundSmsRulesApi#smsInboundAutomationDelete");
        e.printStackTrace();
    }
  }
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "Your record has been deleted.",
  "data": []
}

https://rest.clicksend.com/v3/automations/sms/inbound/{inbound_rule_id}

Delete inbound sms automation

Delete inbound sms automation

Parameters

Parameter In Type Required Description
inbound_rule_id path integer(int32) true Inbound rule id

Refer to Status Codes for definitions of HTTP status code responses.

SMS Delivery Receipt Rules

Everything about SMS Delivery Receipt Automations

View SMS Delivery Receipt Rules

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
'https://rest.clicksend.com/v3/automations/sms/receipts'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\SMSDeliveryReceiptRulesApi(new GuzzleHttp\Client(),$config);
$q = "q_example"; // string | Your keyword or query.
$page = 1; // int | Page number
$limit = 10; // int | Number of records per page

try {
    $result = $apiInstance->smsDeliveryReceiptAutomationsGet($q, $page, $limit);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling SMSDeliveryReceiptRulesApi->smsDeliveryReceiptAutomationsGet: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME, 
    Password = API_KEY  
};
var smsDeliveryReceiptRulesApi = new SMSDeliveryReceiptRulesApi(configuration);
var response = smsDeliveryReceiptRulesApi.SmsDeliveryReceiptAutomationsGet();
var api = require('./api.js');

var smsDeliveryReceiptApi = new api.SMSDeliveryReceiptRulesApi("USERNAME", "API_KEY");

var q = "";
var page = 1;
var limit = 10;

smsDeliveryReceiptApi.smsDeliveryReceiptAutomationsGet(q, page, limit).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::SMSDeliveryReceiptRulesApi.new

opts = {
  page: 1,  # Integer | Page number
  limit: 10 # Integer | Number of records per page
}

begin
  # Get all sms delivery receipt automations
  result = api_instance.sms_delivery_receipt_automations_get(opts)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling SMSDeliveryReceiptRulesApi->sms_delivery_receipt_automations_get: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.SMSDeliveryReceiptRulesApi(clicksend_client.ApiClient(configuration))
page = 1 # int | Page number (optional) (default to 1)
limit = 10 # int | Number of records per page (optional) (default to 10)

try:
    # Get all sms delivery receipt automations
    api_response = api_instance.sms_delivery_receipt_automations_get(page=page, limit=limit)
    print(api_response)
except ApiException as e:
    print("Exception when calling SMSDeliveryReceiptRulesApi->sms_delivery_receipt_automations_get: %s\n" % e)
use WWW::ClickSendClient::SMSDeliveryReceiptRulesApi;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::SMSDeliveryReceiptRulesApi->new(username => $username, password => $password);

my $json_output = $api->sms_delivery_receipt_automations_get('page' => '1' ,'limit' => '10');

print $json_output;
#import "CSSMSDeliveryReceiptRulesApi.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
[apiConfig setUsername:@"USERNAME"];
[apiConfig setPassword:@"PASSWORD"];

NSNumber *page = [[NSNumber alloc] initWithInt:1];
NSNumber *limit = [[NSNumber alloc] initWithInt:15];

CSSMSDeliveryReceiptRulesApi *smsDeliveryReceiptRulesApiInstance = [[CSSMSDeliveryReceiptRulesApi alloc] init];
[smsDeliveryReceiptRulesApiInstance smsDeliveryReceiptAutomationsGetWithQ:@"q" page:page limit:limit completionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire

if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}

SMSDeliveryReceiptRulesAPI.smsDeliveryReceiptAutomationsGet(q: "q", page: 1, limit: 15) { (dataString, error) in
    guard let dataString = dataString else {
        print(error!)
        return
    }
    if let data = dataString.data(using: String.Encoding.utf8) {
        do {
            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                print(dictonary)
            } else {
                print("Cannot convert the String value to JSON")
            }
        } catch let error as NSError {
            print(error)
        }
    }
}
    Coming Soon
package ClickSend;

import ClickSend.Api.SmsDeliveryReceiptRulesApi;

public class view_all_sms_delivery_receipt_rule {
  public static void main(String[] args) {
    ApiClient defaultClient = new ApiClient();
    defaultClient.setUsername("USERNAME");
    defaultClient.setPassword("API_KEY");
    SmsDeliveryReceiptRulesApi apiInstance = new SmsDeliveryReceiptRulesApi(defaultClient);
    String q = "q_example"; // String | Your keyword or query.
    Integer page = 1; // Integer | Page number
    Integer limit = 10; // Integer | Number of records per page
    try {
      String result = apiInstance.smsDeliveryReceiptAutomationsGet(q, page, limit);
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling SmsDeliveryReceiptRulesApi#smsDeliveryReceiptAutomationsGet");
        e.printStackTrace();
    }
  }
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "Your list of rule incoming sms receipt.",
  "data": {
    "total": 5,
    "per_page": 15,
    "current_page": 1,
    "last_page": 1,
    "next_page_url": null,
    "prev_page_url": null,
    "from": 1,
    "to": 5,
    "data": [
      {
        "receipt_rule_id": 5,
        "rule_name": "My Rule",
        "match_type": 0,
        "action": "EMAIL_FIXED",
        "action_address": "john@doe.com",
        "enabled": 0
      },
      {
        "receipt_rule_id": 6,
        "rule_name": "My Rule",
        "match_type": 0,
        "action": "EMAIL_FIXED",
        "action_address": "john@doe.com",
        "enabled": 1
      },
      {
        "receipt_rule_id": 7,
        "rule_name": "My Rule",
        "match_type": 0,
        "action": "EMAIL_FIXED",
        "action_address": "john@doe.com",
        "enabled": 1
      },
      {
        "receipt_rule_id": 8,
        "rule_name": "My Rule",
        "match_type": 0,
        "action": "SMS",
        "action_address": "+61298441484",
        "enabled": 1
      },
      {
        "receipt_rule_id": 9,
        "rule_name": "My Rule",
        "match_type": 0,
        "action": "URL",
        "action_address": "+61298441485",
        "enabled": 1
      }
    ]
  }
}

https://rest.clicksend.com/v3/automations/sms/receipts

Get all sms delivery receipt automations

Get all sms delivery receipt automations

Parameters

Parameter In Type Required Description
page query integer(int32) false Page number
limit query integer(int32) false Number of records per page

Refer to Status Codes for definitions of HTTP status code responses.

Create SMS Delivery Receipt Rule

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
     --request POST \
     --header "Content-Type: application/json" \
     --data-binary "{
    \"rule_name\": \"My Rule\",
    \"match_type\": 3,
    \"action\": \"EMAIL_FIXED\",
    \"action_address\": \"john@doe.com\",
    \"enabled\": 1
}" \
'https://rest.clicksend.com/v3/automations/sms/receipts'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\SMSDeliveryReceiptRulesApi(new GuzzleHttp\Client(),$config);
// \ClickSend\Model\DeliveryReceiptRule | sms delivery receipt rule model
$delivery_receipt_rule = new \ClickSend\Model\DeliveryReceiptRule(); 
$delivery_receipt_rule->setRuleName("my rule");
$delivery_receipt_rule->setMatchType(0);
$delivery_receipt_rule->setAction("URL");
$delivery_receipt_rule->setActionAddress("http://example.com");
$delivery_receipt_rule->setEnabled(1);

try {
    $result = $apiInstance->smsDeliveryReceiptAutomationPost($delivery_receipt_rule);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling SMSDeliveryReceiptRulesApi->smsDeliveryReceiptAutomationPost: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME, 
    Password = API_KEY  
};
var smsDeliveryReceiptRulesApi = new SMSDeliveryReceiptRulesApi(configuration);
var response = smsDeliveryReceiptRulesApi.SmsDeliveryReceiptAutomationPost(new DeliveryReceiptRule(
    ruleName: "Rule Name",
    matchType: 1,
    action: "URL",
    actionAddress: "https://yourdomain.com",
    enabled: 1
));
var api = require('./api.js');

var smsDeliveryReceiptApi = new api.SMSDeliveryReceiptRulesApi("USERNAME", "API_KEY");

var deliveryReceiptRule = new api.DeliveryReceiptRule();

deliveryReceiptRule.ruleName = "My rule";
deliveryReceiptRule.matchType = 1;
deliveryReceiptRule.action = "EMAIL_FIXED";
deliveryReceiptRule.actionAddress = "john@doe.com";
deliveryReceiptRule.enabled = 1;

smsDeliveryReceiptApi.smsDeliveryReceiptAutomationPost(deliveryReceiptRule).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::SMSDeliveryReceiptRulesApi.new

# DeliveryReceiptRule | fax delivery receipt rule model
delivery_receipt_rule = ClickSendClient::DeliveryReceiptRule.new(
  "rule_name": "rule_name",
  "match_type": 1,
  "action": "action",
  "action_address": "action_address",
  "enabled": 1
)

begin
  # Create sms delivery receipt automations
  result = api_instance.sms_delivery_receipt_automation_post(delivery_receipt_rule)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling SMSDeliveryReceiptRulesApi->sms_delivery_receipt_automation_post: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.SMSDeliveryReceiptRulesApi(clicksend_client.ApiClient(configuration))
# DeliveryReceiptRule | sms delivery receipt rule model
delivery_receipt_rule = clicksend_client.DeliveryReceiptRule(
                        rule_name="My Rule",
                        match_type= 1,
                        action="EMAIL_FIXED",
                        action_address="john@doe.com",
                        enabled= 1)


try:
    # Create sms delivery receipt automations
    api_response = api_instance.sms_delivery_receipt_automation_post(delivery_receipt_rule)
    print(api_response)
except ApiException as e:
    print("Exception when calling SMSDeliveryReceiptRulesApi->sms_delivery_receipt_automation_post: %s\n" % e)
use WWW::ClickSendClient::SMSDeliveryReceiptRulesApi;
use WWW::ClickSendClient::Object::DeliveryReceiptRule;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::SMSDeliveryReceiptRulesApi->new(username => $username, password => $password);

my %params = (
    'rule_name'      => 'rule_name',
    'match_type'     => '1',
    'action'         => 'EMAIL_FIXED',
    'action_address' => 'test1@test.com',
    'enabled'        => '0'
);

my $sms_delivery_obj = WWW::ClickSendClient::Object::DeliveryReceiptRule->new(%params);
my $json_output = $api->sms_delivery_receipt_automation_post('delivery_receipt_rule' => $sms_delivery_obj);

print $json_output;
#import "CSSMSDeliveryReceiptRulesApi.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
[apiConfig setUsername:@"USERNAME"];
[apiConfig setPassword:@"PASSWORD"];

CSDeliveryReceiptRule *deliveryReceiptRule = [[CSDeliveryReceiptRule alloc] init];
deliveryReceiptRule.ruleName = @"rule_name";
deliveryReceiptRule.matchType = @(0);
deliveryReceiptRule.action = @"actiion";
deliveryReceiptRule.actionAddress = @"action_address";
deliveryReceiptRule.enabled = @(0);

CSSMSDeliveryReceiptRulesApi *smsDeliveryReceiptRulesApiInstance = [[CSSMSDeliveryReceiptRulesApi alloc] init];
[smsDeliveryReceiptRulesApiInstance smsDeliveryReceiptAutomationPostWithDeliveryReceiptRule:deliveryReceiptRule completionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire

if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}
let deliveryReceiptRule = DeliveryReceiptRule(ruleName: "rule_name",
                                              matchType: 0,
                                              action: "action",
                                              actionAddress: "action_address",
                                              enabled: 0)

SMSDeliveryReceiptRulesAPI.smsDeliveryReceiptAutomationPost(deliveryReceiptRule: deliveryReceiptRule) { (dataString, error) in
    guard let dataString = dataString else {
        print(error!)
        return
    }
    if let data = dataString.data(using: String.Encoding.utf8) {
        do {
            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                print(dictonary)
            } else {
                print("Cannot convert the String value to JSON")
            }
        } catch let error as NSError {
            print(error)
        }
    }
}
    Coming Soon
package ClickSend;

import java.math.BigDecimal;
import ClickSend.Api.SmsDeliveryReceiptRulesApi;
import ClickSend.Model.DeliveryReceiptRule;

public class create_sms_delivery_receipt_rule {
  public static void main(String[] args) {
    ApiClient defaultClient = new ApiClient();
    defaultClient.setUsername("USERNAME");
    defaultClient.setPassword("API_KEY");
    SmsDeliveryReceiptRulesApi apiInstance = new SmsDeliveryReceiptRulesApi(defaultClient);
    // DeliveryReceiptRule | sms delivery receipt rule model
    DeliveryReceiptRule deliveryReceiptRule = new DeliveryReceiptRule(); 
    deliveryReceiptRule.ruleName("new rule");
    deliveryReceiptRule.matchType(new BigDecimal(1.25));
    deliveryReceiptRule.action("EMAIL_FIXED");
    deliveryReceiptRule.actionAddress("xxx@gmail.com");
    deliveryReceiptRule.enabled(new BigDecimal(1));
    try {
        String result = apiInstance.smsDeliveryReceiptAutomationPost(deliveryReceiptRule);
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling SmsDeliveryReceiptRulesApi#smsDeliveryReceiptAutomationPost");
        e.printStackTrace();
    }
  }
}

Body parameter

{
  "action_address": "action_address",
  "rule_name": "rule_name",
  "match_type": 1,
  "action": "action",
  "enabled": 1
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "Your new SMS receipt has been added.",
  "data": {
    "receipt_rule_id": 10,
    "rule_name": "My Rule",
    "match_type": 3,
    "action": "EMAIL_FIXED",
    "action_address": "john@doe.com",
    "enabled": 1
  }
}

https://rest.clicksend.com/v3/automations/sms/receipts

Create sms delivery receipt automations

Create sms delivery receipt automations

Properties

Name Type Required Restrictions Description
rule_name string true none Rule Name.
match_type number true none Match Type. 0=All reports.
action string true none Action to be taken (AUTO_REPLY, EMAIL_USER, EMAIL_FIXED, URL, SMS, POLL, GROUP_SMS, MOVE_CONTACT, CREATE_CONTACT, CREATE_CONTACT_PLUS_EMAIL, CREATE_CONTACT_PLUS_NAME_EMAIL CREATE_CONTACT_PLUS_NAME, SMPP, NONE).
action_address string true none Action address.
enabled number true none Enabled: Disabled=0 or Enabled=1.

Refer to Status Codes for definitions of HTTP status code responses.

View SMS Delivery Receipt Rule

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
'https://rest.clicksend.com/v3/automations/sms/receipts/{receipt_rule_id}'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\SMSDeliveryReceiptRulesApi(new GuzzleHttp\Client(),$config);
$receipt_rule_id = 5334; // int | Receipt rule id

try {
    $result = $apiInstance->smsDeliveryReceiptAutomationGet($receipt_rule_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling SMSDeliveryReceiptRulesApi->smsDeliveryReceiptAutomationGet: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME, 
    Password = API_KEY  
};
var smsDeliveryReceiptRulesApi = new SMSDeliveryReceiptRulesApi(configuration);
var response = smsDeliveryReceiptRulesApi.SmsDeliveryReceiptAutomationGet(RULE_ID);
var api = require('./api.js');

var smsDeliveryReceiptApi = new api.SMSDeliveryReceiptRulesApi("USERNAME", "API_KEY");

var receiptRuleId = 5314;

smsDeliveryReceiptApi.smsDeliveryReceiptAutomationGet(receiptRuleId).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::SMSDeliveryReceiptRulesApi.new

receipt_rule_id = 56 # Integer | Receipt rule id

begin
  # Get specific sms delivery receipt automation
  result = api_instance.sms_delivery_receipt_automation_get(receipt_rule_id)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling SMSDeliveryReceiptRulesApi->sms_delivery_receipt_automation_get: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.SMSDeliveryReceiptRulesApi(clicksend_client.ApiClient(configuration))
receipt_rule_id = 5254 # int | Receipt rule id

try:
    # Get specific sms delivery receipt automation
    api_response = api_instance.sms_delivery_receipt_automation_get(receipt_rule_id)
    print(api_response)
except ApiException as e:
    print("Exception when calling SMSDeliveryReceiptRulesApi->sms_delivery_receipt_automation_get: %s\n" % e)
use WWW::ClickSendClient::SMSDeliveryReceiptRulesApi;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::SMSDeliveryReceiptRulesApi->new(username => $username, password => $password);

my $json_output = $api->sms_delivery_receipt_automation_get('receipt_rule_id' => '1234');

print $json_output;
#import "CSSMSDeliveryReceiptRulesApi.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
[apiConfig setUsername:@"USERNAME"];
[apiConfig setPassword:@"PASSWORD"];

NSNumber *receiptRuleId = [[NSNumber alloc] initWithInt:1];

CSSMSDeliveryReceiptRulesApi *smsDeliveryReceiptRulesApiInstance = [[CSSMSDeliveryReceiptRulesApi alloc] init];
[smsDeliveryReceiptRulesApiInstance smsDeliveryReceiptAutomationGetWithReceiptRuleId:receiptRuleId completionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire

if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}

SMSDeliveryReceiptRulesAPI.smsDeliveryReceiptAutomationGet(receiptRuleId: 1) { (dataString, error) in
    guard let dataString = dataString else {
        print(error!)
        return
    }
    if let data = dataString.data(using: String.Encoding.utf8) {
        do {
            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                print(dictonary)
            } else {
                print("Cannot convert the String value to JSON")
            }
        } catch let error as NSError {
            print(error)
        }
    }
}
    Coming Soon
package ClickSend;

import ClickSend.Api.SmsDeliveryReceiptRulesApi;

public class view_specific_sms_delivery_receipt_rule {
  public static void main(String[] args) {
    ApiClient defaultClient = new ApiClient();
    defaultClient.setUsername("USERNAME");
    defaultClient.setPassword("API_KEY");
    SmsDeliveryReceiptRulesApi apiInstance = new SmsDeliveryReceiptRulesApi(defaultClient);
    Integer receiptRuleId = 5271; // Integer | Receipt rule id
    try {
        String result = apiInstance.smsDeliveryReceiptAutomationGet(receiptRuleId);
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling SmsDeliveryReceiptRulesApi#smsDeliveryReceiptAutomationGet");
        e.printStackTrace();
    }
  }
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "Your rule incoming voice receipt.",
  "data": {
    "receipt_rule_id": 6,
    "rule_name": "My Rule",
    "match_type": 0,
    "action": "EMAIL_FIXED",
    "action_address": "john@doe.com",
    "enabled": 1
  }
}

https://rest.clicksend.com/v3/automations/sms/receipts/{receipt_rule_id}

Get specific sms delivery receipt automation

Get specific sms delivery receipt automation

Parameters

Parameter In Type Required Description
receipt_rule_id path integer(int32) true Receipt rule id

Refer to Status Codes for definitions of HTTP status code responses.

Update SMS Delivery Receipt Rule

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
     --request PUT \
     --header "Content-Type: application/json" \
     --data-binary "{
    \"rule_name\": \"My Rule\",
    \"match_type\": 3,
    \"action\": \"EMAIL_FIXED\",
    \"action_address\": \"john@doe.com\",
    \"enabled\": 1
}" \
'https://rest.clicksend.com/v3/automations/sms/receipts/{receipt_rule_id}'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\SMSDeliveryReceiptRulesApi(new GuzzleHttp\Client(),$config);
$receipt_rule_id = 5334; // int | Receipt rule id
// \ClickSend\Model\DeliveryReceiptRule | Delivery receipt rule model
$delivery_receipt_rule = new \ClickSend\Model\DeliveryReceiptRule(); 
$delivery_receipt_rule->setRuleName("my rule");
$delivery_receipt_rule->setMatchType(0);
$delivery_receipt_rule->setAction("URL");
$delivery_receipt_rule->setActionAddress("http://example.com");
$delivery_receipt_rule->setEnabled(1);

try {
    $result = $apiInstance->smsDeliveryReceiptAutomationPut($receipt_rule_id, $delivery_receipt_rule);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling SMSDeliveryReceiptRulesApi->smsDeliveryReceiptAutomationPut: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME, 
    Password = API_KEY  
};
var smsDeliveryReceiptRulesApi = new SMSDeliveryReceiptRulesApi(configuration);
var response = smsDeliveryReceiptRulesApi.SmsDeliveryReceiptAutomationPut(RULE_ID, new DeliveryReceiptRule( 
    ruleName: "Rule Name",
    matchType: 1,
    action: "URL",
    actionAddress: "https://yourdomain.com",
    enabled: 1
});
var api = require('./api.js');

var smsDeliveryReceiptApi = new api.SMSDeliveryReceiptRulesApi("USERNAME", "API_KEY");

var receiptRuleId = 5314;

var deliveryReceiptRule = new api.DeliveryReceiptRule();

deliveryReceiptRule.ruleName = "My rule";
deliveryReceiptRule.matchType = 1;
deliveryReceiptRule.action = "EMAIL_FIXED";
deliveryReceiptRule.actionAddress = "john@doe.com";
deliveryReceiptRule.enabled = 1;

smsDeliveryReceiptApi.smsDeliveryReceiptAutomationPut(receiptRuleId, deliveryReceiptRule).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::SMSDeliveryReceiptRulesApi.new

receipt_rule_id = 56 # Integer | Receipt rule id

# DeliveryReceiptRule | fax delivery receipt rule model
delivery_receipt_rule = ClickSendClient::DeliveryReceiptRule.new(
  "rule_name": "rule_name",
  "match_type": 1,
  "action": "action",
  "action_address": "action_address",
  "enabled": 1
)

begin
  # Update sms delivery receipt automation
  result = api_instance.sms_delivery_receipt_automation_put(receipt_rule_id, delivery_receipt_rule)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling SMSDeliveryReceiptRulesApi->sms_delivery_receipt_automation_put: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.SMSDeliveryReceiptRulesApi(clicksend_client.ApiClient(configuration))
receipt_rule_id = 5254 # int | Receipt rule id
# DeliveryReceiptRule | Delivery receipt rule model
delivery_receipt_rule = clicksend_client.DeliveryReceiptRule(
                        rule_name="update rule",
                        match_type= 1,
                        action="EMAIL_FIXED",
                        action_address="abc@doe.com",
                        enabled= 1)

try:
    # Update sms delivery receipt automation
    api_response = api_instance.sms_delivery_receipt_automation_put(receipt_rule_id, delivery_receipt_rule)
    print(api_response)
except ApiException as e:
    print("Exception when calling SMSDeliveryReceiptRulesApi->sms_delivery_receipt_automation_put: %s\n" % e)
use WWW::ClickSendClient::SMSDeliveryReceiptRulesApi;
use WWW::ClickSendClient::Object::DeliveryReceiptRule;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::SMSDeliveryReceiptRulesApi->new(username => $username, password => $password);

my %params = (
    'rule_name'      => 'rule_name',
    'match_type'     => '1',
    'action'         => 'EMAIL_FIXED',
    'action_address' => 'test1@test.com',
    'enabled'        => '0'
);

my $sms_delivery_obj = WWW::ClickSendClient::Object::DeliveryReceiptRule->new(%params);

my $json_output = $api->sms_delivery_receipt_automation_put('receipt_rule_id' => '1234','delivery_receipt_rule' => $sms_delivery_obj);

print $json_output;
#import "CSSMSDeliveryReceiptRulesApi.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
[apiConfig setUsername:@"USERNAME"];
[apiConfig setPassword:@"PASSWORD"];

NSNumber *receiptRuleId = [[NSNumber alloc] initWithInt:1];

CSDeliveryReceiptRule *deliveryReceipt = [[CSDeliveryReceiptRule alloc] init];
deliveryReceipt.ruleName = @"rule_name";
deliveryReceipt.matchType = @(0);
deliveryReceipt.action = @"action";
deliveryReceipt.actionAddress = @"action_address";
deliveryReceipt.enabled = @(0);

CSSMSDeliveryReceiptRulesApi *smsDeliveryReceiptRulesApiInstance = [[CSSMSDeliveryReceiptRulesApi alloc] init];
[smsDeliveryReceiptRulesApiInstance smsDeliveryReceiptAutomationPutWithReceiptRuleId:receiptRuleId deliveryReceiptRule:deliveryReceipt completionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire

if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}

let deliveryReceiptRule = DeliveryReceiptRule(ruleName: "rule_name",
                                              matchType: 0,
                                              action: "action",
                                              actionAddress: "action_address",
                                              enabled: 0)

SMSDeliveryReceiptRulesAPI.smsDeliveryReceiptAutomationPut(receiptRuleId: 1, deliveryReceiptRule: deliveryReceiptRule) { (dataString, error) in
    guard let dataString = dataString else {
        print(error!)
        return
    }
    if let data = dataString.data(using: String.Encoding.utf8) {
        do {
            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                print(dictonary)
            } else {
                print("Cannot convert the String value to JSON")
            }
        } catch let error as NSError {
            print(error)
        }
    }
}
    Coming Soon
package ClickSend;

import java.math.BigDecimal;
import ClickSend.Api.SmsDeliveryReceiptRulesApi;
import ClickSend.Model.DeliveryReceiptRule;

public class update_sms_delivery_receipt_rule {
  public static void main(String[] args) {
    ApiClient defaultClient = new ApiClient();
    defaultClient.setUsername("USERNAME");
    defaultClient.setPassword("API_KEY");
    SmsDeliveryReceiptRulesApi apiInstance = new SmsDeliveryReceiptRulesApi(defaultClient);
    Integer receiptRuleId = 5279; // Integer | Receipt rule id
    // DeliveryReceiptRule | Delivery receipt rule model
    DeliveryReceiptRule deliveryReceiptRule = new DeliveryReceiptRule(); 
    deliveryReceiptRule.ruleName("updated rule");
    deliveryReceiptRule.matchType(new BigDecimal(1.25));
    deliveryReceiptRule.action("EMAIL_FIXED");
    deliveryReceiptRule.actionAddress("xxx@gmail.com");
    deliveryReceiptRule.enabled(new BigDecimal(1));
    try {
        String result = apiInstance.smsDeliveryReceiptAutomationPut(receiptRuleId, deliveryReceiptRule);
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling SmsDeliveryReceiptRulesApi#smsDeliveryReceiptAutomationPut");
        e.printStackTrace();
    }
  }
}

Body parameter

{
  "action_address": "action_address",
  "rule_name": "rule_name",
  "match_type": 1,
  "action": "action",
  "enabled": 1
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "Your rule incoming sms receipt has been updated.",
  "data": {
    "receipt_rule_id": 7,
    "rule_name": "My Rule",
    "match_type": 0,
    "action": "EMAIL_FIXED",
    "action_address": "john@doe.com",
    "enabled": 1
  }
}

https://rest.clicksend.com/v3/automations/sms/receipts/{receipt_rule_id}

Update sms delivery receipt automation

Update sms delivery receipt automation

Parameters

Parameter In Type Required Description
receipt_rule_id path integer(int32) true Receipt rule id

Properties

Name Type Required Restrictions Description
rule_name string true none Rule Name.
match_type number true none Match Type. 0=All reports.
action string true none Action to be taken (AUTO_REPLY, EMAIL_USER, EMAIL_FIXED, URL, SMS, POLL, GROUP_SMS, MOVE_CONTACT, CREATE_CONTACT, CREATE_CONTACT_PLUS_EMAIL, CREATE_CONTACT_PLUS_NAME_EMAIL CREATE_CONTACT_PLUS_NAME, SMPP, NONE).
action_address string true none Action address.
enabled number true none Enabled: Disabled=0 or Enabled=1.

Refer to Status Codes for definitions of HTTP status code responses.

Delete SMS Delivery Receipt Rule

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
     --request DELETE \
'https://rest.clicksend.com/v3/automations/sms/receipts/{receipt_rule_id}'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\SMSDeliveryReceiptRulesApi(new GuzzleHttp\Client(),$config);
$receipt_rule_id = 5334; // int | Receipt rule id

try {
    $result = $apiInstance->smsDeliveryReceiptAutomationDelete($receipt_rule_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling SMSDeliveryReceiptRulesApi->smsDeliveryReceiptAutomationDelete: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME, 
    Password = API_KEY  
};
var smsDeliveryReceiptRulesApi = new SMSDeliveryReceiptRulesApi(configuration);
var response = smsDeliveryReceiptRulesApi.SmsDeliveryReceiptAutomationDelete(RULE_ID);
var api = require('./api.js');

var smsDeliveryReceiptApi = new api.SMSDeliveryReceiptRulesApi("USERNAME", "API_KEY");

var receiptRuleId = 5314;

smsDeliveryReceiptApi.smsDeliveryReceiptAutomationDelete(receiptRuleId).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::SMSDeliveryReceiptRulesApi.new

receipt_rule_id = 56 # Integer | Receipt rule id

begin
  # Delete sms delivery receipt automation
  result = api_instance.sms_delivery_receipt_automation_delete(receipt_rule_id)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling SMSDeliveryReceiptRulesApi->sms_delivery_receipt_automation_delete: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.SMSDeliveryReceiptRulesApi(clicksend_client.ApiClient(configuration))
receipt_rule_id = 5254 # int | Receipt rule id

try:
    # Delete sms delivery receipt automation
    api_response = api_instance.sms_delivery_receipt_automation_delete(receipt_rule_id)
    print(api_response)
except ApiException as e:
    print("Exception when calling SMSDeliveryReceiptRulesApi->sms_delivery_receipt_automation_delete: %s\n" % e)
use WWW::ClickSendClient::SMSDeliveryReceiptRulesApi;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::SMSDeliveryReceiptRulesApi->new(username => $username, password => $password);

my $json_output = $api->sms_delivery_receipt_automation_delete('receipt_rule_id' => '1234');

print $json_output;
#import "CSSMSDeliveryReceiptRulesApi.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
[apiConfig setUsername:@"USERNAME"];
[apiConfig setPassword:@"PASSWORD"];

NSNumber *ruleId = [[NSNumber alloc] initWithInt:1];

CSSMSDeliveryReceiptRulesApi *smsDeliveryReceiptRulesApiInstance = [[CSSMSDeliveryReceiptRulesApi alloc] init];
[smsDeliveryReceiptRulesApiInstance smsDeliveryReceiptAutomationDeleteWithReceiptRuleId:ruleId completionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire

if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}

SMSDeliveryReceiptRulesAPI.smsDeliveryReceiptAutomationDelete(receiptRuleId: 1) { (dataString, error) in
    guard let dataString = dataString else {
        print(error!)
        return
    }
    if let data = dataString.data(using: String.Encoding.utf8) {
        do {
            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                print(dictonary)
            } else {
                print("Cannot convert the String value to JSON")
            }
        } catch let error as NSError {
            print(error)
        }
    }
}
    Coming Soon
package ClickSend;

import ClickSend.Api.SmsDeliveryReceiptRulesApi;

public class delete_sms_delivery_receipt_rule {
  public static void main(String[] args) {
    ApiClient defaultClient = new ApiClient();
    defaultClient.setUsername("USERNAME");
    defaultClient.setPassword("API_KEY");
    SmsDeliveryReceiptRulesApi apiInstance = new SmsDeliveryReceiptRulesApi(defaultClient);
    Integer receiptRuleId = 5278; // Integer | Receipt rule id
    try {
        String result = apiInstance.smsDeliveryReceiptAutomationDelete(receiptRuleId);
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling SmsDeliveryReceiptRulesApi#smsDeliveryReceiptAutomationDelete");
        e.printStackTrace();
    }
  }
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "Your rule incoming sms receipt has been deleted.",
  "data": []
}

https://rest.clicksend.com/v3/automations/sms/receipts/{receipt_rule_id}

Delete sms delivery receipt automation

Delete sms delivery receipt automation

Parameters

Parameter In Type Required Description
receipt_rule_id path integer(int32) true Receipt rule id

Refer to Status Codes for definitions of HTTP status code responses.

Statistics

Everything about account statistics

View Voice Statistics

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \

'https://rest.clicksend.com/v3/statistics/voice'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\StatisticsApi(new GuzzleHttp\Client(),$config);

try {
    $result = $apiInstance->statisticsVoiceGet();
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling StatisticsApi->statisticsVoiceGet: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME, 
    Password = API_KEY  
};
var statisticsApi = new StatisticsApi(configuration);
var response = statisticsApi.StatisticsVoiceGet();
var api = require('./api.js');

var statisticsApi = new api.StatisticsApi("USERNAME", "API_KEY");

statisticsApi.statisticsVoiceGet().then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::StatisticsApi.new

begin
  # Get voice statistics
  result = api_instance.statistics_voice_get
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling StatisticsApi->statistics_voice_get: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.StatisticsApi(clicksend_client.ApiClient(configuration))

try:
    # Get voice statistics
    api_response = api_instance.statistics_voice_get()
    print(api_response)
except ApiException as e:
    print("Exception when calling StatisticsApi->statistics_voice_get: %s\n" % e)
use WWW::ClickSendClient::StatisticsApi;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::StatisticsApi->new(username => $username, password => $password);

my $json_output = $api->statistics_voice_get();

print $json_output;
#import "CSStatisticsApi.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
[apiConfig setUsername:@"USERNAME"];
[apiConfig setPassword:@"PASSWORD"];

CSStatisticsApi *statisticsApiInstance = [[CSStatisticsApi alloc] init];
[statisticsApiInstance statisticsVoiceGetWithCompletionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire

if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}
StatisticsAPI.statisticsVoiceGet { (dataString, error) in
    guard let dataString = dataString else {
        print(error!)
        return
    }
    if let data = dataString.data(using: String.Encoding.utf8) {
        do {
            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                print(dictonary)
            } else {
                print("Cannot convert the String value to JSON")
            }
        } catch let error as NSError {
            print(error)
        }
    }
}
    Coming Soon
package ClickSend;

import ClickSend.Api.StatisticsApi;

public class view_voice_statistics {
  public static void main(String[] args) {
    ApiClient defaultClient = new ApiClient();
    defaultClient.setUsername("USERNAME");
    defaultClient.setPassword("API_KEY");
    StatisticsApi apiInstance = new StatisticsApi(defaultClient);
    try {
        String result = apiInstance.statisticsVoiceGet();
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling StatisticsApi#statisticsVoiceGet");
        e.printStackTrace();
    }
  }
}

Response


{  
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "Here are your statistics.",
  "data": {
    "total": {
      "outbound": {
        "count": 1,
        "price": 0
      },
      "bounced": {
        "count": 0
      }
    },
    "stats": [
      {
        "date": 1441065600,
        "outbound": {
          "count": 0,
          "price": 0
        },
        "bounced": {
          "count": 0
        }
      }
    ],
    "_currency": {
      "currency_name_short": "USD",
      "currency_prefix_d": "$",
      "currency_prefix_c": "¢",
      "currency_name_long": "US Dollars"
    }
  }
}

https://rest.clicksend.com/v3/statistics/voice

Get voice statistics

Refer to Status Codes for definitions of HTTP status code responses.

View SMS Statistics

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \

'https://rest.clicksend.com/v3/statistics/sms'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\StatisticsApi(new GuzzleHttp\Client(),$config);

try {
    $result = $apiInstance->statisticsSmsGet();
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling StatisticsApi->statisticsSmsGet: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME, 
    Password = API_KEY  
};
var statisticsApi = new StatisticsApi(configuration);
var response = statisticsApi.StatisticsSmsGet();
var api = require('./api.js');

var statisticsApi = new api.StatisticsApi("USERNAME", "API_KEY");

statisticsApi.statisticsSmsGet().then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::StatisticsApi.new

begin
  # Get sms statistics
  result = api_instance.statistics_sms_get
  p result
rescue ClickSendClient::ApiError => e
  puts "Exception when calling StatisticsApi->statistics_sms_get: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.StatisticsApi(clicksend_client.ApiClient(configuration))

try:
    # Get sms statistics
    api_response = api_instance.statistics_sms_get()
    print(api_response)
except ApiException as e:
    print("Exception when calling StatisticsApi->statistics_sms_get: %s\n" % e)
use WWW::ClickSendClient::StatisticsApi;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::StatisticsApi->new(username => $username, password => $password);

my $json_output = $api->statistics_sms_get();

print $json_output;
#import "CSStatisticsApi.h"
#import "CSDefaultConfiguration.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
[apiConfig setUsername:@"USERNAME"];
[apiConfig setPassword:@"PASSWORD"];

CSStatisticsApi *statisticsApiInstance = [[CSStatisticsApi alloc] init];
[statisticsApiInstance statisticsSmsGetWithCompletionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire

if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}
StatisticsAPI.statisticsSmsGet { (dataString, error) in
    guard let dataString = dataString else {
        print(error!)
        return
    }
    if let data = dataString.data(using: String.Encoding.utf8) {
        do {
            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                print(dictonary)
            } else {
                print("Cannot convert the String value to JSON")
            }
        } catch let error as NSError {
            print(error)
        }
    }
}
    Coming Soon
package ClickSend;

import ClickSend.Api.StatisticsApi;

public class view_sms_statistics {
   public static void main(String[] args) {
      ApiClient defaultClient = new ApiClient();
      defaultClient.setUsername("USERNAME");
      defaultClient.setPassword("API_KEY");
      StatisticsApi apiInstance = new StatisticsApi(defaultClient);
      try {
          String result = apiInstance.statisticsSmsGet();
          System.out.println(result);
      } catch (ApiException e) {
          System.err.println("Exception when calling StatisticsApi#statisticsSmsGet");
          e.printStackTrace();
      }
   }
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "Here are your data.",
  "data": {
    "total": {
      "outbound": {
        "count": 1,
        "price": 5.81
      },
      "inbound": {
        "count": 0
      },
      "bounced": {
        "count": 0
      }
    },
    "stat": [
      {
        "date": 1436918400,
        "outbound": {
          "count": 83,
          "price": 5.81
        },
        "inbound": {
          "count": 0
        },
        "bounced": {
          "count": 0
        }
      }
    ],
    "_currency": {
      "currency_name_short": "AUD",
      "currency_prefix_d": "$",
      "currency_prefix_c": "c",
      "currency_name_long": "Australian Dollars"
    }
  }
}

https://rest.clicksend.com/v3/statistics/sms

Get sms statistics

Refer to Status Codes for definitions of HTTP status code responses.

Subaccount

Everything about Subaccounts

View Subaccounts

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \

'https://rest.clicksend.com/v3/subaccounts'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\SubaccountApi(new GuzzleHttp\Client(),$config);
$page = 1; // int | Page number
$limit = 10; // int | Number of records per page

try {
    $result = $apiInstance->subaccountsGet($page, $limit);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling SubaccountApi->subaccountsGet: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME, 
    Password = API_KEY  
};
var subaccountApi = new SubaccountApi(configuration);
var response = subaccountApi.SubaccountsGet();
var api = require('./api.js');

var subaccountApi = new api.SubaccountApi("USERNAME", "API_KEY");

var page = 1;
var limit = 10;

subaccountApi.subaccountsGet(page, limit).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::SubaccountApi.new

opts = {
  page: 1,  # Integer | Page number
  limit: 10 # Integer | Number of records per page
}

begin
  # Get all subaccounts
  result = api_instance.subaccounts_get(opts)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling SubaccountApi->subaccounts_get: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.SubaccountApi(clicksend_client.ApiClient(configuration))
page = 1 # int | Page number (optional) (default to 1)
limit = 10 # int | Number of records per page (optional) (default to 10)

try:
    # Get all subaccounts
    api_response = api_instance.subaccounts_get(page=page, limit=limit)
    print(api_response)
except ApiException as e:
    print("Exception when calling SubaccountApi->subaccounts_get: %s\n" % e)
use WWW::ClickSendClient::SubaccountApi;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::SubaccountApi->new(username => $username, password => $password);

my $json_output = $api->subaccounts_get('page' => '1' ,'limit' => '10' );

print $json_output;
#import "CSSubaccountApi.h"
#import "CSDefaultConfiguration.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
// Configure HTTP basic authorization (authentication scheme: BasicAuth)
[apiConfig setUsername:@"USERNAME"];
[apiConfig setPassword:@"PASSWORD"];

CSSubaccountApi *subaccountApi = [[CSSubaccountApi alloc] init];
[subaccountApi subaccountsGetWithPage:@(1) limit:@(15) completionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire
if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}

SubaccountAPI.subaccountsGet { (dataString, error) in
    if let error = error {
        print(error)
    } else {
        if let data = dataString!.data(using: String.Encoding.utf8) {
            do {
                if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                    print(dictonary)
                } else {
                    print("Cannot convert the String value to JSON")
                }
            } catch let error as NSError {
                print(error)
            }
        }
    }
}
    Coming Soon
package ClickSend;

import ClickSend.Api.SubaccountApi;

public class view_all_subaccount {
   public static void main(String[] args) {
      ApiClient defaultClient = new ApiClient();
      defaultClient.setUsername("USERNAME");
      defaultClient.setPassword("API_KEY");
      SubaccountApi apiInstance = new SubaccountApi(defaultClient);
      Integer page = 1; // Integer | Page number
      Integer limit = 10; // Integer | Number of records per page
      try {
          String result = apiInstance.subaccountsGet(page, limit);
          System.out.println(result);
      } catch (ApiException e) {
          System.err.println("Exception when calling SubaccountApi#subaccountsGet");
          e.printStackTrace();
      }
   }
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "SUCCESS",
  "data": {
    "total": 1,
    "per_page": 15,
    "current_page": 1,
    "last_page": 1,
    "next_page_url": null,
    "prev_page_url": null,
    "from": 1,
    "to": 1,
    "data": [
      {
        "subaccount_id": 1,
        "api_username": "johndoe",
        "email": "john@doe.com",
        "phone_number": "+13523944199",
        "first_name": "John",
        "last_name": "Doe",
        "api_key": "E72D09F6-AC80-0A5C-F7F0-1A244A377A5C",
        "access_users": 1,
        "access_billing": 1,
        "access_reporting": 1,
        "access_contacts": 1,
        "access_settings": 1,
        "access_sms": 1,
        "access_email": 1,
        "access_voice": 1,
        "access_fax": 1,
        "access_post": 1,
        "access_reseller": 1,
        "access_mms": 1,
        "share_campaigns": 0,
        "notes": null
      }
    ]
  }
}

https://rest.clicksend.com/v3/subaccounts

Get all subaccounts

Parameters

Parameter In Type Required Description
page query integer(int32) false Page number
limit query integer(int32) false Number of records per page

Refer to Status Codes for definitions of HTTP status code responses.

Create Subaccount

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
     --request POST \
     --header "Content-Type: application/json" \

     --data-binary "    {
        \"api_username\":\"nameP99\",
        \"password\":\"pass\",
        \"email\":\"testvrq@gmail.com\",
        \"phone_number\":\"941-751-3278\",
        \"first_name\":\"FirstnameeGPqV\",
        \"last_name\":\"LastnamePvjJp\"
    }" \
'https://rest.clicksend.com/v3/subaccounts'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\SubaccountApi(new GuzzleHttp\Client(),$config);
$subaccount = new \ClickSend\Model\Subaccount(); // \ClickSend\Model\Subaccount | Subaccount model
$subaccount->setApiUsername("name");
$subaccount->setPassword("pwd");
$subaccount->setEmail("xxx@gmail.com");
$subaccount->setPhoneNumber("xxx-xxx-xxxx");
$subaccount->setFirstName("first");
$subaccount->setLastName("last");

try {
    $result = $apiInstance->subaccountsPost($subaccount);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling SubaccountApi->subaccountsPost: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME, 
    Password = API_KEY  
};
var subaccountApi = new SubaccountApi(configuration);
var response = subaccountApi.SubaccountsPost(new Subaccount(
    apiUsername: "username",
    password: "password",
    email: "john@doe.com",
    phoneNumber: "+11231231234",
    firstName: "John",
    lastName: "Doe",
    accessBilling: 1,
    accessContacts: 1,
    accessUsers: 1,
    accessReporting: 1,
    accessSettings: 1
));
var api = require('./api.js');

var subaccountApi = new api.SubaccountApi("USERNAME", "API_KEY");

var subaccount = new api.Subaccount();

subaccount.apiUsername = "apiUsername";
subaccount.password = "pass";
subaccount.email = "xxx@gmail.com";
subaccount.phoneNumber = "xxx-xxx-xxxx";
subaccount.firstName = "firstName";
subaccount.lastName = "lastName";
subaccount.accessUsers = 1;
subaccount.accessBilling = 1;
subaccount.accessReporting = 1;
subaccount.accessContacts = 1;
subaccount.accessSettings = 1;

subaccountApi.subaccountsPost(subaccount).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::SubaccountApi.new

# Subaccount | Subaccount model
subaccount = ClickSendClient::Subaccount.new(
  "api_username": "api_username",
  "access_billing": 1,
  "password": "password",
  "access_reporting": 1,
  "access_settings": 1,
  "access_users": 1,
  "access_contacts": 0,
  "last_name": "last_name",
  "phone_number": "phone_number",
  "first_name": "first_name",
  "email": "email"
)

begin
  # Create new subaccount
  result = api_instance.subaccounts_post(subaccount)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling SubaccountApi->subaccounts_post: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.SubaccountApi(clicksend_client.ApiClient(configuration))
# Subaccount | Subaccount model
subaccount = clicksend_client.Subaccount(
    api_username="username",
    password="password",
    email="xxx@gmail.com",
    phone_number="000-000-0000",
    first_name="Firstnamee",
    last_name="Lastname",
    access_users=1,
    access_billing=1,
    access_reporting=1,
    access_contacts=1,
    access_settings=1) 

try:
    # Create new subaccount
    api_response = api_instance.subaccounts_post(subaccount)
    print(api_response)
except ApiException as e:
    print("Exception when calling SubaccountApi->subaccounts_post: %s\n" % e)
use WWW::ClickSendClient::SubaccountApi;
use WWW::ClickSendClient::Object::Subaccount;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::SubaccountApi->new(username => $username, password => $password);

my %params = (
    'api_username'     => 'api_username',
    'access_billing'   => 1,
    'password'         => 'password',
    'access_reporting' => 1,
    'access_settings'  => 1,
    'access_users'     => 1,
    'access_contacts'  => 0,
    'last_name'        => 'last_name',
    'phone_number'     => 'phone_number',
    'first_name'       => 'first_name',
    'email'            => 'test1@test.com'
);

my $subaccount_obj = WWW::ClickSendClient::Object::Subaccount->new(%params);
my $json_output = $api->subaccounts_post('subaccount' => $subaccount_obj);

print $json_output;
#import "CSSubaccountApi.h"
#import "CSDefaultConfiguration.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
// Configure HTTP basic authorization (authentication scheme: BasicAuth)
[apiConfig setUsername:@"USERNAME"];
[apiConfig setPassword:@"PASSWORD"];

CSSubaccount *subaccount = [[CSSubaccount alloc] init];
subaccount.apiUsername = @"api_username";
subaccount.password = @"password";
subaccount.email = @"johndoe@gmail.com";
subaccount.phoneNumber = @"+639772549340";
subaccount.firstName = @"firstname";
subaccount.lastName = @"lastname";
subaccount.accessUsers = @(1);
subaccount.accessBilling = @(1);
subaccount.accessReporting = @(1);
subaccount.accessContacts = @(1);
subaccount.accessSettings = @(1);

CSSubaccountApi *subaccountApi = [[CSSubaccountApi alloc] init];
[subaccountApi subaccountsPostWithSubaccount:subaccount completionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire

if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}

let subaccount = Subaccount(
                    apiUsername: "api_username", 
                    password: "password", 
                    email: "johndoe@gmail.com", 
                    phoneNumber: "+639772549340", 
                    firstName: "first_name", 
                    lastName: "last_name", 
                    accessUsers: 1, 
                    accessBilling: 1, 
                    accessReporting: 1, 
                    accessContacts: 1, 
                    accessSettings: 1
                )

SubaccountAPI.subaccountsPost(subaccount: subaccount) { (dataString, error) in
    if let error = error {
        print(error)
    } else {
        if let data = dataString!.data(using: String.Encoding.utf8) {
            do {
                if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                    print(dictonary)
                } else {
                    print("Cannot convert the String value to JSON")
                }
            } catch let error as NSError {
                print(error)
            }
        }
    }
}
    Coming Soon
package ClickSend;

import ClickSend.Api.SubaccountApi;
import ClickSend.Model.Subaccount;

public class create_subaccount {
  public static void main(String[] args) {
    ApiClient defaultClient = new ApiClient();
    defaultClient.setUsername("USERNAME");
    defaultClient.setPassword("API_KEY");
    SubaccountApi apiInstance = new SubaccountApi(defaultClient);
    Subaccount subaccount = new Subaccount(); // Subaccount | Subaccount model
    subaccount.apiUsername("testing");
    subaccount.password("pass");
    subaccount.email("xxx@gmail.com");
    subaccount.phoneNumber("000-000-0000");
    subaccount.firstName("test");
    subaccount.lastName("test");
    subaccount.accessUsers(new Integer(1));
    subaccount.accessBilling(new Integer(1));
    subaccount.accessReporting(new Integer(1));
    subaccount.accessContacts(new Integer(1));
    subaccount.accessSettings(new Integer(1));
    try {
        String result = apiInstance.subaccountsPost(subaccount);
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling SubaccountApi#subaccountsPost");
        e.printStackTrace();
    }
  }
}

Body parameter

{
  "api_username": "api_username",
  "access_billing": 1,
  "password": "password",
  "access_reporting": 1,
  "access_settings": 1,
  "access_users": 1,
  "access_contacts": 0,
  "last_name": "last_name",
  "phone_number": "phone_number",
  "first_name": "first_name",
  "email": "email"
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "New account has been created.",
  "data": {
    "subaccount_id": 59,
    "api_username": "nameP99",
    "email": "testvrq@gmail.com",
    "phone_number": "+619417513278",
    "first_name": "FirstnameeGPqV",
    "last_name": "LastnamePvjJp",
    "api_key": "367C506E-FBCA-1EDA-E8E0-1384F9F196D5",
    "access_users": 1,
    "access_billing": 1,
    "access_reporting": 1,
    "access_contacts": 1,
    "access_settings": 1,
    "access_sms": 1,
    "access_email": 1,
    "access_voice": 1,
    "access_fax": 1,
    "access_post": 1,
    "access_reseller": 1,
    "access_mms": 1,
    "share_campaigns": 0,
    "notes": null
  }
}

https://rest.clicksend.com/v3/subaccounts

Create new subaccount

Properties

Name Type Required Restrictions Description
api_username string true none Your new api username.
password string true none Your new password
email string true none Your new email.
phone_number string true none Your phone number in E.164 format.
first_name string true none Your firstname
last_name string true none Your lastname
access_users integer(int1) false none Flag value must be 1 for yes or 0 for no.
access_billing integer(int1) false none Flag value must be 1 for yes or 0 for no.
access_reporting integer(int1) false none Flag value must be 1 for yes or 0 for no.
access_contacts integer(int1) false none Flag value must be 1 for yes or 0 for no.
access_settings integer(int1) false none Flag value must be 1 for yes or 0 for no.

Refer to Status Codes for definitions of HTTP status code responses.

View Specific Subaccount

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \

'https://rest.clicksend.com/v3/subaccounts/{subaccount_id}'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\SubaccountApi(new GuzzleHttp\Client(),$config);
$subaccount_id = 74275; // int | ID of subaccount to get

try {
    $result = $apiInstance->subaccountsBySubaccountIdGet($subaccount_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling SubaccountApi->subaccountsBySubaccountIdGet: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME, 
    Password = API_KEY  
};
var subaccountApi = new SubaccountApi(configuration);
var response = subaccountApi.SubaccountsBySubaccountIdGet(SUB_ACCOUNT_ID);
var api = require('./api.js');

var subaccountApi = new api.SubaccountApi("USERNAME", "API_KEY");

var subaccountId = 80018;

subaccountApi.subaccountsBySubaccountIdGet(subaccountId).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::SubaccountApi.new

subaccount_id = 56 # Integer | ID of subaccount to get

begin
  # Get specific subaccount
  result = api_instance.subaccounts_by_subaccount_id_get(subaccount_id)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling SubaccountApi->subaccounts_by_subaccount_id_get: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.SubaccountApi(clicksend_client.ApiClient(configuration))
subaccount_id = 75094 # int | ID of subaccount to get

try:
    # Get specific subaccount
    api_response = api_instance.subaccounts_by_subaccount_id_get(subaccount_id)
    print(api_response)
except ApiException as e:
    print("Exception when calling SubaccountApi->subaccounts_by_subaccount_id_get: %s\n" % e)
use WWW::ClickSendClient::SubaccountApi;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::SubaccountApi->new(username => $username, password => $password);

my $json_output = $api->subaccounts_by_subaccount_id_get('subaccount_id' => '1234');

print $json_output;
#import "CSSubaccountApi.h"
#import "CSDefaultConfiguration.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
// Configure HTTP basic authorization (authentication scheme: BasicAuth)
[apiConfig setUsername:@"USERNAME"];
[apiConfig setPassword:@"PASSWORD"];

CSSubaccountApi *subaccountApi = [[CSSubaccountApi alloc] init];
[subaccountApi subaccountsBySubaccountIdGetWithSubaccountId:@(1) completionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire
if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}


SubaccountAPI.subaccountsBySubaccountIdGet(subaccountId: 1) { (dataString, error) in
    if let error = error {
        print(error)
    } else {
        if let data = dataString!.data(using: String.Encoding.utf8) {
            do {
                if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                    print(dictonary)
                } else {
                    print("Cannot convert the String value to JSON")
                }
            } catch let error as NSError {
                print(error)
            }
        }
    }
}
    Coming Soon
package ClickSend;

import ClickSend.Api.SubaccountApi;

public class view_specific_subaccount {
   public static void main(String[] args) {
      ApiClient defaultClient = new ApiClient();
      defaultClient.setUsername("USERNAME");
      defaultClient.setPassword("API_KEY");
      SubaccountApi apiInstance = new SubaccountApi(defaultClient);
      Integer subaccountId = 77547; // Integer | ID of subaccount to get
      try {
          String result = apiInstance.subaccountsBySubaccountIdGet(subaccountId);
          System.out.println(result);
      } catch (ApiException e) {
          System.err.println("Exception when calling SubaccountApi#subaccountsBySubaccountIdGet");
          e.printStackTrace();
      }
   }
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "Here are your data.",
  "data": {
    "subaccount_id": 59,
    "api_username": "nameP99",
    "email": "testvrq@gmail.com",
    "phone_number": "+619417513278",
    "first_name": "FirstnameeGPqV",
    "last_name": "LastnamePvjJp",
    "api_key": "367C506E-FBCA-1EDA-E8E0-1384F9F196D5",
    "access_users": 1,
    "access_billing": 1,
    "access_reporting": 1,
    "access_contacts": 1,
    "access_settings": 1,
    "access_sms": 1,
    "access_email": 1,
    "access_voice": 1,
    "access_fax": 1,
    "access_post": 1,
    "access_reseller": 1,
    "access_mms": 1,
    "share_campaigns": 0,
    "notes": null
  }
}

https://rest.clicksend.com/v3/subaccounts/{subaccount_id}

Get specific subaccount

Parameters

Parameter In Type Required Description
subaccount_id path integer(int32) true ID of subaccount to get

Refer to Status Codes for definitions of HTTP status code responses.

Update Subaccount

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
     --request PUT \
     --header "Content-Type: application/json" \

     --data-binary "    {
        \"password\":\"pass\",
        \"email\":\"testfP0.updated@gmail.com\",
        \"phone_number\":\"+19417519130\",
        \"first_name\":\"FirstnameKvdRZUpdated\",
        \"last_name\":\"LastnameHUPYGUpdated\",
        \"access_users\": 1,
        \"access_billing\": 1,
        \"access_reporting\": 1,
        \"access_contacts\": 1,
        \"access_settings\": 1,
        \"access_sms\": 1,
        \"access_email\": 1,
        \"access_voice\": 1,
        \"access_fax\": 1,
        \"access_post\": 1,
        \"access_reseller\": 1,
        \"access_mms\": 1,
        \"share_campaigns\": 0,
        \"notes\": null
    }" \
'https://rest.clicksend.com/v3/subaccounts/{subaccount_id}'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\SubaccountApi(new GuzzleHttp\Client(),$config);
$subaccount_id = 82857; // int | ID of subaccount to update
$subaccount = new \ClickSend\Model\Subaccount(); // \ClickSend\Model\Subaccount | Subaccount model
$subaccount->setApiUsername("name");
$subaccount->setPassword("pwd");
$subaccount->setEmail("xxx@gmail.com");
$subaccount->setPhoneNumber("xxx-xxx-xxxx");
$subaccount->setFirstName("first");
$subaccount->setLastName("last");

try {
    $result = $apiInstance->subaccountsBySubaccountIdPut($subaccount_id, $subaccount);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling SubaccountApi->subaccountsBySubaccountIdPut: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME, 
    Password = API_KEY  
};
var subaccountApi = new SubaccountApi(configuration);
var response = subaccountApi.SubaccountsBySubaccountIdPut(75557, new Subaccount(
    apiUsername: "username",
    password: "password",
    email: "john@doe.com",
    phoneNumber: "+11231231234",
    firstName: "John",
    lastName: "Doe",
    accessBilling: 1,
    accessContacts: 1,
    accessUsers: 1,
    accessReporting: 1,
    accessSettings: 1
));
var api = require('./api.js');

var subaccountApi = new api.SubaccountApi("USERNAME", "API_KEY");

var subaccountId = 80018;

var subaccount = new api.Subaccount();

subaccount.apiUsername = "apiUsername";
subaccount.password = "pass";
subaccount.email = "xxx@gmail.com";
subaccount.phoneNumber = "xxx-xxx-xxxx";
subaccount.firstName = "firstName";
subaccount.lastName = "lastName";
subaccount.accessUsers = 1;
subaccount.accessBilling = 1;
subaccount.accessReporting = 1;
subaccount.accessContacts = 1;
subaccount.accessSettings = 1;

subaccountApi.subaccountsBySubaccountIdPut(subaccountId, subaccount).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::SubaccountApi.new

subaccount_id = 56 # Integer | ID of subaccount to update

# Subaccount | Subaccount model
subaccount = ClickSendClient::Subaccount.new(
  "api_username": "api_username",
  "access_billing": 1,
  "password": "password",
  "access_reporting": 1,
  "access_settings": 1,
  "access_users": 1,
  "access_contacts": 0,
  "last_name": "last_name",
  "phone_number": "phone_number",
  "first_name": "first_name",
  "email": "email"
)

begin
  # Update subaccount
  result = api_instance.subaccounts_by_subaccount_id_put(subaccount_id, subaccount)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling SubaccountApi->subaccounts_by_subaccount_id_put: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.SubaccountApi(clicksend_client.ApiClient(configuration))
subaccount_id = 75094 # int | ID of subaccount to update
# Subaccount | Subaccount model
subaccount = clicksend_client.Subaccount(
    api_username="username",
    password="password",
    email="xxx@gmail.com",
    phone_number="000-000-0000",
    first_name="Firstnamee",
    last_name="Lastname",
    access_users=1,
    access_billing=1,
    access_reporting=1,
    access_contacts=1,
    access_settings=1) 

try:
    # Update subaccount
    api_response = api_instance.subaccounts_by_subaccount_id_put(subaccount_id, subaccount)
    print(api_response)
except ApiException as e:
    print("Exception when calling SubaccountApi->subaccounts_by_subaccount_id_put: %s\n" % e)
use WWW::ClickSendClient::SubaccountApi;
use WWW::ClickSendClient::Object::Subaccount;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::SubaccountApi->new(username => $username, password => $password);

my %params = (
    'api_username'     => 'api_username_updated',
    'access_billing'   => 1,
    'password'         => 'password',
    'access_reporting' => 1,
    'access_settings'  => 1,
    'access_users'     => 1,
    'access_contacts'  => 0,
    'last_name'        => 'last_name',
    'phone_number'     => '+447777777777',
    'first_name'       => 'first_name',
    'email'            => 'test1@test.com'
);

my $subaccount_obj = WWW::ClickSendClient::Object::Subaccount->new(%params);

my $json_output = $api->subaccounts_by_subaccount_id_put('subaccount' => $subaccount_obj, 'subaccount_id' => '12345');

print $json_output;
#import "CSSubaccountApi.h"
#import "CSDefaultConfiguration.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
// Configure HTTP basic authorization (authentication scheme: BasicAuth)
[apiConfig setUsername:@"USERNAME"];
[apiConfig setPassword:@"PASSWORD"];

CSSubaccount *subaccount = [[CSSubaccount alloc] init];
subaccount.apiUsername = @"api_username";
subaccount.password = @"password";
subaccount.email = @"johndoe@gmail.com";
subaccount.phoneNumber = @"+639772549340";
subaccount.firstName = @"firstname";
subaccount.lastName = @"lastname";
subaccount.accessUsers = @(1);
subaccount.accessBilling = @(1);
subaccount.accessReporting = @(1);
subaccount.accessContacts = @(1);
subaccount.accessSettings = @(1);

CSSubaccountApi *subaccountApi = [[CSSubaccountApi alloc] init];
[subaccountApi subaccountsBySubaccountIdPutWithSubaccountId:@(1) subaccount:subaccount completionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire
if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}

let subaccount = Subaccount(
                    apiUsername: "api_username", 
                    password: "password", 
                    email: "johndoe@gmail.com", 
                    phoneNumber: "+639772549340", 
                    firstName: "first_name", 
                    lastName: "last_name", 
                    accessUsers: 1, 
                    accessBilling: 1, 
                    accessReporting: 1, 
                    accessContacts: 1, accessSettings: 1
                )

SubaccountAPI.subaccountsBySubaccountIdPut(subaccountId: 1, subaccount: subaccount) { (dataString, error) in
    if let error = error {
        print(error)
    } else {
        if let data = dataString!.data(using: String.Encoding.utf8) {
            do {
                if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                    print(dictonary)
                } else {
                    print("Cannot convert the String value to JSON")
                }
            } catch let error as NSError {
                print(error)
            }
        }
    }
}
    Coming Soon
package ClickSend;

import ClickSend.Api.SubaccountApi;
import ClickSend.Model.Subaccount;

public class update_subaccount {
  public static void main(String[] args) {
    ApiClient defaultClient = new ApiClient();
    defaultClient.setUsername("USERNAME");
    defaultClient.setPassword("API_KEY");
    SubaccountApi apiInstance = new SubaccountApi(defaultClient);
    Integer subaccountId = 77547; // Integer | ID of subaccount to update
    Subaccount subaccount = new Subaccount(); // Subaccount | Subaccount model
    subaccount.apiUsername("testing");
    subaccount.password("pwd");
    subaccount.email("xxx@gmail.com");
    subaccount.phoneNumber("000-000-0000");
    subaccount.firstName("test");
    subaccount.lastName("test");
    subaccount.accessUsers(new Integer(1));
    subaccount.accessBilling(new Integer(1));
    subaccount.accessReporting(new Integer(1));
    subaccount.accessContacts(new Integer(0));
    subaccount.accessSettings(new Integer(1));
    try {
        String result = apiInstance.subaccountsBySubaccountIdPut(subaccountId, subaccount);
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling SubaccountApi#subaccountsBySubaccountIdPut");
        e.printStackTrace();
    }
  }
}

Body parameter

{
  "api_username": "api_username",
  "access_billing": 1,
  "password": "password",
  "access_reporting": 1,
  "access_settings": 1,
  "access_users": 1,
  "access_contacts": 0,
  "last_name": "last_name",
  "phone_number": "phone_number",
  "first_name": "first_name",
  "email": "email"
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "Subaccount #59 has been updated.",
  "data": {
    "subaccount_id": 59,
    "api_username": "nameP99",
    "email": "testfP0.updated@gmail.com",
    "phone_number": "+619417513065",
    "first_name": "FirstnameKvdRZ Updated",
    "last_name": "LastnameHUPYG Updated",
    "api_key": "367C506E-FBCA-1EDA-E8E0-1384F9F196D5",
    "access_users": 1,
    "access_billing": 1,
    "access_reporting": 1,
    "access_contacts": 1,
    "access_settings": 1,
    "access_sms": 1,
    "access_email": 1,
    "access_voice": 1,
    "access_fax": 1,
    "access_post": 1,
    "access_reseller": 1,
    "access_mms": 1,
    "share_campaigns": 0,
    "notes": null
  }
}

https://rest.clicksend.com/v3/subaccounts/{subaccount_id}

Update subaccount

Parameters

Parameter In Type Required Description
subaccount_id path integer(int32) true ID of subaccount to update

Properties

Name Type Required Restrictions Description
api_username string true none Your new api username.
password string true none Your new password
email string true none Your new email.
phone_number string true none Your phone number in E.164 format.
first_name string true none Your firstname
last_name string true none Your lastname
access_users integer(int1) false none Flag value must be 1 for yes or 0 for no.
access_billing integer(int1) false none Flag value must be 1 for yes or 0 for no.
access_reporting integer(int1) false none Flag value must be 1 for yes or 0 for no.
access_contacts integer(int1) false none Flag value must be 1 for yes or 0 for no.
access_settings integer(int1) false none Flag value must be 1 for yes or 0 for no.

Refer to Status Codes for definitions of HTTP status code responses.

Delete Subaccount

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
     --request DELETE \

'https://rest.clicksend.com/v3/subaccounts/{subaccount_id}'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\SubaccountApi(new GuzzleHttp\Client(),$config);
$subaccount_id = 82271; // int | ID of subaccount to regenerate API key for

try {
    $result = $apiInstance->subaccountsBySubaccountIdDelete($subaccount_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling SubaccountApi->subaccountsBySubaccountIdDelete: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME, 
    Password = API_KEY  
};
var subaccountApi = new SubaccountApi(configuration);
var response = subaccountApi.SubaccountsBySubaccountIdDelete(SUB_ACCOUNT_ID);
var api = require('./api.js');

var subaccountApi = new api.SubaccountApi("USERNAME", "API_KEY");

var subaccountId = 80018;

subaccountApi.subaccountsBySubaccountIdDelete(subaccountId).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::SubaccountApi.new

subaccount_id = 56 # Integer | ID of subaccount to delete

begin
  # Delete a subaccount
  result = api_instance.subaccounts_by_subaccount_id_delete(subaccount_id)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling SubaccountApi->subaccounts_by_subaccount_id_delete: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.SubaccountApi(clicksend_client.ApiClient(configuration))
subaccount_id = 75094 # int | ID of subaccount to delete

try:
    # Delete a subaccount
    api_response = api_instance.subaccounts_by_subaccount_id_delete(subaccount_id)
    print(api_response)
except ApiException as e:
    print("Exception when calling SubaccountApi->subaccounts_by_subaccount_id_delete: %s\n" % e)
use WWW::ClickSendClient::SubaccountApi;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::SubaccountApi->new(username => $username, password => $password);

my $json_output = $api->subaccounts_by_subaccount_id_delete('subaccount_id' => '12345');

print $json_output;
#import "CSSubaccountApi.h"
#import "CSDefaultConfiguration.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
// Configure HTTP basic authorization (authentication scheme: BasicAuth)
[apiConfig setUsername:@"USERNAME"];
[apiConfig setPassword:@"PASSWORD"];

CSSubaccountApi *subaccountApi = [[CSSubaccountApi alloc] init];
[subaccountApi subaccountsBySubaccountIdDeleteWithSubaccountId:@(1) completionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire
if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}

SubaccountAPI.subaccountsBySubaccountIdDelete(subaccountId: 1) { (dataString, error) in
    if let error = error {
        print(error)
    } else {
        if let data = dataString!.data(using: String.Encoding.utf8) {
            do {
                if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                    print(dictonary)
                } else {
                    print("Cannot convert the String value to JSON")
                }
            } catch let error as NSError {
                print(error)
            }
        }
    }
}
    Coming Soon
package ClickSend;

import ClickSend.Api.SubaccountApi;

public class delete_subaccount {
   public static void main(String[] args) {
      ApiClient defaultClient = new ApiClient();
      defaultClient.setUsername("USERNAME");
      defaultClient.setPassword("API_KEY");
      SubaccountApi apiInstance = new SubaccountApi(defaultClient);
      Integer subaccountId = 75097; // Integer | ID of subaccount to delete
      try {
          String result = apiInstance.subaccountsBySubaccountIdDelete(subaccountId);
          System.out.println(result);
      } catch (ApiException e) {
          System.err.println("Exception when calling SubaccountApi#subaccountsBySubaccountIdDelete");
          e.printStackTrace();
      }
   }
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "Subaccount #59 has been deleted",
  "data": true
}

https://rest.clicksend.com/v3/subaccounts/{subaccount_id}

Delete a subaccount

Parameters

Parameter In Type Required Description
subaccount_id path integer(int32) true ID of subaccount to delete

Refer to Status Codes for definitions of HTTP status code responses.

Generate New API Key

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
     --request PUT \

'https://rest.clicksend.com/v3/subaccounts/{subaccount_id}/regen-api-key'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\SubaccountApi(new GuzzleHttp\Client(),$config);
$subaccount_id = 74275; // int | ID of subaccount to regenerate API key for

try {
    $result = $apiInstance->subaccountsRegenApiKeyBySubaccountIdPut($subaccount_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling SubaccountApi->subaccountsRegenApiKeyBySubaccountIdPut: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME, 
    Password = API_KEY  
};
var subaccountApi = new SubaccountApi(configuration);
var response = subaccountApi.SubaccountsRegenApiKeyBySubaccountIdPut(SUB_ACCOUNT_ID);
var api = require('./api.js');

var subaccountApi = new api.SubaccountApi("USERNAME", "API_KEY");

var subaccountId = 80017;

subaccountApi.subaccountsRegenApiKeyBySubaccountIdPut(subaccountId).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::SubaccountApi.new

subaccount_id = 56 # Integer | ID of subaccount to regenerate API key for

begin
  # Regenerate an API Key
  result = api_instance.subaccounts_regen_api_key_by_subaccount_id_put(subaccount_id)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling SubaccountApi->subaccounts_regen_api_key_by_subaccount_id_put: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.SubaccountApi(clicksend_client.ApiClient(configuration))
subaccount_id = 74275 # int | ID of subaccount to regenerate API key for

try:
    # Regenerate an API Key
    api_response = api_instance.subaccounts_regen_api_key_by_subaccount_id_put(subaccount_id)
    print(api_response)
except ApiException as e:
    print("Exception when calling SubaccountApi->subaccounts_regen_api_key_by_subaccount_id_put: %s\n" % e)
use WWW::ClickSendClient::SubaccountApi;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::SubaccountApi->new(username => $username, password => $password);

my $json_output = $api->subaccounts_regen_api_key_by_subaccount_id_put('subaccount_id' => '12345');

print $json_output;
#import "CSSubaccountApi.h"
#import "CSDefaultConfiguration.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
// Configure HTTP basic authorization (authentication scheme: BasicAuth)
[apiConfig setUsername:@"USERNAME"];
[apiConfig setPassword:@"PASSWORD"];

CSSubaccountApi *subaccountApi = [[CSSubaccountApi alloc] init];
[subaccountApi subaccountsRegenApiKeyBySubaccountIdPutWithSubaccountId:@(1) completionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire
if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}

SubaccountAPI.subaccountsRegenApiKeyBySubaccountIdPut(subaccountId: 1) { (dataString, error) in
    if let error = error {
        print(error)
    } else {
        if let data = dataString!.data(using: String.Encoding.utf8) {
            do {
                if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                    print(dictonary)
                } else {
                    print("Cannot convert the String value to JSON")
                }
            } catch let error as NSError {
                print(error)
            }
        }
    }
}
    Coming Soon
package ClickSend;

import ClickSend.Api.SubaccountApi;

public class regenerate_api_key {
   public static void main(String[] args) {
      ApiClient defaultClient = new ApiClient();
      defaultClient.setUsername("USERNAME");
      defaultClient.setPassword("API_KEY");
      SubaccountApi apiInstance = new SubaccountApi(defaultClient);
      // Integer | ID of subaccount to regenerate API key for
      Integer subaccountId = 75093; 
      try {
          String result = apiInstance.subaccountsRegenApiKeyBySubaccountIdPut(subaccountId);
          System.out.println(result);
      } catch (ApiException e) {
          System.err.println("Exception when calling SubaccountApi#subaccountsRegenApiKeyBySubaccountIdPut");
          e.printStackTrace();
      }
   }
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "Your API Key has been regenerated.",
  "data": {
    "api_key": "E72D09F6-AC80-0A5C-F7F0-1A244A377A5C"
  }
}

https://rest.clicksend.com/v3/subaccounts/{subaccount_id}/regen-api-key

Regenerate an API Key

Parameters

Parameter In Type Required Description
subaccount_id path integer(int32) true ID of subaccount to regenerate API key for

Refer to Status Codes for definitions of HTTP status code responses.

Upload

Upload Media File

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
     --request POST \

     --header "Content-Type: application/json" \
     --data-binary "{
    \"content\": \"PGh0bWw+PGhlYWQ+PHN0eWxlIHR5cGU9InRleHQvY3NzIj5ib2R5IHsgZm9udC1mYW1pbHk6J0FyaWFsJzsgfTwvc3R5bGU+PHRpdGxlPkhpPC90aXRsZT48L2hlYWQ+PGJvZHk+PGgxPkhlbGxvIHRoZXJlPC9oMT48aDI+SG93IGFyZSB5b3UgdG9kYXk/PC9oMj48L2JvZHk+PC9odG1sPg==\"
}" \
'https://rest.clicksend.com/v3/uploads?convert={convert}'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\UploadApi(new GuzzleHttp\Client(),$config);
$upload_file = new \ClickSend\Model\UploadFile(); // \ClickSend\Model\UploadFile | Your file to be uploaded
$upload_file->setContent("R0lGODlhEAAQAMIHAEOqRVOvIlKwIVOwIlixFViyFWO3AP///yH+EUNyZWF0ZWQgd2l0aCBHSU1QACH5BAEKAAcALAAAAAAQABAAAAMmeLrcSjBKwoy92JaVuxGcJ45kaZ5oGRrOcYXuuAwOYLXtjTvB7icAOw==");
$convert = "mms"; // string | 

try {
    $result = $apiInstance->uploadsPost($upload_file, $convert);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling UploadApi->uploadsPost: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME, 
    Password = API_KEY  
};
var uploadApi = new UploadApi(configuration);

var file = new UploadFile("BASE64_Encoded_File_Content");
var response = uploadApi.UploadsPost(file, "MMS");
var api = require('./api.js');

var uploadApi = new api.UploadApi("USERNAME", "API_KEY");

var uploadFile = new api.UploadFile();

uploadFile.content = "R0lGODlhEAAQAMIHAEOqRVOvIlKwIVOwIlixFViyFWO3AP///yH+EUNyZWF0ZWQgd2l0aCBHSU1QACH5BAEKAAcALAAAAAAQABAAAAMmeLrcSjBKwoy92JaVuxGcJ45kaZ5oGRrOcYXuuAwOYLXtjTvB7icAOw==";

var convert = "mms";

uploadApi.uploadsPost(uploadFile, convert).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::UploadApi.new

# UploadFile | Your file to be uploaded
upload_file = ClickSendClient::UploadFile.new(
  content: %(R0lGODlhEAAQAMIHAEOqRVOvIlKwIVOwIlixFViyFWO3AP///yH+EUNyZWF0ZWQgd2l0aCBHSU1QACH5BAEKAAcALAAAAAAQABAAAAMmeLrcSjBKwoy92JaVuxGcJ45kaZ5oGRrOcYXuuAwOYLXtjTvB7icAOw==)
)

convert = "post" # String |

begin
  # Upload File
  result = api_instance.uploads_post(upload_file, convert)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling UploadApi->uploads_post: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.UploadApi(clicksend_client.ApiClient(configuration))
convert = 'mms' # str |
upload_file = clicksend_client.UploadFile(content = 'R0lGODlhEAAQAMIHAEOqRVOvIlKwIVOwIlixFViyFWO3AP///yH+EUNyZWF0ZWQgd2l0aCBHSU1QACH5BAEKAAcALAAAAAAQABAAAAMmeLrcSjBKwoy92JaVuxGcJ45kaZ5oGRrOcYXuuAwOYLXtjTvB7icAOw==');

try:
    # Upload File
    api_response = api_instance.uploads_post(upload_file, convert)
    print(api_response)
except ApiException as e:
    print("Exception when calling UploadApi->uploads_post: %s\n" % e)
use WWW::ClickSendClient::UploadApi;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::UploadApi->new(username => $username, password => $password);

#Base64-encoded file contents
my %params = (
    'content'  => 'R0lGODlhEAAQAMIHAEOqRVOvIlKwIVOwIlixFViyFWO3AP///yH+EUNyZWF0ZWQgd2l0aCBHSU1QACH5BAEKAAcALAAAAAAQABAAAAMmeLrcSjBKwoy92JaVuxGcJ45kaZ5oGRrOcYXuuAwOYLXtjTvB7icAOw=='
);

my $uploadFile = WWW::ClickSendClient::Object::UploadFile->new(%params);

my $json_output = $api->uploads_post('upload_file' => $uploadFile ,'convert' => 'fax');

print $json_output;
#import "CSUploadApi.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
[apiConfig setUsername:@"USERNAME"];
[apiConfig setPassword:@"PASSWORD"];

CSUploadFile *uploadFile = [[CSUploadFile alloc] init];
uploadFile.content = @"content";
CSUploadApi *uploadApiInstance = [[CSUploadApi alloc] init];
[uploadApiInstance uploadsPostWithUploadFile:uploadFile  convert:@"content" completionHandler:^(NSString *output, NSError *error) {
if (error) {
    NSLog(@"Error: %@", error);
} else {
    NSLog(@"%@", output);
}
}];
import Alamofire

if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}

let uploadsFile = UploadFile(content: "string")
UploadAPI.uploadsPost(uploadFile: uploadsFile, convert: "string") { (dataString, error) in
    guard let dataString = dataString else {
        print(error!)
        return
    }
    if let data = dataString.data(using: String.Encoding.utf8) {
        do {
            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                print(dictonary)
            } else {
                print("Cannot convert the String value to JSON")
            }
        } catch let error as NSError {
            print(error)
        }
    }
}
    Coming Soon
package ClickSend;

import ClickSend.Api.UploadApi;
import ClickSend.Model.UploadFile;

public class upload_media {
  public static void main(String[] args) {
    ApiClient defaultClient = new ApiClient();
    defaultClient.setUsername("USERNAME");
    defaultClient.setPassword("API_KEY");
    UploadApi apiInstance = new UploadApi(defaultClient);
    UploadFile uploadFile = new UploadFile(); // UploadFile | Your file to be uploaded
    uploadFile.content("R0lGODlhEAAQAMIHAEOqRVOvIlKwIVOwIlixFViyFWO3AP///yH+EUNyZWF0ZWQgd2l0aCBHSU1QACH5BAEKAAcALAAAAAAQABAAAAMmeLrcSjBKwoy92JaVuxGcJ45kaZ5oGRrOcYXuuAwOYLXtjTvB7icAOw==");
    String convert = "mms"; // String | 
    try {
        String result = apiInstance.uploadsPost(uploadFile,convert);
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling UploadApi#uploadsPost");
        e.printStackTrace();
    }
  }
}

Body parameter

{
  "content":"R0lGODlhEAAQAMIHAEOqRVOvIlKwIVOwIlixFViyFWO3AP///yH+EUNyZWF0ZWQgd2l0aCBHSU1QACH5BAEKAAcALAAAAAAQABAAAAMmeLrcSjBKwoy92JaVuxGcJ45kaZ5oGRrOcYXuuAwOYLXtjTvB7icAOw=="
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "Your file has been uploaded.",
  "data": {
    "upload_id": 15,
    "file_name": "161BFA93-3660-4B03-9BCB-7629166F2E91.gif",
    "date_added": 1449500640,
    "date_delete": 1450105440,
    "user_id": 1,
    "_url": "https://s3-ap-southeast-2.amazonaws.com/clicksend-api-downloads/_public/_examples/161BFA93-3660-4B03-9BCB-7629166F2E91.gif"
  }
}

https://rest.clicksend.com/v3/uploads

The upload endpoint provides a method for converting files from an unsupported format to a format that one of our endpoints can handle.

Files can be submitted two ways: 1. Using base64 encoding in an application/json request. In this case, submit the base64-encoded file contents in the content field of the request body, and convert can be specified either also in the body or as part of the query string. 2. Using multipart/form-data encoding, in the same way it would be submitted using a HTML form. You may find cURL useful for this. For an example of how to do this, see one of our SDKs. In this case, specify convert in the query string.

Note that convert specifies the conversion to take place. That is, what the result should be compatible with and can be any of the following:

All files will expire 10 minutes after being uploaded.

Parameters

Parameter In Type Required Description
convert query string true none
content body string true Base64-encoded file contents

Refer to Status Codes for definitions of HTTP status code responses.

Voice

Everything about sending and viewing responses to voice messages

Send Voice Message

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
     --request POST \
     --header "Content-Type: application/json" \

     --data-binary "    {
        \"messages\":[
            {
                \"source\":\"php\",
                \"body\":\"Jelly liquorice marshmallow candy carrot cake 4Eyffjs1vL.\",
                \"to\":\"+61411111111\",
                \"lang\":\"en-au\",
                \"voice\":\"female\",
                \"schedule\":1436874701,
                \"custom_string\":\"this is a test\",
                \"require_input\": 1,
                \"machine_detection\": 1
            },
            {
                \"source\":\"php\",
                \"body\":\"Chocolate bar icing icing oat cake carrot cake jelly cotton MWEvciEPIr.\",
                \"to\":\"+61422222222\",
                \"lang\":\"en-au\",
                \"voice\":\"female\",
                \"schedule\":1436876011,
                \"custom_string\":\"this is a test\"
            }
        ]
    }" \
'https://rest.clicksend.com/v3/voice/send'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\VoiceApi(new GuzzleHttp\Client(),$config);
$voice_message = new \ClickSend\Model\VoiceMessage();
$voice_message->setTo("+61411111111");
$voice_message->setBody("Jelly liquorice marshmallow candy carrot cake 4Eyffjs1vL.");
$voice_message->setVoice("female");
$voice_message->setCustomString("custom");
$voice_message->setCountry("country");
$voice_message->setSource("php");
$voice_message->setListId(185161);
$voice_message->setLang("en-au");
$voice_message->setSchedule(1577053342);
$voice_message->setRequireInput(1);
$voice_message->setMachineDetection(1);
// \ClickSend\Model\VoiceMessageCollection | VoiceMessageCollection model
$voice_messages = new \ClickSend\Model\VoiceMessageCollection(); 
$voice_messages->setMessages([$voice_message]);

try {
    $result = $apiInstance->voiceSendPost($voice_messages);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling VoiceApi->voiceSendPost: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME, 
    Password = API_KEY  
};
var voiceApi = new VoiceApi(configuration);
var listOfVoiceMessages = new List<VoiceMessage>();
listOfVoiceMessages.Add(new VoiceMessage( 
    to: "+11231231234",
    body: "This is test body",
    voice: "female",
    customString: "Custom String",
    country: "CA",
    source: "sdk",
    lang: "en-us",
    machineDetection: 0,
    requireInput: 0,
    schedule: TimeStamp
));
var voicemessagecollection = new VoiceMessageCollection(listOfVoiceMessages);
var response = voiceApi.VoiceSendPost(voicemessagecollection);
var api = require('./api.js');

var voiceDeliveryReceiptApi = new api.VoiceApi("USERNAME", "API_KEY");

var voiceMessage = new api.VoiceMessage();

voiceMessage.to = "+61411111111";
voiceMessage.body = "Jelly liquorice marshmallow candy carrot cake 4Eyffjs1vL";
voiceMessage.voice = "female";
voiceMessage.customString = "this is a test";
voiceMessage.country = "US";
voiceMessage.source = "source";
voiceMessage.listId = 185161;
voiceMessage.lang = "en-au";
voiceMessage.requireInput = 1;
voiceMessage.machineDetection = 1;

var voiceMessages = new api.VoiceMessageCollection();

voiceMessages.messages = [voiceMessage]

voiceDeliveryReceiptApi.voiceSendPost(voiceMessages).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::VoiceApi.new

# VoiceMessageCollection | VoiceMessageCollection model
voice_messages = ClickSendClient::VoiceMessageCollection.new(
  "messages": [
    ClickSendClient::VoiceMessage.new(
      "voice": "voice",
      "require_input": 0,
      "to": "to",
      "source": "source",
      "body": "body",
      "lang": "lang",
      "custom_string": "custom_string",
      "machine_detection": 0
    ),
    ClickSendClient::VoiceMessage.new(
      "voice": "voice",
      "require_input": 0,
      "to": "to",
      "source": "source",
      "body": "body",
      "lang": "lang",
      "custom_string": "custom_string",
      "machine_detection": 0
    )
  ]
)

begin
  # Send voice message(s)
  result = api_instance.voice_send_post(voice_messages)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling VoiceApi->voice_send_post: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client import VoiceMessage
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.VoiceApi(clicksend_client.ApiClient(configuration))
# VoiceMessageCollection | VoiceMessageCollection model
voice_message=VoiceMessage(source="php",
                body="Jelly liquorice marshmallow candy carrot cake 4Eyffjs1vL.",
                to="+61411111111",
                lang="en-au",
                voice="female",
                schedule="1436874701",
                custom_string="this is a test",
                require_input=1,
                machine_detection=1,country="india")
voice_messages = clicksend_client.VoiceMessageCollection(messages=[voice_message]) 

try:
    # Send voice message(s)
    api_response = api_instance.voice_send_post(voice_messages)
    print(api_response)
except ApiException as e:
    print("Exception when calling VoiceApi->voice_send_post: %s\n" % e)
use WWW::ClickSendClient::VoiceApi;
use WWW::ClickSendClient::Object::VoiceMessageCollection;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::VoiceApi->new(username => $username, password => $password);
my %params = (
    'messages' => [
        {
            'voice'             => 'voice',
            'country'           => 'country',
            'require_input'     => 0,
            'to'                => 'to',
            'source'            => 'source',
            'body'              => 'body',
            'lang'              => 'lang',
            'custom_string'     => 'custom_string',
            'machine_detection' => 0
        },
        {
            'voice'             => 'voice',
            'country'           => 'country',
            'require_input'     => 0,
            'to'                => 'to',
            'source'            => 'source',
            'body'              => 'body',
            'lang'              => 'lang',
            'custom_string'     => 'custom_string',
            'machine_detection' => 0
        }
    ]
);

my $voice_messages_obj = WWW::ClickSendClient::Object::VoiceMessageCollection->new(%params);

my $json_output = $api->voice_send_post('voice_messages' => $voice_messages_obj);

print $json_output;
#import "CSDefaultConfiguration.h"
#import "CSVoiceApi.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
// Configure HTTP basic authorization (authentication scheme: BasicAuth)
[apiConfig setUsername:@"USERNAME"];
[apiConfig setPassword:@"PASSWORD"];

CSVoiceMessage *voiceMessage1 = [[CSVoiceMessage alloc] init];
voiceMessage1.to = @"+61411111111";
voiceMessage1.body = @"Jelly two liquorice marshmallow candy carrot cake.";
voiceMessage1.voice = @"female";
voiceMessage1.customString = @"test";
voiceMessage1.country = @"US";
voiceMessage1.source = @"objc";

CSVoiceMessage *voiceMessage2 = [[CSVoiceMessage alloc] init];
voiceMessage2.to = @"+61411111111";
voiceMessage2.body = @"Jelly two liquorice marshmallow candy carrot cake.";
voiceMessage2.voice = @"female";
voiceMessage2.customString = @"test";
voiceMessage2.country = @"US";
voiceMessage2.source = @"objc";

CSVoiceMessageCollection *voiceMessageCollection =  [[CSVoiceMessageCollection alloc] init];
voiceMessageCollection.messages = (NSArray<CSVoiceMessage> *) [NSArray arrayWithObjects:
                                                                        voiceMessage1,
                                                                        voiceMessage2,
                                                                        nil];

CSVoiceApi *voiceAPI = [[CSVoiceApi alloc] init];
[voiceAPI voiceSendPostWithVoiceMessages:voiceMessageCollection completionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire

if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}

let voiceMessage1 = VoiceMessage(
    to: "+61411111111", 
    body: "Jelly liquorice marshmallow candy carrot cake.", 
    voice: "female", 
    customString: "test", 
    country: "US", 
    source: "swift", 
    listId: nil, 
    lang: nil, 
    schedule: nil, 
    requireInput: nil, 
    machineDetection: nil
)

let voiceMessage2 = VoiceMessage(
    to: "+61411111111",
    body: "Jelly two liquorice marshmallow candy carrot cake.", 
    voice: "female", 
    customString: "test",
    country: "US",
    source: "swift", 
    listId: nil, 
    lang: nil, 
    schedule: nil, 
    requireInput: nil, 
    machineDetection: nil
)

let voiceMessageCollection = VoiceMessageCollection(messages: [voiceMessage1, voiceMessage2])

VoiceAPI.voiceSendPost(voiceMessages: voiceMessageCollection) { (dataString, error) in
    guard let dataString = dataString else {
        print(error!)
        return
    }

    if let data = dataString.data(using: String.Encoding.utf8) {
        do {
            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                print(dictonary)
            } else {
                print("Cannot convert the String value to JSON")
            }
        } catch let error as NSError {
            print(error)
        }
    }
}
    Coming Soon
package ClickSend;

import java.util.Arrays;
import java.util.List;
import ClickSend.Api.VoiceApi;
import ClickSend.Model.VoiceMessage;
import ClickSend.Model.VoiceMessageCollection;

public class send_voice_msg {
  public static void main(String[] args) {
    ApiClient defaultClient = new ApiClient();
    defaultClient.setUsername("USERNAME");
    defaultClient.setPassword("API_KEY");
    VoiceApi apiInstance = new VoiceApi(defaultClient);
    VoiceMessage voiceMessage=new VoiceMessage();
    voiceMessage.to("+61411111111");
    voiceMessage.body("Test");
    voiceMessage.voice("female");
    voiceMessage.customString("testing");
    voiceMessage.country("india");
    voiceMessage.source("source");
    voiceMessage.listId(new Integer(185161));
    voiceMessage.lang("lang");
    voiceMessage.schedule(new Integer(1545477071));
    voiceMessage.requireInput(new Integer(1));
    voiceMessage.machineDetection(new Integer(0));
    List<VoiceMessage> voiceMessageList=Arrays.asList(voiceMessage);
    // VoiceMessageCollection | VoiceMessageCollection model
    VoiceMessageCollection voiceMessages = new VoiceMessageCollection(); 
    voiceMessages.messages(voiceMessageList);
    try {
        String result = apiInstance.voiceSendPost(voiceMessages);
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling VoiceApi#voiceSendPost");
        e.printStackTrace();
    }
  }
}

Body parameter

{
  "messages": [
    {
      "voice": "voice",
      "require_input": 0,
      "to": "+61411111111",
      "source": "source",
      "body": "body",
      "lang": "lang",
      "custom_string": "custom_string",
      "machine_detection": 0
    },
    {
      "voice": "voice",
      "require_input": 0,
      "to": "+61422222222",
      "source": "source",
      "body": "body",
      "lang": "lang",
      "custom_string": "custom_string",
      "machine_detection": 0
    }
  ]
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "Here are your data.",
  "data": {
    "total_price": 0.07,
    "total_count": 1,
    "queued_count": 1,
    "messages": [
      {
        "date": 1436871253,
        "to": "+61411111111",
        "to_type": "mobile",
        "body": "Jelly liquorice marshmallow candy carrot cake 4Eyffjs1vL.",
        "from": null,
        "lang": "en-au",
        "voice": "female",
        "schedule": 1436874701,
        "message_id": "BF7AD270-0DE2-418B-B606-71D527D9C1AE",
        "message_parts": 1,
        "message_price": 0.07,
        "custom_string": "this is a test",
        "user_id": 1,
        "subaccount_id": 1,
        "country": "AU",
        "carrier": "Telstra",
        "require_input": 1,
        "machine_detection": 0,
        "status": "SUCCESS"
      }
    ],
    "_currency": {
      "currency_name_short": "USD",
      "currency_prefix_d": "$",
      "currency_prefix_c": "¢",
      "currency_name_long": "US Dollars"
    }
  }
}

https://rest.clicksend.com/v3/voice/send

Send voice message(s)

Send TTS (Text-to-speech) voice calls

How many messages can I send?

You can post up to 1000 messages with each API call. You can send to a mix of contacts and contact lists, as long as the total number of recipients is up to 1000. The response contains a status and details for each recipient.

How many characters can I send in a message?

If a message is longer than 4 message parts, it will be truncated (see below). If a message contains any characters that aren't in the GSM 03.38 character set, the message type will be treated as unicode. (https://en.wikipedia.org/wiki/GSM_03.38)

Standard English Characters:

Number of Characters Message Credits
1 - 300 1
301 - 600 2
601 - 900 3
901 - 1200 4

Non-GSM (Unicode) characters:

Number of Characters Message Credits
1 - 150 1
151 - 300 2
301 - 450 3
451 - 600 4

Allowed Languages

Language, Locale lang voice
English, US en-us female (default) / male
English, Australia en-au female (default) / male
English, UK en-gb female (default) / male
English, India en-in female
English, Wales en-gb-wls female (default) / male
Celtic, Wales cy-gb-wls female (default) / male
German, Germany de-de female (default) / male
Spanish, Spain es-es female (default) / male
Spanish, US es-us female (default) / male
French, Canada fr-ca female
French, France fr-fr female (default) / male
Icelandic, Iceland is-is female (default) / male
Italian, Italy it-it female (default) / male
Danish, Denmark da-dk female (default) / male
Dutch, Netherlands nl-nl female (default) / male
Norwegian, Norway nb-no female
Polish, Poland pl-pl female (default) / male
Portuguese, Portugal pt-pt male
Portuguese, Brazil pt-br female (default) / male
Romanian, Romania ro-ro female
Russian, Russia ru-ru female (default) / male
Swedish, Sweden sv-se female
Turkish, Turkey tr-tr female

Tips

To introduce a small delay between words or digits you can use a comma (,).

For example: Please enter your activation code 9, 0, 9, 0, in the next 20 minutes.

We support some SSML tags allowing custom breaks or pauses to be entered, and the readout rate to be altered.

More info...

Properties

Name Type Required Restrictions Description
to string true none Your phone number in E.164 format.
body string true none Biscuit uv3nlCOjRk croissant chocolate lollipop chocolate muffin.
voice string true none Either 'female' or 'male'.
custom_string string true none Your reference. Will be passed back with all replies and delivery reports.
country string true none The country of the recipient.
source string false none Your method of sending e.g. 'wordpress', 'php', 'c#'.
list_id integer(int32) false none Your list ID if sending to a whole list. Can be used instead of 'to'.
lang string false none au (string, required) - See section on available languages.
schedule integer(int32) false none Leave blank for immediate delivery. Your schedule time in unix format http://help.clicksend.com/what-is-a-unix-timestamp
require_input integer(int1) false none Recieve a keypress from the recipient. Flag value must be 1 for yes or 0 for no.
machine_detection integer(int1) false none Detect answering machine or voicemail and leave a message. Flag value must be 1 for yes or 0 for no.

Refer to Status Codes for definitions of HTTP status code responses.

Calculate Voice Price

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
     --request POST \
     --header "Content-Type: application/json" \

     --data-binary "    {
        \"messages\":[
            {
                \"source\":\"php\",
                \"body\":\"Jelly liquorice marshmallow candy carrot cake 4Eyffjs1vL.\",
                \"to\":\"+61411111111\",
                \"lang\":\"en-au\",
                \"voice\":\"female\",
                \"schedule\":1436874701,
                \"custom_string\":\"this is a test\"
            },
            {
                \"source\":\"php\",
                \"body\":\"Chocolate bar icing icing oat cake carrot cake jelly cotton MWEvciEPIr.\",
                \"to\":\"+61422222222\",
                \"lang\":\"en-au\",
                \"voice\":\"female\",
                \"schedule\":1436876011,
                \"custom_string\":\"this is a test\",
                \"require_input\":1
            }
        ]
    }" \
'https://rest.clicksend.com/v3/voice/price'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\VoiceApi(new GuzzleHttp\Client(),$config);
$voice_message = new \ClickSend\Model\VoiceMessage();
$voice_message->setTo("+61411111111");
$voice_message->setBody("Jelly liquorice marshmallow candy carrot cake 4Eyffjs1vL.");
$voice_message->setVoice("female");
$voice_message->setCustomString("custom");
$voice_message->setCountry("country");
$voice_message->setSource("php");
$voice_message->setListId(185161);
$voice_message->setLang("en-au");
$voice_message->setSchedule(1577053342);
$voice_message->setRequireInput(1);
$voice_message->setMachineDetection(1);
// \ClickSend\Model\VoiceMessageCollection | VoiceMessageCollection model
$voice_messages = new \ClickSend\Model\VoiceMessageCollection(); 
$voice_messages->setMessages([$voice_message]);

try {
    $result = $apiInstance->voicePricePost($voice_messages);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling VoiceApi->voicePricePost: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME, 
    Password = API_KEY  
};
var voiceApi = new VoiceApi(configuration);
var listOfVoiceMessages = new List<VoiceMessage>();
listOfVoiceMessages.Add(new VoiceMessage(
    to: "+11231231234",
    body: "This is test body",
    voice: "female",
    customString: "Custom String",
    country: "CA",
    source: "sdk",
    lang: "en-us",
    machineDetection: 0,
    requireInput: 0,
    schedule: TimeStamp
));
var voicemessagecollection = new VoiceMessageCollection(listOfVoiceMessages);
var response = voiceApi.VoicePricePost(voicemessagecollection);
var api = require('./api.js');

var voiceDeliveryReceiptApi = new api.VoiceApi("USERNAME", "API_KEY");

var voiceMessage = new api.VoiceMessage();

voiceMessage.to = "+61411111111";
voiceMessage.body = "Jelly liquorice marshmallow candy carrot cake 4Eyffjs1vL";
voiceMessage.voice = "female";
voiceMessage.customString = "this is a test";
voiceMessage.country = "US";
voiceMessage.source = "source";
voiceMessage.listId = 185161;
voiceMessage.lang = "en-au";
voiceMessage.requireInput = 1;
voiceMessage.machineDetection = 1;

var voiceMessages = new api.VoiceMessageCollection();

voiceMessages.messages = [voiceMessage]

voiceDeliveryReceiptApi.voicePricePost(voiceMessages).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::VoiceApi.new

# VoiceMessageCollection | VoiceMessageCollection model
voice_messages = ClickSendClient::VoiceMessageCollection.new(
  "messages": [
    ClickSendClient::VoiceMessage.new(
      "voice": "voice",
      "require_input": 0,
      "to": "to",
      "source": "source",
      "body": "body",
      "lang": "lang",
      "custom_string": "custom_string",
      "machine_detection": 0
    ),
    ClickSendClient::VoiceMessage.new(
      "voice": "voice",
      "require_input": 0,
      "to": "to",
      "source": "source",
      "body": "body",
      "lang": "lang",
      "custom_string": "custom_string",
      "machine_detection": 0
    )
  ]
)

begin
  # Calculate voice price
  result = api_instance.voice_price_post(voice_messages)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling VoiceApi->voice_price_post: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client import VoiceMessage
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.VoiceApi(clicksend_client.ApiClient(configuration))
# VoiceMessageCollection | VoiceMessageCollection model
voice_message=VoiceMessage(source="php",
                body="Jelly liquorice marshmallow candy carrot cake 4Eyffjs1vL.",
                to="+61411111111",
                lang="en-au",
                voice="female",
                schedule="1436874701",
                custom_string="this is a test",
                require_input=1,
                machine_detection=1,country="india")
voice_messages = clicksend_client.VoiceMessageCollection(messages=[voice_message]) 

try:
    # Calculate voice price
    api_response = api_instance.voice_price_post(voice_messages)
    print(api_response)
except ApiException as e:
    print("Exception when calling VoiceApi->voice_price_post: %s\n" % e)
use WWW::ClickSendClient::VoiceApi;
use WWW::ClickSendClient::Object::VoiceMessageCollection;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::VoiceApi->new(username => $username, password => $password);
my %params = (
    'messages' => [
        {
            'voice'             => 'voice',
            'country'           => 'country',
            'require_input'     => 0,
            'to'                => 'to',
            'source'            => 'source',
            'body'              => 'body',
            'lang'              => 'lang',
            'custom_string'     => 'custom_string',
            'machine_detection' => 0
        },
        {
            'voice'             => 'voice',
            'country'           => 'country',
            'require_input'     => 0,
            'to'                => 'to',
            'source'            => 'source',
            'body'              => 'body',
            'lang'              => 'lang',
            'custom_string'     => 'custom_string',
            'machine_detection' => 0
        }
    ]
);

my $voice_messages_obj = WWW::ClickSendClient::Object::VoiceMessageCollection->new(%params);

my $json_output = $api->voice_price_post('voice_messages' => $voice_messages_obj);

print $json_output;
#import "CSDefaultConfiguration.h"
#import "CSVoiceApi.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
// Configure HTTP basic authorization (authentication scheme: BasicAuth)
[apiConfig setUsername:@"USERNAME"];
[apiConfig setPassword:@"PASSWORD"];

CSVoiceMessage *voiceMessage1 = [[CSVoiceMessage alloc] init];
voiceMessage1.to = @"+61411111111";
voiceMessage1.body = @"Jelly two liquorice marshmallow candy carrot cake.";
voiceMessage1.voice = @"female";
voiceMessage1.customString = @"test";
voiceMessage1.country = @"US";
voiceMessage1.source = @"objc";

CSVoiceMessage *voiceMessage2 = [[CSVoiceMessage alloc] init];
voiceMessage2.to = @"+61411111111";
voiceMessage2.body = @"Jelly two liquorice marshmallow candy carrot cake.";
voiceMessage2.voice = @"female";
voiceMessage2.customString = @"test";
voiceMessage2.country = @"US";
voiceMessage2.source = @"objc";

CSVoiceMessageCollection *voiceMessageCollection =  [[CSVoiceMessageCollection alloc] init];
voiceMessageCollection.messages = (NSArray<CSVoiceMessage> *) [NSArray arrayWithObjects:
                                                                        voiceMessage1,
                                                                        voiceMessage2,
                                                                        nil];

CSVoiceApi *voiceAPI = [[CSVoiceApi alloc] init];
[voiceAPI voicePricePostWithVoiceMessages:voiceMessageCollection completionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire

if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}

let voiceMessage1 = VoiceMessage(
    to: "+61411111111", 
    body: "Jelly liquorice marshmallow candy carrot cake.", 
    voice: "female", 
    customString: "test", 
    country: "US", 
    source: "swift", 
    listId: nil, 
    lang: nil, 
    schedule: nil, 
    requireInput: nil, 
    machineDetection: nil
)

let voiceMessage2 = VoiceMessage(
    to: "+61411111111",
    body: "Jelly two liquorice marshmallow candy carrot cake.", 
    voice: "female", 
    customString: "test",
    country: "US",
    source: "swift", 
    listId: nil, 
    lang: nil, 
    schedule: nil, 
    requireInput: nil, 
    machineDetection: nil
)

let voiceMessageCollection = VoiceMessageCollection(messages: [voiceMessage1, voiceMessage2])

VoiceAPI.voicePricePost(voiceMessages: voiceMessageCollection) { (dataString, error) in
    guard let dataString = dataString else {
        print(error!)
        return
    }

    if let data = dataString.data(using: String.Encoding.utf8) {
        do {
            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
            print(dictonary)
            } else {
                print("Cannot convert the String value to JSON")
            }
        } catch let error as NSError {
            print(error)
        }
    }
}
    Coming Soon
package ClickSend;

import java.util.Arrays;
import java.util.List;
import ClickSend.Api.VoiceApi;
import ClickSend.Model.VoiceMessage;
import ClickSend.Model.VoiceMessageCollection;

public class calculate_voice_price {
  public static void main(String[] args) {
    ApiClient defaultClient = new ApiClient();
    defaultClient.setUsername("USERNAME");
    defaultClient.setPassword("API_KEY");
    VoiceApi apiInstance = new VoiceApi(defaultClient);
    VoiceMessage voiceMessage=new VoiceMessage();
    voiceMessage.to("+61411111111");
    voiceMessage.body("Test");
    voiceMessage.voice("female");
    voiceMessage.customString("testing");
    voiceMessage.country("india");
    voiceMessage.source("source");
    voiceMessage.listId(new Integer(185161));
    voiceMessage.lang("lang");
    voiceMessage.schedule(new Integer(1545477071));
    voiceMessage.requireInput(new Integer(1));
    voiceMessage.machineDetection(new Integer(0));
    List<VoiceMessage> voiceMessageList=Arrays.asList(voiceMessage);
    // VoiceMessageCollection | VoiceMessageCollection model
    VoiceMessageCollection voiceMessages = new VoiceMessageCollection(); 
    voiceMessages.messages(voiceMessageList);
    try {
        String result = apiInstance.voicePricePost(voiceMessages);
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling VoiceApi#voicePricePost");
        e.printStackTrace();
    }
  }
}

Body parameter

{
  "messages": [
    {
      "voice": "voice",
      "require_input": 0,
      "to": "+61411111111",
      "source": "source",
      "body": "body",
      "lang": "lang",
      "custom_string": "custom_string",
      "machine_detection": 0
    },
    {
      "voice": "voice",
      "require_input": 0,
      "to": "+61422222222",
      "source": "source",
      "body": "body",
      "lang": "lang",
      "custom_string": "custom_string",
      "machine_detection": 0
    }
  ]
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "Here are your data.",
  "data": {
    "total_price": 0.07,
    "total_count": 1,
    "queued_count": 1,
    "messages": [
      {
        "date": 1436871253,
        "to": "+61411111111",
        "to_type": "mobile",
        "body": "Jelly liquorice marshmallow candy carrot cake 4Eyffjs1vL.",
        "from": null,
        "lang": "en-au",
        "voice": "female",
        "schedule": 1436874701,
        "message_id": "BF7AD270-0DE2-418B-B606-71D527D9C1AE",
        "message_parts": 1,
        "message_price": 0.07,
        "custom_string": "this is a test",
        "user_id": 1,
        "subaccount_id": 1,
        "country": "AU",
        "require_input": 0,
        "machine_detection": 0,
        "status": "SUCCESS"
      }
    ],
    "_currency": {
      "currency_name_short": "USD",
      "currency_prefix_d": "$",
      "currency_prefix_c": "¢",
      "currency_name_long": "US Dollars"
    }
  }
}

https://rest.clicksend.com/v3/voice/price

Calculate voice price

Properties

Name Type Required Restrictions Description
to string true none Your phone number in E.164 format.
body string true none Biscuit uv3nlCOjRk croissant chocolate lollipop chocolate muffin.
voice string true none Either 'female' or 'male'.
custom_string string true none Your reference. Will be passed back with all replies and delivery reports.
country string true none The country of the recipient.
source string false none Your method of sending e.g. 'wordpress', 'php', 'c#'.
list_id integer(int32) false none Your list ID if sending to a whole list. Can be used instead of 'to'.
lang string false none au (string, required) - See section on available languages.
schedule integer(int32) false none Leave blank for immediate delivery. Your schedule time in unix format http://help.clicksend.com/what-is-a-unix-timestamp
require_input integer(int1) false none Recieve a keypress from the recipient. Flag value must be 1 for yes or 0 for no.
machine_detection integer(int1) false none Detect answering machine or voicemail and leave a message. Flag value must be 1 for yes or 0 for no.

Refer to Status Codes for definitions of HTTP status code responses.

View Voice Languages

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \

'https://rest.clicksend.com/v3/voice/lang'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\VoiceApi(new GuzzleHttp\Client(),$config);

try {
    $result = $apiInstance->voiceLangGet();
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling VoiceApi->voiceLangGet: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME, 
    Password = API_KEY  
};
var voiceApi = new VoiceApi(configuration);
var response = voiceApi.VoiceLangGet();
var api = require('./api.js');

var voiceDeliveryReceiptApi = new api.VoiceApi("USERNAME", "API_KEY");

voiceDeliveryReceiptApi.voiceLangGet().then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::VoiceApi.new

begin
  # Get all voice languages
  result = api_instance.voice_lang_get
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling VoiceApi->voice_lang_get: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.VoiceApi(clicksend_client.ApiClient(configuration))

try:
    # Get all voice languages
    api_response = api_instance.voice_lang_get()
    print(api_response)
except ApiException as e:
    print("Exception when calling VoiceApi->voice_lang_get: %s\n" % e)
use WWW::ClickSendClient::VoiceApi;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::VoiceApi->new(username => $username, password => $password);

my $json_output = $api->voice_lang_get();

print $json_output;
#import "CSDefaultConfiguration.h"
#import "CSVoiceApi.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
// Configure HTTP basic authorization (authentication scheme: BasicAuth)
[apiConfig setUsername:@"USERNAME"];
[apiConfig setPassword:@"PASSWORD"];

CSVoiceApi *voiceAPI = [[CSVoiceApi alloc] init];
[voiceAPI voiceLangGetWithCompletionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire

VoiceAPI.voiceLangGet { (dataString, error) in
    guard let dataString = dataString else {
        print(error!)
        return
    }

    if let data = dataString.data(using: String.Encoding.utf8) {
        do {
            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                print(dictonary)
            } else {
                print("Cannot convert the String value to JSON")
            }
        } catch let error as NSError {
            print(error)
        }
    }
}
    Coming Soon
package ClickSend;

import ClickSend.Api.VoiceApi;

public class view_voice_language {
  public static void main(String[] args) {
    ApiClient defaultClient = new ApiClient();
    defaultClient.setUsername("USERNAME");
    defaultClient.setPassword("API_KEY");
    VoiceApi apiInstance = new VoiceApi(defaultClient);
    try {
        String result = apiInstance.voiceLangGet();
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling VoiceApi#voiceLangGet");
        e.printStackTrace();
    }
  }
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "Here are the possible languages.",
  "data": [
    {
      "code": "en-us",
      "country": "English, US",
      "gender": [
        "female",
        "male"
      ]
    },
    {
      "code": "en-au",
      "country": "English, Australia",
      "gender": [
        "female",
        "male"
      ]
    }
  ]
}

https://rest.clicksend.com/v3/voice/lang

Get all voice languages

Refer to Status Codes for definitions of HTTP status code responses.

View Voice Receipts

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \

'https://rest.clicksend.com/v3/voice/receipts'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\VoiceApi(new GuzzleHttp\Client(),$config);
$page = 1; // int | Page number
$limit = 10; // int | Number of records per page

try {
    $result = $apiInstance->voiceReceiptsGet($page, $limit);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling VoiceApi->voiceReceiptsGet: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME, 
    Password = API_KEY  
};
var voiceApi = new VoiceApi(configuration);
var response = voiceApi.VoiceReceiptsGet();
var api = require('./api.js');

var voiceDeliveryReceiptApi = new api.VoiceApi("USERNAME", "API_KEY");

var page = 1;
var limit = 10;

voiceDeliveryReceiptApi.voiceReceiptsGet(page, limit).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::VoiceApi.new

opts = {
  page: 1, # Integer | Page number
  limit: 10 # Integer | Number of records per page
}

begin
  # Get all voice receipts
  result = api_instance.voice_receipts_get(opts)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling VoiceApi->voice_receipts_get: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.VoiceApi(clicksend_client.ApiClient(configuration))
page = 1 # int | Page number (optional) (default to 1)
limit = 10 # int | Number of records per page (optional) (default to 10)

try:
    # Get all voice receipts
    api_response = api_instance.voice_receipts_get(page=page, limit=limit)
    print(api_response)
except ApiException as e:
    print("Exception when calling VoiceApi->voice_receipts_get: %s\n" % e)
use WWW::ClickSendClient::VoiceApi;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::VoiceApi->new(username => $username, password => $password);

my $json_output = $api->voice_receipts_get('page' => 1,'limit' => '10');

print $json_output;
#import "CSDefaultConfiguration.h"
#import "CSVoiceApi.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
// Configure HTTP basic authorization (authentication scheme: BasicAuth)
[apiConfig setUsername:@"USERNAME"];
[apiConfig setPassword:@"PASSWORD"];

CSVoiceApi *voiceAPI = [[CSVoiceApi alloc] init];
[voiceAPI voiceReceiptsGetWithPage:@(1) limit:@(15) completionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire
VoiceAPI.voiceReceiptsGet { (dataString, error) in
    guard let dataString = dataString else {
        print(error!)
        return
    }

    if let data = dataString.data(using: String.Encoding.utf8) {
        do {
            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                print(dictonary)
            } else {
                print("Cannot convert the String value to JSON")
            }
        } catch let error as NSError {
            print(error)
        }
    }
}
    Coming Soon
package ClickSend;

import ClickSend.Api.VoiceApi;

public class view_all_voice_receipt {
  public static void main(String[] args) {
    ApiClient defaultClient = new ApiClient();
    defaultClient.setUsername("USERNAME");
    defaultClient.setPassword("API_KEY");
    VoiceApi apiInstance = new VoiceApi(defaultClient);
    Integer page = 1; // Integer | Page number
    Integer limit = 10; // Integer | Number of records per page
    try {
        String result = apiInstance.voiceReceiptsGet(page, limit);
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling VoiceApi#voiceReceiptsGet");
        e.printStackTrace();
    }
  }
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "Here are your delivery receipts.",
  "data": {
    "total": 2,
    "per_page": 15,
    "current_page": 1,
    "last_page": 1,
    "next_page_url": null,
    "prev_page_url": null,
    "from": 1,
    "to": 2,
    "data": [
      {
        "timestamp_send": "1442381791",
        "timestamp": "1442381791",
        "message_id": "31BC271B-1E0C-45F6-9E7E-97186C46BB82",
        "status_code": "201",
        "status_text": "Success: Message received on handset.",
        "error_code": null,
        "error_text": null,
        "custom_string": null,
        "message_type": "voice",
        "digits": "2"
      },
      {
        "timestamp_send": "1442381829",
        "timestamp": "1442381829",
        "message_id": "23C8ADA3-FD8B-420B-801A-F829BB87AC6F",
        "status_code": "201",
        "status_text": "Success: Message received on handset.",
        "error_code": null,
        "error_text": null,
        "custom_string": null,
        "message_type": "voice",
        "digits": "5"
      }
    ]
  }
}

https://rest.clicksend.com/v3/voice/receipts

Get all voice receipts

Push Delivery Receipts

If you prefer, we can push message replies to your server as they arrive with us.

  1. Log into your account.
  2. Click on your profile on the top right.
  3. Then click on the Messaging Settings option.
  4. Click on Voice then Delivery Report Rules.
  5. Click the 'Add New Rule' button.
  6. Select the 'URL' action.
  7. Enter the URL and click 'Save'.

The following variables will be posted to the URL specified:

Variable                     Description
timestamp_send Timestamp of the original send request in UNIX format. e.g 1439173980
timestamp Timestamp of delivery report in UNIX format. e.g 1439173981
message_id Message ID, returned when originally sending the message.
status Delivered or Undelivered
status_code Status code. Refer to 'Voice Delivery Status Codes' in docs.
status_text Status text.
error_code Error code.
error_text Error text.
custom_string A custom string used when sending the original message.
user_id The user ID of the user who sent the message.
subaccount_id The subaccount ID of the user who sent the message.
message_type 'voice' (constant).
digits Numbers the recipient pressed on their keypad during the call. A blank string will be used if they didn't provide any input.

Pull Delivery Receipts

Receive delivery reports by polling. You can poll our server and retrieve delivery reports at a time that suits you.

  1. Log into your account.
  2. Click on your profile on the top right.
  3. Then click on the Messaging Settings option.
  4. Click on Voice then Delivery Report Rules.
  5. Click the 'Add New Rule' button.
  6. Select the 'Poll' action.
  7. Then click 'Save'.

Parameters

Parameter In Type Required Description
page query integer(int32) false Page number
limit query integer(int32) false Number of records per page

Refer to Status Codes for definitions of HTTP status code responses.

Cancel Voice Message

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
     --request PUT \

'https://rest.clicksend.com/v3/voice/{message_id}/cancel'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\VoiceApi(new GuzzleHttp\Client(),$config);
$message_id = "message_id_example"; // string | Your voice message id

try {
    $result = $apiInstance->voiceCancelByMessageIdPut($message_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling VoiceApi->voiceCancelByMessageIdPut: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME, 
    Password = API_KEY  
};
var voiceApi = new VoiceApi(configuration);
var response = voiceApi.VoiceCancelByMessageIdPut("MESSAGE_ID");
var api = require('./api.js');

var voiceDeliveryReceiptApi = new api.VoiceApi("USERNAME", "API_KEY");

var messageId = "message_id";

voiceDeliveryReceiptApi.voiceCancelByMessageIdPut(messageId).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::VoiceApi.new

message_id = "AEABF1AE-A8F7-471B-BA59-256FFC186D81" # String | Your voice message id

begin
  # Update voice message status as cancelled
  result = api_instance.voice_cancel_by_message_id_put(message_id)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling VoiceApi->voice_cancel_by_message_id_put: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.VoiceApi(clicksend_client.ApiClient(configuration))
message_id = 'B8AEB637-1BE6-47C5-9B6B-584A0EE7F415' # str | Your voice message id

try:
    # Update voice message status as cancelled
    api_response = api_instance.voice_cancel_by_message_id_put(message_id)
    print(api_response)
except ApiException as e:
    print("Exception when calling VoiceApi->voice_cancel_by_message_id_put: %s\n" % e)
use WWW::ClickSendClient::VoiceApi;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::VoiceApi->new(username => $username, password => $password);
my $json_output = $api->voice_cancel_by_message_id_put('message_id'  => '1234');

print $json_output;
#import "CSDefaultConfiguration.h"
#import "CSVoiceApi.h

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
// Configure HTTP basic authorization (authentication scheme: BasicAuth)
[apiConfig setUsername:@"USERNAME"];
[apiConfig setPassword:@"PASSWORD"];

CSVoiceApi *voiceAPI = [[CSVoiceApi alloc] init];
[voiceAPI voiceCancelByMessageIdPutWithMessageId:@"message_id" completionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire

VoiceAPI.voiceCancelByMessageIdPut(messageId: "message_id") { (dataString, error) in
    guard let dataString = dataString else {
        print(error!)
        return
    }

    if let data = dataString.data(using: String.Encoding.utf8) {
        do {
            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                print(dictonary)
            } else {
                print("Cannot convert the String value to JSON")
            }
        } catch let error as NSError {
            print(error)
        }
    }
}
    Coming Soon
package ClickSend;

import ClickSend.Api.VoiceApi;

public class cancel_voice_message {
  public static void main(String[] args) {
    ApiClient defaultClient = new ApiClient();
    defaultClient.setUsername("USERNAME");
    defaultClient.setPassword("API_KEY");
    VoiceApi apiInstance = new VoiceApi(defaultClient);
    // String | Your voice message id
    String messageId = "4FEEA69D-4903-4E03-90BF-BCFB5EBC6BB5"; 
    try {
        String result = apiInstance.voiceCancelByMessageIdPut(messageId);
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling VoiceApi#voiceCancelByMessageIdPut");
        e.printStackTrace();
    }
  }
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "Voice have been cancelled.",
  "data": []
}

https://rest.clicksend.com/v3/voice/{message_id}/cancel

Update voice message status as cancelled

Parameters

Parameter In Type Required Description
message_id path string true Your voice message id

Refer to Status Codes for definitions of HTTP status code responses.

Cancel All Voice Messages

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
     --request PUT \

'https://rest.clicksend.com/v3/voice/cancel-all'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\VoiceApi(new GuzzleHttp\Client(),$config);

try {
    $result = $apiInstance->voiceCancelAllPut();
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling VoiceApi->voiceCancelAllPut: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME, 
    Password = API_KEY  
};
var voiceApi = new VoiceApi(configuration);
var response = voiceApi.VoiceCancelAllPut();
var api = require('./api.js');

var voiceDeliveryReceiptApi = new api.VoiceApi("USERNAME", "API_KEY");

voiceDeliveryReceiptApi.voiceCancelAllPut().then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::VoiceApi.new

begin
  # Update all voice messages as cancelled
  result = api_instance.voice_cancel_all_put
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling VoiceApi->voice_cancel_all_put: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.VoiceApi(clicksend_client.ApiClient(configuration))

try:
    # Update all voice messages as cancelled
    api_response = api_instance.voice_cancel_all_put()
    print(api_response)
except ApiException as e:
    print("Exception when calling VoiceApi->voice_cancel_all_put: %s\n" % e)
use WWW::ClickSendClient::VoiceApi;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::VoiceApi->new(username => $username, password => $password);
my $json_output = $api->voice_cancel_all_put();

print $json_output;
#import "CSDefaultConfiguration.h"
#import "CSVoiceApi.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
// Configure HTTP basic authorization (authentication scheme: BasicAuth)
[apiConfig setUsername:@"USERNAME"];
[apiConfig setPassword:@"PASSWORD"];

CSVoiceApi *voiceAPI = [[CSVoiceApi alloc] init];
[voiceAPI voiceCancelAllPutWithCompletionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire

VoiceAPI.voiceCancelAllPut { (dataString, error) in
    guard let dataString = dataString else {
        print(error!)
        return
    }

    if let data = dataString.data(using: String.Encoding.utf8) {
        do {
            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                print(dictonary)
            } else {
                print("Cannot convert the String value to JSON")
            }
        } catch let error as NSError {
            print(error)
        }
    }
}
    Coming Soon
package ClickSend;

import ClickSend.Api.VoiceApi;

public class cancel_all_voice_msg {
  public static void main(String[] args) {
    ApiClient defaultClient = new ApiClient();
    defaultClient.setUsername("USERNAME");
    defaultClient.setPassword("API_KEY");
    VoiceApi apiInstance = new VoiceApi(defaultClient);
    try {
        String result = apiInstance.voiceCancelAllPut();
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling VoiceApi#voiceCancelAllPut");
        e.printStackTrace();
    }
  }
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "5 messages have been cancelled.",
  "data": {
    "count": 5
  }
}

https://rest.clicksend.com/v3/voice/cancel-all

Update all voice messages as cancelled

Refer to Status Codes for definitions of HTTP status code responses.

Get Voice History

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \

'https://rest.clicksend.com/v3/voice/history?date_from=&date_to='
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\VoiceApi(new GuzzleHttp\Client(),$config);
$date_from = '2018-01-01'; // int | Timestamp (from) used to show records by date.
$date_to = '2019-01-01'; // int | Timestamp (to) used to show records by date
$page = 1; // int | Page number
$limit = 10; // int | Number of records per page

try {
    $result = $apiInstance->voiceHistoryGet($date_from, $date_to, $page, $limit);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling VoiceApi->voiceHistoryGet: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME, 
    Password = API_KEY  
};
var voiceApi = new VoiceApi(configuration);
var response = voiceApi.VoiceHistoryGet();
var api = require('./api.js');

var voiceDeliveryReceiptApi = new api.VoiceApi("USERNAME", "API_KEY");

var dateFrom = '2018-01-01';
var dateTo = '2018-12-31';
var page = 1;
var limit = 10;

voiceDeliveryReceiptApi.voiceHistoryGet(dateFrom, dateTo ,page, limit).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::VoiceApi.new

opts = {
  date_from: 56, # Integer | Timestamp (from) used to show records by date.
  date_to: 56,   # Integer | Timestamp (to) used to show records by date
  page: 1,       # Integer | Page number
  limit: 10      # Integer | Number of records per page
}

begin
  # Get all voice history
  result = api_instance.voice_history_get(opts)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling VoiceApi->voice_history_get: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.VoiceApi(clicksend_client.ApiClient(configuration))
date_from = 56 # int | Timestamp (from) used to show records by date. (optional)
date_to = 56 # int | Timestamp (to) used to show records by date (optional)
page = 1 # int | Page number (optional) (default to 1)
limit = 10 # int | Number of records per page (optional) (default to 10)

try:
    # Get all voice history
    api_response = api_instance.voice_history_get(date_from=date_from, date_to=date_to, page=page, limit=limit)
    print(api_response)
except ApiException as e:
    print("Exception when calling VoiceApi->voice_history_get: %s\n" % e)
use WWW::ClickSendClient::VoiceApi;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::VoiceApi->new(username => $username, password => $password);
my $json_output = $api->voice_history_get('date_from' => 'filename','date_to'  => '','page'  => '','limit' => '');

print $json_output;
#import "CSDefaultConfiguration.h"
#import "CSVoiceApi.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
// Configure HTTP basic authorization (authentication scheme: BasicAuth)
[apiConfig setUsername:@"USERNAME"];
[apiConfig setPassword:@"PASSWORD"];


NSNumber *dateFromNum = [NSNumber numberWithInt:123145123];
NSNumber *dateToNum = [NSNumber numberWithInt:12313332];
NSNumber *page = [NSNumber numberWithInt:1];
NSNumber *limit = [NSNumber numberWithInt:15];

CSVoiceApi *voiceAPI = [[CSVoiceApi alloc] init];
[voiceAPI voiceHistoryGetWithDateFrom:dateFromNum dateTo:dateToNum page:page limit:limit completionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire

VoiceAPI.voiceHistoryGet { (dataString, error) in
    guard let dataString = dataString else {
        print(error!)
        return
    }

    if let data = dataString.data(using: String.Encoding.utf8) {
        do {
            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                print(dictonary)
            } else {
                print("Cannot convert the String value to JSON")
            }
        } catch let error as NSError {
            print(error)
        }
    }
}
    Coming Soon
package ClickSend;

import ClickSend.Api.VoiceApi;

public class view_voice_history {
  public static void main(String[] args) {
    ApiClient defaultClient = new ApiClient();
    defaultClient.setUsername("USERNAME");
    defaultClient.setPassword("API_KEY");
    VoiceApi apiInstance = new VoiceApi(defaultClient);
    Integer dateFrom = 56; // Integer | Timestamp (from) used to show records by date.
    Integer dateTo = 56; // Integer | Timestamp (to) used to show records by date
    Integer page = 1; // Integer | Page number
    Integer limit = 10; // Integer | Number of records per page
    try {
        String result = apiInstance.voiceHistoryGet(dateFrom, dateTo, page, limit);
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling VoiceApi#voiceHistoryGet");
        e.printStackTrace();
    }
  }
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "Here is your history.",
  "data": {
    "total": 1,
    "per_page": 15,
    "current_page": 1,
    "last_page": 1,
    "next_page_url": null,
    "prev_page_url": null,
    "from": 1,
    "to": 1,
    "data": [
      {
        "user_id": 1,
        "subaccount_id": 1,
        "list_id": null,
        "message_id": "D6456F8A-9DF9-46EC-8014-BFE87860F65C",
        "to": "+15184811537",
        "to_type": "mobile",
        "from": "+19403944918",
        "voice": "female",
        "lang": "en-us",
        "body": "this is a test.",
        "carrier": "",
        "country": "US",
        "custom_string": "mystring",
        "schedule": "1538672470",
        "message_parts": "1.00",
        "message_price": "0.17",
        "status": "WaitApproval",
        "status_code": null,
        "status_text": null,
        "date_added": 1443501617,
        "digits": null,
        "machine_detected": 0,
        "require_input": 0
      }
    ]
  }
}

https://rest.clicksend.com/v3/voice/history

Get all voice history

Parameters

Parameter In Type Required Description
date_from query integer(int32) false Start date (Unix Timestamp e.g. 1436849372)
date_to query integer(int32) false End date (Unix Timestamp e.g. 1436879372)
page query integer(int32) false Page number
limit query integer(int32) false Number of records per page

Refer to Status Codes for definitions of HTTP status code responses.

Export Voice History

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \

'https://rest.clicksend.com/v3/voice/history/export?filename={filename}'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\VoiceApi(new GuzzleHttp\Client(),$config);
$filename = "filename_example"; // string | Filename to export to

try {
    $result = $apiInstance->voiceHistoryExportGet($filename);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling VoiceApi->voiceHistoryExportGet: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME, 
    Password = API_KEY  
};
var voiceApi = new VoiceApi(configuration);
var response = voiceApi.VoiceHistoryExportGet("File_Name");
var api = require('./api.js');

var voiceDeliveryReceiptApi = new api.VoiceApi("USERNAME", "API_KEY");

var filename = "filename";

voiceDeliveryReceiptApi.voiceHistoryExportGet(filename).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::VoiceApi.new

filename = "filename_example" # String | Filename to export to

begin
  # Export voice history
  result = api_instance.voice_history_export_get(filename)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling VoiceApi->voice_history_export_get: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.VoiceApi(clicksend_client.ApiClient(configuration))
filename = 'voice_history' # str | Filename to export to

try:
    # Export voice history
    api_response = api_instance.voice_history_export_get(filename)
    print(api_response)
except ApiException as e:
    print("Exception when calling VoiceApi->voice_history_export_get: %s\n" % e)
use WWW::ClickSendClient::VoiceApi;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::VoiceApi->new(username => $username, password => $password);
my $json_output = $api->voice_history_export_get('filename' => 'filename');

print $json_output;
#import "CSDefaultConfiguration.h"
#import "CSVoiceApi.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
// Configure HTTP basic authorization (authentication scheme: BasicAuth)
[apiConfig setUsername:@"USERNAME"];
[apiConfig setPassword:@"PASSWORD"];

CSVoiceApi *voiceAPI = [[CSVoiceApi alloc] init];
[voiceAPI voiceHistoryExportGetWithFilename:@"file_name" completionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire

VoiceAPI.voiceHistoryExportGet(filename: "file_name") { (dataString, error) in
    guard let dataString = dataString else {
        print(error!)
        return
    }

    if let data = dataString.data(using: String.Encoding.utf8) {
        do {
            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                print(dictonary)
            } else {
                print("Cannot convert the String value to JSON")
            }
        } catch let error as NSError {
            print(error)
        }
    }
}
    Coming Soon
package ClickSend;

import ClickSend.Api.VoiceApi;

public class export_voice_history {
  public static void main(String[] args) {
    ApiClient defaultClient = new ApiClient();
    defaultClient.setUsername("USERNAME");
    defaultClient.setPassword("API_KEY");
    VoiceApi apiInstance = new VoiceApi(defaultClient);
    String filename = "filename_example"; // String | Filename to export to
    try {
        String result = apiInstance.voiceHistoryExportGet(filename);
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling VoiceApi#voiceHistoryExportGet");
        e.printStackTrace();
    }
  }
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "Download your file here.",
  "data": {
    "url": "https://rest.clicksend.com/files/22D55AF9-6CF0-476D-A8B3-82A998FD2738?filename=export.csv"
  }
}

https://rest.clicksend.com/v3/voice/history/export

Export voice history

Parameters

Parameter In Type Required Description
filename query string true Filename to export to

Refer to Status Codes for definitions of HTTP status code responses.

Voice Delivery Receipt Rules

Everything about Voice Delivery Receipt Automations

View Voice Delivery Receipt Rules

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
'https://rest.clicksend.com/v3/automations/voice/receipts'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\VoiceDeliveryReceiptRulesApi(new GuzzleHttp\Client(),$config);
$q = "q_example"; // string | Your keyword or query.
$page = 1; // int | Page number
$limit = 10; // int | Number of records per page

try {
    $result = $apiInstance->voiceDeliveryReceiptAutomationsGet($q, $page, $limit);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling VoiceDeliveryReceiptRulesApi->voiceDeliveryReceiptAutomationsGet: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME, 
    Password = API_KEY  
};
var voiceDeliveryReceiptRulesApi = new VoiceDeliveryReceiptRulesApi(configuration);
var response = voiceDeliveryReceiptRulesApi.VoiceDeliveryReceiptAutomationsGet();
var api = require('./api.js');

var voiceDeliveryReceiptApi = new api.VoiceDeliveryReceiptRulesApi("USERNAME", "API_KEY");

var page = 1;
var limit = 10;

voiceDeliveryReceiptApi.voiceDeliveryReceiptAutomationsGet(page, limit).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::VoiceDeliveryReceiptRulesApi.new

opts = {
  page: 1,  # Integer | Page number
  limit: 10 # Integer | Number of records per page
}

begin
  # Get all voice delivery receipt automations
  result = api_instance.voice_delivery_receipt_automations_get(opts)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling VoiceDeliveryReceiptRulesApi->voice_delivery_receipt_automations_get: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.VoiceDeliveryReceiptRulesApi(clicksend_client.ApiClient(configuration))
page = 1 # int | Page number (optional) (default to 1)
limit = 10 # int | Number of records per page (optional) (default to 10)

try:
    # Get all voice delivery receipt automations
    api_response = api_instance.voice_delivery_receipt_automations_get(page=page, limit=limit)
    print(api_response)
except ApiException as e:
    print("Exception when calling VoiceDeliveryReceiptRulesApi->voice_delivery_receipt_automations_get: %s\n" % e)
use WWW::ClickSendClient::VoiceDeliveryReceiptRulesApi;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::VoiceDeliveryReceiptRulesApi->new(username => $username, password => $password);

my $json_output = $api->voice_delivery_receipt_automations_get('page' => '1', 'limit' => '10');

print $json_output;
#import "CSVoiceDeliveryReceiptRulesApi.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
[apiConfig setUsername:@"USERNAME"];
[apiConfig setPassword:@"PASSWORD"];

NSNumber *page = [[NSNumber alloc] initWithInt:1];
NSNumber *limit = [[NSNumber alloc] initWithInt:15];

CSVoiceDeliveryReceiptRulesApi *voiceDeliveryReceiptRulesApiInstance =[[CSVoiceDeliveryReceiptRulesApi alloc] init];
[voiceDeliveryReceiptRulesApiInstance voiceDeliveryReceiptAutomationsGetWithQ:@"string" page:page limit:limit completionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire

if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}

VoiceDeliveryReceiptRulesAPI.voiceDeliveryReceiptAutomationsGet { (dataString, error) in
    guard let dataString = dataString else {
        print(error!)
        return
    }
    if let data = dataString.data(using: String.Encoding.utf8) {
        do {
            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                print(dictonary)
            } else {
                print("Cannot convert the String value to JSON")
            }
        } catch let error as NSError {
            print(error)
        }
    }
}
    Coming Soon
package ClickSend;

import ClickSend.Api.VoiceDeliveryReceiptRulesApi;

public class view_all_voice_delivery_receipt_rule {
    public static void main(String[] args) {
      ApiClient defaultClient = new ApiClient();
      defaultClient.setUsername("USERNAME");
      defaultClient.setPassword("API_KEY");
      VoiceDeliveryReceiptRulesApi apiInstance = new VoiceDeliveryReceiptRulesApi(defaultClient);
      String q = "q_example"; // String | Your keyword or query.
      Integer page = 1; // Integer | Page number
      Integer limit = 10; // Integer | Number of records per page
      try {
        String result = apiInstance.voiceDeliveryReceiptAutomationsGet(q, page, limit);
          System.out.println(result);
      } catch (ApiException e) {
          System.err.println("Exception when calling VoiceDeliveryReceiptRulesApi#voiceDeliveryReceiptAutomationsGet");
          e.printStackTrace();
      }
  }
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "Your voice receipts.",
  "data": {
    "total": 1,
    "per_page": 15,
    "current_page": 1,
    "last_page": 1,
    "next_page_url": null,
    "prev_page_url": null,
    "from": 1,
    "to": 1,
    "data": [
      {
        "receipt_rule_id": 2,
        "rule_name": "My Rule 2",
        "match_type": 3,
        "action": "URL",
        "action_address": "http://yourdomain.com",
        "enabled": 1
      }
    ]
  }
}

https://rest.clicksend.com/v3/automations/voice/receipts

Get all voice delivery receipt automations

Get all voice delivery receipt automations

Parameters

Parameter In Type Required Description
page query integer(int32) false Page number
limit query integer(int32) false Number of records per page

Refer to Status Codes for definitions of HTTP status code responses.

Create Voice Delivery Receipt Rule

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
     --request POST \
     --header "Content-Type: application/json" \
     --data-binary "{
    \"rule_name\":\"My Rule\",
    \"match_type\":3,
    \"action\":\"EMAIL_FIXED\",
    \"action_address\":\"john@doe.com\",
    \"enabled\":1
}" \
'https://rest.clicksend.com/v3/automations/voice/receipts'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\VoiceDeliveryReceiptRulesApi(new GuzzleHttp\Client(),$config);
// \ClickSend\Model\DeliveryReceiptRule | voice delivery receipt rule model
$delivery_receipt_rule = new \ClickSend\Model\DeliveryReceiptRule(); 
$delivery_receipt_rule->setRuleName("my rule");
$delivery_receipt_rule->setMatchType(0);
$delivery_receipt_rule->setAction("URL");
$delivery_receipt_rule->setActionAddress("http://example.com");
$delivery_receipt_rule->setEnabled(1);

try {
    $result = $apiInstance->voiceDeliveryReceiptAutomationPost($delivery_receipt_rule);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling VoiceDeliveryReceiptRulesApi->voiceDeliveryReceiptAutomationPost: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME, 
    Password = API_KEY  
};
var voiceDeliveryReceiptRulesApi = new VoiceDeliveryReceiptRulesApi(configuration);
var response = voiceDeliveryReceiptRulesApi.VoiceDeliveryReceiptAutomationPost(new DeliveryReceiptRule(
    ruleName: "Rule Name",
    matchType: 1,
    action: "URL",
    actionAddress: "https://yourdomain.com",
    enabled: 1
));
var api = require('./api.js');

var voiceDeliveryReceiptApi = new api.VoiceDeliveryReceiptRulesApi("USERNAME", "API_KEY");

var deliveryReceiptRule = new api.DeliveryReceiptRule();

deliveryReceiptRule.ruleName = "My rule";
deliveryReceiptRule.matchType = 1;
deliveryReceiptRule.action = "EMAIL_FIXED";
deliveryReceiptRule.actionAddress = "john@doe.com";
deliveryReceiptRule.enabled = 1;

voiceDeliveryReceiptApi.voiceDeliveryReceiptAutomationPost(deliveryReceiptRule).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::VoiceDeliveryReceiptRulesApi.new

# DeliveryReceiptRule | fax delivery receipt rule model
delivery_receipt_rule = ClickSendClient::DeliveryReceiptRule.new(
  "rule_name": "rule_name",
  "match_type": 1,
  "action": "URL",
  "action_address": "action_address",
  "enabled": 1
)

begin
  # Create voice delivery receipt automations
  result = api_instance.voice_delivery_receipt_automation_post(delivery_receipt_rule)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling VoiceDeliveryReceiptRulesApi->voice_delivery_receipt_automation_post: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.VoiceDeliveryReceiptRulesApi(clicksend_client.ApiClient(configuration))
# DeliveryReceiptRule | voice delivery receipt rule model
delivery_receipt_rule = clicksend_client.DeliveryReceiptRule(
                      rule_name='My Rule',
                      match_type=1.1,
                      action='EMAIL_FIXED',
                      action_address='john@doe.com',
                      enabled=1) 

try:
    # Create voice delivery receipt automations
    api_response = api_instance.voice_delivery_receipt_automation_post(delivery_receipt_rule)
    print(api_response)
except ApiException as e:
    print("Exception when calling VoiceDeliveryReceiptRulesApi->voice_delivery_receipt_automation_post: %s\n" % e)
use WWW::ClickSendClient::VoiceDeliveryReceiptRulesApi;
use WWW::ClickSendClient::Object::DeliveryReceiptRule;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::VoiceDeliveryReceiptRulesApi->new(username => $username, password => $password);

my %params = (
    'rule_name'      => 'rule_name',
    'match_type'     => '1',
    'action'         => 'EMAIL_FIXED',
    'action_address' => 'test1@test.com',
    'enabled'        => '1'
);

my $devlivery_rule_obj = WWW::ClickSendClient::Object::DeliveryReceiptRule->new(%params);

my $json_output = $api->voice_delivery_receipt_automation_post('delivery_receipt_rule' => $devlivery_rule_obj);

print $json_output;
#import "CSVoiceDeliveryReceiptRulesApi.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
[apiConfig setUsername:@"USERNAME"];
[apiConfig setPassword:@"PASSWORD"];

CSDeliveryReceiptRule *deliveryReceiptRule = [[CSDeliveryReceiptRule alloc] init];
deliveryReceiptRule.ruleName = @"string";
deliveryReceiptRule.matchType =0;
deliveryReceiptRule.action = @"string";
deliveryReceiptRule.actionAddress = @"string";
deliveryReceiptRule.enabled =0;

CSVoiceDeliveryReceiptRulesApi *voiceDeliveryReceiptRulesApiInstance =[[CSVoiceDeliveryReceiptRulesApi alloc] init];
[voiceDeliveryReceiptRulesApiInstance voiceDeliveryReceiptAutomationPostWithDeliveryReceiptRule:deliveryReceiptRule completionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire

if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}

let deliveryReceiptRule = DeliveryReceiptRule(ruleName: "ruleName",
                                              matchType: 1,
                                              action: "action",
                                              actionAddress: "actionAddress",
                                              enabled: 1)

VoiceDeliveryReceiptRulesAPI.voiceDeliveryReceiptAutomationPost(deliveryReceiptRule: deliveryReceiptRule) { (dataString, error) in
    guard let dataString = dataString else {
        print(error!)
        return
    }
    if let data = dataString.data(using: String.Encoding.utf8) {
        do {
            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                print(dictonary)
            } else {
                print("Cannot convert the String value to JSON")
            }
        } catch let error as NSError {
            print(error)
        }
    }
}
    Coming Soon
package ClickSend;

import java.math.BigDecimal;
import ClickSend.ApiClient;
import ClickSend.ApiException;
import ClickSend.Api.VoiceDeliveryReceiptRulesApi;
import ClickSend.Model.DeliveryReceiptRule;

public class create_voice_delivery_receipt_rule{
    public static void main(String[] args) {
      ApiClient defaultClient = new ApiClient();
      defaultClient.setUsername("USERNAME");
      defaultClient.setPassword("API_KEY");
      VoiceDeliveryReceiptRulesApi apiInstance = new VoiceDeliveryReceiptRulesApi(defaultClient);
      // DeliveryReceiptRule | voice delivery receipt rule model
      DeliveryReceiptRule deliveryReceiptRule = new DeliveryReceiptRule();
      deliveryReceiptRule.ruleName("new rule");
      deliveryReceiptRule.matchType(new BigDecimal(1.25));
      deliveryReceiptRule.action("EMAIL_FIXED");
      deliveryReceiptRule.actionAddress("xxx@gmail.com");
      deliveryReceiptRule.enabled(new BigDecimal(1));
      try {
          String result = apiInstance.voiceDeliveryReceiptAutomationPost(deliveryReceiptRule);
          System.out.println(result);
      } catch (ApiException e) {
          System.err.println("Exception when calling VoiceDeliveryReceiptRulesApi#voiceDeliveryReceiptAutomationPost");
          e.printStackTrace();
      }
  }
}

Body parameter

{
  "action_address": "action_address",
  "rule_name": "rule_name",
  "match_type": 1,
  "action": "action",
  "enabled": 1
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "Your new voice receipt has been added.",
  "data": {
    "receipt_rule_id": 3,
    "rule_name": "My Rule",
    "match_type": 3,
    "action": "EMAIL_FIXED",
    "action_address": "john@doe.com",
    "enabled": 1
  }
}

https://rest.clicksend.com/v3/automations/voice/receipts

Create voice delivery receipt automations

Create voice delivery receipt automations

Properties

Name Type Required Restrictions Description
rule_name string true none Rule Name.
match_type number true none Match Type. 0=All reports.
action string true none Action to be taken (AUTO_REPLY, EMAIL_USER, EMAIL_FIXED, URL, SMS, POLL, GROUP_SMS, MOVE_CONTACT, CREATE_CONTACT, CREATE_CONTACT_PLUS_EMAIL, CREATE_CONTACT_PLUS_NAME_EMAIL CREATE_CONTACT_PLUS_NAME, SMPP, NONE).
action_address string true none Action address.
enabled number true none Enabled: Disabled=0 or Enabled=1.

Refer to Status Codes for definitions of HTTP status code responses.

View Voice Delivery Receipt Rule

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
'https://rest.clicksend.com/v3/automations/voice/receipts/{receipt_rule_id}'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\VoiceDeliveryReceiptRulesApi(new GuzzleHttp\Client(),$config);
$receipt_rule_id = 4486; // int | Receipt rule id

try {
    $result = $apiInstance->voiceDeliveryReceiptAutomationGet($receipt_rule_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling VoiceDeliveryReceiptRulesApi->voiceDeliveryReceiptAutomationGet: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME, 
    Password = API_KEY  
};
var voiceDeliveryReceiptRulesApi = new VoiceDeliveryReceiptRulesApi(configuration);
var response = voiceDeliveryReceiptRulesApi.VoiceDeliveryReceiptAutomationGet(RULE_ID);
var api = require('./api.js');

var voiceDeliveryReceiptApi = new api.VoiceDeliveryReceiptRulesApi("USERNAME", "API_KEY");

var receiptRuleId = 4481;

voiceDeliveryReceiptApi.voiceDeliveryReceiptAutomationGet(receiptRuleId).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::VoiceDeliveryReceiptRulesApi.new

receipt_rule_id = 56 # Integer | Receipt rule id

begin
  # Get specific voice delivery receipt automation
  result = api_instance.voice_delivery_receipt_automation_get(receipt_rule_id)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling VoiceDeliveryReceiptRulesApi->voice_delivery_receipt_automation_get: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.VoiceDeliveryReceiptRulesApi(clicksend_client.ApiClient(configuration))
receipt_rule_id = 4465 # int | Receipt rule id

try:
    # Get specific voice delivery receipt automation
    api_response = api_instance.voice_delivery_receipt_automation_get(receipt_rule_id)
    print(api_response)
except ApiException as e:
    print("Exception when calling VoiceDeliveryReceiptRulesApi->voice_delivery_receipt_automation_get: %s\n" % e)
use WWW::ClickSendClient::VoiceDeliveryReceiptRulesApi;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::VoiceDeliveryReceiptRulesApi->new(username => $username, password => $password);

my $json_output = $api->voice_delivery_receipt_automation_get('receipt_rule_id' => '12345');

print $json_output;
#import "CSVoiceDeliveryReceiptRulesApi.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
[apiConfig setUsername:@"USERNAME"];
[apiConfig setPassword:@"PASSWORD"];

NSNumber *receiptRuleId = [[NSNumber alloc] initWithInt:1];
CSVoiceDeliveryReceiptRulesApi *voiceDeliveryReceiptRulesApiInstance =[[CSVoiceDeliveryReceiptRulesApi alloc] init];
[voiceDeliveryReceiptRulesApiInstance voiceDeliveryReceiptAutomationGetWithReceiptRuleId:receiptRuleId completionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire

if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}

VoiceDeliveryReceiptRulesAPI.voiceDeliveryReceiptAutomationGet(receiptRuleId: 1) { (dataString, error) in
    guard let dataString = dataString else {
        print(error!)
        return
    }
    if let data = dataString.data(using: String.Encoding.utf8) {
        do {
            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                print(dictonary)
            } else {
                print("Cannot convert the String value to JSON")
            }
        } catch let error as NSError {
            print(error)
        }
    }
}
    Coming Soon
package ClickSend;

import ClickSend.Api.VoiceDeliveryReceiptRulesApi;

public class view_specific_voice_delivery_receipt_rule {
    public static void main(String[] args) {
      ApiClient defaultClient = new ApiClient();
      defaultClient.setUsername("USERNAME");
      defaultClient.setPassword("API_KEY");
      VoiceDeliveryReceiptRulesApi apiInstance = new VoiceDeliveryReceiptRulesApi(defaultClient);
      Integer receiptRuleId = 4471; // Integer | Receipt rule id
      try {
          String result = apiInstance.voiceDeliveryReceiptAutomationGet(receiptRuleId);
          System.out.println(result);
      } catch (ApiException e) {
          System.err.println("Exception when calling VoiceDeliveryReceiptRulesApi#voiceDeliveryReceiptAutomationGet");
          e.printStackTrace();
      }
  }
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "Your rule incoming voice receipt.",
  "data": {
    "receipt_rule_id": 2,
    "rule_name": "My Rule 2",
    "match_type": 3,
    "action": "URL",
    "action_address": "http://yourdomain.com",
    "enabled": 1
  }
}

https://rest.clicksend.com/v3/automations/voice/receipts/{receipt_rule_id}

Get specific voice delivery receipt automation

Get specific voice delivery receipt automation

Parameters

Parameter In Type Required Description
receipt_rule_id path integer(int32) true Receipt rule id

Refer to Status Codes for definitions of HTTP status code responses.

Update Voice Delivery Receipt Rule

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
     --request PUT \
     --header "Content-Type: application/json" \
     --data-binary "{
    \"rule_name\":\"My Rule\",
    \"match_type\":3,
    \"action\":\"EMAIL_FIXED\",
    \"action_address\":\"john@doe.com\",
    \"enabled\":1
}" \
'https://rest.clicksend.com/v3/automations/voice/receipts/{receipt_rule_id}'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\VoiceDeliveryReceiptRulesApi(new GuzzleHttp\Client(),$config);
$receipt_rule_id = 4486; // int | Receipt rule id
// \ClickSend\Model\DeliveryReceiptRule | Delivery receipt rule model
$delivery_receipt_rule = new \ClickSend\Model\DeliveryReceiptRule(); 
$delivery_receipt_rule->setRuleName("my rule");
$delivery_receipt_rule->setMatchType(0);
$delivery_receipt_rule->setAction("URL");
$delivery_receipt_rule->setActionAddress("http://example.com");
$delivery_receipt_rule->setEnabled(1);

try {
    $result = $apiInstance->voiceDeliveryReceiptAutomationPut($receipt_rule_id, $delivery_receipt_rule);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling VoiceDeliveryReceiptRulesApi->voiceDeliveryReceiptAutomationPut: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME, 
    Password = API_KEY  
};
var voiceDeliveryReceiptRulesApi = new VoiceDeliveryReceiptRulesApi(configuration);
var response = voiceDeliveryReceiptRulesApi.VoiceDeliveryReceiptAutomationPut(RULE_ID, new DeliveryReceiptRule(
    ruleName: "Rule Name",
    matchType: 1,
    action: "URL",
    actionAddress: "https://yourdomain.com",
    enabled: 1
));
var api = require('./api.js');

var voiceDeliveryReceiptApi = new api.VoiceDeliveryReceiptRulesApi("USERNAME", "API_KEY");

var receiptRuleId = 4481;

var deliveryReceiptRule = new api.DeliveryReceiptRule();

deliveryReceiptRule.ruleName = "My rule";
deliveryReceiptRule.matchType = 1;
deliveryReceiptRule.action = "EMAIL_FIXED";
deliveryReceiptRule.actionAddress = "john@doe.com";
deliveryReceiptRule.enabled = 1;

voiceDeliveryReceiptApi.voiceDeliveryReceiptAutomationPut(receiptRuleId, deliveryReceiptRule).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::VoiceDeliveryReceiptRulesApi.new

receipt_rule_id = 56 # Integer | Receipt rule id

# DeliveryReceiptRule | fax delivery receipt rule model
delivery_receipt_rule = ClickSendClient::DeliveryReceiptRule.new(
  "rule_name": "rule_name",
  "match_type": 1234,
  "action": "action",
  "action_address": "action_address",
  "enabled": 1
)

begin
  # Update voice delivery receipt automation
  result = api_instance.voice_delivery_receipt_automation_put(receipt_rule_id, delivery_receipt_rule)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling VoiceDeliveryReceiptRulesApi->voice_delivery_receipt_automation_put: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.VoiceDeliveryReceiptRulesApi(clicksend_client.ApiClient(configuration))
receipt_rule_id = 4465 # int | Receipt rule id
# DeliveryReceiptRule | Delivery receipt rule model
delivery_receipt_rule = clicksend_client.DeliveryReceiptRule(
                        rule_name='updated Rule',
                        match_type=1.5,
                        action='EMAIL_FIXED',
                        action_address='abc_new@doe.com',
                        enabled=1) 

try:
    # Update voice delivery receipt automation
    api_response = api_instance.voice_delivery_receipt_automation_put(receipt_rule_id, delivery_receipt_rule)
    print(api_response)
except ApiException as e:
    print("Exception when calling VoiceDeliveryReceiptRulesApi->voice_delivery_receipt_automation_put: %s\n" % e)
use WWW::ClickSendClient::VoiceDeliveryReceiptRulesApi;
use WWW::ClickSendClient::Object::DeliveryReceiptRule;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::VoiceDeliveryReceiptRulesApi->new(username => $username, password => $password);

my %params = (
    'rule_name'      => 'rule_name_updated',
    'match_type'     => '1',
    'action'         => 'EMAIL_FIXED',
    'action_address' => 'test1@test.com',
    'enabled'        => '1'

);

my $devlivery_rule_obj = WWW::ClickSendClient::Object::DeliveryReceiptRule->new(%params);

my $json_output = $api->voice_delivery_receipt_automation_put( 'delivery_receipt_rule' => $devlivery_rule_obj ,'receipt_rule_id' => '12345');

print $json_output;
#import "CSVoiceDeliveryReceiptRulesApi.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
[apiConfig setUsername:@"USERNAME"];
[apiConfig setPassword:@"PASSWORD"];

NSNumber *receiptId = [[NSNumber alloc] initWithInt:1];
CSDeliveryReceiptRule *deliveryReceiptRule = [[CSDeliveryReceiptRule alloc] init];
deliveryReceiptRule.ruleName = @"string";
deliveryReceiptRule.matchType =0;
deliveryReceiptRule.action = @"action";
deliveryReceiptRule.actionAddress = @"action_address";
deliveryReceiptRule.enabled =0;

CSVoiceDeliveryReceiptRulesApi *voiceDeliveryReceiptRulesApiInstance =[[CSVoiceDeliveryReceiptRulesApi alloc] init];
[voiceDeliveryReceiptRulesApiInstance voiceDeliveryReceiptAutomationPutWithReceiptRuleId:receiptId  deliveryReceiptRule:deliveryReceiptRule completionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire

if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}
          let deliveryReceiptRule = DeliveryReceiptRule(ruleName: "ruleName",
                                                        matchType: 1,
                                                        action: "action",
                                                        actionAddress: "actionAddress",
                                                        enabled: 1)

VoiceDeliveryReceiptRulesAPI.voiceDeliveryReceiptAutomationPut(receiptRuleId: 1, deliveryReceiptRule: deliveryReceiptRule) { (dataString, error) in
    guard let dataString = dataString else {
        print(error!)
        return
    }
    if let data = dataString.data(using: String.Encoding.utf8) {
        do {
            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                print(dictonary)
            } else {
                print("Cannot convert the String value to JSON")
            }
        } catch let error as NSError {
            print(error)
        }
    }
}
    Coming Soon
package ClickSend;

import java.math.BigDecimal;
import ClickSend.Api.VoiceDeliveryReceiptRulesApi;
import ClickSend.Model.DeliveryReceiptRule;

public class update_voice_delivery_receipt_rule {
   public static void main(String[] args) {
      ApiClient defaultClient = new ApiClient();
      defaultClient.setUsername("USERNAME");
      defaultClient.setPassword("API_KEY");
      VoiceDeliveryReceiptRulesApi apiInstance = new VoiceDeliveryReceiptRulesApi(defaultClient);
      Integer receiptRuleId = 4476; // Integer | Receipt rule id
      DeliveryReceiptRule deliveryReceiptRule = new DeliveryReceiptRule(); // DeliveryReceiptRule | Delivery receipt rule model
      deliveryReceiptRule.ruleName("new rule");
      deliveryReceiptRule.matchType(new BigDecimal(1.25));
      deliveryReceiptRule.action("EMAIL_FIXED");
      deliveryReceiptRule.actionAddress("xxx@gmail.com");
      deliveryReceiptRule.enabled(new BigDecimal(1));
       try {
          String result = apiInstance.voiceDeliveryReceiptAutomationPut(receiptRuleId, deliveryReceiptRule);
          System.out.println(result);
      } catch (ApiException e) {
          System.err.println("Exception when calling VoiceDeliveryReceiptRulesApi#voiceDeliveryReceiptAutomationPut");
          e.printStackTrace();
      }
   }
}

Body parameter

{
  "action_address": "action_address",
  "rule_name": "rule_name",
  "match_type": 1234,
  "action": "action",
  "enabled": 1
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "Your rule incoming voice receipt.",
  "data": {
    "receipt_rule_id": 2,
    "rule_name": "My Rule 2",
    "match_type": 3,
    "action": "URL",
    "action_address": "http://yourdomain.com",
    "enabled": 1
  }
}

https://rest.clicksend.com/v3/automations/voice/receipts/{receipt_rule_id}

Update voice delivery receipt automation

Update voice delivery receipt automation

Parameters

Parameter In Type Required Description
receipt_rule_id path integer(int32) true Receipt rule id

Properties

Name Type Required Restrictions Description
rule_name string true none Rule Name.
match_type number true none Match Type. 0=All reports.
action string true none Action to be taken (AUTO_REPLY, EMAIL_USER, EMAIL_FIXED, URL, SMS, POLL, GROUP_SMS, MOVE_CONTACT, CREATE_CONTACT, CREATE_CONTACT_PLUS_EMAIL, CREATE_CONTACT_PLUS_NAME_EMAIL CREATE_CONTACT_PLUS_NAME, SMPP, NONE).
action_address string true none Action address.
enabled number true none Enabled: Disabled=0 or Enabled=1.

Refer to Status Codes for definitions of HTTP status code responses.

Delete Voice Delivery Receipt Rule

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
     --request DELETE \
'https://rest.clicksend.com/v3/automations/voice/receipts/{receipt_rule_id}'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\VoiceDeliveryReceiptRulesApi(new GuzzleHttp\Client(),$config);
$receipt_rule_id = 4486; // int | Receipt rule id

try {
    $result = $apiInstance->voiceDeliveryReceiptAutomationDelete($receipt_rule_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling VoiceDeliveryReceiptRulesApi->voiceDeliveryReceiptAutomationDelete: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME, 
    Password = API_KEY  
};
var voiceDeliveryReceiptRulesApi = new VoiceDeliveryReceiptRulesApi(configuration);
var response = voiceDeliveryReceiptRulesApi.VoiceDeliveryReceiptAutomationDelete(RULE_ID);
var api = require('./api.js');

var voiceDeliveryReceiptApi = new api.VoiceDeliveryReceiptRulesApi("USERNAME", "API_KEY");

var receiptRuleId = 4481;

voiceDeliveryReceiptApi.voiceDeliveryReceiptAutomationDelete(receiptRuleId).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::VoiceDeliveryReceiptRulesApi.new

receipt_rule_id = 56 # Integer | Receipt rule id

begin
  # Delete voice delivery receipt automation
  result = api_instance.voice_delivery_receipt_automation_delete(receipt_rule_id)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling VoiceDeliveryReceiptRulesApi->voice_delivery_receipt_automation_delete: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.VoiceDeliveryReceiptRulesApi(clicksend_client.ApiClient(configuration))
receipt_rule_id = 4465 # int | Receipt rule id

try:
    # Delete voice delivery receipt automation
    api_response = api_instance.voice_delivery_receipt_automation_delete(receipt_rule_id)
    print(api_response)
except ApiException as e:
    print("Exception when calling VoiceDeliveryReceiptRulesApi->voice_delivery_receipt_automation_delete: %s\n" % e)
use WWW::ClickSendClient::VoiceDeliveryReceiptRulesApi;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::VoiceDeliveryReceiptRulesApi->new(username => $username, password => $password);

my $json_output = $api->voice_delivery_receipt_automation_delete('receipt_rule_id' => '12345');

print $json_output;
#import "CSVoiceDeliveryReceiptRulesApi.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
[apiConfig setUsername:@"USERNAME"];
[apiConfig setPassword:@"PASSWORD"];

NSNumber *receiptRuleId = [[NSNumber alloc] initWithInt:1];
CSVoiceDeliveryReceiptRulesApi *voiceDeliveryReceiptRulesApiInstance =[[CSVoiceDeliveryReceiptRulesApi alloc] init];
[voiceDeliveryReceiptRulesApiInstance voiceDeliveryReceiptAutomationDeleteWithReceiptRuleId:receiptRuleId completionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire

if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}

VoiceDeliveryReceiptRulesAPI.voiceDeliveryReceiptAutomationDelete(receiptRuleId: 1) { (dataString, error) in
    guard let dataString = dataString else {
        print(error!)
        return
    }
    if let data = dataString.data(using: String.Encoding.utf8) {
        do {
            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                print(dictonary)
            } else {
                print("Cannot convert the String value to JSON")
            }
        } catch let error as NSError {
            print(error)
        }
    }
}
    Coming Soon
package ClickSend;

import ClickSend.Api.VoiceDeliveryReceiptRulesApi;

public class delete_voice_delivery_receipt_rule {
   public static void main(String[] args) {
      ApiClient defaultClient = new ApiClient();
      defaultClient.setUsername("USERNAME");
      defaultClient.setPassword("API_KEY");
      VoiceDeliveryReceiptRulesApi apiInstance = new VoiceDeliveryReceiptRulesApi(defaultClient);
      Integer receiptRuleId = 4466; // Integer | Receipt rule id
      try {
          String result = apiInstance.voiceDeliveryReceiptAutomationDelete(receiptRuleId);
          System.out.println(result);
      } catch (ApiException e) {
          System.err.println("Exception when calling VoiceDeliveryReceiptRulesApi#voiceDeliveryReceiptAutomationDelete");
          e.printStackTrace();
      }
  }
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "Your rule voice receipt has been deleted.",
  "data": []
}

https://rest.clicksend.com/v3/automations/voice/receipts/{receipt_rule_id}

Delete voice delivery receipt automation

Delete voice delivery receipt automation

Parameters

Parameter In Type Required Description
receipt_rule_id path integer(int32) true Receipt rule id

Refer to Status Codes for definitions of HTTP status code responses.

Delivery Issues

Everything about Delivery Issues

Delivery Issues

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
'https://rest.clicksend.com/v3/delivery-issues'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\DeliveryIssuesApi(new GuzzleHttp\Client(),$config);
$page = 1; // int | Page number
$limit = 10; // int | Number of records per page

try {
    $result = $apiInstance->deliveryIssuesGet($page, $limit);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling DeliveryIssuesApi->deliveryIssuesGet: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME, 
    Password = API_KEY  
};
var deliveryIssuesApi = new DeliveryIssuesApi(configuration);
var response = deliveryIssuesApi.DeliveryIssuesGet();

var api = require('./api.js');

var deliveryIssuesApi = new api.DeliveryIssuesApi("USERNAME", "API_KEY");

var page = 1;
var limit = 10;

deliveryIssuesApi.deliveryIssuesGet(page, limit).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::DeliveryIssuesApi.new

opts = {
  page: 1,  # Integer | Page number
  limit: 10 # Integer | Number of records per page
}

begin
  # Get all delivery issues
  result = api_instance.delivery_issues_get(opts)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling DeliveryIssuesApi->delivery_issues_get: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.DeliveryIssuesApi(clicksend_client.ApiClient(configuration))
page = 1 # int | Page number (optional) (default to 1)
limit = 10 # int | Number of records per page (optional) (default to 10)

try:
    # Get all delivery issues
    api_response = api_instance.delivery_issues_get(page=page, limit=limit)
    print(api_response)
except ApiException as e:
    print("Exception when calling DeliveryIssuesApi->delivery_issues_get: %s\n" % e)
use WWW::ClickSendClient::DeliveryIssuesApi;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::DeliveryIssuesApi->new(username => $username, password => $password);

my $json_output = $api->delivery_issues_get('page' => '1', 'limit' => '10');

print $json_output;
#import "CSDeliveryIssuesApi.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
[apiConfig setUsername:@"USERNAME"];
[apiConfig setPassword:@"PASSWORD"];

NSNumber *page = [[NSNumber alloc] initWithInt:1];
NSNumber *limit = [[NSNumber alloc] initWithInt:15];

CSDeliveryIssuesApi *deliveryIssuesApiInstance = [[CSDeliveryIssuesApi alloc] init];
[deliveryIssuesApiInstance deliveryIssuesGetWithPage:page limit:limit completionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire

if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}
DeliveryIssuesAPI.deliveryIssuesGet { (dataString, error) in
    guard let dataString = dataString else {
        print(error!)
        return
    }
    if let data = dataString.data(using: String.Encoding.utf8) {
        do {
            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                print(dictonary)
            } else {
                print("Cannot convert the String value to JSON")
            }
        } catch let error as NSError {
            print(error)
        }
    }
}
    Coming Soon
package ClickSend;

import ClickSend.Api.DeliveryIssuesApi;

public class view_delivery_issues {
  public static void main(String[] args) {
    ApiClient defaultClient = new ApiClient();
    defaultClient.setUsername("USERNAME");
    defaultClient.setPassword("API_KEY");
    DeliveryIssuesApi apiInstance = new DeliveryIssuesApi(defaultClient);
    Integer page = 1; // Integer | Page number
    Integer limit = 10; // Integer | Number of records per page
    try {
        String result = apiInstance.deliveryIssuesGet(page, limit);
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling DeliveryIssuesApi#deliveryIssuesGet");
        e.printStackTrace();
    }
  }
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "Here is your result.",
  "data": {
    "total": 5,
    "per_page": 15,
    "current_page": 1,
    "last_page": 1,
    "next_page_url": null,
    "prev_page_url": null,
    "from": 1,
    "to": 7,
    "data": [
      {
        "issue_id": 1,
        "user_id": 3820,
        "message_id": "B388828B-AD46-4366-8AD3-0305FF5E3FE5",
        "type": "sms",
        "description": "this is a test.",
        "client_comments": null,
        "support_comments": null,
        "status": null,
        "date_added": 1481610495,
        "resolved": 0,
        "email_address": "test@user.com"
      },
      {
        "issue_id": 2,
        "user_id": 3820,
        "message_id": "90396A38-146B-46C4-A455-675F620C2E05",
        "type": "sms",
        "description": "this is a test.",
        "client_comments": null,
        "support_comments": null,
        "status": null,
        "date_added": 1481610523,
        "resolved": 0,
        "email_address": "test@user.com"
      },
      {
        "issue_id": 3,
        "user_id": 3820,
        "message_id": "4ECFB6CB-0300-45EC-96E1-5AB189432AF5",
        "type": "sms",
        "description": "this is a test.",
        "client_comments": null,
        "support_comments": null,
        "status": null,
        "date_added": 1481611389,
        "resolved": 0,
        "email_address": "test@user.com"
      },
      {
        "issue_id": 4,
        "user_id": 3820,
        "message_id": "test",
        "type": "sms",
        "description": "this is a test.",
        "client_comments": null,
        "support_comments": null,
        "status": null,
        "date_added": 1481611467,
        "resolved": 0,
        "email_address": "test@user.com"
      },
      {
        "issue_id": 5,
        "user_id": 3820,
        "message_id": "test",
        "type": "SMS",
        "description": "this is a test.",
        "client_comments": null,
        "support_comments": null,
        "status": null,
        "date_added": 1481614516,
        "resolved": 0,
        "email_address": "test@user.com"
      }
    ]
  }
}

https://rest.clicksend.com/v3/delivery-issues

Get all delivery issues

Get all delivery issues

Parameters

Parameter In Type Required Description
page query integer(int32) false Page number
limit query integer(int32) false Number of records per page

Refer to Status Codes for definitions of HTTP status code responses.

Delivery Issues

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
     --request POST \
     --header "Content-Type: application/json" \
     --data-binary "{
  \"message_id\": \"B388828B-AD46-4366-8AD3-0305FF5E3FE5\",
  \"type\": \"SMS\",
  \"description\": \"This is a test\",
  \"client_comments\": \"test\",
  \"email_address\": \"john_doe@user.com\"
}" \
'https://rest.clicksend.com/v3/delivery-issues'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\DeliveryIssuesApi(new GuzzleHttp\Client(),$config);
$delivery_issue = new \ClickSend\Model\DeliveryIssue(); // \ClickSend\Model\DeliveryIssue | DeliveryIssue model
$delivery_issue->setMessageId("B388828B-AD46-4366-8AD3-0305FF5E3FE5");
$delivery_issue->setType("SMS");
$delivery_issue->setDescription("This is a test");
$delivery_issue->setClientComments("test");
$delivery_issue->setEmailAddress("john_doe@user.com");
try {
    $result = $apiInstance->deliveryIssuesPost($delivery_issue);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling DeliveryIssuesApi->deliveryIssuesPost: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME, 
    Password = API_KEY  
};
var deliveryIssuesApi = new DeliveryIssuesApi(configuration);
var response = deliveryIssuesApi.DeliveryIssuesPost(new DeliveryIssue(
    messageId: "MESSAGE_ID",
    type: "MESSAGE_TYPE",
    description: "DESCRIPTION",
    clientComments: "CLIENT_COMMENTS",
    emailAddress: "EMAIL_ID"
));
var api = require('./api.js');

var deliveryIssuesApi = new api.DeliveryIssuesApi("USERNAME", "API_KEY");

var deliveryIssue = new api.DeliveryIssue();

deliveryIssue.messageId = "message_id";
deliveryIssue.type = "SMS";
deliveryIssue.description = "This is a test";
deliveryIssue.clientComments = "comment";
deliveryIssue.emailAddress = "xxx@gmail.com";

deliveryIssuesApi.deliveryIssuesPost(deliveryIssue).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::DeliveryIssuesApi.new

# DeliveryIssue | DeliveryIssue model
delivery_issue = ClickSendClient::DeliveryIssue.new(
  "client_comments": "client_comments",
  "description": "description",
  "message_id": "message_id",
  "type": "type",
  "email_address": "email_address"
)

begin
  # Create delivery Issue
  result = api_instance.delivery_issues_post(delivery_issue)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling DeliveryIssuesApi->delivery_issues_post: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.DeliveryIssuesApi(clicksend_client.ApiClient(configuration))
# DeliveryIssue | DeliveryIssue model
delivery_issue = clicksend_client.DeliveryIssue(
                  message_id='B388828B-AD46-4366-8AD3-0305FF5E3FE5',
                  type='SMS',
                  description='This is a test',
                  client_comments='test',
                  email_address= 'john_doe@user.com') 

try:
    # Create delivery Issue
    api_response = api_instance.delivery_issues_post(delivery_issue)
    print(api_response)
except ApiException as e:
    print("Exception when calling DeliveryIssuesApi->delivery_issues_post: %s\n" % e)
use WWW::ClickSendClient::DeliveryIssuesApi;
use WWW::ClickSendClient::Object::DeliveryIssue;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::DeliveryIssuesApi->new(username => $username, password => $password);

my %params = (
    'message_id'      => 'message_id',
    'type'            => 'SMS',
    'description'     => 'description',
    'client_comments' => 'client_comments',
    'email_address'   => 'test1@test.com'
);

my $delivery_issue_obj = WWW::ClickSendClient::Object::DeliveryIssue->new(%params);
my $json_output = $api->delivery_issues_post('delivery_issue' => $delivery_issue_obj);

print $json_output;
#import "CSDeliveryIssuesApi.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
[apiConfig setUsername:@"USERNAME"];
[apiConfig setPassword:@"PASSWORD"];


CSDeliveryIssue *deliveryIssue = [[CSDeliveryIssue alloc] init];
deliveryIssue.messageId = @"message_id";
deliveryIssue.type = @"SMS";
deliveryIssue._description = @"description";
deliveryIssue.clientComments = @"client_comments";
deliveryIssue.emailAddress = @"email_address";

CSDeliveryIssuesApi *deliveryIssuesApiInstance = [[CSDeliveryIssuesApi alloc] init];
[deliveryIssuesApiInstance deliveryIssuesPostWithDeliveryIssue:deliveryIssue completionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire

if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}
let deliveryIssue = DeliveryIssue(
                        messageId: "messageId", 
                        type: "SMS", 
                        _description: "desciption", 
                        clientComments: "clientcomments", 
                        emailAddress: "emailAddress"
                    )
DeliveryIssuesAPI.deliveryIssuesPost(deliveryIssue: deliveryIssue) { (dataString, error) in
    guard let dataString = dataString else {
        print(error!)
        return
    }
    if let data = dataString.data(using: String.Encoding.utf8) {
        do {
            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                print(dictonary)
            } else {
                print("Cannot convert the String value to JSON")
            }
        } catch let error as NSError {
            print(error)
        }
    }
}
    Coming Soon
package ClickSend;

import ClickSend.Api.DeliveryIssuesApi;
import ClickSend.Model.DeliveryIssue;

public class create_delivery_issue {
  public static void main(String[] args) {
    ApiClient defaultClient = new ApiClient();
    defaultClient.setUsername("USERNAME");
    defaultClient.setPassword("API_KEY");
    DeliveryIssuesApi apiInstance = new DeliveryIssuesApi(defaultClient);
    // DeliveryIssue | DeliveryIssue model
    DeliveryIssue deliveryIssue = new DeliveryIssue();
    deliveryIssue.messageId("B388828B-AD46-4366-8AD3-0305FF5E3FTY");
    deliveryIssue.type("SMS");
    deliveryIssue.description("testing");
    deliveryIssue.clientComments("test");
    deliveryIssue.emailAddress("xxx@gmail.com");
    try {
        String result = apiInstance.deliveryIssuesPost(deliveryIssue);
        System.out.println(result);
    } catch (ApiException e) {
        System.err.println("Exception when calling DeliveryIssuesApi#deliveryIssuesPost");
        e.printStackTrace();
    }
  }
}

Body parameter

{
  "client_comments": "client_comments",
  "email-address": "email-address",
  "description": "description",
  "message_id": "message_id",
  "type": "type"
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "Delivery issue has been created.",
  "data": {
    "issue_id": 9,
    "user_id": 3820,
    "message_id": "B388828B-AD46-4366-8AD3-0305FF5E3FE5",
    "type": "SMS",
    "description": "this is a test.",
    "date_added": 1481617579,
    "email_address": "john_doe@user.com"
  }
}

https://rest.clicksend.com/v3/delivery-issues

Create delivery Issue

Create delivery Issue

Properties

Name Type Required Restrictions Description
message_id string false none The message id of the message.
type string true none The type of message, must be one of the following values SMS, MMS, VOICE, EMAIL_MARKETING, EMAIL_TRANSACTIONAL, FAX, POST.
description string true none The description of the message.
client_comments string false none The user's comments.
email-address string true none The user's email address.

Refer to Status Codes for definitions of HTTP status code responses.

Timezones

Everything about Timezones

Timezones

Code samples

curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
'https://rest.clicksend.com/v3/timezones'
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuth
$config = ClickSend\Configuration::getDefaultConfiguration()
              ->setUsername('USERNAME')
              ->setPassword('API_KEY');

$apiInstance = new ClickSend\Api\TimezonesApi(new GuzzleHttp\Client(),$config);
$page = 1; // int | Page number
$limit = 10; // int | Number of records per page

try {
    $result = $apiInstance->timezonesGet($page, $limit);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling TimezonesApi->timezonesGet: ', $e->getMessage(), PHP_EOL;
}
?>
using IO.ClickSend.ClickSend.Api;
using IO.ClickSend.Client;
using IO.ClickSend.ClickSend.Model;

var configuration = new Configuration()
{
    Username = USERNAME, 
    Password = API_KEY  
};
var timezonesApi = new TimezonesApi(configuration);
var response = timezonesApi.TimezonesGet();
var api = require('./api.js');

var timezonesApi = new api.TimezonesApi("USERNAME", "API_KEY");

var page = 1;
var limit = 10;

timezonesApi.timezonesGet(page, limit).then(function(response) {
  console.log(response.body);
}).catch(function(err){
  console.error(err.body);
});
# load the gem
require 'clicksend_client'
require 'json'

# setup authorization
ClickSendClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'USERNAME'
  config.password = 'API_KEY'
end

api_instance = ClickSendClient::TimezonesApi.new

opts = {
  page: 1,  # Integer | Page number
  limit: 10 # Integer | Number of records per page
}

begin
  # Get supported list of timezones.
  result = api_instance.timezones_get(opts)
  p JSON.parse(result)
rescue ClickSendClient::ApiError => e
  puts "Exception when calling TimezonesApi->timezones_get: #{e.response_body}"
end
from __future__ import print_function
import clicksend_client
from clicksend_client.rest import ApiException

# Configure HTTP basic authorization: BasicAuth
configuration = clicksend_client.Configuration()
configuration.username = 'USERNAME'
configuration.password = 'API_KEY'

# create an instance of the API class
api_instance = clicksend_client.TimezonesApi(clicksend_client.ApiClient(configuration))
page = 1 # int | Page number (optional) (default to 1)
limit = 10 # int | Number of records per page (optional) (default to 10)

try:
    # Get supported list of timezones.
    api_response = api_instance.timezones_get(page=page, limit=limit)
    print(api_response)
except ApiException as e:
    print("Exception when calling TimezonesApi->timezones_get: %s\n" % e)
use WWW::ClickSendClient::TimezonesApi;

my $username = 'YOUR_API_USER_NAME';
my $password = 'YOUR_API_PASSWORD';

my $api = WWW::ClickSendClient::TimezonesApi->new(username => $username, password => $password);

my $json_output = $api->timezones_get('page'  => '1','limit' => '10');

print $json_output;
#import "CSDefaultConfiguration.h"
#import "CSTimeZonesApi.h"

CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];
[apiConfig setUsername:@"USERNAME"];
[apiConfig setPassword:@"PASSWORD"];

NSNumber *page = [[NSNumber alloc] initWithInt:1];
NSNumber*limit = [[NSNumber alloc] initWithInt:15];

CSTimezonesApi *timeZonesApiInstance = [[CSTimezonesApi alloc] init];
[timeZonesApiInstance timezonesGetWithPage:page limit:limit completionHandler:^(NSString *output, NSError *error) {
    if (error) {
        NSLog(@"Error: %@", error);
    } else {
        NSLog(@"%@", output);
    }
}];
import Alamofire

if let authHeader = Request.authorizationHeader(user: "USERNAME", password: "PASSWORD") {
    ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
}
TimezonesAPI.timezonesGet(page: 1, limit: 15) { (dataString, error) in
    guard let dataString = dataString else {
        print(error!)
        return
    }
    if let data = dataString.data(using: String.Encoding.utf8) {
        do {
            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                print(dictonary)
            } else {
                print("Cannot convert the String value to JSON")
            }
        } catch let error as NSError {
            print(error)
        }
    }
}
    Coming Soon
package ClickSend;

import ClickSend.Api.TimezonesApi;

public class timezone {
   public static void main(String[] args) {
      ApiClient defaultClient = new ApiClient();
      defaultClient.setUsername("USERNAME");
      defaultClient.setPassword("API_KEY");
      TimezonesApi apiInstance = new TimezonesApi(defaultClient);
      Integer page = 1; // Integer | Page number
      Integer limit = 10; // Integer | Number of records per page
      try {
          String result = apiInstance.timezonesGet(page, limit);
          System.out.println(result);
      } catch (ApiException e) {
          System.err.println("Exception when calling TimezonesApi#timezonesGet");
          e.printStackTrace();
      }
  }
}

Response

{
  "http_code": 200,
  "response_code": "SUCCESS",
  "response_msg": "List of timezones.",
  "data": [
    "Africa/Abidjan",
    "Africa/Accra",
    "Africa/Addis_Ababa",
    "Africa/Algiers",
    "Africa/Asmara",
    "Africa/Bamako",
    "Africa/Bangui",
    "etc..."
  ]
}

https://rest.clicksend.com/v3/timezones

Get supported list of timezones.

Get supported list of timezones.

Parameters

Parameter In Type Required Description
page query integer(int32) false Page number
limit query integer(int32) false Number of records per page

Refer to Status Codes for definitions of HTTP status code responses.