APIMethodsInterface

epochta-client~ APIMethodsInterface

Original API methods specification

Source:

Default methods performs validation of required arguments

Methods

(static) addAddressBook(apiRequestArguments) → {Promise.<number>}

Source:

Creates new address book with provided name and description.

Parameters:
Name Type Description
apiRequestArguments Object
Properties
Name Type Attributes Description
name string

Name of the address book

description string <optional>

Description of the address book

Returns:
  • Unique identifier of the created address book
Type
Promise.<number>

(static) addPhoneToAddressBook(apiRequestArguments) → {Promise.<number>}

Source:

Adds phone number to address book

Parameters:
Name Type Description
apiRequestArguments Object
Properties
Name Type Attributes Description
idAddressBook number

id of the address book

phone number <optional>

phone number

data Array.<number, string> <optional>

array of phone numbers and variables

variables number <optional>

personalization variables

Returns:

Phone number id

Type
Promise.<number>

(static) addPhoneToExceptions(apiRequestArguments) → {Promise.<number>}

Source:

Add phone number to exceptions

Parameters:
Name Type Description
apiRequestArguments Object
Properties
Name Type Attributes Description
idPhone number <optional>

phone number record id

phone number <optional>

phone number

reason string <optional>

reason for adding phone to exception

Returns:

unique exception id

Type
Promise.<number>

(static) cancelCampaign(apiRequestArguments) → {Promise.<number>}

Source:

Cancel campaign until it started

Parameters:
Name Type Description
apiRequestArguments Object
Properties
Name Type Description
id number

campaign id

Returns:
Type
Promise.<number>

(static) checkCampaignPrice(apiRequestArguments) → {Promise.<number>}

Source:

Check campaign price by address book

Parameters:
Name Type Description
apiRequestArguments Object
Properties
Name Type Attributes Description
sender number

sender id

text string

message text

list_id number

address book id

type 2 | 3 | 4 <optional>

Russian Federation only, see https://www.epochta.ru/products/sms/v3.php

asender number <optional>

alternative sender

Returns:

campaign price in current currency

Type
Promise.<number>

(static) checkCampaignPriceGroup(apiRequestArguments) → {Promise.<{price: number, currency: string}>}

Source:

Check campaign price for a custom group of recipients

Parameters:
Name Type Description
apiRequestArguments Object
Properties
Name Type Attributes Description
sender number

sender id

text string

message text

phones string

JSON string, array of arrays ["phone number"[, "variables"]]

type 2 | 3 | 4 <optional>

Russian Federation only, see https://www.epochta.ru/products/sms/v3.php

asender number <optional>

alternative sender

Returns:
Type
Promise.<{price: number, currency: string}>

(static) cloneAddressBook(apiRequestArguments) → {Promise.<module:epochta-client.AddressBookClonedResponse>}

Source:

Creates a copy of address book with new id

Parameters:
Name Type Description
apiRequestArguments Object
Properties
Name Type Description
idAddressBook number

id of the address book to clone

Returns:
Type
Promise.<module:epochta-client.AddressBookClonedResponse>

(static) createCampaign(apiRequestArguments) → {Promise.<{id: number, price: number}>}

Source:

Create campaign by address book

Parameters:
Name Type Description
apiRequestArguments Object
Properties
Name Type Attributes Default Description
sender number

sender id

text string

message text

list_id number

address book id

datetime Date <optional>

to schedule mailing for a given date-time

batch number <optional>
0

For partial mailing - the number of sms in the 1st part

batchinterval number <optional>
0

For partial mailing - interval between parts

sms_lifetime number <optional>
0

Lifetime of SMS (hours) 0 == maximum

control_phone number <optional>

phone number for mailing quality control

type 2 | 3 | 4 <optional>

Russian Federation only, see https://www.epochta.ru/products/sms/v3.php

asender number <optional>

alternative sender

Returns:
  • id and price(in user currency) for created campaign
Type
Promise.<{id: number, price: number}>

(static) delAddressBook(apiRequestArguments) → {Promise.<boolean>}

Source:

Deletes an address book by id.

Parameters:
Name Type Description
apiRequestArguments Object
Properties
Name Type Description
idAddressBook number

id of the address book to delete

Returns:
  • In case of success returns true, otherwise throws Error
Type
Promise.<boolean>

(static) deleteCampaign(apiRequestArguments) → {Promise.<number>}

Source:

Delete campaign

Parameters:
Name Type Description
apiRequestArguments Object
Properties
Name Type Description
id number

campaign id

Returns:
Type
Promise.<number>

(static) delPhoneFromAddressBook(apiRequestArguments) → {Promise.<boolean>}

Source:

Deletes phone number from address book

Parameters:
Name Type Description
apiRequestArguments Object
Properties
Name Type Attributes Description
idAddressBook number <optional>

id of the address book

idPhone number <optional>

id of the phone number to delete

Returns:
  • In case of success returns true, otherwise throws Error
Type
Promise.<boolean>

(static) delPhoneFromAddressBookGroup(apiRequestArguments) → {Promise.<boolean>}

Source:

Deletes group of phone numbers from address book

Parameters:
Name Type Description
apiRequestArguments Object
Properties
Name Type Description
idPhones string

phone number ids to delete, separated with comma

Returns:
  • In case of success returns true, otherwise throws Error
Type
Promise.<boolean>

(static) delPhoneFromExceptions(apiRequestArguments) → {Promise.<boolean>}

Source:

Delete phone number from exceptions

Parameters:
Name Type Description
apiRequestArguments Object
Properties
Name Type Attributes Description
idPhone number <optional>

phone number record id

phone number <optional>

phone number

idException number <optional>

exception id

Returns:
Type
Promise.<boolean>

(static) editExceptions(apiRequestArguments) → {Promise.<boolean>}

Source:

Edit phone number in exceptions

Parameters:
Name Type Description
apiRequestArguments Object
Properties
Name Type Attributes Description
idException number <optional>

exception id

reason string <optional>

reason for adding phone to exception

Returns:
Type
Promise.<boolean>

(static) editPhone(apiRequestArguments) → {Promise.<boolean>}

Source:

Edits phone number

Parameters:
Name Type Description
apiRequestArguments Object
Properties
Name Type Description
idPhone number

phone number id

phone number

new phone number

variables number

new personalization variables

Returns:
  • In case of success returns true, otherwise throws Error
Type
Promise.<boolean>

(static) getAddressBook(apiRequestArguments) → {Promise.<(module:epochta-client.AddressBook|Array.<module:epochta-client.AddressBook>)>}

Source:

Returns address book data. If no arguments provided - returns all address books data.

Parameters:
Name Type Description
apiRequestArguments Object
Properties
Name Type Attributes Description
idAddressBook number <optional>

id of the address book to get data. If not provided, returns all address books data

from number <optional>

return address books starting at 'from' (API inner index number NOT AN idAddressBook !!!)

offset number <optional>

number of address books to return

Returns:
Type
Promise.<(module:epochta-client.AddressBook|Array.<module:epochta-client.AddressBook>)>

(static) getCampaignDeliveryStats(apiRequestArguments) → {Promise.<module:epochta-client.CampaignDeliveryStats>}

Source:

Get campaign delivery statuses information

Parameters:
Name Type Description
apiRequestArguments Object
Properties
Name Type Attributes Description
id number

campaign id

datefrom Date <optional>

return only statuses updated after datefrom

Returns:
Type
Promise.<module:epochta-client.CampaignDeliveryStats>

(static) getCampaignDeliveryStatsGroup(apiRequestArguments) → {Promise.<module:epochta-client.CampaignDeliveryStats>}

Source:

Get campaign delivery statuses information for a group of campaigns

Parameters:
Name Type Description
apiRequestArguments Object
Properties
Name Type Description
id string

campaign ids separated with comma

Returns:
Type
Promise.<module:epochta-client.CampaignDeliveryStats>

(static) getCampaignInfo(apiRequestArguments) → {Promise.<module:epochta-client.CampaignInfo>}

Source:

Get campaign information

Parameters:
Name Type Description
apiRequestArguments Object
Properties
Name Type Description
id number

campaign id

Returns:
Type
Promise.<module:epochta-client.CampaignInfo>

(static) getCampaignList(apiRequestArguments) → {Promise.<module:epochta-client.CampaignList>}

Source:

Get a list of campaigns

Parameters:
Name Type Description
apiRequestArguments Object
Returns:
Type
Promise.<module:epochta-client.CampaignList>

(static) getException(apiRequestArguments) → {Promise.<(module:epochta-client.PhoneException|Array.<module:epochta-client.PhoneException>)>}

Source:

Get an exception / exceptions

Parameters:
Name Type Description
apiRequestArguments Object
Properties
Name Type Attributes Description
idException number <optional>

exception id

phone number <optional>

phone number

idAddressBook number <optional>

id of the address book to delete

from number <optional>

return exceptions starting at 'from'

offset number <optional>

number of exceptions to return

Returns:
Type
Promise.<(module:epochta-client.PhoneException|Array.<module:epochta-client.PhoneException>)>

(static) getPhoneFromAddressBook(apiRequestArguments) → {Promise.<(module:epochta-client.PhoneNumber|Array.<module:epochta-client.PhoneNumber>)>}

Source:

Retrieves phone numbers data

Parameters:
Name Type Description
apiRequestArguments Object
Properties
Name Type Attributes Description
idAddressBook number <optional>

id of the address book

idPhone number <optional>

phone number id

phone number <optional>

phone number

from number <optional>

return phone numbers starting at 'from'

offset number <optional>

number of phone numbers to return

Returns:
Type
Promise.<(module:epochta-client.PhoneNumber|Array.<module:epochta-client.PhoneNumber>)>

(static) getSenderStatus(apiRequestArguments) → {Promise.<(module:epochta-client.SenderName|Array.<module:epochta-client.SenderName>)>}

Source:

Get sender data

Parameters:
Name Type Description
apiRequestArguments Object
Properties
Name Type Attributes Description
idName number <optional>

sender id

name string <optional>

sender name

country string <optional>

registration country

from number <optional>

return sender names starting at 'from'

offset number <optional>

number of sender names to return

Returns:
Type
Promise.<(module:epochta-client.SenderName|Array.<module:epochta-client.SenderName>)>

(static) getTaskInfo(apiRequestArguments) → {Promise.<Array.<module:epochta-client.TaskInfo>>}

Source:

Get full status for campaigns

Parameters:
Name Type Description
apiRequestArguments Object
Properties
Name Type Description
taskIds string

campaign ids separated with comma

Returns:
Type
Promise.<Array.<module:epochta-client.TaskInfo>>

(static) getUserBalance(apiRequestArguments) → {Promise.<module:epochta-client.Balance>}

Source:

Balance check

Parameters:
Name Type Description
apiRequestArguments Object
Properties
Name Type Attributes Description
currency module:epochta-client.Currency <optional>

currency

Returns:
Type
Promise.<module:epochta-client.Balance>

(static) registerSenderName(apiRequestArguments) → {Promise.<module:epochta-client.SenderShortName>}

Source:

Sender name registration

Parameters:
Name Type Description
apiRequestArguments Object
Properties
Name Type Attributes Description
name string

sender name (11 letters or 14 digits max!)

description string <optional>

base64 encrypted description of provided services (required for UA)

siteUrl string <optional>

contact site url (required for UA)

smsSubject string <optional>

base64 encrypted sms subject (required for UA)

taxId string <optional>

TIN

taxName string <optional>

base64 encrypted name of your legal entity

operatorId number <optional>

operator 1-Megafon, 2-MTS (required for RU)

country 'RU' | 'UA' | 'SA' | 'EG'

registration country

Returns:
Type
Promise.<module:epochta-client.SenderShortName>

(static) searchAddressBook(apiRequestArguments) → {Promise.<(module:epochta-client.AddressBook|Array.<module:epochta-client.AddressBook>)>}

Source:

Performs search of address book

Parameters:
Name Type Description
apiRequestArguments Object
Properties
Name Type Attributes Description
searchFields module:epochta-client.AddressBookSearchFields

Search params object

from number <optional>

return address books starting at 'from' (search result array index number NOT AN idAddressBook !!!)

offset number <optional>

number of address books to return

Returns:
Type
Promise.<(module:epochta-client.AddressBook|Array.<module:epochta-client.AddressBook>)>

(static) searchPhones(apiRequestArguments) → {Promise.<(module:epochta-client.PhoneNumber|Array.<module:epochta-client.PhoneNumber>)>}

Source:

Search for phone number

Parameters:
Name Type Description
apiRequestArguments Object
Properties
Name Type Attributes Description
searchFields module:epochta-client.PhoneNumberSearchFields

Search params object

from number <optional>

return phone numbers starting at 'from'

offset number <optional>

number of phone numbers to return

Returns:
Type
Promise.<(module:epochta-client.PhoneNumber|Array.<module:epochta-client.PhoneNumber>)>

(static) searchPhonesInExceptions(apiRequestArguments) → {Promise.<(module:epochta-client.PhoneException|Array.<module:epochta-client.PhoneException>)>}

Source:

Search for exceptions

Parameters:
Name Type Description
apiRequestArguments Object
Properties
Name Type Attributes Description
searchFields module:epochta-client.AddressBookSearchFields

Search params object

from number <optional>

return exceptions starting at 'from'

offset number <optional>

number of exceptions to return

Returns:
Type
Promise.<(module:epochta-client.PhoneException|Array.<module:epochta-client.PhoneException>)>

(static) sendSMS(apiRequestArguments) → {Promise.<{id: number, price: number}>}

Source:

Send SMS to any phone

Parameters:
Name Type Description
apiRequestArguments Object
Properties
Name Type Attributes Default Description
sender number

sender id

text string

message text

phone number

recipient phone number

datetime Date <optional>

to schedule mailing for a given date-time

sms_lifetime number <optional>
0

Lifetime of SMS (hours) 0 == maximum

type 2 | 3 | 4 <optional>

Russian Federation only, see https://www.epochta.ru/products/sms/v3.php

asender number <optional>

alternative sender

Returns:
  • id and price(in user currency) for created campaign
Type
Promise.<{id: number, price: number}>

(static) sendSMSGroup(apiRequestArguments) → {Promise.<{id: number, price: number}>}

Source:

Send SMS to custom group of recipients

Parameters:
Name Type Description
apiRequestArguments Object
Properties
Name Type Attributes Default Description
sender number

sender id

text string

message text

phones string

JSON string, array of arrays ["phone number"[, "variables"]]

datetime Date <optional>

to schedule mailing for a given date-time

sms_lifetime number <optional>
0

Lifetime of SMS (hours) 0 == maximum

type 2 | 3 | 4 <optional>

Russian Federation only, see https://www.epochta.ru/products/sms/v3.php

asender number <optional>

alternative sender

Returns:
  • id and price(in user currency) for created campaign
Type
Promise.<{id: number, price: number}>