# IiiDispatch.TaxiRequestApi

All URIs are relative to *http://localhost/v1*

Method | HTTP request | Description
------------- | ------------- | -------------
[**createTaxiRequest**](TaxiRequestApi.md#createTaxiRequest) | **POST** /taxi_request | 新增叫車
[**deleteTaxiRequest**](TaxiRequestApi.md#deleteTaxiRequest) | **DELETE** /taxi_request/{taxi_requestId} | Deletes a taxi_request
[**findAllTaxiRequests**](TaxiRequestApi.md#findAllTaxiRequests) | **GET** /taxi_request | 取得叫車服務清單
[**getTaxiRequestById**](TaxiRequestApi.md#getTaxiRequestById) | **GET** /taxi_request/{taxi_requestId} | 以ID連結叫車資料
[**updateTaxiRequestWithForm**](TaxiRequestApi.md#updateTaxiRequestWithForm) | **POST** /taxi_request/{taxi_requestId} | 更新ID指定之叫車資料


<a name="createTaxiRequest"></a>
# **createTaxiRequest**
> createTaxiRequest(body)

新增叫車

This can only be done by the logged in user.

### Example
```javascript
var IiiDispatch = require('iii_dispatch');

var apiInstance = new IiiDispatch.TaxiRequestApi();

var body = new IiiDispatch.TaxiRequest(); // TaxiRequest | Created user object


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
apiInstance.createTaxiRequest(body, callback);
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **body** | [**TaxiRequest**](TaxiRequest.md)| Created user object | 

### Return type

null (empty response body)

### Authorization

No authorization required

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: application/xml, application/json

<a name="deleteTaxiRequest"></a>
# **deleteTaxiRequest**
> deleteTaxiRequest(taxiRequestId, opts)

Deletes a taxi_request



### Example
```javascript
var IiiDispatch = require('iii_dispatch');
var defaultClient = IiiDispatch.ApiClient.instance;

// Configure OAuth2 access token for authorization: iii_dispatch_auth
var iii_dispatch_auth = defaultClient.authentications['iii_dispatch_auth'];
iii_dispatch_auth.accessToken = 'YOUR ACCESS TOKEN';

var apiInstance = new IiiDispatch.TaxiRequestApi();

var taxiRequestId = 789; // Number | TaxiRequest id to delete

var opts = { 
  'apiKey': "apiKey_example" // String | 
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
apiInstance.deleteTaxiRequest(taxiRequestId, opts, callback);
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **taxiRequestId** | **Number**| TaxiRequest id to delete | 
 **apiKey** | **String**|  | [optional] 

### Return type

null (empty response body)

### Authorization

[iii_dispatch_auth](../README.md#iii_dispatch_auth)

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: application/xml, application/json

<a name="findAllTaxiRequests"></a>
# **findAllTaxiRequests**
> [TaxiRequest] findAllTaxiRequests()

取得叫車服務清單

### Example
```javascript
var IiiDispatch = require('iii_dispatch');
var defaultClient = IiiDispatch.ApiClient.instance;

// Configure OAuth2 access token for authorization: iii_dispatch_auth
var iii_dispatch_auth = defaultClient.authentications['iii_dispatch_auth'];
iii_dispatch_auth.accessToken = 'YOUR ACCESS TOKEN';

var apiInstance = new IiiDispatch.TaxiRequestApi();

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.findAllTaxiRequests(callback);
```

### Parameters
This endpoint does not need any parameter.

### Return type

[**[TaxiRequest]**](TaxiRequest.md)

### Authorization

[iii_dispatch_auth](../README.md#iii_dispatch_auth)

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: application/xml, application/json

<a name="getTaxiRequestById"></a>
# **getTaxiRequestById**
> TaxiRequest getTaxiRequestById(taxiRequestId)

以ID連結叫車資料

回傳單筆叫車資料

### Example
```javascript
var IiiDispatch = require('iii_dispatch');
var defaultClient = IiiDispatch.ApiClient.instance;

// Configure API key authorization: api_key
var api_key = defaultClient.authentications['api_key'];
api_key.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key.apiKeyPrefix = 'Token';

var apiInstance = new IiiDispatch.TaxiRequestApi();

var taxiRequestId = 789; // Number | ID of taxi_request to return


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.getTaxiRequestById(taxiRequestId, callback);
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **taxiRequestId** | **Number**| ID of taxi_request to return | 

### Return type

[**TaxiRequest**](TaxiRequest.md)

### Authorization

[api_key](../README.md#api_key)

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: application/xml, application/json

<a name="updateTaxiRequestWithForm"></a>
# **updateTaxiRequestWithForm**
> updateTaxiRequestWithForm(taxiRequestId, opts)

更新ID指定之叫車資料

更新單筆叫車資料

### Example
```javascript
var IiiDispatch = require('iii_dispatch');
var defaultClient = IiiDispatch.ApiClient.instance;

// Configure OAuth2 access token for authorization: iii_dispatch_auth
var iii_dispatch_auth = defaultClient.authentications['iii_dispatch_auth'];
iii_dispatch_auth.accessToken = 'YOUR ACCESS TOKEN';

var apiInstance = new IiiDispatch.TaxiRequestApi();

var taxiRequestId = 789; // Number | ID of taxiRequest that needs to be updated

var opts = { 
  'startLongitude': 3.4, // Number | 預計上車地點：經度
  'startLatitude': 3.4, // Number | 預計上車地點：緯度
  'startPlaceId': "startPlaceId_example", // String | 預計上車地點：google place id
  'destinationLongitude': 3.4, // Number | 預計前往地點：經度
  'destinationLatitude': 3.4, // Number | 預計前往地點：緯度
  'destinationPlaceId': "destinationPlaceId_example" // String | 預計前往地點：google place id
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
apiInstance.updateTaxiRequestWithForm(taxiRequestId, opts, callback);
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **taxiRequestId** | **Number**| ID of taxiRequest that needs to be updated | 
 **startLongitude** | **Number**| 預計上車地點：經度 | [optional] 
 **startLatitude** | **Number**| 預計上車地點：緯度 | [optional] 
 **startPlaceId** | **String**| 預計上車地點：google place id | [optional] 
 **destinationLongitude** | **Number**| 預計前往地點：經度 | [optional] 
 **destinationLatitude** | **Number**| 預計前往地點：緯度 | [optional] 
 **destinationPlaceId** | **String**| 預計前往地點：google place id | [optional] 

### Return type

null (empty response body)

### Authorization

[iii_dispatch_auth](../README.md#iii_dispatch_auth)

### HTTP request headers

 - **Content-Type**: application/x-www-form-urlencoded
 - **Accept**: application/xml, application/json

