Sign in
Function articles/info is used to get the list of crosses, part images and some other specifications (weight, description, etc.). The set of specifications depends on the goods. Some goods may not have images.

Getting the item card

Operation: articles/info
Method: GET

Returns information about specified item.

Request parameters

ParameterDescription
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.

Example of request

http://api.abcp.online/articles/info?userlogin=username&userpsw=md5pass&brand=Nokian&number=TS31671&format=bnpich&locale=en_US

Method returns an array of objects:
ParameterDescription
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 https://pubimg.nodacdn.net/images/
Function search/brands is used to get the list of brands for specified number (article). Typically used in the first stage of the search algorithm, when a user searches for parts by number, which correspond to different brands.

Search brand by number

Operation: search/brands
Method: GET

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.

Request parameters

ParameterDescription
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.

Example of request

http://api.abcp.online/search/brands/?userlogin=username&userpsw=md5pass&number=403730&locale=en_US

Response fields:
FieldDescription
brand Brand name
number Part number
numberFix "Cleaned" number containing only alphabetic and numeric characters
description Item description
availability Mark "availability"
Function articles/brands returns a list of all registered brands with their aliases. The function only needs to be called once, after which the brand names in your system need to be synchronized with this reference directory.

Obtaining a brand directory

Operation: articles/brands
Method: GET

Returns a list of all brands registered in the system with their aliases.

Request parameters

ParameterDescription
userlogin User login in the system
userpsw md5-hash of user password in the system

Example of request

http://api.abcp.online/articles/brands?userlogin=username&userpsw=md5pass

Method returns an array of objects:
ParameterDescription
name Brand name
aliases An array, containing a list of aliases for the current brand
Function search/tips returns the pair "brand/number" for prompting the user by the first characters typed. The function tries to give hints on the most commonly sought products.

Search tips

Operation: search/tips
Method: GET

Return an array of brand-number pairs that matches to several characters of part number.

Request parameters

ParameterDescription
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.

Example of request

http://api.abcp.online/search/tips?userlogin=username&userpsw=md5pass&number=А113094&locale=en_US

Method returns an array of objects:
FieldDescription
brand Brand name
number Part number
rating Item rating
Function advices/batch implements the "also bought with this product" mechanism based on the statistics of purchases of sets of products. A typical example of using the function: the buyer chose an oil filter - the system recommends other products from the set for maintenance. Or the buyer chose the left front shock absorber, the system will show the right front.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.

Search for related products

Operation: advices
Method: GET
Implements the "also bought with this product" mechanism for the requested "Brand-number" pair. Additionally, you can pass the limit parameter (recommended=5), which limits the issuance of recommendations.

Request parameters

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

Example of request

http://api.abcp.online/advices/?userlogin=username&userpsw=md5pass&brand=MB&number=A2058350147&limit=5

Response fields

Method returns an array of objects:
Field Description
brand Brand name
number Part number (manufacturer code)
total The number of orders in which a given combination of products occurs
Operation: advices/batch
Method: POST

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.

Request parameters

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

Example of request

{"userlogin":"userlogin","userpsw":"userpsw","articles":[{"brand":"kyb","number":"331009"},{"brand":"Mobil","number":"152566"}],"limit":5}

Response fields

Method returns an array of objects:
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:

http://api.abcp.online/

The exchange is performed in the UTF-8 encoding.
For debugging you can use a Google Chrome extension Advanced REST Client.

Request

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:

GET http://api.abcp.online/articles/info/?userlogin=***&userpsw=***&brand=Mercedes-Benz&number=A1130940048&format=bnphic&locale=en_US

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.

Response

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.
2) articles/info - Allows you to get a list of cross-references and product information.
3) search/brands - List of brands known to the system by a given number.
4) search/tips - Helps organize client suggestions when entering a number.

Recommended search algorithm in your service with the participation of built-in API function

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.