POST: https://www.autovit.ro/api/open/account/adverts
Permission: write
Header
| Field | Type | Description |
| User-Agent | string | Account email. |
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 |
| title | String | Title |
| description | String | Description |
| category_id | Number | Category id , see: Category |
| brand_program_id | Number | Brand program id |
| advertiser_type | String | Allowed values: private, business |
| image_collection_id | String | Id of images collection, see: Images |
| contact | Object | Contact object |
| phones | Array | The list of phones to contact - Unavailable until further instruction |
| 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 |
Request example:
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",
"generation": "gen-mk4-2018",
"version": "ver-1-6-gold-x",
"mileage": 199000,
"fuel_type": "petrol",
"body_type": "sedan",
"color": "white",
"price":
{
"0": "arranged",
"1": 20000,
"currency": "RON",
"gross_net": "gross"
},
"video": "https://www.youtube.com/watch?v=code"
}
"image_collection_id": 821165359,
"advertiser_type": "private",
"brand_program_id": "1"
}
Copied to clipboard
Success response:
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":
{
"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,
"body_type": "sedan",
"color": "white",
"price":
{
"0": "price",
"1": 2000,
"currency": "RON",
"gross_net": "gross"
},
"video": "https://www.youtube.com/watch?v=code"
},
"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