Перейти к содержимому

Manage vendors

Это содержимое пока не доступно на вашем языке.

These methods manage vendors, the carriers you terminate calls to, the same as the Vendors screen of the panel. The gateways of a vendor are its connections. To change a vendor’s balance, use the methods in Change a vendor’s balance.

All methods support trusted mode with i_customer.

createVendor and updateVendor take these fields, and getVendorInfo and listVendors return them together with i_vendor. Required applies to createVendor.

Name Type Required Description
name string yes Vendor Name
web_login string yes Web Login of the vendor’s portal
web_password string yes Web Password of the vendor’s portal
i_time_zone int yes Time Zone of the vendor’s portal and reports. See Time zones
base_currency string no Base Currency, ISO 4217, for example USD. Fixed after creation
balance double no Opening Balance. Fixed after creation; change it with vendorAddFunds, vendorCredit or vendorDebit
i_lang string no Language of the portal, a two-letter code such as en
i_export_type int no Download Format, from the export_types dictionary
i_password_policy int no Password Policy for the web password
round_up boolean no Calls Duration: True for Round-Up, False (default) for Round
cost_round_up boolean no Calls Cost: True for Round-Up, False (default) for Round
decimal_precision int no Cost Decimal Precision: decimals kept for the cost of each call. Default 20
company_name, salutation, first_name, mid_init, last_name string no Company Name, Mr./Ms…, First Name, M.I., Last Name
street_addr, city, state, postal_code, country string no Address, City, Province/State, Postal Code, Country/Region
contact, phone, fax, alt_phone, alt_contact string no Contact, Phone, Fax, Alt. Phone, Alt. Contact
email, cc, bcc string no E-Mail, CC, BCC

The dictionaries are read with getDictionary.

Creates a vendor. addVendor is another name for the same method.

The fields of the vendor structure.

Name Type Description
result string OK
i_vendor int ID of the new vendor
request
call("createVendor", {
"name": "Example Carrier",
"web_login": "example-carrier",
"web_password": "Vx4-mT8-qL2",
"i_time_zone": 1,
"base_currency": "USD",
"email": "noc@carrier.example.com",
})
response
{"result": "OK", "i_vendor": 41}

Changes a vendor. Fields you leave out keep their values. balance and base_currency cannot be changed.

Name Type Required Description
i_vendor int yes ID of the vendor
other fields no Any field of the vendor structure
Name Type Description
result string OK
request
call("updateVendor", {"i_vendor": 41, "decimal_precision": 4})
response
{"result": "OK"}

Deletes a vendor together with its connections. Routing group entries that used those connections stop matching.

Name Type Required Description
i_vendor int yes ID of the vendor
Name Type Description
result string OK
request
call("deleteVendor", {"i_vendor": 41})
response
{"result": "OK"}

Returns one vendor by ID or by name.

Name Type Required Description
i_vendor int one of ID of the vendor
name string one of Name of the vendor
Name Type Description
result string OK
vendor struct i_vendor and the fields of the vendor structure
request
call("getVendorInfo", {"i_vendor": 41})
response
{
"result": "OK",
"vendor": {
"i_vendor": 41,
"name": "Example Carrier",
"web_login": "example-carrier",
"base_currency": "USD",
"balance": 250.0,
"i_time_zone": 1,
"round_up": False,
"cost_round_up": False,
"decimal_precision": 4,
# … the other fields
},
}

Returns your vendors. getVendorsList is an older name for the same method, with the same parameters and result.

Name Type Required Description
name_pattern string no Filter by name, an SQL ILIKE pattern: case-insensitive, % matches any characters. %carrier% finds every name containing carrier
limit int no Return at most this many vendors
offset int no Skip this many vendors first
Name Type Description
result string OK
vendors array One struct per vendor, with i_vendor and the fields of the vendor structure
request
call("listVendors", {"name_pattern": "%carrier%", "limit": 50, "offset": 0})
response
{
"result": "OK",
"vendors": [
{"i_vendor": 41, "name": "Example Carrier", "web_login": "example-carrier",
"balance": 250.0, "base_currency": "USD"}, # … the other fields
],
}