### Example GET Request for Stand Source: https://www.standvirtual.com/api/doc This snippet shows an example of a GET request to retrieve stand information. Ensure the User-Agent, Content-Type, and Authorization headers are correctly set. ```http HTTP/1.1 GET /stands/12321/123 User-Agent: $USER_EMAIL Content-Type: application/json Authorization: Bearer $ACCESS_TOKEN ``` -------------------------------- ### Get User Adverts Request and Response Source: https://www.standvirtual.com/api/doc Examples for retrieving a paginated list of user adverts. ```http /account/adverts ``` ```http HTTP/1.1 GET /account/adverts?limit=10&page=1 User-Agent: $USER_EMAIL Content-Type: application/json Authorization: Bearer $ACCESS_TOKEN ``` ```http HTTP/1.1 200 OK { "results": [ { "id": 6001358299, "user_id": 1289250, "status": "new", ... }, { "id": 6001358301, "user_id": 1289250, "status": "active", ... } ], "is_last_page": true, "is_first_page": true, "current_page": 1, "total_pages": 1, "current_elements": 2, "total_elements": 2 } ``` -------------------------------- ### Retrieve Vehicle Versions Request Source: https://www.standvirtual.com/api/doc Example GET request to fetch vehicle versions with specific filters applied via query parameters. ```HTTP HTTP/1.1 GET /categories/29/models/ford/versions/focus?fuel_type=diesel&door_count=4&engine_power=150&engine_capacity=1997&year=2018&gearbox=automatic&is_imported_car=1 User-Agent: $USER_EMAIL Content-Type: application/json Authorization: Bearer $ACCESS_TOKEN ``` -------------------------------- ### Request Gearboxes for a Model Source: https://www.standvirtual.com/api/doc Example GET request to retrieve gearboxes with optional filters for fuel type, door count, and engine specifications. ```http HTTP/1.1 GET /categories/29/models/ford/gearboxes/focus?fuel_type=diesel&door_count=4&engine_power=150&engine_capacity=1997&year=2018&is_imported_car=1 User-Agent: $USER_EMAIL Content-Type: application/json Authorization: Bearer $ACCESS_TOKEN ``` -------------------------------- ### Read Single Advert Request Source: https://www.standvirtual.com/api/doc Example GET request to retrieve a specific advert by its ID. Ensure to include the User-Agent, Content-Type, and Authorization headers. ```http HTTP/1.1 GET /account/adverts/900118 User-Agent: $USER_EMAIL Content-Type: application/json Authorization: Bearer $ACCESS_TOKEN ``` -------------------------------- ### GET Request to Read Image Collection Source: https://www.standvirtual.com/api/doc Example of a GET request to retrieve an image collection by its ID. Requires User-Agent and Authorization headers. ```http GET /imageCollections/821165357 HTTP/1.1 User-Agent: $USER_EMAIL Content-Type: application/json Authorization: Bearer $ACCESS_TOKEN ``` -------------------------------- ### Retrieve Advert Details Source: https://www.standvirtual.com/api/doc Examples for requesting and receiving advert data. ```http HTTP/1.1 GET /adverts/999 User-Agent: $USER_EMAIL Content-Type: application/json Authorization: Bearer $ACCESS_TOKEN ``` ```json HTTP/1.1 200 OK { "id": 999, "user_id": 1, "status": "active", "title": "Advert title", "url": "http://{example.com}/ad/{example}.html", "created_at": "2015-10-01 10:54:11", "valid_to": "2015-10-15 11:05:34", "description": "Lorem ipsum dolor sit amet, consectetur adipiscing elit.", "category_id": 29, "region_id": 3, "city_id": 24545, "municipality": "Municipality name", "city": { "pl": "City name", "en": "City name" }, "coordinates": { "latitude": 51.26247, "longitude": 15.56956, "radius": 4, "zoom_level": 12 }, "advertiser_type": "private", "contact": { "person": "John Doe" }, "params": { "make": "ford", "model": "focus", "version": "mk1-1998-2004", "year": 2003, "mileage": 199000, "fuel_type": "petrol", "engine_capacity": 1600, "engine_power": 120, "gearbox": "manual", "transmission": "front-wheel", "co2_emissions": 136, "particle_filter": "1", "damaged": "0", "body_type": "hatchback", "door_count": 4, "color": "violet", "metallic": "1", "pearl": "1", "matt": "0", "acrylic": "0", "nr_seats": 5, "rhd": "1", "features": [ "abs", "alarm", "alloy-wheels" ], "price": { "0": "arranged", "1": 20000, "currency": "PLN", "gross_net": "gross" }, "vat_discount": "0", "vat": "1", "financial_option": "0", "leasing_concession": "0", "country_origin": "d", "date_registration": "2003-3-01", "vin": "WF0WXXGCDW6M23967", "registered": "1", "original_owner": "0", "no_accident": "0", "service_record": "1", "historical_vehicle": "0", "tuning": "0", "approval_for_goods": "0" }, "photos": { "1": { "1080x720": "http://lorempixel.com/1080/720/transport/9/", "732x488": "http://lorempixel.com/732/488/transport/9/", "320x240": "http://lorempixel.com/320/240/transport/9/", "148x110": "http://lorempixel.com/148/110/transport/9/" }, "2": { "1080x720": "http://lorempixel.com/1080/720/transport/2/", "732x488": "http://lorempixel.com/732/488/transport/2/", "320x240": "http://lorempixel.com/320/240/transport/2/", "148x110": "http://lorempixel.com/148/110/transport/2/" }, "3": { "1080x720": "http://lorempixel.com/1080/720/transport/7/", "732x488": "http://lorempixel.com/732/488/transport/7/", "320x240": "http://lorempixel.com/320/240/transport/7/", "148x110": "http://lorempixel.com/148/110/transport/7/" } }, "image_collection_id": 817443447, "external_partner_code": "partner-code", "external_id": "126", "last_update_date": "2015-10-15 11:05:35", "new_used": "used" } ``` ```json HTTP/1.1 404 Not Found { "error": { "type": "NotFoundException", "message": "Advert 999 not found." } } ``` -------------------------------- ### Retrieve All Countries Source: https://www.standvirtual.com/api/doc Endpoint and example for listing all countries with optional pagination parameters. ```HTTP /countries ``` ```HTTP HTTP/1.1 GET /countries User-Agent: $USER_EMAIL Content-Type: application/json Authorization: Bearer $ACCESS_TOKEN ``` ```JSON HTTP/1.1 200 OK { "results": [ { "id": 1, "name": "Poland", "code": "POL", "in_eu": true }, { "id": 2, "name": "Ukraine", "code": "UKR", "in_eu": false } ] } ``` -------------------------------- ### Retrieve Authorization Token Source: https://www.standvirtual.com/api/doc Request and response examples for retrieving token information. ```http GET /oauth/token HTTP/1.1 Content-Type: application/json Authorization: Bearer $ACCESS_TOKEN ``` ```json HTTP/1.1 200 OK { "user_id": "1", "client_id": "client_id", "partner_code": "partner_code", "grant_type": "password", "owner_type": "user" } ``` -------------------------------- ### GET Request to Read Unlinked Image Collection Source: https://www.standvirtual.com/api/doc Example of a GET request to retrieve an image collection that is not linked to any ad. Requires User-Agent header. ```http get ``` /imageCollections/:id/unlinked ``` ``` -------------------------------- ### GET /account/adverts/:adId/promotions/ Source: https://www.standvirtual.com/api/doc Checks if an advert is eligible for a promotion. ```APIDOC ## GET /account/adverts/:adId/promotions/ ### Description Checks if an advert is eligible for a promotion. ### Method GET ### Endpoint /account/adverts/:adId/promotions/ ### Parameters #### Path Parameters - **adId** (string) - Required - The ID of the advert. ### Request Example ``` GET /account/adverts/8000040812/promotions/ HTTP/1.1 User-Agent: $USER_EMAIL Content-Type: application/json Authorization: Bearer $ACCESS_TOKEN ``` ### Response #### Success Response (200) - **promotions** (object) - An object containing promotion details. - **export_olx** (object) - Details for the 'Export to OLX' promotion. - **promotion_name** (string) - The name of the promotion. - **promotion_id** (string) - The ID of the promotion. - **promotion_code** (string) - The code for the promotion. - **payments** (object) - Payment details for the promotion. - **account** (object) - Account payment details. - **payment_type** (string) - The type of payment. - **price** (number) - The price of the promotion. - **formated_price** (string) - The formatted price of the promotion. - **paypal** (object) - PayPal payment details. - **payshop** (object) - Payshop payment details. - **mb** (object) - MB payment details. #### Response Example ```json { "promotions": { "export_olx": { "promotion_name": "Export advert to OLX", "promotion_id": "49", "promotion_code": "export_olx", "payments": { "account": { "payment_type": "account", "price": 0, "formated_price": "0 EUR" }, "paypal": { "payment_type": "paypal", "price": 0, "formated_price": "0 EUR" }, "payshop": { "payment_type": "payshop", "price": 0, "formated_price": "0 EUR" }, "mb": { "payment_type": "mb", "price": 0, "formated_price": "0 EUR" } } } } ``` #### Error Response (400) - **error** (object) - An error object. - **type** (string) - The type of error. - **message** (string) - A description of the error. #### Error Response Example ```json { "error": { "type": "BadRequestException", "message": "You have to provide correct ID." } } ``` ``` -------------------------------- ### Retrieve All Regions Request and Response Source: https://www.standvirtual.com/api/doc Example request and successful response for listing all regions. ```HTTP HTTP/1.1 GET /regions User-Agent: $USER_EMAIL Content-Type: application/json Authorization: Bearer $ACCESS_TOKEN ``` ```HTTP HTTP/1.1 200 OK { "results": [ { "id": 3, "name": { "pl": "Example region", "en": "example region" }, "country_id": 19 }, { "id": 15, "name": { "pl": "Example region", "en": "example region" }, "country_id": 19 } ... ] } ``` -------------------------------- ### GET /cities Source: https://www.standvirtual.com/api/doc Retrieves details of all cities available in the system. ```APIDOC ## GET /cities ### Description Returns details of all cities. ### Method GET ### Endpoint /cities ### Parameters #### Header Parameters - **User-Agent** (string) - Required - Account email. - **Authorization** (string) - Required - Bearer token for authentication. ### Request Example ```http GET /cities HTTP/1.1 User-Agent: $USER_EMAIL Content-Type: application/json Authorization: Bearer $ACCESS_TOKEN ``` ### Response #### Success Response (200) - **results** (Array of Objects) - A list of city objects, each containing id, name (localized), and country_id. #### Response Example ```json { "results": [ { "id": 1, "name": { "pl": "Warsaw", "en": "Warsaw" }, "country_id": 19 }, { "id": 2, "name": { "pl": "Krakow", "en": "Krakow" }, "country_id": 19 } ] } ``` ``` -------------------------------- ### GET /districts Source: https://www.standvirtual.com/api/doc Retrieves a list of all available districts. ```APIDOC ## GET /districts ### Description Retrieves details of all districts. ### Method GET ### Endpoint /districts ### Header Parameters - **User-Agent** (String) - Required - Account email. ### Request Example ``` HTTP/1.1 GET /districts User-Agent: $USER_EMAIL Content-Type: application/json Authorization: Bearer $ACCESS_TOKEN ``` ### Response #### Success Response (200) (Response structure for /districts is not fully detailed in the provided text, but it is expected to return a list of district objects.) ``` -------------------------------- ### GET /cities Source: https://www.standvirtual.com/api/doc Retrieves a list of all available cities. Supports pagination. ```APIDOC ## GET /cities ### Description Retrieves details of all cities. Supports pagination. ### Method GET ### Endpoint /cities ### Query Parameters - **page** (Number) - Optional - Allows requesting specific page results. - **limit** (Number) - Optional - Allows limitation of results for one request. ### Request Example ``` HTTP/1.1 GET /cities User-Agent: $USER_EMAIL Content-Type: application/json Authorization: Bearer $ACCESS_TOKEN ``` ### Response #### Success Response (200) - **results** (Array) - An array of city objects. - **id** (Number) - The unique identifier for the city. - **text** (String) - A descriptive text for the city. - **lon** (Number) - The longitude coordinate of the city. - **lat** (Number) - The latitude coordinate of the city. - **radius** (Number) - The radius associated with the city's location. - **zoom** (Number) - The default zoom level for the city. - **name** (String) - The name of the city. - **url** (String) - A URL-friendly version of the city name. - **districts_city_id** (Number) - The identifier of the district this city belongs to. - **region_id** (Number) - The identifier of the region this city belongs to. #### Response Example ```json { "results": [ { "id": 627, "text": "Lorem ipsum dolor sit amet, consectetur adipiscing elit.", "lon": 18.69801, "lat": 52.86653, "radius": 3, "zoom": 13, "name": "Example name", "url": "example-name", "districts_city_id": 2, "region_id": 15 }, { "id": 2131, "text": "Lorem ipsum dolor sit amet, consectetur adipiscing elit.", "lon": 18.71738, "lat": 52.89437, "radius": 0.75, "zoom": 13, "name": "Example name", "url": "example-name", "districts_city_id": 4, "region_id": 15 } ] } ``` ``` -------------------------------- ### Read Category Details Request Source: https://www.standvirtual.com/api/doc Example request to retrieve details for a specific category ID. ```http HTTP/1.1 GET /categories/29 User-Agent: $USER_EMAIL Content-Type: application/json Authorization: Bearer $ACCESS_TOKEN ``` -------------------------------- ### GET /cities Source: https://www.standvirtual.com/api/doc Retrieves a list of cities with optional pagination parameters. ```APIDOC ## GET /cities ### Description Retrieves a list of cities. Supports pagination to manage results. ### Method GET ### Endpoint /cities ### Query Parameters - **page** (Number) - Optional - Allows requesting specific page results. - **limit** (Number) - Optional - Allows limitation of results for one request. ### Request Example ``` HTTP/1.1 GET /cities User-Agent: $USER_EMAIL Content-Type: application/json Authorization: Bearer $ACCESS_TOKEN ``` ### Response #### Success Response (200) - **results** (Array) - An array of city objects. - **id** (Number) - The unique identifier for the city. - **text** (String) - Description of the city. - **lon** (Number) - Longitude coordinate. - **lat** (Number) - Latitude coordinate. - **radius** (Number) - Radius associated with the city data. - **zoom** (Number) - Default zoom level for the city. - **name** (String) - The name of the city. - **url** (String) - A URL-friendly identifier for the city. - **districts_city_id** (Number) - The ID of the city in the districts context. - **region_id** (Number) - The ID of the region the city belongs to. #### Response Example ```json { "results": [ { "id": 627, "text": "Lorem ipsum dolor sit amet, consectetur adipiscing elit.", "lon": 18.69801, "lat": 52.86653, "radius": 3, "zoom": 13, "name": "Example name", "url": "example-name", "districts_city_id": 2, "region_id": 15 } ] } ``` ``` -------------------------------- ### Create Advert Error Response Source: https://www.standvirtual.com/api/doc Example of a 400 Bad Request response when validation fails. ```http HTTP/1.1 400 Bad Request { "error": { "type": "AdvertsPostingException", "message": "Adding the ad failed.", "details": { "district": "Invalid district", "params.price": "Invalid value" } } } ``` -------------------------------- ### Retrieve District by ID Source: https://www.standvirtual.com/api/doc Endpoint and example for retrieving details of a specific district by its ID. ```HTTP /districts/:id ``` ```HTTP HTTP/1.1 GET /districts/215 User-Agent: $USER_EMAIL Content-Type: application/json Authorization: Bearer $ACCESS_TOKEN ``` ```JSON HTTP/1.1 200 OK { "id": 215, "lon": 19.03651, "lat": 50.24945, "city_id": 13155, "zoom": 13, "name": "Lorem ipsum dolor sit amet, consectetur adipiscing elit." } ``` -------------------------------- ### Retrieve Region by ID Request and Response Source: https://www.standvirtual.com/api/doc Example request and successful response for a specific region. ```HTTP HTTP/1.1 GET /regions/3 User-Agent: $USER_EMAIL Content-Type: application/json Authorization: Bearer $ACCESS_TOKEN ``` ```HTTP HTTP/1.1 200 OK { "id": 3, "name": { "pl": "Example region", "en": "Example region" }, "country_id": 19 } ``` -------------------------------- ### GET /categories/{category_id}/models/{brand_code} Source: https://www.standvirtual.com/api/doc Retrieves a list of models for a specific category and brand. ```APIDOC ## GET /categories/{category_id}/models/{brand_code} ### Description Retrieves a list of models for a specific category and brand. ### Method GET ### Endpoint /categories/{category_id}/models/{brand_code} ### Query Parameters - **page** (Number) - Optional - Allows requesting specific page results - **limit** (Number) - Optional - Allows limitation results for one request ### Headers - **User-Agent** (string) - Required - Account email. - **Authorization** (string) - Required - Bearer token for authentication. ### Response #### Success Response (200) - **options** (object) - An object containing model codes as keys and their localized names as values. - **model_code** (object) - Contains localized names for the model. - **pt** (string) - Portuguese name of the model. - **en** (string) - English name of the model. ### Request Example ``` HTTP/1.1 GET /categories/29/models/mercedes-benz User-Agent: $USER_EMAIL Content-Type: application/json Authorization: Bearer $ACCESS_TOKEN ``` ### Response Example ```json { "options": { "100": { "pt": "100", "en": "100" }, "170": { "pt": "170", "en": "170" } // ... more models } } ``` ``` -------------------------------- ### Create Advert Request and Responses Source: https://www.standvirtual.com/api/doc Examples for creating an advert via POST, including a successful creation response and a bad request error response. ```http POST /account/adverts HTTP/1.1 User-Agent: $USER_EMAIL Content-Type: application/json Authorization: Bearer $ACCESS_TOKEN { "title": "Advert title", "description": "Lorem ipsum dolor sit amet, consectetur adipiscing elit.", "category_id": 29, "region_id": 1, "city_id": 1, "district_id": 1, "coordinates": { "latitude": 52.39255, "longitude": 16.86718 }, "contact": { "person": "John Doe" }, "params": { "make": "ford", "model": "focus", "version": "mk1-1998-2004", "year": 2003, "mileage": 199000, "fuel_type": "petrol", "body_type": "sedan", "color": "white", "price": { "0": "arranged", "1": 20000, "currency": "PLN", "gross_net": "gross" }, "video": "https://www.youtube.com/watch?v=code", "is_imported_car": 0 } "image_collection_id": 821165359, "advertiser_type": "private", "brand_program_id": "1" } ``` ```http HTTP/1.1 201 Created { "id": 999, "user_id": 1, "status": "unpaid", "title": "Advert title", "url": "http://{example.com}/ad/{example}.html", "created_at": "2015-10-01 10:54:11", "valid_to": "2015-10-15 11:05:34", "description": "Lorem ipsum dolor sit amet, consectetur adipiscing elit.", "category_id": 29, "region_id": 3, "city_id": 24545, "municipality": "Municipality name", "city": { "pl": "City name", "en": "City name" }, "coordinates": { "latitude": 51.26247, "longitude": 15.56956, "radius": 4, "zoom_level": 12 }, "advertiser_type": "private", "contact": { "person": "John Doe" }, "params": { "make": "ford", "model": "focus", "version": "mk1-1998-2004", "year": 2003, "mileage": 199000, "fuel_type": "petrol", "body_type": "sedan", "color": "white", "price": { "0": "arranged", "1": 20000, "currency": "EUR", "gross_net": "gross" } }, "image_collection_id": 821165359, "last_update_date": "2015-10-15 11:05:35", "new_used": "used", "brand_program_id": "1" } ``` ```http HTTP/1.1 400 Bad Request { "error": { "type": "AdvertsPostingException", "message": "Adding the ad failed.", "details": { "district": "Invalid district", "params.price": "Invalid value" } } } ``` -------------------------------- ### 200 OK Response for Options Source: https://www.standvirtual.com/api/doc This is a success response indicating that options have been retrieved. It contains a document with version keys and associated labels per language. ```http HTTP/1.1 200 OK { "options": { "1499": { "pt": "1499", "en": "1499" } } } ``` -------------------------------- ### GET /countries Source: https://www.standvirtual.com/api/doc Retrieves a list of all countries. ```APIDOC ## GET /countries ### Description Returns details of all countries. ### Method GET ### Endpoint /countries ### Parameters #### Query Parameters - **page** (Number) - Optional - Allows requesting specific page results. - **limit** (Number) - Optional - Allows limitation of results for one request. ### Request Example ``` GET /countries ``` ### Response #### Success Response (200) - **results** (Array) - An array of country objects. - **id** (Number) - The unique identifier for the country. - **name** (String) - The name of the country. - **code** (String) - The country code. - **in_eu** (Boolean) - Indicates if the country is part of the EU. #### Response Example ```json { "results": [ { "id": 1, "name": "Poland", "code": "POL", "in_eu": true }, { "id": 2, "name": "Ukraine", "code": "UKR", "in_eu": false } ] } ``` ``` -------------------------------- ### Create New Advert Request Source: https://www.standvirtual.com/api/doc Example of a POST request to create an advert, including contact details and specific category parameters. ```http POST /account/adverts HTTP/1.1 User-Agent: $USER_EMAIL Content-Type: application/json Authorization: Bearer $ACCESS_TOKEN { "title": "Advert title", "description": "Lorem ipsum dolor sit amet, consectetur adipiscing elit.", "category_id": 29, "region_id": 1, "city_id": 1, "district_id": 1, "coordinates": { "latitude": 52.39255, "longitude": 16.86718 }, "contact": { "person": "John Doe" }, "params": { "vin": "11111111111111111", "year": 2018, "make": "ford", "model": "focus", "fuel_type": "petrol", "engine_power": "86", "engine_capacity": "1596", "door_count": 4, "gearbox": "manual", "version": "ver-1-6-gold-x", "mileage": 199000, "fuel_type": "petrol", "body_type": "sedan", "color": "white", "price": { "0": "arranged", "1": 20000, "currency": "PLN", "gross_net": "gross" }, "video": "https://www.youtube.com/watch?v=code" } "image_collection_id": 821165359, "advertiser_type": "private", "brand_program_id": "1" } ``` -------------------------------- ### Create Advert Source: https://www.standvirtual.com/api/doc Allows partners to create new adverts. Requires specific permissions. ```APIDOC ## POST /adverts ### Description Creates a new advert. This endpoint is restricted for partner use and requires the 'advertsWrite' permission. ### Method POST ### Endpoint /adverts ### Headers - **User-Agent** (string) - Required - Account email. ### Permissions - advertsWrite ### Note If using the 'password' grant type, refer to the Account section for authentication details. ``` -------------------------------- ### GET /regions Source: https://www.standvirtual.com/api/doc Retrieves details of all available regions. ```APIDOC ## GET /regions ### Description Returns details of all regions. ### Method GET ### Endpoint /regions ### Response #### Success Response (200) (Details of all regions are returned in the response body. Specific fields are not detailed in the provided text.) ``` -------------------------------- ### Successful Advert Response (v2.0.0) Source: https://www.standvirtual.com/api/doc Example of a successful HTTP 200 OK response when retrieving advert data. ```json HTTP/1.1 200 OK { "id": 900115, "user_id": 10000000, "title": "Titulo AnĂșncio", "description": "Lorem ipsum", "category_id": 29, "region_id": 11, "city_id": 10000000, "municipality": "Lisboa", "city": { "pt": "Lisboa", "en": "Lisboa" }, "coordinates": { "latitude": 38.73688, "longitude": -9.13731, "radius": 0, "zoom_level": 12 }, "advertiser_type": "business", "contact": { "person": "123456", "phone_numbers": [ "91123456789" ] }, "params": { "make": "renault", "model": "clio", "version": "ver-1-5-dci-energy-alize", "fuel_type": "diesel", "first_registration_month": "1", "first_registration_year": 2017, "mileage": 97197, "engine_capacity": 1461, "power": 90, "vin": "11111111111111111", "price": { "0": "price", "1": 25250, "currency": "EUR", "gross_net": "net" }, "section": "city-car", "color": "silver", "number_doors": "5", "vendors_warranty_valid_until_date": 24 }, "photos": { "1": { "1080x720": "http://lorempixel.com/1080/720/transport/9/", "732x488": "http://lorempixel.com/732/488/transport/9/", "320x240": "http://lorempixel.com/320/240/transport/9/", "148x110": "http://lorempixel.com/148/110/transport/9/" }, "2": { "1080x720": "http://lorempixel.com/1080/720/transport/2/", "732x488": "http://lorempixel.com/732/488/transport/2/", "320x240": "http://lorempixel.com/320/240/transport/2/", "148x110": "http://lorempixel.com/148/110/transport/2/" }, "3": { "1080x720": "http://lorempixel.com/1080/720/transport/7/", "732x488": "http://lorempixel.com/732/488/transport/7/", "320x240": "http://lorempixel.com/320/240/transport/7/", "148x110": "http://lorempixel.com/148/110/transport/7/" } }, "new_used": "used" } ``` -------------------------------- ### GET /regions Source: https://www.standvirtual.com/api/doc Retrieves details of all regions available in the system. ```APIDOC ## GET /regions ### Description Returns details of all regions. ### Method GET ### Endpoint /regions ### Parameters #### Header Parameters - **User-Agent** (string) - Required - Account email. - **Authorization** (string) - Required - Bearer token for authentication. ### Request Example ```http GET /regions HTTP/1.1 User-Agent: $USER_EMAIL Content-Type: application/json Authorization: Bearer $ACCESS_TOKEN ``` ### Response #### Success Response (200) - **results** (Array of Objects) - A list of region objects, each containing id, name (localized), and country_id. #### Response Example ```json { "results": [ { "id": 3, "name": { "pl": "Example region", "en": "example region" }, "country_id": 19 }, { "id": 15, "name": { "pl": "Example region", "en": "example region" }, "country_id": 19 } ] } ``` ``` -------------------------------- ### GET /countries/{id} Source: https://www.standvirtual.com/api/doc Retrieves details for a specific country by its ID. ```APIDOC ## GET /countries/{id} ### Description Retrieves details for a specific country by its ID. ### Method GET ### Endpoint /countries/{id} ### Parameters #### Path Parameters - **id** (integer) - Required - The ID of the country to retrieve. ### Request Example ``` HTTP/1.1 GET /countries/627 User-Agent: $USER_EMAIL Content-Type: application/json Authorization: Bearer $ACCESS_TOKEN ``` ### Response #### Success Response (200) - **id** (integer) - The unique identifier for the country. - **name** (string) - The name of the country. - **code** (string) - The country code. - **in_eu** (boolean) - Indicates if the country is part of the EU. #### Response Example ```json { "id": 627, "name": "Poland", "code": "POL", "in_eu": true } ``` ``` -------------------------------- ### Create Advert Request Source: https://www.standvirtual.com/api/doc Example of a POST request to create an advert. Requires authentication via Bearer token. ```HTTP POST /adverts HTTP/1.1 User-Agent: $USER_EMAIL Content-Type: application/json Authorization: Bearer $ACCESS_TOKEN { "title": "Advert title", "description": "Lorem ipsum dolor sit amet, consectetur adipiscing elit.", "category_id": 29, "region_id": 1, "city_id": 1, "district_id": 1, "coordinates": { "latitude": 52.39255, "longitude": 16.86718 }, "contact": { "person": "John Doe" }, "params": { "make": "ford", "model": "focus", "version": "mk1-1998-2004", "year": 2003, "mileage": 199000, "fuel_type": "petrol", "body_type": "sedan", "color": "white", "price": { "0": "price", "1": 2000, "currency": "PLN", "gross_net": "gross" }, "video": "https://www.youtube.com/watch?v=code" } "image_collection_id": 821165355, "external_id": "126", "partner_offer_url": "http://partner-domain/partner-offer-url", "email": "john.doe@example.com", "advertiser_type": "private", "new_used" : "used" } ``` -------------------------------- ### GET /countries/:id Source: https://www.standvirtual.com/api/doc Retrieves details for a specific country by its ID. ```APIDOC ## GET /countries/:id ### Description Returns details of a country given its ID. ### Method GET ### Endpoint /countries/:id ### Parameters #### Path Parameters - **id** (Number) - Required - The ID of the country to retrieve. ### Response #### Success Response (200) - **id** (Number) - The unique identifier for the country. - **name** (String) - The name of the country. - **code** (String) - The country code. - **in_eu** (Boolean) - Indicates if the country is part of the EU. #### Response Example ```json { "id": 1, "name": "Poland", "code": "POL", "in_eu": true } ``` ``` -------------------------------- ### GET /districts/:id Source: https://www.standvirtual.com/api/doc Retrieves details for a specific district by its ID. ```APIDOC ## GET /districts/:id ### Description Returns details of a district given its ID. ### Method GET ### Endpoint /districts/:id ### Parameters #### Path Parameters - **id** (Number) - Required - The ID of the district to retrieve. ### Request Example ``` GET /districts/215 ``` ### Response #### Success Response (200) - **id** (Number) - The unique identifier for the district. - **lon** (Number) - The longitude coordinate of the district. - **lat** (Number) - The latitude coordinate of the district. - **city_id** (Number) - The ID of the city the district belongs to. - **zoom** (Number) - The default zoom level for the district. - **name** (String) - The name of the district. #### Response Example ```json { "id": 215, "lon": 19.03651, "lat": 50.24945, "city_id": 13155, "zoom": 13, "name": "Lorem ipsum dolor sit amet, consectetur adipiscing elit." } ``` ``` -------------------------------- ### Create Stand Request Source: https://www.standvirtual.com/api/doc Use this endpoint to create a new stand. Requires 'write' permission and proper User-Agent and Authorization headers. ```http HTTP/1.1 POST /stands User-Agent: $USER_EMAIL Content-Type: application/json Authorization: Bearer $ACCESS_TOKEN { 'name' => 'Name of the stand', 'status' => 'active', 'address' => 'Stand address', 'postcode' => '39384-213', 'email' => 'standemail@gmail.com', 'phone1' => '00441892892', 'phone2' => '00441892893', 'phone3' => '00441892894', 'userId' => '1234', 'cityId' => '123123', 'mapLat' => '40.200537', 'mapLon' => '-8.242188', } ``` -------------------------------- ### Account - Create new advert Source: https://www.standvirtual.com/api/doc Creates a new advert under the authenticated account. Requires 'write' permission. ```APIDOC ## POST /account/adverts ### Description Creates a new advert for the authenticated account. Requires 'write' permission. ### Method POST ### Endpoint /account/adverts ### Parameters #### Header Parameters - **User-Agent** (string) - Required - Account email. #### Query Parameters - **voptional** (Number) - Optional - Specifies the version to use (2 for new version; anything else for OLD version). ### Permission write ``` -------------------------------- ### GET /districts/for-city-id/:id Source: https://www.standvirtual.com/api/doc Retrieves all districts for a specific city ID. ```APIDOC ## GET /districts/for-city-id/:id ### Description Returns details of all city districts for a given city ID. ### Method GET ### Endpoint /districts/for-city-id/:id ### Parameters #### Path Parameters - **id** (Number) - Required - The ID of the city for which to retrieve districts. ### Request Example ``` GET /districts/for-city-id/7478 ``` ### Response #### Success Response (200) - **results** (Array) - An array of district objects. - **id** (Number) - The unique identifier for the district. - **lon** (Number) - The longitude coordinate of the district. - **lat** (Number) - The latitude coordinate of the district. - **city_id** (Number) - The ID of the city the district belongs to. - **zoom** (Number) - The default zoom level for the district. - **name** (String) - The name of the district. #### Response Example ```json { "results": [ { "id": 91, "lon": 18.63075, "lat": 54.31777, "city_id": 7478, "zoom": 13, "name": "Name example" } ] } ``` ``` -------------------------------- ### GET /cities/:id Source: https://www.standvirtual.com/api/doc Retrieves details for a specific city by its ID. ```APIDOC ## GET /cities/:id ### Description Retrieves details of a city by its ID. ### Method GET ### Endpoint /cities/:id ### Path Parameters - **id** (Number) - Required - The unique identifier of the city. ### Request Example ``` HTTP/1.1 GET /cities/627 User-Agent: $USER_EMAIL Content-Type: application/json Authorization: Bearer $ACCESS_TOKEN ``` ### Response #### Success Response (200) - **id** (Number) - The unique identifier for the city. - **text** (String) - A descriptive text for the city. - **lon** (Number) - The longitude coordinate of the city. - **lat** (Number) - The latitude coordinate of the city. - **radius** (Number) - The radius associated with the city's location. - **zoom** (Number) - The default zoom level for the city. - **name** (String) - The name of the city. - **url** (String) - A URL-friendly version of the city name. - **districts_city_id** (Number) - The identifier of the district this city belongs to. - **region_id** (Number) - The identifier of the region this city belongs to. #### Response Example ```json { "id": 627, "text": "Lorem ipsum dolor sit amet, consectetur adipiscing elit.", "lon": 18.69801, "lat": 52.86653, "radius": 3, "zoom": 13, "name": "Example name", "url": "example-name", "districts_city_id": 2, "region_id": 15 } ``` ```