Returns information about specified item.
Parameter | Description |
---|---|
userlogin | User login in the system |
userpsw | md5-hash of user password in the system |
brand | Brand name |
number | Part number |
format | Format of the answer. Values include: [b][n][p][c][h][m][t][i] - output format (b - brand name, n - part number, p - properties, c - crosses, h - locale-sensitive properties, m - information about model, t - outpute types of crosses considering direction, i - images) |
cross_image | When cross_image = 1 and [i] are transmitted in the format parameter, the response of the operation displays images of cross articles |
locale | Locale. Should be in format language[_territory], for example, en_US. |
Parameter | Description |
---|---|
brand | Brand name |
number | Part number |
outer_number | Part number containing gaps, slashes and other characters |
properties | An array of properties of the item: description, weight, volume, etc. (format [p]) |
rating | Item rating |
crosses | An array of information about analogues (format [c]) |
images | An array of images (format [i]). The array contains the names of the images located at /.abcp-pr/pubimg.nodacdn.net/images/ |
Search by part number and return an array of brands which have the items with required part number. Tihs is an analogue of selection the brand on the site.
Parameter | Description |
---|---|
userlogin | User login in the system |
userpsw | md5-hash of user password in the system |
number | Part number |
useOnlineStocks | Check-box "Use online-stocks". Values include 0 or 1 (don't use and use respectively; default - 0). When value is 0 there aren't items from online-stocks in the array. This increases the speed of response. |
locale | Locale. Should be in format language[_territory], for example, en_US. |
Field | Description |
---|---|
brand | Brand name |
number | Part number |
numberFix | "Cleaned" number containing only alphabetic and numeric characters |
description | Item description |
availability | Mark "availability" |
Returns a list of all brands registered in the system with their aliases.
Parameter | Description |
---|---|
userlogin | User login in the system |
userpsw | md5-hash of user password in the system |
Parameter | Description |
---|---|
name | Brand name |
aliases | An array, containing a list of aliases for the current brand |
Return an array of brand-number pairs that matches to several characters of part number.
Parameter | Description |
---|---|
userlogin | User login in the system |
userpsw | md5-hash of user password in the system |
number | Part number or several characters of part number |
locale | Locale. Should be in format language[_territory], for example, en_US. |
Field | Description |
---|---|
brand | Brand name |
number | Part number |
rating | Item rating |
Parameter | Description |
---|---|
userlogin | User login in the system |
userpsw | md5-hash of user password in the system |
brand | Brand name |
number | Part number |
limit | Optional parameter that limits output |
Field | Description |
---|---|
brand | Brand name |
number | Part number (manufacturer code) |
total | The number of orders in which a given combination of products occurs |
Implements the "also bought with this product" mechanism for several items. Additionally, you can pass the limit parameter (recommended=5), which limits the issuance of recommendations. Product parameters are passed as a JSON array of articles from objects with the fields 'brand' and 'number'.
When using this operation, you must pass the Content-Type: application/json header and pass the parameters in the request body.
Parameter | Description |
---|---|
userlogin | User login in the system |
userpsw | md5-hash of user password in the system |
articles | Array of objects containing brand and number |
limit | Optional parameter that limits output |
Field | Description |
---|---|
brand | Brand name |
number | Part number (manufacturer code) |
advices | An array of objects with the fields: brand - manufacturer name, number - part number, total - number of orders in which this combination of products occurs |
Access to the API is provided by the HTTP-requests and implemented using the principles of REST. Basic URI for web-service is:
The exchange is performed in the UTF-8 encoding.
For debugging you can use a Google Chrome extension Advanced REST Client.
Requests for receiving and recording data performed using HTTP GET and POST methods, respectively. There is the concept of operations in service structure. The operation is indicated as the path in the URL. Parameters are passed as a query string HTTP (GET) or POST data. Most of the operations perform on behalf of a specific user and requires authentication using parameters userlogin (user login in the system) and userpsw (md5-hash of user password in the system). Md5-hash can be generated by programming function (most programming languages have this feature), or use the online-generator (eg, md5x). Every operation may have a list of additional parameters defined by the context. For example, request operation "Search items by number" could be as follows:
When using the POST method in HTTP-Content-Type header to be transmitted media data type of query application / x-www-form-urlencoded and according to the type of body from the HTTP-request. It's nesessary to transmit media-type of request data in HTTP-header Content-Type when using POST method and it needs to generate the body of HTTP-request with this media-type.
The HTTP-header Accept needs to transmit the expected type of response data. Currently implemented only JSON type and, in any case, it will be returned. However, in developing it's necessary to take into account the specified feature and transmit Accept header with a value application/json.
In case of successful execution of the operation the web service returns a response with HTTP-200 code and the response body in JSON. The format of the response is determined by each operation. Example of a successful request:
{ "brand": "MERCEDES-BENZ", "number": "A1130940048", "short_number": "1130940048", "outer_number": "A 113 094 00 48", "properties": { "weight": "0.248", "descr": "Mass Air Flow Sensor" }, "images": [ { "name": "00296fd49ba2b385e441829fc0b2913ea6.jpeg", "order": 0 } ], "is_skipped_image": false, "images_count": 1, "rating": 112, "rating_4mycar": 88, "crosses": [ { "brand": "ASHUKI", "number": "116617A", "numberFix": "116617A" }, { "brand": "BBT", "number": "AMS405", "numberFix": "AMS405" } ] }
Response with HTTP-code 400 and more is an error. The response body contains an error code and, as a rule, a text message describing the causes of the errors in JSON. An example of an error message:
{ "errorCode": 102, "errorMessage": "User Authentication Error" }
To organize a quality search for auto parts on your resource, it is recommended to use four API functions:
1) articles/brands - Obtain a reference directory (several thousand brand names with aliases). For the search to work successfully, your brand directory must be synchronized with ours.First Stage of Search | |
---|---|
1. Your client enters the part code (let's call this variable NUMBER). As the number is entered, suggestions can be displayed to the client (search/tips function). | Example: The client entered the number 01089 in the search field. |
2. When the client has entered the number and started the search, you request all products with the numbers NUMBER from your price list database, and the result is formed into an array BRANDS. | Example: You found products FEBI 01089 and GLASER 01089 in your database. The resulting array BRANDS = {{FEBI 01089 Antifreeze} {GLASER 01089 Gasket}} |
3. Call the search/brands API function with the NUMBER parameter. Add the response to BRANDS (if there are already such brands, do not add them). | Example: search/brands returned FEBI 01089, GLASER 01089, and BOSCH 01089. The BRANDS array will contain {{FEBI 01089 Antifreeze} {GLASER 01089 Gasket} {BOSCH 01089 Distributor}} |
4. If the BRANDS array is empty as a result of the actions, inform the client "Nothing found or you entered an incorrect number." End of algorithm. | --- |
5. If there is only one brand in the BRANDS array, proceed to step 7 of the algorithm. | --- |
6. If there are several brands in the BRANDS array, this is called the "first stage of search." The user is required to clarify what exactly they were looking for and select the brand. | Example: The first stage of the search looks like this http://4mycar.ru/?pcode=01089. Next, the user clicks on a specific part and proceeds to the second stage of the search. |
Second Stage of Search | |
7. Call the articles/info function with the specific product selected by the user in step 5 or 6. The result is an array of pairs (BRAND, NUMBER). As a result, you have an array of products (BRAND, NUMBER) where the first pair is the requested part number and all other pairs are its analogs. | Example: The client clicked on FEBI 01089, and the articles/info function for this product returned approximately the following array: {{BMW 81229407454}{Diesel Technic 129101}..........{HEPU P999}} |
8. Search in your price lists for all these products, and if something is found, provide your output to the user. | Example: You search for FEBI 01089 and {{BMW 81229407454}{Diesel Technic 129101}..........{HEPU P999}} |
Note the feature of forming the first stage of search using the search/brands function. The essence is that you add to the first stage of search those products that can lead (directly or through cross-references) to the products you can sell. Naturally, some products may potentially be absent in your product offer, so clicking on some lines may lead to an empty result. And in the case of low demand coverage by your assortment, such cases can lead to the customer's departure. To avoid this, you can "look into the future" for each product from the first stage of the search in advance to find out "if there will be anything available" and exclude lines without availability. On the other hand, in this case, you will lose the opportunity to collect unsatisfied demand (if you collect and use it) and create additional load on your database with additional requests.