Add contact, method: /api/contact-add/json/
Example:
It is also possible to fill in additional contact fields. For this, the identifier of the additional field is specified as a variable, and the values are accepted with the same types as the specified field
№ | Field | Type | Description | Required or not | Comment |
1 | login | string | Login in BOX system | Required field. | |
2 | password | string | Password in md5 format | Required field. | Contact tech support and we will give you a hash for the API |
3 | name | string | username | Optional field. | |
4 | userlogin | string | username | Optional field. | |
5 | userpass | string | user password | Optional field. | |
6 | string | email user | Required field (or email or phone must be). | ||
7 | phone | string | user phone | Required field (or email or phone must be). | |
8 | address | string | full user address in one line (deprecated parameter) | Optional field. | |
9 | country | string | Country | Optional field. | |
10 | region | string | Region (area) | Optional field. | |
11 | district | string | District | Optional field. | |
12 | city | string | Name of the settlement | Optional field. | |
13 | street | string | Street | Optional field. | |
14 | street_number | string | House number | Optional field. | |
15 | apartment | string | Apartment | Optional field. | |
16 | bdate | date | user's birthday | Optional field. | |
17 | parentid | integer | by recommendation from | Optional field. | |
18 | level | integer | user access level | Optional field. | Access levels: 0 - locked 1 - client 2 - Employee 3 - Administrator |
19 | commentadmin | string | admin comment | Optional field. | |
20 | groupid | integer | user group | Optional field. | BOX contact group ID |
21 | source | integer | User source | Optional field. | Source ID in the BOX system |
22 | pricelevel | string | user price level | Optional field. | The name of the price you want to set the user |
23 | distribution | boolean | Subscribed mailing list contact | Optional field. | |
24 | tags | string | Tags | Optional field. | |
25 | namelast | string | user's last name | Optional field. | |
26 | namemiddle | string | User's middle name | Optional field. | |
27 | typesex | string | user gender | Optional field. | The default user type is male. Available user types: man - man woman - woman company - company |
28 | company | string | user company | Optional field. | |
29 | code1c | string | code1c user | Optional field. | id user from your system |
30 | companyid | integer | id user company | Optional field. | |
31 | companycode1c | integer | external company code of the user | Optional field. | |
32 | emails | string | email-s user (optional) | Optional field. | Specify through space (test @ tset.ua dddd@ya.ru) |
33 | managerid | integer | id OneBox manager | Optional field. | |
34 | managercode | string | code1c OneBox manager | Optional field. | |
35 | employer | boolean | Является ли контакт сотрудником | Optional field. | |
36 | phones | string | User phone numbers (additional) | Optional field. | Separate spaces (380977777777 380500500550) without spaces in the phones themselves |
37 | dataFromBody | boolean | Take data not from arguments, but from body | Optional field. | If dataFromBody = 1 is passed, then data will be taken not from arguments, but from the request body. Json must be passed to the body, in which the keys must be the parameters described above. login and password should be sent as usual |
38 | update | boolean | Update contact if found by contact details | Optional field. | |
39 | fullname | string | Полное фамилия имя отчество в одном поле | Optional field. | Если не указаны параметры name, namelast и namemiddle, они будут через пробел браться из fullname согласно формата в nameformat, если одна из частей ФИО отсутствует, необходимо в этом месте вставить еще один пробел |
40 | nameformat | string | Порядок расположения имени (f), фамилии (l) и отчества (m) в fullname | Optional field. | По умолчанию формат l-f-m, что означает порядок Фамилия Имя Отчество |
Get one contact and get all contacts, method: /api/contact-get/json/
Example:
№ | Field | Type | Description | Required or not | Comment |
1 | login | string | Login in BOX system | Required field. | |
2 | password | string | Password in md5 format | Required field. | Contact tech support and we will give you a hash for the API |
3 | supplierhash | string | Vendor key | Optional field. | Available in the customer card, which is the supplier's contact. Available with system login and password and access level" client". Allows to restrict access to receiving contacts according to the connection of the additional contact field with the vendor key (see. Settings" Checks and uniqueness") or process clients where this vendor is the supplier of the process products. |
4 | userid | integer | Contact ID in the BOX system | Either userid or code1c or userlogin or phone or email of the contact is required |
Return field values contactCountry - contact country, contactRegion - Region (area), contactDistrict - District, contactCity - city, contactStreet - Street, contactStreetNumber - House number, contactApartment - Apartment Data collection forms full contact address [contactAdress] contactTypesex - gender of contact (undefined, man, woman, company),, |
5 | code1c | string | Contact ID from your system (from your store) | ||
6 | phone | string | Contact phone number | ||
7 | string | Contact email | |||
8 | userlogin | string | Contact login | ||
9 | showbonus | boolean | Display Contact Bonuses | Optional field. | Specifying parameter 1 will display the contactBonuses field with contact bonuses |
10 | showbonushistory | boolean | Show contact's bonus history | Optional field. | If you specify the value of parameter 1, the contactBonusHistoryArray array with a list of accrued bonuses will be displayed |
11 | showbonusbycategory | boolean | Display the number of contact bonuses by bonus category | Optional field. | If you specify 1, the contactBonusByCategoryArray will be displayed with a list of the number of bonuses broken down by bonus categories |
12 | searchcustomfield | boolean | Поиск контакта по значению дополнительного поля контакта | Optional field. | Параметр передается в виде массива, где key - ключ поля, а value - его значение |
Example:
№ | Field | Type | Description | Required or not | Comment |
1 | login | string | Login in BOX system | Required field. | |
2 | password | string | Password in md5 format | Required field. | Contact tech support and we will give you a hash for the API |
3 | supplierhash | string | Vendor key | Optional field. | Available in the customer card, which is the supplier's contact. Available with system login and password and access level" client". Allows to restrict access to receiving contacts according to the connection of the additional contact field with the vendor key (see. Settings" Checks and uniqueness") or process clients where this vendor is the supplier of the process products. |
4 | groupid | integer | id the group you want to get users from | Optional field. | |
5 | udatefrom | datetime | user update date starting from date in Ymd format H: i: s | Optional field. | |
6 | udateto | datetime | user update date to date in Ymd format H: i: s | Optional field. | |
7 | typesex | string | Contact type | Optional field. | It is necessary to transfer the key of contact types (for example company) |
8 | custom_[key] | optional | Filter by additional contact fields | Optional field. | |
9 | part | integer | Part of goods | Required field. |
API gives up to 1000 contacts in the 1st part, to get the next 1000 products transfer there 2 (part 2 is obtained) and so on. contactCountry - contact country, contactRegion - Region (area), contactDistrict - District, contactCity - city, contactStreet - Street, contactStreetNumber - House number, contactApartment - Apartment Data collection forms full contact address [contactAdress] contactTypesex - gender of contact (undefined, man, woman, company), Filtering contacts by returned fields is also available. |
10 | showbonus | boolean | Display Contact Bonuses | Optional field. | Specifying parameter 1 will display the contactBonuses field with contact bonuses |
11 | showbonushistory | boolean | Show contact's bonus history | Optional field. | If you specify the value of parameter 1, the contactBonusHistoryArray array with a list of accrued bonuses will be displayed |
12 | showbonusbycategory | boolean | Display the number of contact bonuses by bonus category | Optional field. | If you specify 1, the contactBonusByCategoryArray will be displayed with a list of the number of bonuses broken down by bonus categories |
13 | getmultiple | boolean | Получить массив результатов поиска контактов с дополнительной фильтрацией | Optional field. | Данный параметр работает, если заполнен хотя бы один из параметров для поиска одного контакта userid, code1c, phone, email, userlogin, searchcustomfield |
Edit contact, method: /api/contact-update/json/
Example:
№ | Field | Type | Description | Required or not | Comment |
1 | login | string | Login in BOX system | Required field. | |
2 | password | string | Password in md5 format | Required field. | Contact tech support and we will give you a hash for the API |
3 | userid | integer | Either contact userid or code1c is required | Required field. | |
4 | code1c | string | Contact ID from your system (from your store) | Optional field. | |
5 | userlogin | string | Contact login | Optional field. | |
6 | userpass | string | Contact password | Optional field. | |
7 | name | string | username | Optional field. | |
8 | string | email user | Optional field. | ||
9 | emails | string | email-s user (optional) | Optional field. | Specify through space (test @ tset.ua dddd@ya.ru) |
10 | phone | string | user phone | Optional field. | |
11 | phones | string | User phone numbers (additional) | Optional field. | |
12 | address | string | full user address in one line (deprecated parameter) | Optional field. | |
13 | country | string | Country | Optional field. | |
14 | region | string | Region (area) | Optional field. | |
15 | district | string | District | Optional field. | |
16 | city | string | Name of the settlement | Optional field. | |
17 | street | string | Street | Optional field. | |
18 | street_number | string | House number | Optional field. | |
19 | apartment | string | Apartment | Optional field. | |
20 | bdate | date | user's birthday | Optional field. | |
21 | groupid | integer | user group | Optional field. | BOX contact group ID |
22 | namelast | string | user's last name | Optional field. | |
23 | namemiddle | string | User's middle name | Optional field. | |
24 | source | string | User source | Optional field. | |
25 | typesex | string | user gender | Optional field. | The default user type is male. Available user types: man - man woman - woman company - company |
26 | company | string | Company | Optional field. | If there are several of them separated by commas |
27 | companyid | integer | id companies | Optional field. | |
28 | distribution | boolean | Subscribed mailing list contact | Optional field. | |
29 | urls | string | contact website | Optional field. | |
30 | image | string | user avatar | Optional field. | |
31 | employer | boolean | Является ли контакт сотрудником | Optional field. | |
32 | update | boolean | Update contact details | Optional field. | Accepts parameter 1 or 0, default 0. If you send 1, then contact data (phones and emails) will be updated, otherwise if you send 0, they will be added to existing ones |
33 | dataFromBody | boolean | Take data not from arguments, but from body | Optional field. | If dataFromBody = 1 is passed, then data will be taken not from arguments, but from the request body. Json must be passed to the body, in which the keys must be the parameters described above. login and password should be sent as usual |
Delete contact, method: /api/contact-delete/json/
Example:
№ | Field | Type | Description | Required or not | Comment |
1 | login | string | Login in BOX system | Required field. | |
2 | password | string | Password in md5 format | Required field. | Contact tech support and we will give you a hash for the API |
3 | userid | integer | The OneBox ID of the contact to remove | Optional field. | |
4 | code1c | string | The identifier of the contact to be removed from your system (from your store) | Optional field. | |
5 | mergeuserid | integer | The OneBox ID of the contact with which the deleted contact should be merged | Optional field. | |
6 | mergecode1c | string | The identifier of the contact from your system (from your store) with which you want to merge the deleted contact | Optional field. |
Checking client activity by login or id, method: /api/contact-login/status/json/
Example:
№ | Field | Type | Description | Required or not | Comment |
1 | login | string | Login in BOX system | Required field. | |
2 | password | string | Password in md5 format | Required field. | Contact tech support and we will give you a hash for the API |
3 | userid | integer | Contact ID (OneBox ID) | Either contact userid or userlogin is required |
Return field values |
4 | userlogin | string | Contact login in OneBox |
Possible responses to the request
№ | Status | Message | Message Description |
1 | ok | userid | id added / edited user |
2 | fail | login_empty | Login missing |
3 | fail | password_empty | Missing password |
4 | fail | Login or password not correct! | Invalid username or password |
5 | fail | Bad user level! | Low user level to perform this action (requires level 2 or higher) |
6 | fail | name_empty | No name |
7 | fail | email or phone is empty | email or phone is missing |
8 | fail | Payment by id or code1c not found | A payment with this id or code already exists |
9 | fail | dublicate by code1c | A contact with this code already exists |
10 | fail | Not found contact | Contact not found |
11 | fail | User-object by code1c not found | No contact found with this code |
12 | fail | Phone is exists | A contact with the same phone number already exists |
13 | fail | Email is exists | A contact with this email already exists |