---
# System prepended metadata

title: AVON APP API

---

---
title: 'AVON APP API'
disqus: hackmd
---

Check In/Out App API
===


## Login

    首先我們要先登入系統,拿到JWT。拿到JWT後,才能使用其他API。

| Method |URL | Headers |
| -------- | -------- | -------- |
| POST     | https://fcrms.net:8443/app/api/AuthenticateUser| **Content-Type**: application/json

<br>

>**Login Request**
>
| Field | Type |Comments |
| -------- | -------- |-------- |
| username| String     |Required, Login username|
| password| String     |Required, password    |
| company_code| string  |Required, company code <br>  |
| platform| String     |Required: <br>**RMS** - system code name|

<br>

>**Example Request body**

    {
        "username":"scott",
        "password":"test0000",
        "company_code":"avon8",
        "platform":"RMS"
    }
    
<br>

>**Login Response**
>
| Field | Type |Comments |
| -------- | -------- |-------- |
| username| String     |user name|
| active| String     |this user status:<br>**1** - active <br> **0** - inactive |
| jwt| String | this string should used as the authorized header of reuquert |

<br>

>**Example Response**

    {
        "id": 20,
        "username": "gary",
        "roles_title": "Super Administrators",
        "password": null,
        "first_name": "gary",
        "last_name": "l",
        "email": "",
        "login_count": 812,
        "location_id": 0,
        "last_login_at": null,
        "active": 1,
        "jwt": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1bmlxdWVfbmFtZSI6ImdhcnkiLCJyb2xlIjoiU3VwZXIgQWRtaW5pc3RyYXRvcnMiLCJodHRwOi8vc2NoZW1hcy54bWxzb2FwLm9yZy93cy8yMDA1LzA1L2lkZW50aXR5L2NsYWltcy9zaWQiOiIxIiwibmJmIjoxNTY4MjU1NDU1LCJleHAiOjE1NjgyNjk4NTUsImlhdCI6MTU2ODI1NTQ1NX0.gYZOXIEaMkd2hh6RAKsopILCY03xj2s2R2rMID0tGes",
        "token": "3e6bf95b-885e-41d5-b3f2-c8498a307468",
        "action_text": null,
        "active_text": null,
        "password1": null,
        "password2": null,
        "role_id": 1,
        "photo_url": "",
        "phone": "",
        "platform": null,
        "company_code": "ascy",
        "new_username": null,
        "end_date": ""
    }

<br>


## Search Reservations
```
用Reservation, Contact, or Vehicle 來搜尋Reservations
```


| Method | URL | Headers |
| -------- | -------- | -------- |
| GET     | https://fcrms.net:8443/app/api/SearchReservations?reservation_display_id={reservation_display_id}&contact_fname={contact_fname}&contact_lname={contact_lname}&location_name={location_name}&unit_number={unit_number}&check_out={check_out}&check_in={check_in}&swap={swap}     | **Content-Type**: application/json<br>**Authorization** Bearer "JWT"     |
<br>

>**Request Parameter**
>
| Field | Type |Comments |
| -------- | -------- |-------- |
| reservation_display id| int     |Reservation number or 空白|
| contact_fname| string |First Name or 空白|
| contact_lname| string |Last Name or 空白|
| location_name| string |Location name or 空白|
| unit_number | string |Unit number or 空白|
| check_out | int |**0**: Check-out pending   <br> **1**: Check-out completed <br> **空白**: Check-out pending or completed|
| check_in | int |**0**: Check-in pending   <br> **1**: Check-in completed <br> **空白**: Check-in pending or completed|
|swap | int | **0:** Reservations without Swap <br> **1**: Reservations with Swap <br> **空白**: All Reservations

<br>

>**Example Response**
:::success
status 200 OK
:::

```
[{
    "reservation_id":2119,
    "reservation_display_id":109,
    "swap_id":0,
    "contact_fname":"Albert",
    "contact_lname":"T",
    "location_name":"GOT Filming Location A",
    "unit_number":"Lux 1",
    "account_name":"HBO",
    "license":"112",
    "make":"",
    "model":"",
    "dl_number":"3131",
    "pickup_date":"8/6/2019 12:00:00 PM",
    "return_date":"8/12/2019 12:00:00 PM",
    "check_out":1,
    "check_in":1,
    "fuel_out":8,
    "fuel_out2":0,
    "haveFuel2": true,
    "odometer_out": 10,
    "odometer_in": 0,
    "customer_id": 1353,
    "demo_diesel": 0,
    "demo_lift_gate": 1
},
{...}]
```

>**Response Parameter**
>
| Field | Type |Comments |
| -------- | -------- |-------- |
| reservation_id| int |Reservation number (internal use)|
| swap_id|int| Unit Swap record id (internal use)|
| reservation_display id| int     |Reservation number|
| contact_fname| string |Contact first name|
| contact_lname| string |Contact last name|
| location_name| string |Location name|
| unit_number | string |Unit number|
|account_name|string|Account name|
|license|string|License plate number of unit|
|make|string|Make of unit|
|model|string|Model of unit|
|dl_number|string|Driver's license number|
|pickup_date|string|Pick up date and time|
|return_date|string|Return date and time|
| check_out | int |**0**: Check-out pending   <br> **1**: Check-out completed |
| check_in | int |**0**: Check-in pending   <br> **1**: Check-in completed |
|fuel_out|int|inspection check out value|
|fuel_out2|int|inspection check out value|
|haveFuel2|bool|have Fuel2 or not|
|odometer_out|int|odometer out value|
|odometer_in|int|odometer in value|
|customer_id|int|customer id|
|demo_diesel|int|0 or 1|
|demo_lift_gate|int|0 or 1|
|last_swap|int|0 or 1|

## Rental Items 

    輸入 reservation id, 拿到 Rental Items 資料

| Method |URL | Headers |
| -------- | -------- | -------- |
| GET     | https://fcrms.net:8443/app/api/GetEquipmentRental?reservation_id={reservation_id}| **Content-Type**: application/json<br>**Authorization** Bearer "JWT"

<br>

>**Example Response**
>
    [
        {
        "id": 500,
        "reservation_id": 0,
        "equipment_id": 0,
        "equipment_name": "phone",
        "quantity": 1,
        "cost": 15,
        "calculate_unit": "day",
        "total": 225,
        "total_days": 0,
        "active": 0,
        "taxable": 1,
        "equipment_name_view": "phone&nbsp; <i data-toggle='tooltip' class='fa fa-asterisk' title='Taxable' aria-hidden='true' style='font-size:10px'></i>",
        "billing_days_per_week": 5
        },
        ...
    ]     
<br>

>**App databind picture**
>
![](https://i.imgur.com/0yMzctV.png)

<br>

## Create Note

    輸入 Note 資訊, 存入DB

| Method |URL | Headers |
| -------- | -------- | -------- |
| POST     | https://fcrms.net:8443/app/api/Notes| **Content-Type**: application/json<br>**Authorization** Bearer "JWT"

>**Request Parameter**
>
| Field | Type |Comments |
| -------- | -------- |-------- |
| link_type| String     |Required: <br>**Reservation** - in Reservation situation |
| link_value| Int     |Required, reservation_id|
| note_body| String   |Required, note content|

<br>

>**Example Request body**

    {
        "link_type": "Reservation",
        "link_value": 1349,
        "note_body": "test note"
    }

<br>

>**Example Response**

    {
        "id": 1017,
        "link_type": "Reservation",
        "link_value": 1349,
        "note_body": "test note",
        "created_time": null,
        "updated_time": null,
        "user_id": 95,
        "active": true
    }  

<br>

## Acknowledgement - Check Out
```
Acknowledgement 頁面的內容
```
| Method |URL | Headers |
| -------- | -------- | -------- |
| GET     | https://fcrms.net:8443/app/api/InspectionApp| **Content-Type**: application/json<br>**Authorization** Bearer "JWT"

<br>


>**Example Response**

    {
        "body": "I acknowledge receipt of the above stated vehicle and equipment. I agree to pay on demand:",
        "body_order": 1
    }   

<br>


## Inspection - Check In && Check Out

    輸入 Inspection 資訊, 存入DB

| Method |URL | Headers |
| -------- | -------- | -------- |
| POST     | https://fcrms.net:8443/app/api/CreateInspection| **Content-Type**: application/json<br>**Authorization** Bearer "JWT"

>**Request Parameter**
>
| Field | Type |Comments |
| -------- | -------- |-------- |
| reservation_id| Int     |Required, Login username|
| inspection_type| String     |Required: <br>**check-in** - in check-in situation <br>**check-out** - in check-out situation  |
| completed_by| String  |Required, user name <br>  |
| fuel| Int     |Required, 0(min) ~ 8(max)|
| odometer| Int   |Required, odometer number|
| link_type| String   |Required: <br>**Reservation** - Reservation situation|

<br>

>**Example Request body**

    {
        "reservation_id": "333",
        "inspection_type": "check-out",
        "completed_by": "gary",
        "fuel": 8,
        "odometer": 10,
        "generator": 50,
        "link_type": "Reservation"
    }

<br>

>**Example Response**

    {
        "reservation_id": 333,
        "inspection_type": "check-out",
        "inspection_datetime": null,
        "completed_by": "gary",
        "active": 0,
        "fuel": "8",
        "odometer": 10,
        "generator": 50,
        "lp": "0",
        "link_type": "Reservation"
    }   

<br>

## Question - Get Question

    拿到問題和選項

| Method |URL | Headers |
| -------- | -------- | -------- |
| GET     | https://fcrms.net:8443/app/api/Question?type={<font color="orange">type</font>}| **Content-Type**: application/json<br>**Authorization** Bearer "JWT"

<br>

>**Request Parameter**
>
| Field | Type |Comments |
| -------- | -------- |-------- |
| type| String     |search question type: <br>**check--out** <br>**check--in**|

<br>

>**Response Detail**

| Field | Type | Comments |
| -------- | -------- |-------- |
| option_id| Int     |option id <br> **if = 0**: text filed <br> **if > 0**: selector|
| option_description| String     |option description|
| id| int  |question id|
| description| String  |question  description|





>**Example Response**

    [
        {
            "option_id": 1,
            "option_description": "yes",
            "id": 2,
            "description": "is it clean"
        },
        {
            "option_id": 2,
            "option_description": "no",
            "id": 2,
            "description": "is it clean"
        },
        {
            "option_id": 0,
            "option_description": "",
            "id": 7,
            "description": "how is wheather?"
        },
        ...
    ]  
<br>

## Question - Post Question Answer

    傳送問題的選項內容

| Method |URL | Headers |
| -------- | -------- | -------- |
| POST     | https://fcrms.net:8443/app/api/Question| **Content-Type**: application/json<br>**Authorization** Bearer "JWT"

<br>

>**Request Parameter**
>
| Field | Type |Comments |
| -------- | -------- |-------- |
| reservation_id| Int     |Required, reservation id|
| question_id| Int     |Required, question id |
| option_id| Int  | **if selector**, input option id |
| option_value| String  | **if text field** , input description |



<br>

>**Example Request body**

    [
        {
            "reservation_id": 1353,
            "question_id": 2,
            "option_id": 1
        },
        {
            "reservation_id": 1353,
            "question_id": 5,
            "option_id": 4
        },
         {
            "reservation_id": 1353,
            "question_id": 7,
            "option_value": "good"
        }
    ] 
<br>

>**Example Response**

    {
        "post data success"
    }   
<br>

## Driver License - Get Driver License Image Url

    拿到駕照圖片

| Method |URL | Headers |
| -------- | -------- | -------- |
| POST     | https://fcrms.net:8443/app/api/GetFileFromRMS?Module_ID={<font color="orange">customer_id</font>}&type={<font color="orange">file_type</font>}| **Content-Type**: application/json<br>**Authorization** Bearer "JWT"

<br>

>**Request Parameter**
>
| Field | Type |Comments |
| -------- | -------- |-------- |
| customer_id| Int     |Required, customer id|
| file_type| Int     |Required file type id <br> **0**: front side  of dirver license   <br> **1**: back side  of dirver license |

<br>

>**Example Response**

    "https://app.box.com/shared/static/kwi0it8op6v8giulhu5nup4ya2rvqrq4"
    
<br>   

## Driver License - Upload Driver License Image

    上傳駕照照片

| Method |URL | Headers |
| -------- | -------- | -------- |
| PUT     | https://fcrms.net:8443/app/api/UploadFileFromRMS| **Content-Type**: **<font color="red">multipart/form-data</font>**<br>**Authorization** Bearer "JWT"

>**Request Parameter**
>
| Field | Type |Comments |
| -------- | -------- |-------- |
| id| Text     |Required, customer_id|
| t| Text     |Required file type id <br> **0**: front of dirver license   <br> **1**: back of dirver license |
| 0| file  |driver's license image file|


<br>

## Damage Location

    損壞部位

| Method |URL | Headers |
| -------- | -------- | -------- |
| GET     | https://fcrms.net:8443/app/api/GetDamageLocation| **Content-Type**: application/json<br>**Authorization** Bearer "JWT"

<br>

>**Response Detail**

| Field | Type | Comments |
| -------- | -------- |-------- |
| id| Int     |damage id |
| damage_location| String     |damage_location description|



<br>

>**Example Response**

    [
        {
            "id": 1,
            "reservation_id": 0,
            "damage_location": "Awning",
            "damage_condition": null,
            "memo": null,
            "datetime": null,
            "unit_fullname": null
        },
        {
            "id": 2,
            "reservation_id": 0,
            "damage_location": "Appliance",
            "damage_condition": null,
            "memo": null,
            "datetime": null,
            "unit_fullname": null
        },
        ...
    ]
    
<br>

## Damage Condition

    損壞種類

| Method |URL | Headers |
| -------- | -------- | -------- |
| GET     | https://fcrms.net:8443/app/api/GetDamageCondition| **Content-Type**: application/json<br>**Authorization** Bearer "JWT"

<br>

>**Response Detail**

| Field | Type | Comments |
| -------- | -------- |-------- |
| id| Int     |damage  condition id |
| damage_condition| String     |damage_condition description|

<br>

>**Example Response**

    "[
         {
            "id": 1,
            "reservation_id": 0,
            "damage_location": null,
            "damage_condition": "Chip",
            "memo": null,
            "datetime": null,
            "unit_fullname": null
        },
        {
            "id": 2,
            "reservation_id": 0,
            "damage_location": null,
            "damage_condition": "Dent",
            "memo": null,
            "datetime": null,
            "unit_fullname": null
        },
        ...
    ]"
    
<br>

## Get Check Out Notes
    回傳Check Out時所紀錄的Notes
| Method |URL | Headers |
| -------- | -------- | -------- |
| GET     | https://fcrms.net:8443/app/api/Notes?link_type={link_type}&link_value={link_value}&label={label}| **Content-Type**: application/json<br>**Authorization** Bearer "JWT"

>**Request Parameter**
>
| Field      | Type | Comments                                                                                                   |
| ---------- | ---- | ---------------------------------------------------------------------------------------------------------- |
| link_type  | String  | <b>Reservation</b> or <b>Swap</b> |
| link_value| Int     | [reservation_id] or [swap_id] |
| label | Int  | 1 |

## Submit Inspection

    所有功能整合

| Method |URL | Headers |
| -------- | -------- | -------- |
| POST     | https://fcrms.net:8443/app/api/InspectionApp| **Content-Type**: application/json<br>**Authorization** Bearer "JWT"

<br>

>**Request Parameter**
>
| Field | Type |Comments |
| -------- | -------- |-------- |
| type| String     |Required: <br>**check-in** - in check-in situation <br>**check-out** - in check-out situation  |
| inspection| Object  |   |
| equipmentRentals| List<Object> | |
| questionAnswerList| List<Object>|  |
| notes| Object   |  |
| sendEmail| bool   | **true:** send email <br> **false:** dont send emil |


<br>

>**Inspection Detail**
>
| Field | Type |Comments |
| -------- | -------- |-------- |
| reservation_id| Int     |Required, <br>**Reservation:** reservation_id <br>**Swap:** swap_id|
| inspection_type| String     |Required: <br>**check-in** - in check-in situation <br>**check-out** - in check-out situation  |
| completed_by| String  |Required, user name <br>  |
| fuel| Int     |Required, 0(min) ~ 8(max)|
| lp| Int     | 0(min) ~ 8(max), fuel2|
| odometer| Int   |Required, odometer number|
| link_type| String   |Required: <br>**Reservation** - Reservation situation <br>**Swap** - Swap situation|

<br>

>**Equipment Rental Detail**
>
| Field | Type |Comments |
| -------- | -------- |-------- |
| id| Int     |Required, equipment_rental id|
| reservation_id| Int     |Required, reservation id |
| quantity| Int  | Required, quantity |
| cost| String  | Required, cost |
| total| String  | Required, total |

<br>

>**Question Detail**
>
| Field | Type |Comments |
| -------- | -------- |-------- |
| reservation_id| Int     |Required, reservation id|
| question_id| Int     |Required, question id |
| option_id| Int  | 回答種類是**選擇類型**, 填入 option id |
| option_value| String  | 回答種類是**文字類型** , 填入 文字敘述 |

<br>

>**Note Detail**
>
| Field | Type |Comments |
| -------- | -------- |-------- |
| link_type| String     |Required: **Reservation**|
| link_value| Int     |Required, reservation_id|
| note_body| String   |Required, note content|

<br>

>**Example Request body**

    {
        "type": "check-out",
        "inspection" : {
            "inspection_type":"check-out",
            "link_type": "Reservation",
            "reservation_id": "1359",
            "fuel": 6,
            "odometer": 11,
            "generator": 51
        },
        "equipmentRentals":
        [
            {
                "id": 504,
                "reservation_id": 1359,
                "quantity" : 3,
                "cost" : 5,
                "total" : 165
            },
            {
                "id": 505,
                "reservation_id": 1359,
                "quantity" : 1,
                "cost" : 12,
                "total" : 12
            }
        ],
        "questionAnswerList" :
        [
            {
                "reservation_id": 1359,
                "question_id": 2,
                "option_id": 1
            },
            {
                "reservation_id": 1359,
                "question_id": 5,
                "option_id": 4
            },
            {
                "reservation_id": 1359,
                "question_id": 6,
                "option_id": 6
            },
            {
                "reservation_id": 1359,
                "question_id": 7,
                "option_value": "app api test 1024 "
            }
        ],
        "notes" : 
        {
            "link_type": "Reservation",
            "link_value" : 1359,
            "note_body" : "app api test 1024 notes"
        }
    }
    
<br>
    
    
## Submit Inspection (Upload Image)

    上傳所有圖片

| Method |URL | Headers |
| -------- | -------- | -------- |
| PUT     | https://fcrms.net:8443/app/api/InspectionApp| **Content-Type**: **<font color="red">multipart/form-data</font>**<br>**Authorization** Bearer "JWT"

>**Check Out Request Parameter**
>
| Key | Type |Comments |
| -------- | -------- |-------- |
| type| Text     |Required, **check-out**|
| link_type| Text     |Required,  <br> **reservation** <br> **swap**|
| link_value| Text     |Required, reservation_id or swap_id|
| customer_id| Text  |Required, customer_id|
| file1 <br> file2 <br> file3 <br> ...| File  |image file. file name rule <br> **drive license**: drive_back.jpg, drive_front.jpg <br> **signature**: signature <br> **car inspection picture**: inspection_1, inspection_2, inspection_3, ... <br> **car damage picture**: damage_1, damage_2, damage_3, ...|
| damageLocation1 <br> damageLocation2 <br> damageLocation3 <br> ...| Text  |damage location description。 damageLocation1 會對應 file1 的敘述 |
| damageCondition1 <br> damageCondition2 <br> damageCondition3 <br> ...| Text  |damage condition description。 damageCondition1 會對應 file1 的敘述|


>**Check In Request Parameter**
>
| Key | Type |Comments |
| -------- | -------- |-------- |
| type| Text     |Required, **check-in**|
| link_type| Text     |Required,  <br> **reservation** <br> **swap**|
| link_value| Text     |Required, reservation_id or swap_id|
| customer_id| Text  |Required, customer_id|
| file1 <br> file2 <br> file3 <br> ...| File  |image file. file name rule <br> **car inspection picture**: damage_1, damage_2, damage_3, ... <br> **signature:** signature
| damageLocation1 <br> damageLocation2 <br> damageLocation3 <br> ...| Text  |damage location description。 damageLocation1 會對應 file1 的敘述 |
| damageCondition1 <br> damageCondition2 <br> damageCondition3 <br> ...| Text  |damage condition description。 damageCondition1 會對應 file1 的敘述|


>**Postman Example**
[Click Here](https://trello-attachments.s3.amazonaws.com/59bf8d5a10cbb50a587674d2/5d798a1ed17275576af4b9ca/a0427ec5e7a48d60043a0ba272ed055c/avonApp.postman_collection.json)
>

<br>

## Send Inspection PDF Email

    寄Inspection PDF Email

| Method |URL | Headers |
| -------- | -------- | -------- |
| POST     | https://fcrms.net:8443/app/api/GetInspectionHtml?link_type={<font color="orange">link_type</font>}&reservation_id={<font color="orange">reservation_id</font>}| **Content-Type**: application/json<br>**Authorization** Bearer "JWT"

<br>

>**Request Parameter**

| Field | Type | Comments |
| -------- | -------- |-------- |
| link_type| string  | **Reservation** or **Swap**  |
| reservation_id| int  | encode link value id, reservation_id or swap_id, detail can see **Get encode reservation id**  |

<br>

>**Example Response**
:::success
status 200 OK
:::
    {
        email sended
    }
<br>

:::danger
status 400 BadRequest
:::
    {
        no inspection
    }

<br>

## Get Check Out Image

    拿到之前check out 的圖片

| Method |URL | Headers |
| -------- | -------- | -------- |
| GET     | https://fcrms.net:8443/app/api/BoxFileFromRMS?moduleName={<font color="orange">moduleName</font>}&moduleId={<font color="orange">moduleId</font>}| **Content-Type**: application/json<br>**Authorization** Bearer "JWT"

<br>

>**Request Parameter**

| Field | Type | Comments |
| -------- | -------- |-------- |
| moduleName| String     |母資料夾名稱<br> **InspectionImage**: check out 圖片資料夾名稱<br> **DamageImage**: check in 圖片資料夾名稱 |
| moduleId| String     |子資料夾名稱 <br>link_type + _ + _link_value (reservation_1359, swap_12)|

<br>

>**Response Detail**
>
| Field | Type |Comments |
| -------- | -------- |-------- |
| Box_url| String  | image url  |


<br>

>**Example Response**

    [
        {
            "ID": "3138",
            "Module_Name": "DamageImage",
            "Module_ID": "91254817388",
            "Box_Type": "file",
            "Box_Name": "damage_1.JPG",
            "Box_Size": "213501",
            "Create_By": "box-dev@fleetcommandrms.com",
            "Create_Date": "10/25/2019 8:42 AM",
            "Box_ID": "546139479756",
            "ParentID": "91254817388",
            "Box_url": https://app.box.com/shared/static/veyovf4mh0st7srlxonxtobuqnnpuyl2.jpg"
        },
        {
            "ID": "3139",
            "Module_Name": "DamageImage",
            "Module_ID": "91254817388",
            "Box_Type": "file",
            "Box_Name": "damage_2 .JPG",
            "Box_Size": "30044",
            "Create_By": "box-dev@fleetcommandrms.com",
            "Create_Date": "10/25/2019 8:54 AM",
            "Box_ID": "546141934538",
            "ParentID": "91254817388",
            "Box_url": "https://app.box.com/shared/static/uspvct073kb66n5l0wsb8ubdxg3k51k0.jpg"
        }
    ]
    
<br>

## Get Location

    拿Location list

| Method |URL | Headers |
| -------- | -------- | -------- |
| GET     | https://fcrms.net:8443/app/api/GetLocations| **Content-Type**: application/json<br>**Authorization** Bearer "JWT"

<br>

>**Response Detail**
>
| Field | Type |Comments |
| -------- | -------- |-------- |
| id| int  | location id  |
| location_name| string  | location name  |

<br>

>**Example Response**

    [
        {
            "id": 269,
            "type": 0,
            "location_name": "my company location",
            "street_1": "14861 Artesia Blvd",
            "street_2": "",
            "city": "La Mirada",
            "state": "CA",
            "zip": null,
            "zip_string": "90638",
            "active": 1,
            "account_id": 0,
            "tax_rate": 0.0,
            "place_id": "EiwxNDg2MSBBcnRlc2lhIEJsdmQsIExhIE1pcmFkYSwgQ0EgOTA2MzgsIFVTQSIxEi8KFAoSCaMPpzOBK92AET7UFM6hhAlZEI10",
            "lat": "33.8739681",
            "lng": "-118.0146747",
            "address": "14861 Artesia Blvd, La Mirada, CA, USA",
            "phone_number": "1111"
        },
        {
            "id": 404,
            "type": 0,
            "location_name": "Yellowstone National Park, WY, USA",
            "street_1": "",
            "street_2": "",
            "city": "Yellowstone National Park",
            "state": "WY",
            "zip": null,
            "zip_string": "82190",
            "active": 1,
            "account_id": 0,
            "tax_rate": 0.0,
            "place_id": "0",
            "lat": "0",
            "lng": "0",
            "address": "",
            "phone_number": ""
        },
    ...
    ]
    
<br>

## Inspection Html

    Inspection Html Url

 | Method | URL | 
|  -------- | -------- 
| GET | https://fcrms.net:8443/rms/production/inspection.html?link_type={<font color="orange">link_type</font>}&reservation_id={<font color="orange">reservation_id</font>}|

<br>

>**Url Parameter**
>
| Field | Type |Comments |
| -------- | -------- |-------- |
| link_type| string  | **Reservation** or **Swap**  |
| reservation_id| int  | encode link value id, reservation_id or swap_id, detail can see **Get encode reservation id**  |


<br>

## Get encode reservation id

    拿到加密的 link value

 |Method |URL | 
|------ | -------- | 
|POST |https://fcrms.net:8443/app/api/GetInspectionHtml?reservationId={<font color="orange">link_value</font>}|

<br>

>**Request Parameter**
>
| Field | Type |Comments |
| -------- | -------- |-------- |
| link_value| int  | **Reservation id** or **Swap id**  |

<br>

>**Example Response**

    
    {
        "31740BB9F18E0EC9"
    }

    
<br>

## Inspection URL

       Get Inspection Html Url

| Method | URL | 
|  -------- | -------- 
| GET | https://fcrms.net:8443/app/api/InspectionApp?link_type={<font color="orange">link_type</font>}&reservation_id={<font color="orange">reservation_id</font>}|

<br>

>**Url Parameter**
>
| Field | Type |Comments |
| -------- | -------- |-------- |
| link_type| string  | **Reservation** or **Swap**  |
| reservation_id| int  | encode link value id, reservation_id or swap_id, detail can see **Get encode reservation id**  |

<br>

>**Example Response**

    
    {
        "https://fcrms.net:8443/app_html/production/inspection.html?link_type=Reservation&reservation_id=6C5977C9FC766D4B"
    }

<br>

## Get Equipment Rental

       如果inspection 是最後一個 swap, 拿原本的reservation equipment rental 資料

| Method | URL | 
|  -------- | -------- 
| GET | https://fcrms.net:8443/app/api/GetEquipmentRental?reservation_id={<font color="orange">reservation_id</font>}|

<br>

>**Url Parameter**
>
| Field | Type |Comments |
| -------- | -------- |-------- |
| reservation_id| int  | reservation id  |

<br>

>**Response Detail**
>
| Field | Type |Comments |
| -------- | -------- |-------- |
| id| int  | location id  |
| location_name| string  | location name  |


<br>

>**Example Response**

    
    [
        {
         "id":520,
         "reservation_id":1370,
         "equipment_id":105,
         "equipment_name":"noodle",
         "quantity":1,
         "cost":20.0,
         "calculate_unit":"day",
         "total":460.0,
         "total_days":0,
         "active":0,
         "taxable":0,
         "equipment_name_view":"noodle",
         "billing_days_per_week":7,
         "check_in_quantity":0
         },...
    ]
    
<br>

## Get Damage

       獲得車子damage 的狀態

| Method | URL | 
|  -------- | -------- 
| GET | https://fcrms.net:8443/app/api/GetDamage?units_auto_id={<font color="orange">units_auto_id</font>}|

<br>

>**Url Parameter**
>
| Field | Type |Comments |
| -------- | -------- |-------- |
| units_auto_id| int  | units auto id  |

<br>

>**Response Detail**
>
| Field | Type |Comments |
| -------- | -------- |-------- |
| id| int  | damage id  |
| reservation_id| string  | reservation id |
| damage_location| string  | damage location  |
| damage_condition| string   | damage condition  |
| memo| string  | memo  |
| datetime| string  | create time  |
| unit_fullname| int  | unit name  |
| link_type| string  | Reservation or Swap  |
| box_url| string  | image url  |


<br>

>**Example Response**

    
    [
        {
         id: 58
         reservation_id: 1362
         damage_location: "Front"
         damage_condition: "Dent"
         memo: ""
         datetime: "2019-11-06 08:52 AM"
         unit_fullname: "0627"
         link_type: "reservation"
         box_url: "https://app.box.com/shared/static/8td289c8lzoi2yrnrvwt5lngcezso07i.jpg"
        },...
    ]