PUT: https://www.autovit.ro/api/open/account/adverts/:id
Permission: write
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 |
| city_id | Number | City id |
| brand_program_id | Number | Brand program id |
| advertiser_type | String | Allowed values: private, business |
| image_collection_id | String | Id of images collection |
| district_id | Number | District id |
| 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 /account/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": "arranged",
"1": 20000,
"currency": "PLN",
"gross_net": "gross"
}
}
"image_collection_id": 821165359,
"advertiser_type": "private",
"new_used" : "used",
"brand_program_id": "1"
}
Copied to clipboard
Success response:
HTTP/1.1 200 OK
{
"id": 999,
"user_id": 1,
"status": "unpaid",
"title": "Advert title",
"url": "http://{example.com}/oferta/ogloszenie-ID15FTQ4.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": "Santarém",
"city":
{
"pt": "Santarém",
"en": "Santarém"
},
"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,
"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"
}
Copied to clipboard
Error response example:
HTTP/1.1 400 Bad Request
{
"error":
{
"type": "AdvertsPostingException",
"message": "Adding the ad failed.",
"details":
{
"district": "Invalid district",
"params.price": "Invalid value"
}
}
}
Copied to clipboard