PUT: https://www.autovit.ro/api/open/adverts/:id
Permission: advertsWrite
Header
| Field | Type | Description |
| User-Agent | string | Account email. |
Path Param
| Field | Type | Description |
| id | Number | Ad id |
Query Param
| Field | Type | Description |
| v
optional |
Number | Optional parameter to specify which version to use (2 - for new version; anything else for OLD version) |
Request Body
| Field | Type | Description |
| coordinates | Object | Location for map coordinates |
| title | String | Title |
| description | String | Description |
| category_id | Number | Category id , see: Category |
| region_id | Number | Region id , see: Regions |
| city_id | Number | City id , see: Cities |
| brand_program_id | Number | Brand program id |
| advertiser_type | String | Allowed values: private, business |
| image_collection_id | String | Id of images collection, see: Images |
| district_id | Number | District id , see: Districts |
| latitude | Number | Latitude |
| longitude | Number | Longitude |
| radius | Number | Radius |
| zoom_level | Number | Zoom level |
| contact | Object | Contact object |
| phones | Array | The list of phones to contact |
| person | Object | The name of the person to contact |
| params | Object | Detailed advert parameters, see Category to find what parameters are available for specific category |
Example request:
PUT /adverts/999 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",
"generation": "gen-mk4-2018",
"version": "ver-1-6-gold-x",
"mileage": 199000,
"body_type": "sedan",
"color": "white",
"price":
{
"0": "price",
"1": 2000,
"currency": "RON",
"gross_net": "gross"
}
}
"image_collection_id": 821165355,
"external_id": "126",
"partner_offer_url": "http://partner-domain/partner-offer-url",
"email": "john.doe@example.com",
"advertiser_type": "private"
}
Copied to clipboard
Success response:
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":
{
"ro": "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":
{
"vin": "11111111111111111",
"year": 2018,
"make": "ford",
"model": "focus",
"fuel_type": "petrol",
"engine_power": "86",
"engine_capacity": "1596",
"door_count": 4,
"gearbox": "manual",
"generation": "gen-mk4-2018",
"version": "ver-1-6-gold-x",
"mileage": 199000,
"transmission": "front-wheel",
"co2_emissions": 136,
"particle_filter": "1",
"damaged": "0",
"body_type": "hatchback",
"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": "RON",
"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"
},
"external_partner_code": "partner-code",
"external_id": "126",
"last_update_date": "2015-10-15 11:05:35",
"new_used": "used"
}
Copied to clipboard
Error response example:
HTTP/1.1 400 Bad Request
{
"error":
{
"type": "AdvertsPostingException",
"message": "Adding the ad failed.",
"details":
{
"district": "Choose a district from city",
"params.price": "You should specify a price"
}
}
}
Copied to clipboard