POST api/drivers
Request Information
URI Parameters
None.
Body Parameters
DriverInputViewModel| Name | Description | Type | Additional information |
|---|---|---|---|
| id | integer |
None. |
|
| firstname | string |
Required |
|
| middlename | string |
None. |
|
| lastname | string |
Required |
|
| nickname | string |
Required |
|
| birth_date | date |
Required |
|
| gender | integer |
Required |
|
| status | integer |
None. |
|
| hired_date | date |
Required |
|
| driver_license | string |
None. |
|
| addresses | Collection of DriverAddressInputViewModel |
None. |
|
| contacts | Collection of DriverContactInputViewModel |
None. |
Request Formats
application/json, text/json
Sample:
{
"id": 1,
"firstname": "sample string 2",
"middlename": "sample string 3",
"lastname": "sample string 4",
"nickname": "sample string 5",
"birth_date": "2025-10-27T21:21:13.2980151+08:00",
"gender": 7,
"status": 8,
"hired_date": "2025-10-27T21:21:13.2980151+08:00",
"driver_license": "sample string 10",
"addresses": [
{
"driver_id": 1,
"address": "sample string 2",
"city": "sample string 3",
"country": "sample string 4"
},
{
"driver_id": 1,
"address": "sample string 2",
"city": "sample string 3",
"country": "sample string 4"
}
],
"contacts": [
{
"driver_id": 1,
"number": "sample string 2",
"types": 3,
"primary": true
},
{
"driver_id": 1,
"number": "sample string 2",
"types": 3,
"primary": true
}
]
}
application/xml, text/xml
Sample:
<DriverInputViewModel xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/autocenter_api.Models.ViewModel">
<addresses>
<DriverAddressInputViewModel>
<address>sample string 2</address>
<city>sample string 3</city>
<country>sample string 4</country>
<driver_id>1</driver_id>
</DriverAddressInputViewModel>
<DriverAddressInputViewModel>
<address>sample string 2</address>
<city>sample string 3</city>
<country>sample string 4</country>
<driver_id>1</driver_id>
</DriverAddressInputViewModel>
</addresses>
<birth_date>2025-10-27T21:21:13.2980151+08:00</birth_date>
<contacts>
<DriverContactInputViewModel>
<driver_id>1</driver_id>
<number>sample string 2</number>
<primary>true</primary>
<types>3</types>
</DriverContactInputViewModel>
<DriverContactInputViewModel>
<driver_id>1</driver_id>
<number>sample string 2</number>
<primary>true</primary>
<types>3</types>
</DriverContactInputViewModel>
</contacts>
<driver_license>sample string 10</driver_license>
<firstname>sample string 2</firstname>
<gender>7</gender>
<hired_date>2025-10-27T21:21:13.2980151+08:00</hired_date>
<id>1</id>
<lastname>sample string 4</lastname>
<middlename>sample string 3</middlename>
<nickname>sample string 5</nickname>
<status>8</status>
</DriverInputViewModel>
application/x-www-form-urlencoded
Sample:
Sample not available.
Response Information
Resource Description
IHttpActionResultNone.
Response Formats
application/json, text/json, application/xml, text/xml
Sample:
Sample not available.