Adding telephone numbers to a mailing list

To add telephone numbers to a mailing list submit a POST request to

https://api.sendpulse.com/sms/numbers

Request parameters:

addressBookId the ID of the mailing list (int)
phones the bulk telephone list in json format

A sample response when retrieving mailing list information: 

[
 {
   "result": true,
   "counters": {
     "added": 0,
     "exceptions": 0,
     "exists": 83
   }
 }
]
 

Updating the list of variables by a phone number

For updating the list of variables by a phone number submit a PUT request to

https://api.sendpulse.com/sms/numbers

Request parameters:

addressBookId the ID of the mailing list (int)
phones the bulk telephone list in json format
variables the array of variables in json format

A sample response: 

[
 {
   "result": true,
   "counters": {
     "updated": 4
   }
 }
]
 

Deleting telephone numbers from a mailing list

To delete a phone number from a mailing list submit a DELETE request to

https://api.sendpulse.com/sms/numbers

Request parameters:

phones the bulk telephone list in json format
addressBookId the ID of the mailing list

A sample response: 

[
 {
   "result": true,
   "counters": {
     "added": 0,
"exists": 3
} } ]
 

Retrieving information for specific phone number

To retrieve information for specific phone number submit a GET request to

https://api.sendpulse.com/sms/numbers/info/{addressBookId}/{phoneNumber}

Request parameters:

phoneNumber a phone number
addressBookId a mailing list ID

A sample response: 

[
 {
   "result": true,
   "data": {
     "status": 1,
     "variables": {
       "test1": "2018-10-10 23:00:00",
       "test2": "czxczxczx",
       "test3": 12312312312
     },
    "added": "2017-02-21 13:19:47" 
    }
 }
]
 

Adding telephone number to the blacklist

To add telephone number to the blacklist submit a POST request to

https://api.sendpulse.com/sms/black_list

Request parameters:

phones the bulk telephone list in json format
description description

A sample response: 

[
 {
   "result": true,
   "counters": {
     "added": 2,
     "exists": 3 
    }
 }
]
 

Deleting a phone number from the blacklist

To delete a phone number from the blacklist submit a DELETE request to

https://api.sendpulse.com/sms/black_list

Request parameters:

phones the bulk telephone list in json format

A sample response: 

[
 {
	"result": true,
	"counters": {
		"removed": 3
    }
 }
]
 

Viewing the blacklist

To view the blacklist submit a GET request to

https://api.sendpulse.com/sms/black_list

A sample response: 


[
 {
   "result": true,
   "data": [ {
		"phone": 380506383302,
		"description": "texst",
		"add_date": "2017-02-27 10:48:22"
	},
	]
  }
]
 

Retrieving information of telephone numbers in the blacklist

To retrieve information of telephone numbers in the blacklist submit a GET request to

https://api.sendpulse.com/sms/black_list/by_numbers

Request parameters:

phones a list of telephone numbers in json format

A sample response: 


[
  {
   "result": true,
   "data": [ {
		"phone": 380506383302,
		"description": "texst",
		"add_date": "2017-02-27 10:48:22"
	},
	]
}
]
 

Creating of a campaign

To create a campaign submit a POST request to

https://api.sendpulse.com/sms/campaigns

Request parameters:

sender sender (optional)
addressBookId a mailing list
body the text of a campaign
date the date of a campaign in Y-m-d H:i:s format (optional)
transliterate 1 or 0 , transliteration of a body

A sample response: 


[
 {
  "result": true,
  "campaign_id": 2623084
 }
]
 

Creating a campaign to a list of phone numbers

To create a campaign to a list of phone numbers submit a POST request to

https://api.sendpulse.com/sms/send

Request parameters:

sender sender (optional)
phones the bulk telephone list in json format
body the text of a mailing
date the date of a campaign in Y-m-d H:i:s format (optional)
transliterate 1 or 0 , transliteration of a body

A sample response: 


[
 {
   "result": true,
   "campaign_id": 2623085,
   "counters": {
     "exceptions": 0,
     "sends": 3
   }
 }
]
 

Retrieving a list of campaigns by date

To retrieve a list of campaigns by date submit a GET request to

https://api.sendpulse.com/sms/campaigns/list

Request parameters:

dateFrom the date from in Y-m-d H:i:s format
dateTo the date until in Y-m-d H:i:s format

A sample response: 


[
 {
   "result": true,
   "data": [ {
     "id": 2136035,
     "address_book_id": 0,
     "company_price": 0.81,
     "company_currency": "USD",
     "send_date": "2017-01-18 08:15:18",
     "date_created": "2017-01-18 08:15:18",
     "sender_mail_address": "",
     "sender_mail_name": "",
     "external_stat": []
   }, 
   {
   "id": 2136036,
   "address_book_id": 0,
   "company_price": 0.27,
   "company_currency": "USD",
   "send_date": "2017-01-18 11:59:52",
   "date_created": "2017-01-18 11:59:52",
   "sender_mail_address": "",
   "sender_mail_name": "",
   "external_stat": []
   },
   ]
 }
]
 

Retrieving a campaign information

To retrieve a campaign information submit a GET request to

https://api.sendpulse.com/sms/campaigns/info/{id}

Request parameters:

{id} the ID of the mailing

A sample response: 


[
 {
   "result": true,
   "data": {
     "id": 2136035,
     "address_book_id": 0,
     "currency": "USD",
     "company_price": 0.81,
     "send_date": "2017-01-18 08:15:18",
     "date_created": "2017-01-18 08:15:18",
     "sender_mail_address": "",
     "sender_mail_name": "",
     "external_stat": [],
     "task_phones_info": [ {
     "phone": 380632636296,
     "money_spent": 0.27
     }, {
        "phone": 380632636298,
        "money_spent": 0.27
        }, {
         "phone": 380632636299,
         "money_spent": 0.27
           }
     ]
   }
 }
]
 

Cancelling a campaign in case when the sending has not started

To cancel a campaign submit a PUT request to

https://api.sendpulse.com/sms/campaigns/cancel/{id}

Request parameters:

{id} the ID of the mailing

A sample response: 


[
 {
   "result": false
 }
]
 

Calculating the cost of a campaign

To calculate the cost of a campaign submit a GET request to

https://api.sendpulse.com/sms/campaigns/cost

If the mailing list is not specified, the list of phone numbers should be specified and vice versa.

Request parameters:

addressBookId a mailing list ID (optional)
sender a sender
phones the bulk telephone list in json format (optional)
body The body of a message

A sample response: 


[
 {
   "result": true,
   "data": {
     "price": 0.05,
     "currency": "USD" 
   }
 }
]
 

Deleting a campaign

To delete a campaign submit a DELETE request to

https://api.sendpulse.com/sms/campaigns

Request parameters:

id a campaign ID

A sample response: 

[
 {
   "result": false | true
 }
]
 

Adding telephone numbers to a mailing list with variables

To add telephone numbers to a mailing list with variables submit a POST request to

https://api.sendpulse.com/sms/numbers/variables

Request parameters:

addressBookId the ID of the mailing list (int)
phones the array of phones in json format (find example below)

A sample response: 


[
  {
    "result": true,
    "counters": {
    "added": 0,
    "exceptions": 0,
    "exists": 83
    }
  }
]

'14158002961' => [
        [
            ['name' => 'test1', 'type' => 'date', 'value' => '2018-10-10 23:00:00'],
            ['name' => 'test2', 'type' => 'string', 'value' => 'czxczxczx'],
            ['name' => 'test3', 'type' => 'number', 'value' => '12312312312']
        ]
    ],
     '14158002960 ' => [
        [
            ['name' => 'test1', 'type' => 'date', 'value' => '2018-10-10 23:00:00'],
            ['name' => 'test2', 'type' => 'string', 'value' => 'czxczxczx'],
            ['name' => 'test3', 'type' => 'number', 'value' => '12312312312']
        ]
    ],