1b.app
Link copied -

API User (User)

Add contact, method: /api/contact-add/json/

Parameters

Example:

http://myboxurl/api/contact-add/json/?login=LOGIN&password=PASSWORD&name=user123&email=user123@user.com&distribution=1&typesex=man&level=2&userlogin=userlogin&company=company&namemiddle=middle name&namelast=last name&commentadmin=commentadmin&parentid=24&country=Country®ion=area&district=District&city=city&street=Street&street_number=house number&apartment=Apartment&phone=80639350555&userpass=123456789A&code1c=code1c&pricelevel=Price 1&customfield_key1=customvalue1&customfield_key2=2016-01-01

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 email 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/

Parameters
Parameters for getting one contact:

Example:

http://myboxurl/api/contact-get/json/?login=LOGIN&password=PASSWORD&userid=666

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
contactId - id contact,
contactNamefull - Contact name,
contactCode1c - 1C contact code,
contactName - contact name,
contactNamelast - contact surname,
contactNamemiddle - middle name of the contact,
contactCompany - contact company,
contactCompanyID - id contact company,
contactEmail - contact's main email,
contactEmails - additional contact email,
contactPhone - contact's main phone number,
contactPhones - additional phone numbers of the contact,
contactAdress - full contact address (in one line),

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),,
contactBirthdate - date of birth of contact,
contactGroupsArray - list of IDs and names of groups to which the contact belongs,
contactManagerid - ID contact manager,
contactCdate - date the contact was created,
contactPost - position (specialization) of the contact,
contactSourceid - ID contact source,
contactSourcename - contact source,
contactPricelevel - contact price level,
contactAuthorid - ID contact author,
contactBonuses - contact bonuses,
contactCurrency - contact currency,
customFieldArray - additional contact fields (additional name is passed as key.contact fields, in value - value),
legalArray - list of legal contact details,
contactCommentadmin - Admin comment,
contactCommentLast - Last contact comment added via note block

5 code1c string Contact ID from your system (from your store)
6 phone string Contact phone number
7 email 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 - его значение


Parameters for getting all contacts:

Example:

http://myboxurl/api/contact-get/json/?login=LOGIN&password=PASSWORD&part=1
http://myboxurl/api/contact-get/json/?login=LOGIN&password=PASSWORD&part=2
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.

Return field values
contactId - id contact,
contactNamefull - Contact name,
contactCode1c - 1C contact code,
contactName - contact name,
contactNamelast - contact surname,
contactNamemiddle - middle name of the contact,
contactCompany - contact company,
contactCompanyID - id contact company,
contactEmail - contact's main email,
contactEmails - additional contact email,
contactPhone - contact's main phone number,
contactPhones - additional phone numbers of the contact,
contactAdress - full contact address,

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),
contactBirthdate - date of birth of contact,
contactGroupsArray - list of IDs and names of groups to which the contact belongs,
contactManagerid - ID contact manager,
contactCdate - date the contact was created,
contactPost - position (specialization) of the contact,
contactSourceid - ID contact source,
contactSourcename - contact source,
contactPricelevel - contact price level,
contactAuthorid - ID contact author,
contactBonuses - contact bonuses,
contactCurrency - contact currency,
customFieldArray - additional contact fields (additional name is passed as key.contact fields, in value - value)



Filtering contacts by returned fields is also available.
You must pass a parameter equal to the name of the returned variable and a value to filter by the variable field.
For example, when passing the contactCountry = Ukraine parameter, contacts will be filtered if their address contains" Ukraine"

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/

Parameters

Example:

http://myboxurl/api/contact-update/json/?login=LOGIN&password=PASSWORD&userid=666&email=test@tst.com

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 email 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/

Parameters

Example:

http://myboxurl/api/contact-delete/json/?login=LOGIN&password=PASSWORD&userid=666

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/

Parameters

Example:

http://myboxurl/api/contact-login/status/json/?login=LOGIN&password=PASSWORD&userid=666

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
id - id contact,
login - contact login,
isonline - (true/false) status, is the user logged in,
lastactivity - date and time of the last activity of the contact,
pultstatus - (work/pause/stop) contact console status

4 userlogin string Contact login in OneBox

Possible responses to the request

More details
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

Errors may also occur:

502 Bad Gateway - If this error occurs it is necessary:
1. Check if you have internet access (go to any other site).
2. If there are no problems with access — cookies can be deleted.
If the above doesn't work — server side problem. Please contact your site system administrator.

503 (Service Temporarily Unavailable) - this error may occur as a result of too many server requests. If you see this error, you should wait a couple of minutes and try again.

504 Gateway Timeout - cmost likely the reason is the increased load on the site, in which Apache is not has time to send HTTP responses and new requests are queued. You can add resources to the server, in particular RAM, and increase the number of httpd (Apache) processes.
Another possible reason for error 504 is that the executable script does not fit within the allotted limit time. This happens when the request is too heavy. Try to split your request into a few more small.

Error 505 HTTP Version not supported means the website is not Supports the version of the HTTP protocol that the browser uses to request a web page