Endpoint | Description |
---|---|
POST api/account | Register a new account |
POST api/account/token | Retrieve an authorization token |
Endpoint | Description |
---|---|
GET api/trips?pageNumber={pageNumber}&pageSize={pageSize} | Retrieve a paginated list of trips created by the user. |
GET api/trips/template | Retrieve a template of a trip containing the current date, last destination address as the origin address and last used car. |
GET api/trips/{id} | Retrieve a trip with a given ID |
POST api/trips | Create a new trip |
PUT api/trips/{id} | Update an existing trip |
DELETE api/trips/{id} | Delete a trip |
Endpoint | Description |
---|---|
GET api/addresses?pageNumber={pageNumber}&pageSize={pageSize} | Retrieve a paginated list of addresses created by the user. |
GET api/addresses/{id} | Retrieve an address with a given ID. |
POST api/addresses | Create a new address |
PUT api/addresses/{id} | Update an existing address |
DELETE api/addresses/{id} | Delete an address |
Endpoint | Description |
---|---|
GET api/cars?pageNumber={pageNumber}&pageSize={pageSize} | Retrieve a paginated list of cars created by the user. |
GET api/cars/{id} | Retrieve an car with a given ID. |
POST api/cars | Create a new car |
PUT api/cars/{id} | Update an existing car |
DELETE api/cars/{id} | Delete a car |
Register a new account
POST api/account
Header | Value |
---|---|
Accept | application/json |
Content-Type | application/json |
{
"userName": "sample string 1",
"password": "sample string 2",
"confirmPassword": "sample string 3"
}
Retrieve an authorization token
POST api/account/token
Header | Value |
---|---|
Accept | application/json |
Content-Type | application/x-www-form-urlencoded |
grant_type=password&username={username}&password={password}
{
"access_token": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"token_type": "bearer",
"expires_in": 86399
}
Retrieve a paginated list of trips created by the user.
GET api/trips?pageNumber={pageNumber}&pageSize={pageSize}
Name | Description | Type | Additional information |
---|---|---|---|
pageNumber | Current page number | integer | Default value is 1 |
pageSize | Maximum number of items to return per page | integer | Default value is 15 |
Header | Value |
---|---|
Accept | application/json |
Authorization | Bearer {token} |
{
"currentPage": 1,
"pageSize": 15,
"totalPages": 1,
"items": [
{
"id": 1,
"date": "2015-01-19T12:06:59.7202676Z",
"addressOrigin": {
"id": 1,
"name": "sample string 2",
"addressLine": "sample string 3",
"postalCode": "sample string 4",
"city": "sample string 5",
"remarks": "sample string 6"
},
"addressDestination": {
"id": 1,
"name": "sample string 2",
"addressLine": "sample string 3",
"postalCode": "sample string 4",
"city": "sample string 5",
"remarks": "sample string 6"
},
"car": {
"id": 1,
"numberPlate": "sample string 2",
"make": "sample string 3",
"model": "sample string 4",
"remarks": "sample string 5"
},
"remarks": "sample string 3",
"distanceInKm": 4
},
{
"id": 1,
"date": "2015-01-19T12:06:59.7202676Z",
"addressOrigin": {
"id": 1,
"name": "sample string 2",
"addressLine": "sample string 3",
"postalCode": "sample string 4",
"city": "sample string 5",
"remarks": "sample string 6"
},
"addressDestination": {
"id": 1,
"name": "sample string 2",
"addressLine": "sample string 3",
"postalCode": "sample string 4",
"city": "sample string 5",
"remarks": "sample string 6"
},
"car": {
"id": 1,
"numberPlate": "sample string 2",
"make": "sample string 3",
"model": "sample string 4",
"remarks": "sample string 5"
},
"remarks": "sample string 3",
"distanceInKm": 4
}
]
}
Retrieve a template of a trip containing the current date, last destination address as the origin address and last used car.
GET api/trips/template
Header | Value |
---|---|
Accept | application/json |
Authorization | Bearer {token} |
{
"date": "2015-01-19T12:08:51.5038334Z",
"addressOrigin": {
"id": 1,
"name": "sample string 2",
"addressLine": "sample string 3",
"postalCode": "sample string 4",
"city": "sample string 5",
"remarks": "sample string 6"
},
"addressDestination": null,
"car": {
"id": 1,
"numberPlate": "sample string 2",
"make": "sample string 3",
"model": "sample string 4",
"remarks": "sample string 5"
},
"remarks": null
}
Retrieve a trip with a given ID.
GET api/trips/{id}
Name | Description | Type | Additional information |
---|---|---|---|
id | ID of trip | integer | Required |
Header | Value |
---|---|
Accept | application/json |
Authorization | Bearer {token} |
{
"id": 1,
"date": "2015-01-19T12:09:59.969874Z",
"addressOrigin": {
"id": 1,
"name": "sample string 2",
"addressLine": "sample string 3",
"postalCode": "sample string 4",
"city": "sample string 5",
"remarks": "sample string 6"
},
"addressDestination": {
"id": 1,
"name": "sample string 2",
"addressLine": "sample string 3",
"postalCode": "sample string 4",
"city": "sample string 5",
"remarks": "sample string 6"
},
"car": {
"id": 1,
"numberPlate": "sample string 2",
"make": "sample string 3",
"model": "sample string 4",
"remarks": "sample string 5"
},
"remarks": "sample string 3",
"distanceInKm": 4
}
Create a new trip.
POST api/trips
Header | Value |
---|---|
Accept | application/json |
Content-Type | application/json |
Authorization | Bearer {token} |
{
"date": "2015-01-19T12:11:24.0605093Z",
"addressOrigin": {
"id": 1
},
"addressDestination": {
"id": 2
},
"car": {
"id": 1
},
"remarks": "sample string 3"
}
{
"id": 1,
"date": "2015-01-19T12:11:24.0605093Z",
"addressOrigin": {
"id": 1,
"name": "sample string 2",
"addressLine": "sample string 3",
"postalCode": "sample string 4",
"city": "sample string 5",
"remarks": "sample string 6"
},
"addressDestination": {
"id": 2,
"name": "sample string 2",
"addressLine": "sample string 3",
"postalCode": "sample string 4",
"city": "sample string 5",
"remarks": "sample string 6"
},
"car": {
"id": 1,
"numberPlate": "sample string 2",
"make": "sample string 3",
"model": "sample string 4",
"remarks": "sample string 5"
},
"remarks": "sample string 3",
"distanceInKm": 4
}
Update an existing trip.
PUT api/trips/{id}
Name | Description | Type | Additional information |
---|---|---|---|
id | ID of address | integer | Required |
Header | Value |
---|---|
Accept | application/json |
Content-Type | application/json |
Authorization | Bearer {token} |
{
"id": 1,
"date": "2015-01-19T12:29:51.3317288Z",
"addressOrigin": {
"id": 1
},
"addressDestination": {
"id": 2
},
"car": {
"id": 1
},
"remarks": "sample string 3"
}
{
"id": 1,
"date": "2015-01-19T12:29:51.3317288Z",
"addressOrigin": {
"id": 1,
"name": "sample string 2",
"addressLine": "sample string 3",
"postalCode": "sample string 4",
"city": "sample string 5",
"remarks": "sample string 6"
},
"addressDestination": {
"id": 2,
"name": "sample string 2",
"addressLine": "sample string 3",
"postalCode": "sample string 4",
"city": "sample string 5",
"remarks": "sample string 6"
},
"car": {
"id": 1,
"numberPlate": "sample string 2",
"make": "sample string 3",
"model": "sample string 4",
"remarks": "sample string 5"
},
"remarks": "sample string 3",
"distanceInKm": 4
}
Delete a trip.
DELETE api/trips/{id}
Name | Description | Type | Additional information |
---|---|---|---|
id | ID of address | integer | Required |
Header | Value |
---|---|
Authorization | Bearer {token} |
Retrieve a paginated list of addresses created by the user.
GET api/addresses?pageNumber={pageNumber}&pageSize={pageSize}
Name | Description | Type | Additional information |
---|---|---|---|
pageNumber | Current page number | integer | Default value is 1 |
pageSize | Maximum number of items to return per page | integer | Default value is 15 |
Header | Value |
---|---|
Accept | application/json |
Authorization | Bearer {token} |
{
"currentPage": 1,
"pageSize": 15,
"totalPages": 1,
"items": [
{
"id": 1,
"name": "sample string 2",
"addressLine": "sample string 3",
"postalCode": "sample string 4",
"city": "sample string 5",
"remarks": "sample string 6"
},
{
"id": 1,
"name": "sample string 2",
"addressLine": "sample string 3",
"postalCode": "sample string 4",
"city": "sample string 5",
"remarks": "sample string 6"
}
]
}
Retrieve an address with a given ID.
GET api/addresses/{id}
Name | Description | Type | Additional information |
---|---|---|---|
id | ID of address | integer | Required |
Header | Value |
---|---|
Accept | application/json |
Authorization | Bearer {token} |
{
"id": 1,
"name": "sample string 2",
"addressLine": "sample string 3",
"postalCode": "sample string 4",
"city": "sample string 5",
"remarks": "sample string 6"
}
Create a new address.
POST api/addresses
Header | Value |
---|---|
Accept | application/json |
Content-Type | application/json |
Authorization | Bearer {token} |
{
"name": "sample string 2",
"addressLine": "sample string 3",
"postalCode": "sample string 4",
"city": "sample string 5",
"remarks": "sample string 6"
}
{
"id": 1,
"name": "sample string 2",
"addressLine": "sample string 3",
"postalCode": "sample string 4",
"city": "sample string 5",
"remarks": "sample string 6"
}
Update an existing address
PUT api/addresses/{id}
Name | Description | Type | Additional information |
---|---|---|---|
id | ID of address | integer | Required |
Header | Value |
---|---|
Accept | application/json |
Content-Type | application/json |
Authorization | Bearer {token} |
{
"id": 1,
"name": "sample string 2",
"addressLine": "sample string 3",
"postalCode": "sample string 4",
"city": "sample string 5",
"remarks": "sample string 6"
}
{
"id": 1,
"name": "sample string 2",
"addressLine": "sample string 3",
"postalCode": "sample string 4",
"city": "sample string 5",
"remarks": "sample string 6"
}
Delete an address
DELETE api/addresses/{id}
Name | Description | Type | Additional information |
---|---|---|---|
id | ID of address | integer | Required |
Header | Value |
---|---|
Authorization | Bearer {token} |
Retrieve a paginated list of cars created by the user.
GET api/cars?pageNumber={pageNumber}&pageSize={pageSize}
Name | Description | Type | Additional information |
---|---|---|---|
pageNumber | Current page number | integer | Default value is 1 |
pageSize | Maximum number of items to return per page | integer | Default value is 15 |
Header | Value |
---|---|
Accept | application/json |
Authorization | Bearer {token} |
{
"currentPage": 1,
"pageSize": 15,
"totalPages": 1,
"items": [
{
"id": 1,
"numberPlate": "sample string 2",
"make": "sample string 3",
"model": "sample string 4",
"remarks": "sample string 5"
},
{
"id": 1,
"numberPlate": "sample string 2",
"make": "sample string 3",
"model": "sample string 4",
"remarks": "sample string 5"
}
]
}
Retrieve a car with a given ID.
GET api/cars/{id}
Name | Description | Type | Additional information |
---|---|---|---|
id | ID of car | integer | Required |
Header | Value |
---|---|
Accept | application/json |
Authorization | Bearer {token} |
{
"id": 1,
"numberPlate": "sample string 2",
"make": "sample string 3",
"model": "sample string 4",
"remarks": "sample string 5"
}
Create a new car.
POST api/cars
Header | Value |
---|---|
Accept | application/json |
Content-Type | application/json |
Authorization | Bearer {token} |
{
"numberPlate": "sample string 2",
"make": "sample string 3",
"model": "sample string 4",
"remarks": "sample string 5"
}
{
"id": 1,
"numberPlate": "sample string 2",
"make": "sample string 3",
"model": "sample string 4",
"remarks": "sample string 5"
}
Update an existing car
PUT api/cars/{id}
Name | Description | Type | Additional information |
---|---|---|---|
id | ID of car | integer | Required |
Header | Value |
---|---|
Accept | application/json |
Content-Type | application/json |
Authorization | Bearer {token} |
{
"id": 1,
"numberPlate": "sample string 2",
"make": "sample string 3",
"model": "sample string 4",
"remarks": "sample string 5"
}
{
"id": 1,
"numberPlate": "sample string 2",
"make": "sample string 3",
"model": "sample string 4",
"remarks": "sample string 5"
}
Delete a car
DELETE api/cars/{id}
Name | Description | Type | Additional information |
---|---|---|---|
id | ID of car | integer | Required |
Header | Value |
---|---|
Authorization | Bearer {token} |