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.
Either:
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.
OR
username
: Your account username
password
: Your account password
These are the same credentials that you use to login to the dashboard.
Authorization Header
The Authorization header is constructed as follows:
- Username and password are combined into a string
username:password
- The resulting string is then encoded using Base64 encoding
- The authorization method and a space i.e. "Basic " is then put before the encoded string.
For example, if the user uses Aladdin
as the username and open sesame
as the password then the header is formed as follows:
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
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. |
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. |
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. |
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.
Search
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:
AND
- returns results matching all query fields specifiedOR
- returns results matching any query fields specified
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.
+61411111111
+61422222222
+61433333333
+61444444444
+14055555555
+14055555666
+447777777777
+8615555555555
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.
+61411111111
+61422222222
+61433333333
+61444444444
+14055555555
+14055555666
+447777777777
+8615555555555
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.
+61261111111
+61262222222
+61263333333
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.
test1@test.com
test2@test.com
test3@test.com
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.
11111
22222
33333
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 |
---|---|---|---|---|
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. |
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. |
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("