Introduction
OpenAPI 3.0 (Swagger)
Usage
RRR API has OpenAPI (Swagger) configuration file.
That means, you can use such tools as openapi-generator
or swagger-codegen
,
in order to generate fully functioning RRR API Client in many supported programming languages.
For example, in order to generate RRR API php
client (and it's documentation),
you should do as following:
- Install Openapi Generator by following instructions
-
Run:
openapi-generator generate -i https://api.rrr.lt/openapi/swagger.yaml -g php -o /path/for/client --enable-post-process-file --global-property skipFormModel=false
-
Go to
/path/for/client/docs
and you'll find documentation, how to use newly generated RRR API Client.
Notice: it is mandatory to override skipFormModel
flag, in order generated client will work properly: --global-property skipFormModel=false
Links
General information
Requests categories:
- CRM IMPORT requests for saving cars/parts data into user's CRM.
- CRM EXPORT requests for return cars/parts data from user's CRM.
- CRM INFO requests for return information required for cars/parts import/export into & from CRM.
General request details
- Each request to the API is made via POST form data, with at least 3 mandatory fields: username, password, user_token.
- API accepts requests with form data, and NOT content type JSON
-
If you want to pass an array to the request form data, use a key with square brackets
at the end as many times as you have values.
Example:
photos[]=img1.jpg;photos[]=img2.jpg
- The photo's URL must have an extension. One of: jpg, jpeg, png.
- In order to make full integration, the first step usually is to map Ovoko and Your system’s fields: part_category_id, car_model, car_fuel car_engine_cubic_capacity, car_engine_power. There may be some other mandatory fields depending on a part type, but these are common ones.
- API always returns response status code 200. In order to know if the request failed or succeeded, you need to check the value of the status_code key in the response’s JSON body. Available status_code values and their meanings are listed in the documentation page, in the section Status codes, errors.
- If you have any questions of feedback about the documentation, please, reach out to [email protected].
Cars Import
Before car import You must collect possible values of required fields:
- Car models
- Car body types
- Car classes
- Car status
- Car steering wheel type
- Car wheel drive
- Car gearbox types
- Fuel
After getting all this data You can follow to the Car Import. Car import has 3 mandatory fields (besides authentication ones defined in General request details): car_model, car_years, status.
After successful request API return JSON object:
{"car_id":292,"msg":"OK","status_code":"R200"}
Response fields meaning:
"car_id" : 292
- car #ID in CRM;
"msg" : "OK"
- response message;
"status_code" : "R200"
- response status code
(all codes).
After Car Import can be used these requests:
Parts Import
Before part import You must collect possible values of required fields:
After getting all this data You can follow to the
Part Import. Part import has 3 mandatory fields
(besides authentication ones defined in General request details): category_id,
quality, car_id, status.
Part is available into e-shop only if these optional fields are filled:
price (must be greater than 0.00),
photo URL.
Note: for the part import one of required values is - car #ID. This car must exist in CRM.
After successful request API return JSON object:
{"part_id":288651,"msg":"OK","status_code":"R200"}
Response fields meaning:
"part_id" : 288651
- part #ID in CRM;
"msg" : "OK"
- response message;
"status_code" : "R200"
- response status code
(all codes).
After Part Import can be used these requests: