> For the complete documentation index, see [llms.txt](https://docs.artificient.de/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.artificient.de/api-documentation/users-car.md).

# User's Car

<mark style="color:red;">**NOTE: Use the following endpoints only if you intend to store the personal information of your users on GIZO platform.**</mark>&#x20;

## Adding a New Vehicle&#x20;

The endpoint is designed to handle requests for adding the information associated with the user's vehicles.

## POST /api/v2/User/carModel

>

```json
{"openapi":"3.0.1","info":{"title":"Gizo","version":"2.0"},"servers":[{"url":"https://api.artificient.de"}],"security":[{"Bearer":[]}],"components":{"securitySchemes":{"Bearer":{"type":"http","description":"Provide a JWT Bearer","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"AddUserCarModelRequest":{"required":["license","mileage","yearOfProduction"],"type":"object","properties":{"carModelId":{"type":"integer","format":"int64"},"license":{"minLength":1,"type":"string"},"yearOfProduction":{"maximum":2099,"minimum":1900,"type":"integer","format":"int32"},"mileage":{"type":"integer","format":"int32"}},"additionalProperties":false}}},"paths":{"/api/v2/User/carModel":{"post":{"tags":["User"],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddUserCarModelRequest"}},"text/json":{"schema":{"$ref":"#/components/schemas/AddUserCarModelRequest"}},"application/*+json":{"schema":{"$ref":"#/components/schemas/AddUserCarModelRequest"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"boolean"}}}}}}}}}
```

#### Header Request Parameters

Authentication Bearer Token

#### Request Body Parameters

**carModelName:** the model name of the user's car that is expected to be a string value, e.g. **"C200"**.

&#x20;**carBrandName:** the brand name of the user's car that is expected to be a string value, e.g. **"Benz"**.

&#x20;**license:** the license plate number of the user's car that is expected to be a string value, e.g. **"RAKL 8136"**.

&#x20;**yearOfProduction:** the year of production of the user's car that is expected to be a numeric value, e.g. **2001**.

**NOTE:** yearOfProduction must be added between 1900 and the current year.

**mileage:** the mileage or distance traveled by the user's car that  is expected to be a numeric value, e.g. **1000**.

**NOTE:** the maximum number of characters in mileage is 9.

#### **Response**

If it is **true**, it means that the car model is added.

## **Selecting the Current Vehicle**&#x20;

The endpoint is designed to handle requests for selecting the vehicle which is currently being driven by the user.

## PATCH /api/v1/User/carModel/select

>

```json
{"openapi":"3.0.1","info":{"title":"Gizo API v1","version":"1.0"},"servers":[{"url":"https://api.artificient.de"},{"url":"https://api.gizo.pod.artificient.de"}],"security":[{"Bearer":[]}],"components":{"securitySchemes":{"Bearer":{"type":"http","description":"Provide a JWT Bearer","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"Gizo.Api.Contracts.UserCarModels.V1.Requests.SelectUserCarModelRequest":{"type":"object","properties":{"id":{"type":"integer","format":"int64"}},"additionalProperties":false}}},"paths":{"/api/v1/User/carModel/select":{"patch":{"tags":["User"],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Gizo.Api.Contracts.UserCarModels.V1.Requests.SelectUserCarModelRequest"}},"text/json":{"schema":{"$ref":"#/components/schemas/Gizo.Api.Contracts.UserCarModels.V1.Requests.SelectUserCarModelRequest"}},"application/*+json":{"schema":{"$ref":"#/components/schemas/Gizo.Api.Contracts.UserCarModels.V1.Requests.SelectUserCarModelRequest"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"boolean"}}}}}}}}}
```

#### Header Request Parameters

Authentication Bearer Token

#### Request Body Parameters

**id:** The ID of the car which is selected and is expected to be a numeric value, e.g. **1560**

#### **Response**

If it is **true**, it means that the car model is selected.

## **Getting the List of All Vehicles of a User**

The endpoint is designed to handle requests for retrieving the model of cars associated with the user.

## GET /api/v2/User/carModels

>

```json
{"openapi":"3.0.1","info":{"title":"Gizo","version":"2.0"},"servers":[{"url":"https://api.artificient.de"}],"security":[{"Bearer":[]}],"components":{"securitySchemes":{"Bearer":{"type":"http","description":"Provide a JWT Bearer","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"UserCarResponse":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"carModelId":{"type":"integer","format":"int64"},"carBrandId":{"type":"integer","format":"int64"},"carName":{"type":"string","nullable":true},"carModel":{"type":"string","nullable":true},"license":{"type":"string","nullable":true},"yearOfProduction":{"type":"integer","format":"int32","nullable":true},"mileage":{"type":"integer","format":"int32","nullable":true},"isSelected":{"type":"boolean"}},"additionalProperties":false}}},"paths":{"/api/v2/User/carModels":{"get":{"tags":["User"],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/UserCarResponse"}}}}}}}}}}
```

#### Header Request Parameters

Authentication Bearer Token

#### **Response**

The provided endpoint response contains an array of several properties, including:

**id:** this property represents the ID of the car. It is expected to be a numeric value, e.g. **2256**.

**carModelId:** the carModelId property represents the ID of the car model associated with the car. It is expected to be a numeric value, e.g. **80**.

**caBrandId:** this property represents the ID of the car brand associated with the car. It is expected to be a numeric value, e.g. **3**.

**carName:** the carName property represents the name or identifier of the car. It is expected to be a string value, e.g. **"Benz"**.

**carModel:** this property represents the model of the car. It is expected to be a string value, e.g. **"C200"**.

**license:** the license property represents the license plate number or identifier of the car. It is expected to be a string value, e.g. **"RAKL 8136"**.

**yearOfProduction:** this property represents the year of production for the car. It is expected to be a numeric value, e.g. **2023**.

**mileage:** the mileage property represents the mileage or distance traveled by the car. It is expected to be a numeric value, e.g. **1000**.

**isSelected:** the isSelected property is a Boolean value (true or false). This property typically indicates whether the car is selected or chosen for a particular purpose, e.g. **false**.&#x20;

**NOTE:** just one car can be selected on a list.

## **Getting the Information about a Vehicle By ID**&#x20;

The endpoint is designed to handle requests for retrieving or fetching a specific car model associated with a user.

## GET /api/v2/User/carModels/{id}

>

```json
{"openapi":"3.0.1","info":{"title":"Gizo","version":"2.0"},"servers":[{"url":"https://api.artificient.de"}],"security":[{"Bearer":[]}],"components":{"securitySchemes":{"Bearer":{"type":"http","description":"Provide a JWT Bearer","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"UserCarResponse":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"carModelId":{"type":"integer","format":"int64"},"carBrandId":{"type":"integer","format":"int64"},"carName":{"type":"string","nullable":true},"carModel":{"type":"string","nullable":true},"license":{"type":"string","nullable":true},"yearOfProduction":{"type":"integer","format":"int32","nullable":true},"mileage":{"type":"integer","format":"int32","nullable":true},"isSelected":{"type":"boolean"}},"additionalProperties":false}}},"paths":{"/api/v2/User/carModels/{id}":{"get":{"tags":["User"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","format":"int64"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserCarResponse"}}}}}}}}}
```

#### Header Request Parameters

Authentication Bearer Token

#### Request Parameters

**id:** the ID of the car and which is expected to be a numeric value, e.g. **2256**.

#### **Response**

The provided endpoint response contains several properties, including:

**id:** this property represents the ID of the car. It is expected to be a numeric value, e.g. **2256**.

**carModelId:** the carModelId property represents the ID of the car model associated with the car. It is expected to be a numeric value, e.g. **80**.

**caBrandId:** this property represents the ID of the car brand associated with the car. It is expected to be a numeric value, e.g. **3**.

**carName:** the carName property represents the name or identifier of the car. It is expected to be a string value, e.g. **"Benz"**.

**carModel:** this property represents the model of the car. It is expected to be a string value, e.g. **"C200"**.

**license:** the license property represents the license plate number or identifier of the car. It is expected to be a string value, e.g. **"RAKL 8136"**.

**yearOfProduction:** this property represents the year of production for the car. It is expected to be a numeric value, e.g. **2023**.

**mileage:** the mileage property represents the mileage or distance traveled by the car. It is expected to be a numeric value, e.g. **1000**.

**isSelected:** the isSelected property is a Boolean value (true or false). This property typically indicates whether the car is selected or chosen for a particular purpose, e.g. **false**.

**NOTE:** just one car can be selected on a list.

## **Delete Car Model**

The endpoint is designed to handle requests for deleting the car model information associated with a user.&#x20;

## DELETE /api/v2/User/carModel

>

```json
{"openapi":"3.0.1","info":{"title":"Gizo","version":"2.0"},"servers":[{"url":"https://api.artificient.de"}],"security":[{"Bearer":[]}],"components":{"securitySchemes":{"Bearer":{"type":"http","description":"Provide a JWT Bearer","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"DeleteUserCarModelRequest":{"type":"object","properties":{"id":{"type":"integer","format":"int64"}},"additionalProperties":false}}},"paths":{"/api/v2/User/carModel":{"delete":{"tags":["User"],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteUserCarModelRequest"}},"text/json":{"schema":{"$ref":"#/components/schemas/DeleteUserCarModelRequest"}},"application/*+json":{"schema":{"$ref":"#/components/schemas/DeleteUserCarModelRequest"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"boolean"}}}}}}}}}
```

#### Header Request Parameters

Authentication Bearer Token

#### Request Body Parameters

**id:** The ID of the car, and it is expected to be a numeric value, e.g. **2256**.

#### **Response**

If it is **true**, it means that the car is deleted.
