FORMAT: 1A
HOST: https://api.tookanapp.com/v2

# Tookan API

- The Tookan API is a RESTful web service for developers to programmatically interact with Tookan’s data and real-time delivery management functionality.

- Every bit of data exchanged between clients and the API is JSON over HTTPS.

- The base URL for the Tookan API is https://api.tookanapp.com , all the requests on this url use post method and we need to add the specific end points mentioned below to this URL. Example, if you want to create a task in Tookan, you will Post to the below API: https://api.tookanapp.com/v2/create_task

- All sample requests in this documentation are formatted for cURL.

- API key is mandatory in all the API's request.

- All parameters marked with * are  mandatory  otherwise optional.

- If you have questions about using the API, want to share some feedback, or have come across a bug you'd like to report, write us an email at contact@tookanapp.com or submit a request through our Support Center.

- Tookan API uses key based authentication method. You can get a key from settings(Login>Menu>Settings>API Keys) in your tookan account. Or <a href="https://app.tookanapp.com/#/app/settings/apikey">click here</a> to get API key from v2 section.

### Data Types & Response Format

The API we have follows all the following DATATYPES and Response Formats.

- Throughout the api the date format we recommend is YYYY-MM-DD HH:MM:SS. Explore http://gr2m.github.io/moment-parseformat/ for more formats.
- The response format will be JSON having status, message and data key.
        
        {
            "message": "Successful",
            "status": 200,
            "data": {}
        }

### Error Codes

When something is wrong with a request, the API will respond with a non-`200` status code in the response. To help you better understand the problem, where possible, the API overloads a number of different error codes so your application logic has as much visibility as possible into what has gone wrong.

 `100`  -- PARAMETER_MISSING <br>
 `101`  -- INVALID_KEY <br>
 `200`  -- ACTION_COMPLETE <br>
 `201`  -- SHOW_ERROR_MESSAGE <br>
 `404`  -- ERROR_IN_EXECUTION <br>

### Timezones

How are timezones handled in Tookan?

- Here is the link to find your timezone

https://timezones.tookanapp.com


- In Dashboard

When a task is created from Tookan Dashboard the local time zone from where the task is being created is considered.

Example: Let’s say a task is created in Singapore, the time zone considered is GMT +8hrs.

- In Bulk Upload

In the case of bulk upload of tasks, the time zone of the admin account is taken into consideration while tasks are created.

Example: Let’s say an admin in the US(say A for convenience) has created a manager(say M) in India. When this manager(M) creates tasks using the bulk upload the timezone of Admin(A) and tasks are created in US TimeZone.

- Using Tookan API

Tookan API accepts a request body parameter named “timezone” which is the Timezone difference with UTC in minutes. When a task is created with local time(say X), and timezone(+Y). Y minutes are added to X to make it UTC time.

- How to get the Timezone difference with UTC in minutes?

Let’s say I am creating a task in India’s time which is five and half hours ahead of UTC time (+05:30), convert five and half hours into minutes i.e 330 minutes. Since India’s time is ahead of UTC time to convert it into UTC time 330 minutes has to be subtracted from it. So, timezone is -330.

### Task Statuses

Below mentioned are the values of the `job_status` parameters of the respective Task Status:

<table class="humanColumnApiDescription markdown formalTheme">
<tr><td style="padding-left: 0;" colspan="1"><strong>Status</strong><td style="padding-left: 0;" colspan="1"><strong>Value </strong></td><td style="padding-left: 0;" colspan="1"><strong>Description </strong></td></tr>
<tr><td style="padding-left: 0;" >Assigned</td><td > <code>0</code></td><td>The task has been assigned to a agent.</td></tr>
<tr><td style="padding-left: 0;" >Started</td><td><code>1</code></td><td>The task has been started and the agent is on the way. This will appear as a light-blue pin on the map and as a rectangle in the assigned category on the left.</td></tr>
<tr><td style="padding-left: 0;" >Successful</td><td><code>2</code></td><td>The task has been completed successfully and will appear as a green pin on the map and as a rectangle in the completed category on the left.</td></tr>
<tr><td style="padding-left: 0;" >Failed</td><td><code>3</code></td><td>The task has been completed unsuccessfully and will appear as red pin on the map and as a rectangle in the completed category on the left.</td></tr>
<tr><td style="padding-left: 0;" >InProgress/Arrived</td><td><code>4</code></td><td>The task is being performed and the agent has reached the destination. This will appear as a dark-blue pin on the map and as a rectangle in the assigned category on the left.</td></tr>
<tr><td style="padding-left: 0;" >Unassigned</td><td><code>6</code></td><td>The task has not been assigned to any agent and will appear as a grey pin on the map and as a rectangle in the unassigned category on the left.</td></tr>
<tr><td style="padding-left: 0;" >Accepted/Acknowledged</td><td><code>7</code></td><td> The task has been accepted by the agent which is assigned to him.</td></tr>
<tr><td style="padding-left: 0;" >Decline</td><td><code>8</code></td><td> The task has been declined by the agent which is assigned to him.</td></tr>
<tr><td style="padding-left: 0;" >Cancel</td><td><code>9</code></td><td> The task has been cancelled by the agent which is accepted by him.</td></tr>
<tr><td style="padding-left: 0;" >Deleted</td><td><code>10</code></td><td>When the task is deleted from the Dashboard.</td></tr>
</table>

### Custom Fields 

We support a variety of Custom Fields/Data Types which you can create and manage from the Templates section from your Tookan Dashboard. As described below, you can utilize the "meta_data" key in the /create_task API calls, to send custom data for each task. "meta_data" or "pickup_meta_data" key should be detailed as follows - 

1. Array of Objects, where each Object consists of two keys - "label" - which is the name of the custom field key, as shown in the template settings page and "data" with the value of that key. Both the keys should be of string Data Type.
For ex - 
        
        [{
            "label": "Price",
            "data":"10"
        }]
        
2. All the Custom Field Data Types work in the similar fashion, except the following - 
    
    a. Checklist 

        {
            "label": "PackageType",
            "data":"A,B,C"
        }
        
    comma separated values that you want to display in task details. If you skip the "label" or "data" key, it will populate the checklist as per the template settings. 
        
    b. Tables 
    
        {
            "label": "DeliveryDetails",
            "data":[
                ["car","123"],
                ["bike","234"],
                ["scooter","456"]
            ]
        }
        
    data key should be a 2D Array, with the number of each element in the parent array are different rows and each element in the child arrays are values of each key, as per your template table settings. If you send different number of elements in any particular row, then the complete row will be ignored. For sending the location datatype within a table, you can send the value in the following format - 
        
            {
                lat" :"22.44",
                "lng":"34.4555",
                "add":"srilanka"
            }
            
    So, in this case, a sample row would look like this - 

        [
            "car",
            "123", 
            { 
                "lat":"22.44", 
                "lng":"34.4555", 
                "add":"srilanka 
            }
        ] 
        
    c. Barcode Verification
    
        { 
            "label":"barode_custom_field", 
            "data":[ 
                { 
                    "display_name":"Barcode1", 
                    "data":"data1", 
                    "is_verified":0 
                }, 
                { 
                    "display_name":"Barcode2", 
                    "data":"data2", 
                    "is_verified":1 
                } 
            ] 
        }

You can pass the array of objects and each object should contains these keys and act as a one barcode value.

If you have any questions regarding Custom Fields, you can reach out to us, with your questions on support@tookanapp.com 

### NPM Module

Refer to Tookan's NPM Module <b><a href="https://www.npmjs.com/package/tookan-api">tookan-api</a></b> to directly access tookan's APIs.

# Group Task

## Create Task [/create_task]

There are different types of tasks can be created inside Tookan depending on the workflow you have selected in your account for e.g. - pick & delivery task, appointment task etc. Please refer to appropriate API below according to your requirement. In case of any doubt, feel free to reach out to us at contact@tookanapp.com.

### Create a Pickup Task [POST]

This API is used to create a pickup task.
<br>
Request Body Parameters:
<table class="humanColumnApiDescription markdown formalTheme">
<tr><td colspan="1"><strong>Name</strong><td colspan="1"><strong>Type</strong><td colspan="1"><strong>Description</strong></td></tr>
<tr><td style="padding-right: 40px; width: 140px;">api_key</td><td>string</td> <td> You can generate a key from settings(Login>Menu>Settings>API Keys) in your tookan account. Or <a href="https://app.tookanapp.com/#/app/settings/apikey">click here</a> to get API key</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">order_id</td><td>string</td> <td>Your can pass this key as your own transaction number which can be used to identify tasks in tookan</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">job_description</td><td> String </td><td>The description of the task to be done</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">job_pickup_phone</td><td>string</td><td> The contact number of the person from whom the pickup should be collected</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">job_pickup_name</td><td>string<br/>(optional)</td><td> The name of the person from whom the pickup should be collected</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">job_pickup_email</td><td>string <br/> (optional)</td><td> The email of the person from whom the pickup should be collected</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">job_pickup_address*</td><td>string</td><td>The address from which the pickup should be collected.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">job_pickup_latitude</td><td>string <br/> (optional)</td><td> This is the latitiude of the  pickup location</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">job_pickup_longitude</td><td>string <br/> (optional)</td><td>This is the longitude of the  pickup location</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">job_pickup_datetime*</td><td>string</td><td> This is time before which the pickup should be collected</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">has_pickup*</td><td> boolean <br/> (Fixed)</td><td>For a Pickup task, this is fixed to <code>1</code</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">has_delivery*</td><td>boolean <br/> (Fixed)</td><td>For a Pickup task this is fixed to <code>0</code></td></tr>
<tr><td style="padding-right: 40px; width: 140px;">layout_type*</td><td> integer <br/> (Fixed)</td><td>For a Pickup task this is fixed to <code>0</code></td></tr>
<tr><td style="padding-right: 40px; width: 140px;">tracking_link</td><td> boolean </td><td>If this value is <code>1</code> it will return a url in the response where the driver's movement can be tracked.if not no url will be returned </td></tr>
<tr><td style="padding-right: 40px; width: 140px;">timezone*</td><td> string </td><td>Timezone difference with UTC in minutes for e.g., For PST:<code>+480</code> (PDT: <code>+420</code>),For MST <code>+420</code> (MDT:<code>+360</code>) for EST: <code>+300</code>(EDT:<code>+240</code>), for AEST: <code>-600</code> (AEDT: <code>-660</code>), for IST: <code>-330</code>, for CST: <code>+360</code> (CDT:<code>+300</code>)</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">pickup_custom_field_template</td><td>string</td> <td>This is the custom fields template name that is pre-defined in your workflow page in the admin account and you just need to replace space in template with underscore(_).</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">pickup_meta_data</td><td>json array</td> <td>This is array of object containing label and data where label defines the custom field name and data will be his value.(Provided label should be in specified template.)</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">team_id</td><td>integer</td> <td>This is the Unique id of every team. You can get it from the dashBoard. More>teams>respective id of the team will displayed.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">auto_assignment</td><td>boolean</td> <td> If this value is <code>1</code> The task will be auto assigned to the members of the specific team mentioned. or if this value is <code>0</code> it will be unassigned task created. </td></tr>
<tr><td style="padding-right: 40px; width: 140px;">fleet_id</td><td>string</td> <td> This is unique agent id given to each agent, if given the task will be assigned to the respective agent. You can get it from dashboard Menu>More>agents.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">p_ref_images</td><td>Array</td><td> This is an array of strings containing links of images.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">notify</td><td>integer</td><td>This is used to enable the notifications.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">geofence</td><td>integer</td><td>This is used to enable the geofencing.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">ignore_customer_lat_long</td><td>integer</td><td> This is used to add address sent in request body  otherwise tookan fetch customer by phone number  saved in tookan database and use that customer adddress   .</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">pickup_job_validate_otp</td><td>Number</td><td>4-digit OTP is allowed & It should start from 1000 onwards. Applicable only if Validate OTP extension is enabled.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">Barcode</td><td>string</td><td>Use this key to add Barcode to the Task</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">tags</td><td>string</td><td> This is a string containing comma separated tags as filters for agents in auto assignment.</td></tr>
</table>


+ Request (application/json)

            {
                "api_key":"2b997be77e2cc22becfd4c66426ef504",
                "order_id":"654321",
                "job_description":"groceries delivery",
                "job_pickup_phone":"+1201555555",
                "job_pickup_name":"7 Eleven Store",
                "job_pickup_email":"",
                "job_pickup_address":"114, sansome street, San Francisco",
                "job_pickup_latitude":"30.7188978",
                "job_pickup_longitude":"76.810296",
                "job_pickup_datetime":"2016-08-14 19:00:00",
                "pickup_custom_field_template":"Template_1",
                "pickup_meta_data": [{"label":"Price","data":"100"},{"label":"Quantity","data":"100"}],
                "team_id":"",
                "auto_assignment":"0",
                "has_pickup":"1",
                "has_delivery":"0",
                "layout_type":"0",
                "tracking_link":1,
                "timezone":"300",
                "fleet_id":"",
                "p_ref_images": ["http://tookanapp.com/wp-content/uploads/2015/11/logo_dark.png"],
                "notify":1,
                "tags":"",
                "barcode" : "11225544777",
                "geofence":0
            }

+ Response 200 (application/json)


    + Body

                {
                  "message": "Successful",
                  "status": 200,
                  "data": {
                    "tracking_link": "http://bit.ly/1LwzMJS",
                    "job_id": 5265,
                    "job_hash": "f02aac468aebde6ef46ed90532b4a417",
                    "job_token": "1444849200000",
                    "job_pickup_name": "7 Eleven Store",
                    "job_pickup_address": "frigate bay 1",
                    "geofence_details": [{
                                "region_id": 5215,
                                "region_name": "CHD"
                                }],
                  }
                }

### Create a Delivery Task [POST]

This API is used to create a Delivery Task.
<br>
Body Parameters :
<table class="humanColumnApiDescription markdown formalTheme">
<tr><td colspan="1"><strong>name</strong><td colspan="1"><strong>Type</strong><td colspan="1"><strong>Description</strong></td></tr>
<tr><td style="padding-right: 40px; width: 140px;">api_key</td><td>string</td> <td> You can generate a key from settings(Login>Menu>Settings>API Keys) in your tookan account. Or <a href="https://app.tookanapp.com/#/app/settings/apikey">click here</a> to get API key</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">order_id</td><td>string</td> <td>Your can pass this key as your own transaction number which can be used to identify tasks in tookan</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">job_description</td><td> String </td><td>The description of the task to be done</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">customer_email</td><td> email <br/> (optional)</td><td>  This is email of the customer to whom the product should be delivered</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">customer_username</td><td>String<br/>(optional)</td><td>This is the name of the customer to whom the product should be delivered</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">customer_phone</td><td> String </td><td>This is the contact number of the customer to whom the product should be delivered</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">customer_address*</td><td>String </td><td>This is the address of the customer to whom the product should be delivered</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">latitude</td><td>String  <br/> (optional)</td><td> This is the latitiude of the  pickup location if you have it. Otherwise leave it blank. We will get it through geocoding API</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">longitude</td><td>String  <br/> (optional)</td><td>This is the latitiude of the  pickup location if you have it. Otherwise leave it blank. We will get it through geocoding API</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">job_delivery_datetime*</td><td> Date/String </td><td>This is time before which the product should be delivered</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">has_pickup*</td><td> boolean<br/> (Fixed)</td><td>For a delivery task this value is <code>0</code></td></tr>
<tr><td style="padding-right: 40px; width: 140px;">has_delivery*</td><td>boolean<br/> (Fixed)</td><td>For a delivery task this value is <code>1</code></td></tr>
<tr><td style="padding-right: 40px; width: 140px;">layout_type*</td><td> integer<br/> (Fixed)</td><td>For a delivery task this value is <code>0</code></td></tr>
<tr><td style="padding-right: 40px; width: 140px;">tracking_link</td><td> boolean</td><td>If this value is <code>1</code> it will return a url in the respone where the driver's movement can be tracked. </td></tr>
<tr><td style="padding-right: 40px; width: 140px;">timezone*</td><td> string </td><td>Timezone difference with UTC in minutes for e.g., For PST:<code>+480</code> (PDT: <code>+420</code>),For MST <code>+420</code> (MDT:<code>+360</code>) for EST: <code>+300</code>(EDT:<code>+240</code>), for AEST: <code>-600</code> (AEDT: <code>-660</code>), for IST: <code>-330</code></td></tr>
<tr><td style="padding-right: 40px; width: 140px;">custom_field_template</td><td>string</td><td>This is the custom fields template name that is pre-defined in your workflow page in the admin account and you just need to replace space in template with underscore(_).</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">meta_data</td><td>json array</td> <td>This is array of object containing label and data where label defines the custom field name and data will be his value.(Provided label should be in specified template.)</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">team_id</td><td>integer</td> <td>This is the Unique id of every team. You can get it from the dashBoard. More>teams>respective id of the team will displayed.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">auto_assignment</td><td>boolean</td> <td> If this value is <code>1</code> The task will be auto assigned to the members of the specific team mentioned. or if this value is <code>0</code> it will be unassigned task created. </td></tr>
<tr><td style="padding-right: 40px; width: 140px;">fleet_id</td><td>string</td> <td> This is unique agent id given to each agent, if given the task will be assigned to the respective agent. You can get it from dashboard Menu>More>agents.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">ref_images</td><td>Array</td><td> This is an array of strings containing links of images.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">notify</td><td>integer</td><td>This is used to enable the notifications.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">geofence</td><td>integer</td><td>This is used to enable the geofencing.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">ignore_customer_lat_long</td><td>integer</td><td> This is used to add address sent in request body  otherwise tookan fetch customer by phone number  saved in tookan database and use that customer adddress   .</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">job_validate_otp</td><td>Number</td><td>4-digit Otp is allowed & It should start from 1000 onwards. Applicable only if Validate OTP extension is enabled.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">Barcode</td><td>string</td><td>Use this key to add Barcode to the Task</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">tags</td><td>string</td><td> This is a string containing comma separated tags as filters for agents in auto assignment.</td></tr>
</table>
+ Request (application/json)

            {
                "api_key":"2b997be77e2cc22becfd4c66426ef504",
                "order_id":"654321",
                "job_description":"groceries delivery",
                "customer_email":"john@example.com",
                "customer_username":"John Doe",
                "customer_phone":"+12015555555",
                "customer_address":"frigate bay 2",
                "latitude":"30.7188978",
                "longitude":"76.810298",
                "job_delivery_datetime":"2016-08-14 21:00:00",
                "custom_field_template":"Template_1",
                "meta_data": [{"label":"Price","data":"100"},{"label":"Quantity","data":"100"}],
                "team_id":"",
                "auto_assignment":"0",
                "has_pickup":"0",
                "has_delivery":"1",
                "layout_type":"0",
                "tracking_link":1,
                "timezone":"-330",
                "fleet_id":"636",
                "ref_images": ["http://tookanapp.com/wp-content/uploads/2015/11/logo_dark.png","http://tookanapp.com/wp-content/uploads/2015/11/logo_dark.png"],
                "notify":1,
                "tags":"",
                "barcode" : "11225544777",
                "geofence":0
            }

+ Response 200 (application/json)


    + Body

                {
                  "message": "Successful",
                  "status": 200,
                  "data": {
                    "tracking_link": "http://bit.ly/1OqtCS9",
                    "job_id": 5268,
                    "job_hash": "6e419074d9cbaa2ec52754e852b91e21",
                    "job_token": "1444856400000",
                    "customer_name": "John Doe",
                    "customer_address": "frigate bay 2",
                    "geofence_details": [{
                                "region_id": 5215,
                                "region_name": "CHD"
                                }],
                  }
                }

### Create a Pickup and Delivery Task [POST]

This api is used to create Pickup and delivery task.
<br>
Request Body Parameters :
<table class="humanColumnApiDescription markdown formalTheme">
<tr><td colspan="1"><strong>name</strong><td colspan="1"><strong>Type</strong><td colspan="1"><strong>Description</strong></td></tr>
<tr><td style="padding-right: 40px; width: 140px;">api_key</td><td>string</td> <td> You can get a key from settings(Login>Menu>Settings>API Keys) in your tookan account. Or <a href="https://app.tookanapp.com/#/app/settings/apikey">click here</a> to get API key</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">order_id</td><td>string</td> <td>Your can pass this key as your own transaction number which can be used to identify tasks in tookan</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">team_id</td><td>integer</td> <td>This is the Unique id of every team. You can get it from the dashBoard. More>teams>respective id of the team will displayed.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">auto_assignment</td><td>boolean</td> <td> If this value is <code>1</code> The task will be auto assigned to the members of the specific team mentioned. or if this value is <code>0</code> it will be unassigned task created. </td></tr>
<tr><td style="padding-right: 40px; width: 140px;">job_description</td><td> String </td><td>The description of the task to be done</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">job_pickup_phone</td><td>string</td><td> The contact number of the person from whom the pickup should be collected</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">job_pickup_name</td><td>string <br/> (optional) </td><td> The name of the person from whom the pickup should be collected</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">job_pickup_email</td><td>string <br/> (optional)</td><td> The email of the person from whom the pickup should be collected</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">job_pickup_address*</td><td>string</td><td>The address from which the pickup should be collected.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">job_pickup_latitude</td><td>string <br/> (optional)</td><td> This is the latitiude of the  pickup location</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">job_pickup_longitude</td><td>string <br/> (optional)</td><td>This is the longitude of the  pickup location</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">job_pickup_datetime*</td><td>string</td><td> This is time before which the pickup should be collected</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">pickup_custom_field_template</td><td>string</td> <td>This is the custom fields template name that is pre-defined in your workflow page in the admin account and you just need to replace space in template with underscore(_).</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">pickup_meta_data</td><td>json array</td> <td>This is array of object containing label and data where label defines the custom field name and data will be his value.(Provided label should be in specified template.)</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">customer_email</td><td> email <br/> (optional)</td><td>  This is email of the customer to whom the product should be delivered</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">customer_username</td><td>String <br/> (optional)</td><td>This is the name of the customer to whom the product should be delivered</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">customer_phone</td><td> String </td><td>This is the contact number of the customer to whom the product should be delivered</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">customer_address*</td><td>String </td><td>This is the address of the customer to whom the product should be delivered</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">latitude</td><td>String <br/> (optional) </td><td> This is the latitiude of the  delivery location </td></tr>
<tr><td style="padding-right: 40px; width: 140px;">longitude</td><td>String <br/> (optional) </td><td>This is the longitude of the  delivery location</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">job_delivery_datetime*</td><td> Date/String </td><td>This is time before which the product should be delivered</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">custom_field_template</td><td>string</td> <td>This is the custom fields template name that is pre-defined in your workflow page in the admin account and you just need to replace space in template with underscore(_).</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">meta_data</td><td>json array</td> <td>This is array of object containing label and data where label defines the custom field name and data will be his value.(Provided label should be in specified template.)</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">timezone*</td><td> Integer</td><td>Timezone difference with UTC in minutes for e.g., For PST:<code>+480</code> (PDT: <code>+420</code>),For MST <code>+420</code> (MDT:<code>+360</code>) for EST: <code>+300</code>(EDT:<code>+240</code>), for AEST: <code>-600</code> (AEDT: <code>-660</code>), for IST: <code>-330</code></td></tr>
<tr><td style="padding-right: 40px; width: 140px;">has_pickup*</td><td> boolean<br/> (Fixed)</td><td>For a pickup and delivery task this value is fixed to <code>1</code></td></tr>
<tr><td style="padding-right: 40px; width: 140px;">has_delivery*</td><td>boolean<br/> (Fixed)</td><td>For a pickup and delivery task this value is fixed to <code>1</code></td></tr>
<tr><td style="padding-right: 40px; width: 140px;">layout_type*</td><td> integer<br/> (Fixed)</td><td>For a pickup and delivery task this value is fixed to <code>0</code></td></tr>
<tr><td style="padding-right: 40px; width: 140px;">tracking_link</td><td> boolean</td><td>If this value is <code>1</code> it will return a url in the respone where the driver's movement can be tracked. </td></tr>
<tr><td style="padding-right: 40px; width: 140px;">fleet_id</td><td>string</td> <td> This is unique agent id given to each agent, if given the task will be assigned to the respective agent. You can get it from dashboard Menu>More>agents.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">p_ref_images</td><td>Array</td><td>(Pickup) This is an array of strings containing links of images.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">ref_images</td><td>Array</td><td>(Delivery) This is an array of strings containing links of images.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">notify</td><td>integer</td><td>This is used to enable the notifications.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">geofence</td><td>integer</td><td>This is used to enable the geofencing.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">ignore_customer_lat_long</td><td>integer</td><td> This is used to add address sent in request body  otherwise tookan fetch customer by phone number  saved in tookan database and use that customer adddress   .</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">tags</td><td>string</td><td> This is a string containing comma separated tags as filters for agents in auto assignment.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">ignore_validate_otp</td><td>Number</td><td>1 - OTP won't be required, 0 - OTP will be required. Applicable only if Validate OTP extension is enabled. Default value is 0.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">pickup_job_validate_otp</td><td>Number</td><td>4-digit OTP is allowed & It should start from 1000 onwards. Applicable only if Validate OTP extension is enabled.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">job_validate_otp</td><td>Number</td><td>4-digit Otp is allowed & It should start from 1000 onwards. Applicable only if Validate OTP extension is enabled.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">ride_type</td><td>number</td><td>0 for Non-Pool Task, 1 for Pool Task.</td></tr>
</table>

<br>

Response Body Parameters : 
<table>
<tr><td colspan="1"><strong>Name</strong><td colspan="1"><strong>Type</strong><td colspan="1"><strong>Description</strong></td></tr>
<tr><td style="padding-right: 40px; width: 140px;">message</td><td>string</td><tdThis says whether the request is successful or not></td></tr>
<tr><td style="padding-right: 40px; width: 140px;">status</td><td>number</td><td>This should be mapped with the error codes mention in error codes section above.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">data</td><td>Object</td> <td>This gives the information about the task like pickup_tracking_link,delivery_tracing_link,job_id, job_token,
pickup_hash, delivery_hash</td></tr>
</table>

+ Request (application/json)

            {
                "api_key":"2b997be77e2cc22becfd4c66426ef504",
                "order_id":"654321",
                "team_id":"",
                "auto_assignment":"0",
                "job_description":"groceries delivery",
                "job_pickup_phone":"+1201555555",
                "job_pickup_name":"7 Eleven Store",
                "job_pickup_email":"",
                "job_pickup_address":"frigate bay 1",
                "job_pickup_latitude":"30.7188978",
                "job_pickup_longitude":"76.810296",
                "job_pickup_datetime":"2016-08-14 19:00:00",
                "customer_email":"john@example.com",
                "customer_username":"John Doe",
                "customer_phone":"+12015555555",
                "customer_address":"frigate bay 2",
                "latitude":"30.7188978",
                "longitude":"76.810298",
                "job_delivery_datetime":"2016-08-14 21:00:00",
                "has_pickup":"1",
                "has_delivery":"1",
                "layout_type":"0",
                "tracking_link":1,
                "timezone":"-330",
                "custom_field_template":"Template_1",
                "meta_data": [{"label":"Price","data":"100"},{"label":"Quantity","data":"100"}],
                "pickup_custom_field_template":"Template_2",
                "pickup_meta_data": [{"label":"Price","data":"100"},{"label":"Quantity","data":"100"}],
                "fleet_id":"",
                "p_ref_images": ["http://tookanapp.com/wp-content/uploads/2015/11/logo_dark.png","http://tookanapp.com/wp-content/uploads/2015/11/logo_dark.png"],
                "ref_images": ["http://tookanapp.com/wp-content/uploads/2015/11/logo_dark.png","http://tookanapp.com/wp-content/uploads/2015/11/logo_dark.png"],
                "notify":1,
                "tags":"",
                "geofence":0,
                "ride_type":0
            }

+ Response 200 (application/json)


    + Body

                {
                  "message": "Successful",
                  "status": 200,
                  "data": {
                            "pickup_tracking_link": "http://bit.ly/1htQjX9",
                            "delivery_tracing_link": "http://bit.ly/1jSBizX",
                            "job_id": 5233,
                            "job_token": "1444849200000",
                            "pickup_hash": "e70c492a098f1e741bd47c44ba5a8530",
                            "delivery_hash": "f30a06756a922ee36b3fcc58ec5072ea",
                            "customer_name": "John Doe",
                            "customer_address": "frigate bay 2",
                            "geofence_details": [{
                                "region_id": 5215,
                                "region_name": "CHD"
                                }],
                          }
                }

### Create an Appointment Task [POST]

This api is used to create an appointment task.
<br>
Request Body Parameters :
<table class="humanColumnApiDescription markdown formalTheme">
<tr><td colspan="1"><strong>name</strong><td colspan="1"><strong>Type</strong><td colspan="1"><strong>Description</strong></td></tr>
<tr><td style="padding-right: 40px; width: 140px;">api_key</td><td>string</td><td> You can get a key from settings(Login>Menu>Settings>API Keys) in your tookan account. Or <a href="https://app.tookanapp.com/#/app/settings/apikey">click here</a> to get API key</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">order_id</td><td>string</td> <td>Your can pass this key as your own transaction number which can be used to identify tasks in tookan</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">customer_email</td><td> email <br/> (optional)</td><td> Customer email</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">customer_username</td><td>String</td><td>customer name to whom the product should be delivered.</tr>
<tr><td style="padding-right: 40px; width: 140px;">customer_phone</td><td> String</td><td> The contact number of the customer to whom the product should be delivered</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">customer_address*</td><td>String </td><td>The address to which the product should be delivered.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">latitude</td><td>number  <br/> (optional)</td><td>The latitude of the location of customer address</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">longitude</td><td>number  <br/> (optional)</td><td>The longitude of the location of customer address</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">job_description</td><td> String </td><td> The description of the task to be done</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">job_pickup_datetime*</td><td> Date/String </td><td> This is the start time of the appointment.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">job_delivery_datetime*</td><td> Date/String </td><td> Time before which the appointment should be completed</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">timezone*</td><td> Integer</td><td> Timezone difference with UTC in minutes for e.g., For PST:<code>+480</code> (PDT: <code>+420</code>),For MST <code>+420</code> (MDT:<code>+360</code>) for EST: <code>+300</code>(EDT:<code>+240</code>), for AEST: <code>-600</code> (AEDT: <code>-660</code>), for IST: <code>-330</code></td></tr>
<tr><td style="padding-right: 40px; width: 140px;">custom_field_template</td><td>string</td> <td>This is the custom fields template name that is pre-defined in your workflow page in the admin account and you just need to replace space in template with underscore(_).</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">meta_data</td><td>json array</td> <td>This is array of object containing label and data where label defines the custom field name and data will be his value.(Provided label should be in specified template.)</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">has_pickup*</td><td>boolean<br/> (Fixed)</td><td>For an appointment task this value is fixed to <code>0</code></td></tr>
<tr><td style="padding-right: 40px; width: 140px;">has_delivery*</td><td> boolean <br/> (Fixed)</td><td>For an appointment task this value is fixed to <code>0</code></td></tr>
<tr><td style="padding-right: 40px; width: 140px;">layout_type*</td><td> number <br/> (Fixed)</td><td>For an appointment task this value is fixed to <code>1</code></td></tr>
<tr><td style="padding-right: 40px; width: 140px;">tracking_link</td><td> boolean</td><td> If this value is <code>1</code> it will return a url in the respone where the driver's movement can be tracked</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">team_id</td><td>integer</td> <td>This is the Unique id of every team. You can get it from the dashBoard. More>teams>respective id of the team will displayed.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">auto_assignment</td><td>boolean</td> <td> If this value is <code>1</code> The task will be auto assigned to the members of the specific team mentioned. or if this value is <code>0</code> it will be unassigned task created. </td></tr>
<tr><td style="padding-right: 40px; width: 140px;">fleet_id</td><td>string</td> <td> This is unique agent id given to each agent, if given the task will be assigned to the respective agent. You can get it from dashboard Menu>More>agents.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">ref_images</td><td>Array</td><td>This is an array of strings containing links of images.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">notify</td><td>integer</td><td>This is used to enable the notifications.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">geofence</td><td>integer</td><td>This is used to enable the geofencing.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">ignore_customer_lat_long</td><td>integer</td><td> This is used to add address sent in request body  otherwise tookan fetch customer by phone number  saved in tookan database and use that customer adddress   .</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">tags</td><td>string</td><td> This is a string containing comma separated tags as filters for agents in auto assignment.</td></tr>
</table>
+ Request (application/json)

            {
                "customer_email":"john@example.com",
                "order_id":"654321",
                "customer_username":"John Doe",
                "customer_phone":"+919999999999",
                "customer_address":"Powai Lake, Powai, Mumbai, Maharashtra, India",
                "latitude":"28.5494489",
                "longitude":"77.2001368",
                "job_description":"Beauty services",
                "job_pickup_datetime":"2016-10-30 16:00:00",
                "job_delivery_datetime":"2016-10-30 17:00:00",
                "has_pickup":"0",
                "has_delivery":"0",
                "layout_type":"1",
                "tracking_link":1,
                "timezone":"-330",
                "custom_field_template":"Template_1",
                "meta_data": [{"label":"Price","data":"100"},{"label":"Quantity","data":"100"}],
                "api_key":"2b997be77e2cc22becfd4c66426ef504",
                "team_id":"",
                "auto_assignment":"0",
                "fleet_id":"",
                "ref_images": ["http://tookanapp.com/wp-content/uploads/2015/11/logo_dark.png","http://tookanapp.com/wp-content/uploads/2015/11/logo_dark.png"],
                "notify":1,
                "tags":"",
                "geofence":0
            }

+ Response 200 (application/json)


    + Body

                {
                  "message": "Successful",
                  "status": 200,
                  "data": {
                            "tracking_link": "http://bit.ly/1GA4z7e",
                            "job_id": 5236,
                            "job_hash": "67657b3ed35c5548d7806d9eafd22e43",
                            "job_token": "1446220800000",
                            "customer_name": "John Doe",
                            "customer_address": "Powai Lake, Powai, Mumbai, Maharashtra, India",
                            "geofence_details": [{
                                "region_id": 5215,
                                "region_name": "CHD"
                                }],
                            }
                }

### Create a Field Workforce Task [POST]

This api is used to create a field workforce task.
<br>
Request Body Parameters :
<table class="humanColumnApiDescription markdown formalTheme">
<tr><td colspan="1"><strong>name</strong><td colspan="1"><strong>Type</strong><td colspan="1"><strong>Description</strong></td></tr>
<tr><td style="padding-right: 40px; width: 140px;">api_key</td><td>string</td><td> You can get a key from settings(Login>Menu>Settings>API Keys) in your tookan account. Or <a href="https://app.tookanapp.com/#/app/settings/apikey">click here</a> to get API key</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">order_id</td><td>string</td> <td>Your can pass this key as your own transaction number which can be used to identify tasks in tookan</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">customer_email</td><td> email <br/> (optional)</td><td> Customer email</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">customer_username</td><td>String</td><td>customer name to whom the product should be delivered.</tr>
<tr><td style="padding-right: 40px; width: 140px;">customer_phone</td><td> String</td><td> The contact number of the customer to whom the product should be delivered</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">customer_address*</td><td>String </td><td>The address to which the product should be delivered.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">latitude</td><td>number  <br/> (optional)</td><td>The latitude of the location of customer address</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">longitude</td><td>number  <br/> (optional)</td><td>The longitude of the location of customer address</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">job_description</td><td> String </td><td> The description of the task to be done</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">job_pickup_datetime*</td><td> Date/String </td><td> This is the start time of the appointment.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">job_delivery_datetime*</td><td> Date/String </td><td> Time before which the appointment should be completed</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">timezone*</td><td> Integer</td><td> Timezone difference with UTC in minutes for e.g., For PST:<code>+480</code> (PDT: <code>+420</code>),For MST <code>+420</code> (MDT:<code>+360</code>) for EST: <code>+300</code>(EDT:<code>+240</code>), for AEST: <code>-600</code> (AEDT: <code>-660</code>), for IST: <code>-330</code></td></tr>
<tr><td style="padding-right: 40px; width: 140px;">custom_field_template</td><td>string</td> <td>This is the custom fields template name that is pre-defined in your workflow page in the admin account and you just need to replace space in template with underscore(_).</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">meta_data</td><td>json array</td> <td>This is array of object containing label and data where label defines the custom field name and data will be his value.(Provided label should be in specified template.)</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">has_pickup*</td><td>boolean<br/> (Fixed)</td><td>For an appointment task this value is fixed to <code>0</code></td></tr>
<tr><td style="padding-right: 40px; width: 140px;">has_delivery*</td><td> boolean <br/> (Fixed)</td><td>For an appointment task this value is fixed to <code>0</code></td></tr>
<tr><td style="padding-right: 40px; width: 140px;">layout_type*</td><td> number <br/> (Fixed)</td><td>For an field workforce task this value is fixed to <code>2</code></td></tr>
<tr><td style="padding-right: 40px; width: 140px;">tracking_link</td><td> boolean</td><td> If this value is <code>1</code> it will return a url in the respone where the driver's movement can be tracked</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">team_id</td><td>integer</td> <td>This is the Unique id of every team. You can get it from the dashBoard. More>teams>respective id of the team will displayed.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">auto_assignment</td><td>boolean</td> <td> If this value is <code>1</code> The task will be auto assigned to the members of the specific team mentioned. or if this value is <code>0</code> it will be unassigned task created. </td></tr>
<tr><td style="padding-right: 40px; width: 140px;">fleet_id</td><td>string</td> <td> This is unique agent id given to each agent, if given the task will be assigned to the respective agent. You can get it from dashboard Menu>More>agents.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">ref_images</td><td>Array</td><td>This is an array of strings containing links of images.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">notify</td><td>integer</td><td>This is used to enable the notifications.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">geofence</td><td>integer</td><td>This is used to enable the geofencing.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">ignore_customer_lat_long</td><td>integer</td><td> This is used to add address sent in request body  otherwise tookan fetch customer by phone number  saved in tookan database and use that customer adddress   .</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">tags</td><td>string</td><td> This is a string containing comma separated tags as filters for agents in auto assignment.</td></tr>
</table>
+ Request (application/json)

            {
                "customer_email":"john@example.com",
                "order_id":"654321",
                "customer_username":"John Doe",
                "customer_phone":"+919999999999",
                "customer_address":"Powai Lake, Powai, Mumbai, Maharashtra, India",
                "latitude":"28.5494489",
                "longitude":"77.2001368",
                "job_description":"Beauty services",
                "job_pickup_datetime":"2016-10-30 16:00:00",
                "job_delivery_datetime":"2016-10-30 17:00:00",
                "has_pickup":"0",
                "has_delivery":"0",
                "layout_type":"2",
                "tracking_link":1,
                "timezone":"-330",
                "custom_field_template":"Template_1",
                "meta_data": [{"label":"Price","data":"100"},{"label":"Quantity","data":"100"}],
                "api_key":"2b997be77e2cc22becfd4c66426ef504",
                "team_id":"",
                "auto_assignment":"0",
                "fleet_id":"",
                "ref_images": ["http://tookanapp.com/wp-content/uploads/2015/11/logo_dark.png","http://tookanapp.com/wp-content/uploads/2015/11/logo_dark.png"],
                "notify":1,
                "tags":"",
                "geofence":0
            }

+ Response 200 (application/json)


    + Body

                {
                  "message": "Successful",
                  "status": 200,
                  "data": {
                            "tracking_link": "http://bit.ly/1GA4z7e",
                            "job_id": 5236,
                            "job_hash": "67657b3ed35c5548d7806d9eafd22e43",
                            "job_token": "1446220800000",
                            "customer_name": "John Doe",
                            "customer_address": "Powai Lake, Powai, Mumbai, Maharashtra, India",
                            "geofence_details": [{
                                "region_id": 5215,
                                "region_name": "CHD"
                                }],
                            }
                }

## Create Multiple Tasks [/create_multiple_tasks]

### Create Multiple Pickup And Delivery Tasks [POST]
This API is used to create multiple pickup and delivery tasks for the fleets at once. 

Request Body Parameters:

<table class="humanColumnApiDescription markdown formalTheme">
<tr><td colspan="1"><strong>name</strong><td colspan="1"><strong>Type</strong><td colspan="1"><strong>Description</strong></td></tr>
<tr><td style="padding-right: 40px; width: 140px;">api_key</td><td>string</td> <td> You can generate a key from settings(Login>Menu>Settings>API Keys) in your tookan account. Or <a href="https://app.tookanapp.com/#/app/settings/apikey">click here</a> to get API key</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">fleet_id</td><td> String </td><td>Id of the fleet to which this task is to be assigned, optional.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">timezone</td><td>string</td><td>Timezone of the country or location in numerical format. Eg - timezone for India = -330.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">has_pickup</td><td>boolean</td> <td> Boolean key containing 1 if these are pickup tasks.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">has_delivery</td><td>boolean</td><td>Boolean key containing 1 if these are delivery tasks.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">layout_type</td><td>string</td><td>Set it as 0 (PICKUP_AND_DELIVERY), 1 (APPOINTMENT) or 2 (FOS) depending upon the type of layout.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">geofence</td><td>string</td> <td> This is used to enable the geofencing.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">ignore_customer_lat_long</td><td>integer</td><td> This is used to add address sent in request body  otherwise tookan fetch customer by phone number  saved in tookan database and use that customer adddress   .</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">auto_assignment</td><td>boolean</td><td>Boolean key containing the value 0 if the task is not to be assigned automatically to the fleet.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">tags</td><td> String </td><td>This is a string containing comma separated tags as filters for agents in auto assignment.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">ignore_validate_otp</td><td>Number</td><td>1 - OTP won't be required, 0 - OTP will be required. Applicable only if Validate OTP extension is enabled. Default value is 0.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">deliveries</td><td>JSON array</td><td>Array of objects containing address, name, job_description, latitude, longitude, tie, phone, template_name, template_data, ref_images, email, order_id where address defines the address of the customer to whom the product should be delivered, name defines the name  of the customer, job_description defines the description of the task, latitude defines the latitude of the pickup location if you have it, otherwise leave it blank. We'll get it through geocoding API, longitude and latitude defines the long and lat of the pick up, time defines the time before the pickup should be collected, phone defines the contact number of the customer, template_name defines the custom fields template name that is predefined in your workflow page in the admin account and you just need to replace space in template with underscore(_), template_data defines an array of object containing label and data where label defines the custom field name and data will be his value. (Provided label should be in specified template.),ref_images defines an array of strings containing links of images,email defines the  email of the customer to whom the product should be delivered,order_id can be  passed as your own transaction number which can be used to identify tasks in tookan.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">pickups*</td><td>JSON array</td><td>Array of objects containing address, name, job_description, latitude, longitude, time, phone, template_name, template_data, ref_images, email, order_id where address defines the address from which the pickup should be collected, name defines the name of the person from whom the pickup should be collected, job_description defines the description of the task to be done, latitude and longitude defines the lat and long of the pick up location, time defines the time before which the pickup should be collected,phone defines the contact number of the person from whom the pickup should be collected,template_name defines the custom fields template name that is pre-defined in your workflow page in the admin account and you just need to replace space in template with underscore(_), template_data defines an array of object containing label and data where label defines the custom field name and data will be his value.(Provided label should be in specified template.),ref_images defines an array of strings containing links of images,email defines the email of the person from whom the pickup should be collected,order_id can be  passed as your own transaction number which can be used to identify tasks in tookan.</td></tr>
</table>


+ Request (application/json)   

        {
          "api_key": "c3e46bc0bbdc2d6cdf22f4dae426581259435bd522fd98b30f5baf939b9ce2ba",
          "fleet_id": 19750,
          "timezone": -330,
          "has_pickup": 1,
          "has_delivery": 1,
          "layout_type": 0,
          "geofence": 0,
          "team_id":"",
          "auto_assignment": 0,
          "tags": "",
          "pickups": [{
            "address": "Chandigarh International Airport, Sahibzada Ajit Singh Nagar, Punjab, India",
            "latitude": 30.7333148,
            "longitude": 76.7794179,
            "time": "2017-08-14 17:24:00",
            "phone": "+911234567890",
            "job_description":"",
            "template_name": "Template_1",
            "template_data": [{
                "label": "Price",
                "data": "100"
             }, {
                "label": "Quantity",
                "data": "100"
            }],
            "ref_images": ["http://tookanapp.com/wp-content/uploads/2015/11/logo_dark.png"],
            "name": "Saurabh",
            "email": "saurabh@saurabh.com",
            "order_id": "12234556",
            "job_description": "Job description goes here"
          }],
          "deliveries": [{
            "address": "Chandigarh Railway Station, Daria, Chandigarh, India",
            "latitude": 30.7022191,
            "longitude": 76.82247009999992,
            "time": "2017-08-14 17:30:00",
            "phone": "+913242342342",
            "job_description":"",
            "template_name": "Template_1",
            "template_data": [
            {
              "label": "Price",
              "data": "100"
            },
            {
              "label": "Quantity",
              "data": "100"
            }
            ],
            "ref_images": ["http://tookanapp.com/wp-content/uploads/2015/11/logo_dark.png"],
            "name": "Saurabh",
            "email": "saurabh@saurabh.com",
            "order_id": "123456",
            "job_description": "Job description goes here"
          }]
        }
        
        
+ Response 200 (application/json)

        {
            "message":"Successful",
            "status":200,
            "data":{
            "pickups":[{
                "job_id":254737,
                "job_hash":"fc0f4e89d604a180bcb33a5aebdcd146",
                "job_token":"25473715022796802388950",
                "status":true,
                "auto_assignment_data":0,
                "order_id":"12234556",
                "result_tracking_link":"https://goo.gl/53jKDJ",
                "new_agent_task_insertion_data":[]}],
            "deliveries":[{
                "job_id":254738,
                "job_hash":"bc41a6e7dcfd3716d8540fbcd6e32fb9",
                "job_token":"25473715022796802388950",
                "status":true,
                "auto_assignment_data":0,
                "order_id":"123456",
                "result_tracking_link":"https://goo.gl/r3Gj4L",
                "new_agent_task_insertion_data":[]}]
                "geofence_details":[{
                    "region_id":5215,
                    "region_name":"CHD"}]
                }
        }

### Create Multiple Pickup Tasks [POST]
This API is used to create multiple pickup tasks for the fleets at once.

Request Body Parameters:

<table class="humanColumnApiDescription markdown formalTheme">
<tr><td colspan="1"><strong>name</strong><td colspan="1"><strong>Type</strong><td colspan="1"><strong>Description</strong></td></tr>
<tr><td style="padding-right: 40px; width: 140px;">api_key</td><td>string</td> <td> You can generate a key from settings(Login>Menu>Settings>API Keys) in your tookan account. Or <a href="https://app.tookanapp.com/#/app/settings/apikey">click here</a> to get API key</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">fleet_id</td><td> String </td><td>Id of the fleet to which this task is to be assigned, optional.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">timezone*</td><td>string</td><td>Timezone of the country or location in numerical format. Eg - timezone for India = -330.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">has_pickup*</td><td>boolean</td> <td> Boolean key containing 1 if these are pickup tasks.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">has_delivery*</td><td>boolean</td><td>Boolean key containing 1 if these are delivery tasks.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">layout_type*</td><td>string</td><td>Set it as 0(PICKUP_AND_DELIVERY), 1(APPOINTMENT) or 2(FOS) depending upon the type of layout.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">geofence</td><td>string</td> <td> This is used to enable the geofencing.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">ignore_customer_lat_long</td><td>integer</td><td> This is used to add address sent in request body  otherwise tookan fetch customer by phone number  saved in tookan database and use that customer adddress   .</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">auto_assignment</td><td>boolean</td><td>Boolean key containing the value 0 if the task is not to be assigned automatically to the fleet.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">tags</td><td> String </td><td>This is a string containing comma separated tags as filters for agents in auto assignment.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">pickups*</td><td>JSON array</td><td>Array of objects containing address, name, job_description, latitude, longitude, time, phone, template_name, template_data, ref_images, email, order_id where address defines the address from which the pickup should be collected, name defines the name of the person from whom the pickup should be collected, job_description defines the description of the task to be done, latitude and longitude defines the lat and long of the pick up location, time defines the time before which the pickup should be collected,phone defines the contact number of the person from whom the pickup should be collected,template_name defines the custom fields template name that is pre-defined in your workflow page in the admin account and you just need to replace space in template with underscore(_), template_data defines an array of object containing label and data where label defines the custom field name and data will be his value.(Provided label should be in specified template.),ref_images defines an array of strings containing links of images,email defines the email of the person from whom the pickup should be collected,order_id can be  passed as your own transaction number which can be used to identify tasks in tookan.</td></tr>
</table>


+ Request (application/json)   

        {
          "api_key": "c3e46bc0bbdc2d6cdf22f4dae426581259435bd522fd98b30f5baf939b9ce2ba",
          "fleet_id": "",
          "timezone": -330,
          "has_pickup": 1,
          "has_delivery": 0,
          "layout_type": 0,
          "geofence": 0,
          "auto_assignment": 0,
          "team_id":"",
          "tags": "",
          "pickups": [{
            "address": "Chandigarh International Airport, Sahibzada Ajit Singh Nagar, Punjab, India",
            "name": "Saurabh",
            "latitude": "30.7333148",
            "longitude": "76.7794179",
            "time": "2017-08-14 17:29:00",
            "phone": "+911234567890",
            "job_description":"",
            "template_name": "Template_1",
            "template_data": [
            {
              "label": "Price",
              "data": "100"
            },
            {
              "label": "Quantity",
              "data": "100"
            }
            ],
            "ref_images": ["http://tookanapp.com/wp-content/uploads/2015/11/logo_dark.png"],
            "order_id": "123456",
            "job_description": "Job description goes here"
          }]
        }
        
        
+ Response 200 (application/json)

        {
        "message":"Successful",
        "status":200,
        "data":{
            "pickups":[{
            "job_id":254746,
            "job_hash":"4e77cf8abc38bb1a81facaf7e4499550",
            "job_token":"25474615022800065310310",
            "status":true,
            "auto_assignment_data":0,
            "order_id":"123456",
            "result_tracking_link":"https://goo.gl/GMYjmy",
            "new_agent_task_insertion_data":[]}]
            "geofence_details":[{
                "region_id":5215,
                "region_name":"CHD"}]
            }
        }

### Create Multiple Delivery Tasks [POST]

This API is used to create multiple delivery tasks for the fleets at once.

Request Body Parameters:

<table class="humanColumnApiDescription markdown formalTheme">
<tr><td colspan="1"><strong>name</strong><td colspan="1"><strong>Type</strong><td colspan="1"><strong>Description</strong></td></tr>
<tr><td style="padding-right: 40px; width: 140px;">api_key</td><td>string</td> <td> You can generate a key from settings(Login>Menu>Settings>API Keys) in your tookan account. Or <a href="https://app.tookanapp.com/#/app/settings/apikey">click here</a> to get API key</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">fleet_id</td><td> String </td><td>Id of the fleet to which this task is to be assigned, optional.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">timezone*</td><td>string</td><td>Timezone of the country or location in numerical format. Eg - timezone for India = -330.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">has_pickup*</td><td>boolean</td> <td> Boolean key containing 1 if these are pickup tasks.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">has_delivery*</td><td>boolean</td><td>Boolean key containing 1 if these are delivery tasks.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">layout_type*</td><td>string</td><td>Set it as 0(PICKUP_AND_DELIVERY), 1(APPOINTMENT) or 2(FOS) depending upon the type of layout.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">geofence</td><td>string</td> <td> This is used to enable the geofencing.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">ignore_customer_lat_long</td><td>integer</td><td> This is used to add address sent in request body  otherwise tookan fetch customer by phone number  saved in tookan database and use that customer adddress   .</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">auto_assignment</td><td>boolean</td><td>Boolean key containing the value 0 if the task is not to be assigned automatically to the fleet.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">tags</td><td> String </td><td>This is a string containing comma separated tags as filters for agents in auto assignment.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">deliveries*</td><td>JSON array</td><td>Array of objects containing address, name, job_description, latitude, longitude, tie, phone, template_name, template_data, ref_images, email, order_id where address defines the address of the customer to whom the product should be delivered, name defines the name  of the customer, job_description defines the description of the task, latitude defines the latitude of the pickup location if you have it, otherwise leave it blank. We'll get it through geocoding API, longitude and latitude defines the long and lat of the pick up, time defines the time before the pickup should be collected, phone defines the contact number of the customer, template_name defines the custom fields template name that is predefined in your workflow page in the admin account and you just need to replace space in template with underscore(_), template_data defines an array of object containing label and data where label defines the custom field name and data will be his value. (Provided label should be in specified template.),ref_images defines an array of strings containing links of images,email defines the  email of the customer to whom the product should be delivered,order_id can be  passed as your own transaction number which can be used to identify tasks in tookan.</td></tr>
</table>


+ Request (application/json)   

        {
          "api_key": "c3e46bc0bbdc2d6cdf22f4dae426581259435bd522fd98b30f5baf939b9ce2ba",
          "fleet_id": "",
          "timezone": -330,
          "has_pickup": 0,
          "has_delivery": 1,
          "layout_type": 0,
          "geofence": 0,
          "team_id":"",
          "auto_assignment": 0,
          "tags": "",
          "deliveries": [{
            "address": "Chandigarh International Airport, Sahibzada Ajit Singh Nagar, Punjab, India",
            "name": "Saurabh",
            "latitude": 30.66776609999999,
            "longitude": 76.78622870000004,
            "time": "2017-08-14 17:31:00",
            "phone": "+911234567890",
            "job_description":"",
            "template_name": "Template_1",
            "template_data": [
            {
              "label": "Price",
              "data": "100"
            },
            {
              "label": "Quantity",
              "data": "100"
            }
            ],
            "ref_images": ["http://tookanapp.com/wp-content/uploads/2015/11/logo_dark.png"],
            "email": null,
            "order_id": "123345566",
            "job_description": "Job description goes here"
          }]
        }
        
        
+ Response 200 (application/json)

        {
            "message":"Successful",
            "status":200,
            "data":
                {
                "deliveries":[
                    {
                        "job_id":254751,
                        "job_hash":"5e0e634e7bd29fe36319b53617698a2a",
                        "job_token":"25475115022801325504460",
                        "status":true,
                        "auto_assignment_data":0,
                        "order_id":"123345566",
                        "result_tracking_link":"https://goo.gl/agt8MV",
                        "new_agent_task_insertion_data":[]
                    }
                ]
                "geofence_details":[{
                "region_id":5215,
                "region_name":"CHD"
                }]
                }
        }

## Create Task From CSV [/import_bulk_tasks_csv]

### Create Tasks From CSV [POST]

This API is used to create tasks from CSV.

Request File Parameters:

<table class="humanColumnApiDescription markdown formalTheme">
<tr><td colspan="1"><strong>Name</strong><td colspan="1"><strong>Type</strong><td colspan="1"><strong>Description</strong></td></tr>
<tr><td style="padding-right: 40px; width: 140px;">tasks_csv</td><td>file</td> <td>File with extension .csv that contains tasks in proper format as described in “Create Task”</td></tr>
</table>

Request Body Parameters:

<table class="humanColumnApiDescription markdown formalTheme">
<tr><td colspan="1"><strong>Name</strong><td colspan="1"><strong>Type</strong><td colspan="1"><strong>Description</strong></td></tr>
<tr><td style="padding-right: 40px; width: 140px;">api_key</td><td>string</td> <td> You can get a key from settings(Login>Menu>Settings>API Keys) in your tookan account. Or <a href="https://app.tookanapp.com/#/app/settings/apikey">click here</a> to get API key</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">timezone*</td><td> Integer</td><td>Timezone difference with UTC in minutes for e.g., For PST:<code>+480</code> (PDT: <code>+420</code>),For MST <code>+420</code> (MDT:<code>+360</code>) for EST: <code>+300</code>(EDT:<code>+240</code>), for AEST: <code>-600</code> (AEDT: <code>-660</code>), for IST: <code>-330</code></td></tr>
<tr><td style="padding-right: 40px; width: 140px;">team_id</td><td>integer</td> <td>This is the Unique id of every team. You can get it from the dashBoard. More>teams>respective id of the team will displayed.</td></tr><tr><td style="padding-right: 40px; width: 140px;">auto_assignment</td><td>boolean (optional)</td> <td> If this value is <code>1</code> The task will be auto assigned to the members of the specific team mentioned. or if this value is <code>0</code> it will be unassigned task created. </td></tr>
<tr><td style="padding-right: 40px; width: 140px;">notify</td><td>integer (optional)</td><td>This is used to enable the notifications.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">geofence</td><td>integer (optional)</td><td>This is used to enable the geofencing.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">tags</td><td>string (optional)</td><td> This is a string containing comma separated tags as filters for agents in auto assignment.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">p_c_f</td><td>string (optional)</td><td>Pickup custom field, used to define the custom field in csv for pickup.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">d_c_f</td><td>string (optional)</td><td>Delivery custom field, used to define the custom field in csv for delivery.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">search_add_on</td><td>integer (optional)</td><td>This is used to enable search add on (if applicable)</td></tr>
</table>

+ Request (appliation/json)

        {
            "api_key":"eaac56717958fa6664a9c5a0a29a43810a0fcda90be26a3e023b2f70f9ffa05",
            "timezone":"-330",
            "team_id":126,
        
            "notify":1,
            "geofence":0,
            "tags":"basic, premium",
            "p_c_f":"Pickups",
            "d_c_f":"Deliveries",
            "search_add_on":0
        }

+ Response 200 (application/json)

        {
            "message":"ACTION_COMPLETE_2",
            "Status":205,
            "Data":{}
        }

## Create Task For Form User [/create_task_for_form_user]

### Create Tasks For Form User [POST]

This API is used to create tasks for form user.


Request Body Parameters:

<table class="humanColumnApiDescription markdown formalTheme">
<tr><td colspan="1"><strong>Name</strong><td colspan="1"><strong>Type</strong><td colspan="1"><strong>Description</strong></td></tr>
<tr><td style="padding-right: 40px; width: 140px;">api_key</td><td>string</td> <td> You can get a key from settings(Login>Menu>Settings>API Keys) in your tookan account. Or <a href="https://app.tookanapp.com/#/app/settings/apikey">click here</a> to get API key</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">timezone*</td><td>string</td><td>Timezone of the country or location in numerical format. Eg - timezone for India = -330.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">has_pickup*</td><td>boolean</td> <td> Boolean key containing 1 if these are pickup tasks.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">has_delivery*</td><td>boolean</td><td>Boolean key containing 1 if these are delivery tasks.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">layout_type*</td><td>string</td><td>Set it as 0 (PICKUP_AND_DELIVERY), 1 (APPOINTMENT) or 2 (FOS) depending upon the type of layout.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">deliveries*</td><td>JSON array</td><td>Array of objects containing address, name, job_description, latitude, longitude, tie, phone, template_name, template_data, ref_images, email, order_id where address defines the address of the customer to whom the product should be delivered, name defines the name  of the customer, job_description defines the description of the task, latitude defines the latitude of the pickup location if you have it, otherwise leave it blank. We'll get it through geocoding API, longitude and latitude defines the long and lat of the pick up, time defines the time before the pickup should be collected, phone defines the contact number of the customer, template_name defines the custom fields template name that is predefined in your workflow page in the admin account and you just need to replace space in template with underscore(_), template_data defines an array of object containing label and data where label defines the custom field name and data will be his value. (Provided label should be in specified template.),ref_images defines an array of strings containing links of images,email defines the  email of the customer to whom the product should be delivered,order_id can be  passed as your own transaction number which can be used to identify tasks in tookan.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">pickups*</td><td>JSON array</td><td>Array of objects containing address, name, job_description, latitude, longitude, time, phone, template_name, template_data, ref_images, email, order_id where address defines the address from which the pickup should be collected, name defines the name of the person from whom the pickup should be collected, job_description defines the description of the task to be done, latitude and longitude defines the lat and long of the pick up location, time defines the time before which the pickup should be collected,phone defines the contact number of the person from whom the pickup should be collected,template_name defines the custom fields template name that is pre-defined in your workflow page in the admin account and you just need to replace space in template with underscore(_), template_data defines an array of object containing label and data where label defines the custom field name and data will be his value.(Provided label should be in specified template.),ref_images defines an array of strings containing links of images,email defines the email of the person from whom the pickup should be collected,order_id can be  passed as your own transaction number which can be used to identify tasks in tookan.</td></tr>


<tr><td style="padding-right: 40px; width: 140px;">is_multiple_tasks*</td><td>boolean</td> <td>Boolean key containing 1.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">vendor_email_id*</td><td>email</td> <td>Registered email of form user. </td></tr>
<tr><td style="padding-right: 40px; width: 140px;">domain_name*</td><td>string </td><td>Domain name of form.</td></tr>
</table>

+ Request (appliation/json)
        
        {
          "api_key": "YOUR_API_KEY",
          "timezone": -330,
          "has_pickup": 1,
          "has_delivery": 1,
          "layout_type": 0,
          "deliveries": [{
            "address": "Chandigarh International Airport, Sahibzada Ajit Singh Nagar, Punjab, India",
            "name": "Saurabh",
            "latitude": 30.66776609999999,
            "longitude": 76.78622870000004,
            "time": "2017-08-14 17:31:00",
            "phone": "+911234567890",
            "template_name": "Template_1",
            "template_data": [
            {
              "label": "Price",
              "data": "100"
            },
            {
              "label": "Quantity",
              "data": "100"
            }
            ],
            "ref_images": ["http://tookanapp.com/wp-content/uploads/2015/11/logo_dark.png"],
            "email": null,
            "job_description": "Job description goes here"
          }],
          "pickups": [{
            "address": "Chandigarh International Airport, Sahibzada Ajit Singh Nagar, Punjab, India",
            "name": "Saurabh",
            "latitude": "30.7333148",
            "longitude": "76.7794179",
            "time": "2017-08-14 17:29:00",
            "phone": "+911234567890",
            "template_name": "Template_1",
            "template_data": [
            {
              "label": "Price",
              "data": "100"
            },
            {
              "label": "Quantity",
              "data": "100"
            }
            ],
            "ref_images": ["http://tookanapp.com/wp-content/uploads/2015/11/logo_dark.png"],
            "job_description": "Job description goes here"
          }]
          "is_multiple_tasks" : 1,
          "vendor_email_id" : "nadeem@jungleworks.in",
          "domain_name" : "Your domain name"
        }
        
        
        
+ Response 200 (application/json)
{
    "message": "Successful",
    "status": 200,
    "data": {
        "pickups": [
            {
                "job_id": 351378,
                "job_hash": "1997e140c50a99556b69756147cad219",
                "job_token": "35137815413251963435918",
                "status": true,
                "auto_assignment_data": 0,
                "order_id": "12234556",
                "result_tracking_link": "https://k7ggd.app.goo.gl/XkPsGQ",
                "new_agent_task_insertion_data": []
            }
        ],
        "deliveries": [
            {
                "job_id": 351379,
                "job_hash": "23dccbd6038ba110ae91813360e1ba80",
                "job_token": "35137815413251963435918",
                "status": true,
                "auto_assignment_data": 0,
                "order_id": "123456",
                "result_tracking_link": "https://k7ggd.app.goo.gl/K7FeQ3",
                "new_agent_task_insertion_data": []
            }
        ]
    }
} 


## Get Task Details [/get_job_details]

### Get Task Details [POST]

This api is used to get the details of the task.
<br>
Request Body Parameters:
<table>
<tr><td style="padding-left: 0;" colspan="2"><strong>Name</strong><td><strong>Type</strong></td><td><strong>Description</strong></td></tr>
<tr><td style="padding-left: 0;" colspan="2">api_key</td><td>string</td><td> You can get a key from settings(Login>Menu>Settings>API Keys) in your tookan account. Or <a href="https://app.tookanapp.com/#/app/settings/apikey">click here</a> to get API key</td></tr>
<tr><td style="padding-left: 0;" colspan="2">job_ids*</td><td>array</td><td>You can get it from task details. You can send 100 job id's in single request.</td></tr>
<tr><td style="padding-left: 0;" colspan="2">include_task_history</td><td>number</td><td>Enter 1, if you want task history. Otherwise, enter 0 in the key.</td></tr>
<tr><td style="padding-left: 0;" colspan="2">job_additional_info </td><td>number</td><td>Enter 1, if you want Job Additional Details. Otherwise, enter 0 in the key.</td></tr>
<tr><td style="padding-left: 0;" colspan="2">include_job_report </td><td>number</td><td>Enter 1, if you want to retreive the Job report. Otherwise, enter 0 in the key.</td></tr>
</table>
+ Request (application/json)

            {
                "api_key":"2b997be77e2cc22becfd4c66426ef504",
                "job_ids":[5145, 1234],
                "include_task_history": 0,
                "job_additional_info" : 1,
                "include_job_report" : 0
            }

+ Response 200 (application/json)


        {
              "message": "Successful",
              "status": 200,
              "data": [
                {
                  "job_details_by_fleet": 189,
                  "fleet_id": 189,
                  "fleet_name": "Chandra",
                  "user_id": 222,
                  "customer_username": "Joey Tribianni",
                  "customer_phone": "+91 99869 06722",
                  "customer_email": "Joey@yahoo.com",
                  "is_customer_rated": 0,
                  "customer_comment": "",
                  "customer_rating": 0,
                  "job_pickup_email": null,
                  "job_pickup_name": "",
                  "job_pickup_phone": "0",
                  "job_latitude": "43.87274070000001",
                  "job_longitude": "-79.320782",
                  "job_address": "36 Pennock Crescent,Unionville,L3R,3M4 CA",
                  "job_status": 0,
                  "job_description": "#7717700",
                  "has_pickup": 0,
                  "completed_by_admin": 0,
                  "pickup_delivery_relationship": "1444471200000",
                  "job_pickup_datetime": "Invalid date",
                  "job_id": 5145,
                  "job_delivery_datetime": "12/06/2017 10:00 am",
                  "job_type": 1,
                  "job_pickup_latitude": "0",
                  "job_pickup_longitude": "0",
                  "job_pickup_address": "",
                  "job_acknowledge_text": null,
                  "job_acknowledge_status": 0,
                  "job_acknowledge_image": null,
                  "started_datetime": "",
                  "started_datetime_utc": "2017-12-06 12:29:47",
                  "started_datetime_local": "2017-12-06 17:59:47",
                  "completed_datetime_utc": "2017-12-06 12:37:16",
                  "completed_datetime_local": "2017-12-06 18:07:16",
                  "arrived_datetime_utc": "2017-12-06 12:37:16",
                  "arrived_datetime_local": "2017-12-06 18:07:16",
                  "acknowledged_datetime_utc": "2017-12-06 12:27:26",
                  "acknowledged_datetime_local": "2017-12-06 17:57:26",
                  "completed_datetime": "",
                  "arrived_datetime": "",
                  "acknowledged_datetime": "",
                  "total_distance_travelled": "0",
                   "tracking_link": "https://jngl.ml/5bCScff",
                  "task_history": []
                }
              ]
            }

## Get Task From Order ID [/get_job_details_by_order_id]

### Get Task Details From Order ID [POST]

This api is used to get the details of the task.
<br>
Request Body Parameters:
<table>
<tr><td style="padding-left: 0;" colspan="2"><strong>Name</strong><td><strong>Type</strong></td><td><strong>Description</strong></td></tr>
<tr><td style="padding-left: 0;" colspan="2">api_key</td><td>string</td><td> You can get a key from settings(Login>Menu>Settings>API Keys) in your tookan account. Or <a href="https://app.tookanapp.com/#/app/settings/apikey">click here</a> to get API key</td></tr>
<tr><td style="padding-left: 0;" colspan="2">order_ids*</td><td>array</td><td>This will be set by you.</td></tr>
<tr><td style="padding-left: 0;" colspan="2">include_task_history</td><td>number</td><td>Enter 1, if you want task history. Otherwise, enter 0 in the key.</td></tr>
</table>
+ Request (application/json)

            {
                "api_key":"7fed9dc6f41eb088bb49ab5344685d13",
                "order_ids":["P000469","123"],
                "include_task_history": 0
            }

+ Response 200 (application/json)


        {
              "message": "Successful",
              "status": 200,
              "data": [
                {
                  "job_details_by_fleet": 189,
                  "user_id": 222,
                  "customer_username": "Joey Tribianni",
                  "customer_phone": "+91 99869 06722",
                  "customer_email": "Joey@yahoo.com",
                  "is_customer_rated": 0,
                  "customer_comment": "",
                  "customer_rating": 0,
                  "job_pickup_email": null,
                  "job_pickup_name": "",
                  "job_pickup_phone": "0",
                  "job_latitude": "43.87274070000001",
                  "job_longitude": "-79.320782",
                  "job_address": "36 Pennock Crescent,Unionville,L3R,3M4 CA",
                  "job_status": 0,
                  "job_description": "#7717700",
                  "has_pickup": 0,
                  "completed_by_admin": 0,
                  "pickup_delivery_relationship": "1444471200000",
                  "job_pickup_datetime": "Invalid date",
                  "job_id": 5145,
                  "job_delivery_datetime": "12/06/2017 10:00 am",
                  "job_type": 1,
                  "job_pickup_latitude": "0",
                  "job_pickup_longitude": "0",
                  "job_pickup_address": "",
                  "job_acknowledge_text": null,
                  "job_acknowledge_status": 0,
                  "job_acknowledge_image": null,
                  "started_datetime": "",
                  "completed_datetime": "",
                  "started_datetime_utc": "2017-12-06 12:29:47",
                  "started_datetime_local": "2017-12-06 17:59:47",
                  "completed_datetime_utc": "2017-12-06 12:37:16",
                  "completed_datetime_local": "2017-12-06 18:07:16",
                  "arrived_datetime_utc": "2017-12-06 12:37:16",
                  "arrived_datetime_local": "2017-12-06 18:07:16",
                  "acknowledged_datetime_utc": "2017-12-06 12:27:26",
                  "acknowledged_datetime_local": "2017-12-06 17:57:26",
                  "arrived_datetime": "",
                  "acknowledged_datetime": "",
                  "total_distance_travelled": "0",
                  "total_time_spent_at_task_till_completion" : "15",
                  "fleet_id": 189,
                  "tracking_link": "https://app.tookanapp.com/tracking/index.html?jobID=39802dace6589590ac5ab771f2cae4ba",
                  "custom_field": [
                      {
                        "label": "Price Test",
                        "value": "true",
                        "required": "true",
                        "data_type": "Number",
                        "app_side": "Get Fleet Input",
                        "data": ""
                      },
                      {
                        "label": "what happened",
                        "value": "true",
                        "required": "true",
                        "data_type": "Text",
                        "app_side": "Get Fleet Input",
                        "data": ""
                      },
                      {
                        "label": "wfwef",
                        "value": "true",
                        "required": "false",
                        "data_type": "Text",
                        "app_side": "Get Fleet Input",
                        "data": ""
                      }
                    ]
                  },
                  "task_history": []
                }
              ]
            }

## Edit Task [/edit_task]

### Edit Task [POST]

This api used to edit a task that has already been added.
<br>
Request Body Parameters : Every parameter is same as while creating a task  the only parameters that should added while editing a task is shown below.
<table>
<tr><td style="padding-left: 0;" colspan="1"><strong>Name</strong><td style="padding-left: 0;" colspan="1"><strong>Type</strong></td><td style="padding-left: 0;" colspan="1"><strong>Description</strong></td></tr>
<tr><td style="padding-right: 40px; width: 140px;">job_id*</td><td>string</td><td>This is the unique id given to every job which is returned while creating a task</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">meta_data</td><td>string</td><td>This is array of object containing label and data where label defines the custom field name and data will be his value.(Provided label should be in specified template</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">custom_field_template</td><td>string</td><td>This is the custom fields template name that is pre-defined in your workflow page in the admin account and you just need to replace space in template with underscore(_).</td></tr>
</table>
+ Request (application/json)

            {
                "customer_email":"john@example.com",
                "customer_username":"John Doe",
                "customer_phone":"+919999999999",
                "customer_address":"Powai Lake, Powai, Mumbai, Maharashtra, India",
                "latitude":"28.5494489",
                "longitude":"77.2001368",
                "job_description":"Beauty services",
                "job_pickup_datetime":"2016-09-30 16:00:00",
                "job_delivery_datetime":"2016-09-30 17:00:00",
                "has_pickup":"0",
                "has_delivery":"0",
                "layout_type":"1",
                "tracking_link":1,
                "timezone":"-330",
                "api_key":"2b997be77e2cc22becfd4c66426ef504",
                "job_id":2952,
                "notify": 1
            }

+ Response 200 (application/json)


    + Body

                {
                  "message": "Successful",
                  "status": 200,
                  "data": {}
                }

## Edit Multiple Tasks [/edit_multiple_tasks]

### Edit Multiple Tasks [POST]

This API is used to edit multiple tasks that are already added. It takes as input the array of pickup and delivery tasks and one by one updates their data.

Request Parameters:

<table>
<tr><td style="padding-left: 0;" colspan="2"><strong>Name</strong><td><strong>Type</strong></td><td><strong>Description</strong></td></tr>
<tr><td style="padding-left: 0;" colspan="2">api_key</td><td>string</td><td> You can get a key from settings(Login>Menu>Settings>API Keys) in your tookan account. Or <a href="https://app.tookanapp.com/#/app/settings/apikey">click here</a> to get API key</td></tr>
<tr><td style="padding-left: 0;" colspan="2">pickups*</td><td>json array</td><td>This json array contains the pickup tasks the you want to edit. The format of each pickup task is same as defined in the create multiple tasks section.</td></tr>
<tr><td style="padding-left: 0;" colspan="2">deliveries*</td><td>json array</td><td>This json array contains the delivery tasks the you want to edit. The format of each delivery task is same as defined in the create multiple tasks section.</td></tr>
</table>

+ Request (application/json)

        {
            "api_key":"7fed9dc6f41eb088bb49ab5344685d13",
            "pickups":[{
                        "job_id":"123344",
                        "address": "Chandigarh International Airport, Sahibzada Ajit Singh Nagar, Punjab, India",
                        "latitude": 30.7333148,
                        "longitude": 76.7794179,
                        "time": "2017-08-14 17:24:00",
                        "phone": "+911234567890"
                        }],
            "deliveries":[{
                        "job_id":"123345",
                        "address": "Chandigarh Railway Station, Daria, Chandigarh, India",
                        "latitude": 30.7022191,
                        "longitude": 76.82247009999992,
                        "time": "2017-08-14 17:30:00",
                        "phone": "+913242342342"
                        }]
        }
        
+ Response 200 (application/json)

        {
            "message":"Successful",
            "status":200,
            "data":{}
        }

## Change Task Datetime [/change_job_date]

### Change Task Datetime [POST]

This API is used to change datetime of multiple tasks that are already added. It takes as input the array of task id's and one by one update the datetime for all the tasks.

Request Parameters:

<table>
<tr><td style="padding-left: 0;" colspan="2"><strong>Name</strong><td><strong>Type</strong></td><td><strong>Description</strong></td></tr>
<tr><td style="padding-left: 0;" colspan="2">api_key</td><td>string</td><td> You can get a key from settings(Login>Menu>Settings>API Keys) in your tookan account. Or <a href="https://app.tookanapp.com/#/app/settings/apikey">click here</a> to get API key</td></tr>
<tr><td style="padding-left: 0;" colspan="2">job_ids*</td><td>array</td><td>This array contains the task id's the you want to edit.</td></tr>
<tr><td style="padding-left: 0;" colspan="2">layout_type*</td><td>number</td><td>For Pickup & Delivery, it's value is 0. For Appointment, it's value is 1. For FOS, it's value is 2.</td></tr>
<tr><td style="padding-left: 0;" colspan="2">start_time*</td><td>datetime</td><td>Enter the datetime of the pickup tasks. For Appointment/FOS, it refers to start time of the task.</td></tr>
<tr><td style="padding-left: 0;" colspan="2">end_time*</td><td>datetime</td><td>Enter the datetime of the delivery tasks. For Appointment/FOS, it refers to end time of the task.</td></tr>
</table>

+ Request (application/json)

        {
    "api_key": "55646583f01653421d142e7a4204414e2cdfb2bd57a3b5f",
    "job_ids": [
        "3360",
        "3368",
        "3967"
    ],
    "layout_type": 0,
    "start_time": "2019-04-26 11:00:00",
    "end_time": "2019-04-26 11:30:00"
}
        
+ Response 200 (application/json)

        {
            "message":"Bulk Date Change is in progress. It may take a few seconds.",
            "status":200,
            "data":{}
        }

## Delete Task [/delete_task]

### Delete Task [POST]

This API is used to Delete a task which is not necessary.

Request Body Parameters:
<table>
<tr><td style="padding-left: 0;" colspan="2"><strong>Name</strong><td><strong>Type</strong></td><td><strong>Description</strong></td></tr>
<tr><td style="padding-left: 0;" colspan="2">api_key</td><td>string</td><td> You can get a key from settings(Login>Menu>Settings>API Keys) in your tookan account. Or <a href="https://app.tookanapp.com/#/app/settings/apikey">click here</a> to get API key</td></tr>
<tr><td style="padding-left: 0;" colspan="2">job_id*</td><td>number</td><td>You can get it from task details.</td></tr>
</table>
+ Request (application/json)

            {
                "api_key": "2b997be77e2cc22becfd4c66426ef504",
                "job_id": "2755"
            }

+ Response 200 (application/json)


        {
            "message": "Successful",
            "status": 200,
            "data": {}
        }

## Update Task Status [/update_task_status]

### Update Task Status [POST]

This API is used to force update the status of a task.

Request Body Parameters:
<table>
<tr><td style="padding-left: 0;" colspan="2"><strong>Name</strong><td><strong>Type</strong></td><td><strong>Description</strong></td></tr>
<tr><td style="padding-left: 0;" colspan="2">api_key</td><td>string</td><td> You can get a key from settings(Login>Menu>Settings>API Keys) in your tookan account. Or <a href="https://app.tookanapp.com/#/app/settings/apikey">click here</a> to get API key</td></tr>
<tr><td style="padding-left: 0;" colspan="2">job_id*</td><td>string (single or comma separated values)</td><td>You can get it from task details.</td></tr>
<tr><td style="padding-left: 0;" colspan="2">job_status*</td><td>number</td><td>Refer status codes section above for various statuses available.</td></tr>
</table>

+ Request (application/json)

            {
                "api_key": "2b997be77e2cc22becfd4c66426ef504",
                "job_id": "5145",
                "job_status": "2"
            }

+ Response 200 (application/json)


        {
          "message": "Successful",
          "status": 200,
          "data": {}
        }

## Ready to Dispatch [/ready_to_dispatch]

### Ready to Dispatch [POST]

Upon requested, this API sends push notifications to the Agent Application following the assignment of an agent to a designated task. Additionally, it sends a webhook aligned with the "Ready to dispatch" event.

Request Body Parameters:
<table>
<tr><td style="padding-left: 0;" colspan="2"><strong>Name</strong><td><strong>Type</strong></td><td><strong>Description</strong></td></tr>
<tr><td style="padding-left: 0;" colspan="2">api_key</td><td>string</td><td> You can get a key from settings(Login>Menu>Settings>API Keys) in your tookan account. Or <a href="https://app.tookanapp.com/#/app/settings/apikey">click here</a> to get API key</td></tr>
<tr><td style="padding-left: 0;" colspan="2">job_id*</td><td>number</td><td>You can get it from task details.</td></tr>
<tr><td style="padding-left: 0;" colspan="2">message</td><td>string</td><td>You can specify a custom push message.</td></tr>
</table>

+ Request (application/json)

            {
                "api_key": "2b997be77e2cc22becfd4c66426ef504",
                "job_id": "5145",
                "message"  : "Hey the Order is ready to pickup at location"
            }

+ Response 200 (application/json)


        {
          "message": "Successful",
          "status": 200,
          "data": {}
        }

## Start Task [/start_task]

### Start Task [POST]

This API is used to change the status of a task that has already been created to "start".

Request Body Parameters:

<table>
<tr><td style="padding-left: 0;" colspan="2"><strong>Name</strong><td><strong>Type</strong></td><td><strong>Description</strong></td></tr>
<tr><td style="padding-left: 0;" colspan="2">api_key</td><td>string</td><td> You can get a key from settings(Login>Menu>Settings>API Keys) in your tookan account. Or <a href="https://app.tookanapp.com/#/app/settings/apikey">click here</a> to get API key</td></tr>
<tr><td style="padding-left: 0;" colspan="2">job_id*</td><td>string</td><td>You can get it from task details. (single or comma separated values)</td></tr>
<tr><td style="padding-left: 0;" colspan="2">job_status*</td><td>number (fixed)</td><td>Set this value to “1” to start the task.</td></tr>
</table>

+ Request (application/json)

            {
                "api_key": "2b997be77e2cc22becfd4c66426ef504",
                "job_id": "5145",
                "job_status": "1"
            }

+ Response 200 (application/json)


        {
          "message": "Successful",
          "status": 200,
          "data": {}
        }

## Cancel Task [/cancel_task]

### Cancel Task [POST]

This API is used to change the status of a task that has already been created to "cancelled".

Request Body Parameters:

<table>
<tr><td style="padding-left: 0;" colspan="2"><strong>Name</strong><td><strong>Type</strong></td><td><strong>Description</strong></td></tr>
<tr><td style="padding-left: 0;" colspan="2">api_key</td><td>string</td><td> You can get a key from settings(Login>Menu>Settings>API Keys) in your tookan account. Or <a href="https://app.tookanapp.com/#/app/settings/apikey">click here</a> to get API key</td></tr>
<tr><td style="padding-left: 0;" colspan="2">job_id*</td><td>string</td><td>You can get it from task details. (single or comma separated values)</td></tr>
<tr><td style="padding-left: 0;" colspan="2">job_status*</td><td>number (fixed)</td><td>Set this value to “9” to start the task.</td></tr>
</table>

+ Request (application/json)

            {
                "api_key": "2b997be77e2cc22becfd4c66426ef504",
                "job_id": "5145",
                "job_status": "9"
            }

+ Response 200 (application/json)


        {
          "message": "Successful",
          "status": 200,
          "data": {}
        }

##  Assign task [/assign_task]

### Assign Task  [POST]

This API is used to assign/reassign a unassigned/assigned task or an assigned task to Agent.

Request Body Parameters:
<table>
<tr><td style="padding-left: 0;" colspan="2"><strong>Name</strong><td><strong>Type</strong></td><td><strong>Description</strong></td></tr>
<tr><td style="padding-left: 0;" colspan="2">api_key</td><td>string</td><td> You can get a key from settings(Login>Menu>Settings>API Keys) in your tookan account. Or <a href="https://app.tookanapp.com/#/app/settings/apikey">click here</a> to get API key</td></tr>
<tr><td style="padding-left: 0;" colspan="2">job_id*</td><td>number</td><td>You can get it from task details.</td></tr>
<tr><td style="padding-left: 0;" colspan="2">fleet_id</td><td>number</td><td>You can get it from your tookan account or you can use 'Get All Agents' API for retrieving list from your account.</td></tr>
<tr><td style="padding-left: 0;" colspan="2">team_id*</td><td>number</td><td>You can get it from your tookan account in teams section.</td></tr>
<tr><td style="padding-left: 0;" colspan="2">job_status</td><td>string</td><td>Refer status codes section above for various statuses available.</td></tr>
</table>
+ Request (application/json)

            {
                "api_key": "2b997be77e2cc22becfd4c66426ef504",
                "job_id": "5145",
                "fleet_id": "",
                "team_id":"",
                "job_status": "2"
            }

+ Response 200 (application/json)


        {
          "message": "Successful",
          "status": 200,
          "data": {}
        }

## AutoAssign Task [/re_autoassign_task]

### AutoAssign Task [POST]

This API is used to auto-assign an unassigned/assigned task. Only tasks that have <code>auto_assignment</code> enabled will be auto-assigned through this API.

Request Body Parameters:
<table>
<tr><td style="padding-left: 0;" colspan="2"><strong>Name</strong><td><strong>Type</strong></td><td><strong>Description</strong></td></tr>
<tr><td style="padding-left: 0;" colspan="2">api_key</td><td>string</td><td> You can get a key from settings (Login>Menu>Settings>API Keys) in your tookan account. Or <a href="https://app.tookanapp.com/#/app/settings/apikey">click here</a> to get API key</td></tr>
<tr><td style="padding-left: 0;" colspan="2">job_id*</td><td>number</td><td>This is the id of the task you want to auto assign. You can get it from task details.</td></tr>
</table>
+ Request (application/json)

        {
            "api_key":"2b997be77e2cc22becfd4c66426ef504",
            "job_id":"5145"
        }

+ Response 200 (application/json)

        {
            "message":"Successful",
            "status":200,
            "data":{}
        }
    
##  View All Tasks [/get_all_tasks]

### View All Tasks  [POST]

This API is used to get all the tasks as per the filters. Start Date and End Date range refer to Task Date. The start and End Date shall have to be inside the 31 days span.
By utilizing this API, you can retrieve task details for a maximum span of 31 days from the current date.


Request Body Parameters:
<table>
<tr><td style="padding-left: 0;" colspan="2"><strong>Name</strong><td><strong>Type</strong></td><td><strong>Description</strong></td></tr>
<tr><td style="padding-left: 0;" colspan="2">api_key</td><td>string</td><td> You can get a key from settings(Login>Menu>Settings>API Keys) in your tookan account. Or <a href="https://app.tookanapp.com/#/app/settings/apikey">click here</a> to get API key</td></tr>
<tr><td style="padding-left: 0;" colspan="2">job_status</td><td>string</td><td>Filter the list of tasks via their status</td></tr>
<tr><td style="padding-left: 0;" colspan="2">job_type*</td><td>number(mandatory)</td><td>Filter via Job Type - 0 for Pick Up, 1 for Delivery, 2 for Appointment and 3 for FOS</td></tr>
<tr><td style="padding-left: 0;" colspan="2">start_date*</td><td>date/string</td><td>Start Date for the date range (YYYY-MM-DD)</td></tr>
<tr><td style="padding-left: 0;" colspan="2">end_date*</td><td>date/string</td><td>End Date for the date range (YYYY-MM-DD)</td></tr>
<tr><td style="padding-left: 0;" colspan="2">custom_fields</td><td>number</td><td>You can pass this flag as 1, if you want the custom fields data to be included in the response. default is 0</td></tr>
<tr><td style="padding-left: 0;" colspan="2">is_pagination</td><td>Boolean</td><td>You can set this as 1 to enable pagination. </td></tr>
<tr><td style="padding-left: 0;" colspan="2">requested_page</td><td>number</td><td>Current(Which) page according to the page number of tasks in the filter.</td></tr>
<tr><td style="padding-left: 0;" colspan="2">customer_id</td><td>number</td><td> Filter the list based on the customer id.</td></tr>
<tr><td style="padding-left: 0;" colspan="2">fleet_id</td><td>number</td><td> Filter the list based on the agent id.</td></tr>
<tr><td style="padding-left: 0;" colspan="2">job_id</td><td>array</td><td> Filter the list based on the job ids.</td></tr>
<tr><td style="padding-left: 0;" colspan="2">order_id</td><td>array</td><td> Filter the list based on the order ids.</td></tr>
<tr><td style="padding-left: 0;" colspan="2">team_id</td><td>number</td><td> Filter the list based on the team id.</td></tr>
</table>
    
+ Request (application/json)

        {
          "api_key": "00be7353ba73d5cb9812b9b9af404f8b",
          "job_status": "1",
          "job_type": 1,
          "start_date": "2016-08-20",
          "end_date": "2016-08-20",
          "custom_fields": 0,
          "is_pagination":1,
          "requested_page":1,
          "customer_id":"",
          "fleet_id": 1234,
          "job_id": [123, 456, 789],
          "order_id": ["123", "Y-456", "O_789"],
          "team_id":123
        }

+ Response 200 (application/json)

        {
          "message": "Successful",
          "status": 200,
          "data": {<Array of task data>}
        }
        
##  View All Deleted Tasks [/get_all_deleted_tasks]

### View All Deleted Tasks  [POST]

This API is used to get all the tasks as per the filters. Start Date and End Date range refer to Task Date.

Request Body Parameters:
<table>
<tr><td style="padding-left: 0;" colspan="2"><strong>Name</strong><td><strong>Type</strong></td><td><strong>Description</strong></td></tr>
<tr><td style="padding-left: 0;" colspan="2">api_key</td><td>string</td><td> You can get a key from settings(Login>Menu>Settings>API Keys) in your tookan account. Or <a href="https://app.tookanapp.com/#/app/settings/apikey">click here</a> to get API key</td></tr>
<tr><td style="padding-left: 0;" colspan="2">job_type*</td><td>number(mandatory)</td><td>Filter via Job Type - 0 for Pick Up, 1 for Delivery, 2 for Appointment and 3 for FOS</td></tr>
<tr><td style="padding-left: 0;" colspan="2">start_date</td><td>number</td><td>Start Date for the date range</td></tr>
<tr><td style="padding-left: 0;" colspan="2">end_date</td><td>number</td><td>End Date for the date range</td></tr>
<tr><td style="padding-left: 0;" colspan="2">custom_fields</td><td>number</td><td>You can pass this flag as 1, if you want the custom fields data to be included in the response. default is 0</td></tr>
<tr><td style="padding-left: 0;" colspan="2">is_pagination</td><td>Boolean</td><td>You can set this as 1 to enable pagination. </td></tr>
<tr><td style="padding-left: 0;" colspan="2">requested_page</td><td>number</td><td>Current(Which) page according to the page number of tasks in the filter.</td></tr>
<tr><td style="padding-left: 0;" colspan="2">customer_id</td><td>number</td><td> Filter the list based on the customer id.</td></tr>
<tr><td style="padding-left: 0;" colspan="2">fleet_id</td><td>number</td><td> Filter the list based on the agent id.</td></tr>
<tr><td style="padding-left: 0;" colspan="2">job_id</td><td>array</td><td> Filter the list based on the job ids.</td></tr>
<tr><td style="padding-left: 0;" colspan="2">order_id</td><td>array</td><td> Filter the list based on the order ids.</td></tr>
<tr><td style="padding-left: 0;" colspan="2">team_id</td><td>number</td><td> Filter the list based on the team id.</td></tr>
</table>
    
+ Request (application/json)

        {
          "api_key": "00be7353ba73d5cb9812b9b9af404f8b",
          "job_type": 1,
          "start_date": "2016-08-20",
          "end_date": "2016-08-20",
          "custom_fields": 0,
          "is_pagination":1,
          "requested_page":1,
          "customer_id":"",
          "fleet_id": 1234,
          "job_id": [123, 456, 789],
          "order_id": ["123", "Y-456", "O_789"],
          "team_id":123
        }

+ Response 200 (application/json)

        {
          "message": "Successful",
          "status": 200,
          "data": {<Array of task data>}
        }        
        
    
## Get All Related Tasks [/get_related_tasks]

### Get All Related Tasks [POST]

This api is used to get all related tasks.
<br>
Request Body Parameters:
<table>
<tr><td style="padding-left: 0;" colspan="2"><strong>Name</strong><td><strong>Type</strong></td><td><strong>Description</strong></td></tr>
<tr><td style="padding-left: 0;" colspan="2">api_key</td><td>string</td><td> You can get a key from settings(Login>Menu>Settings>API Keys) in your tookan account. Or <a href="https://app.tookanapp.com/#/app/settings/apikey">click here</a> to get API key</td></tr>
<tr><td style="padding-left: 0;" colspan="2">pickup_delivery_relationship*</td><td>string</td><td>You can get it from task details.</td></tr>
</table>
+ Request (application/json)

            {
                "api_key":"2b997be77e2cc22becfd4c66ef504",
               "pickup_delivery_relationship": "229315408060285612612"
            }

+ Response 200 (application/json)

        {
        "message: "Successful",
        "status": 200,
        "data": [
            {
                "job_id": 123456,
                "created_by": 5,
                "order_id": null,
                "recurring_id": "0",
                "recurring_count": 0,
                "partner_order_id": null,
                "team_id": 0,
                "vertical": 0,
                "merchant_id": 0,
                "geofence": 1,
                "tags": "",
                "auto_assignment": 2,
                "dispatcher_id": null,
                "job_hash": "465cbe86f23d22554cd490c5a1c7",
                "has_pickup": 1,
                "has_delivery": 1,
                "is_routed": 0,
                "pickup_delivery_relationship": "229315408060285612612",
                "job_description": "groceries delivery",
                "job_pickup_datetime": "2018-10-29T19:00:00.000Z",
                "job_pickup_name": "7 Eleven Store",
                "job_pickup_phone": "+1 201555555",
                "job_delivery_datetime": "2018-10-29T21:00:00.000Z",
                "job_pickup_latitude": "30.7299586",
                "job_pickup_longitude": "76.8101038",
                "job_pickup_address": "Sector 26, Chandigarh, India",
                "job_pickup_email": "",
                "job_latitude": "30.7339583",
                "job_longitude": "76.77261969999999",
                "customer_username": "7 Eleven Store",
                "customer_email": "",
                "customer_phone": "+1 201555555",
                "job_address": "Sector 26, Chandigarh, India",
                "creation_datetime": "2018-10-29T09:40:28.000Z",
                "fleet_id": null,
                "user_id": 123,
                "fleet_rating": 0,
                "customer_comment": null,
                "is_customer_rated": 0,
                "customer_id": 292130,
                "arrived_datetime": "0000-00-00 00:00:00",
                "started_datetime": "0000-00-00 00:00:00",
                "completed_datetime": "0000-00-00 00:00:00",
                "acknowledged_datetime": "0000-00-00 00:00:00",
                "job_status": 6,
                "is_active": 1,
                "job_type": 0,
                "completed_by_admin": 0,
                "open_tracking_link": 0,
                "timezone": "-330",
                "job_time": "2018-10-29T19:00:00.000Z",
                "job_date": "2018-10-29T00:00:00.000Z",
                "job_time_utc": "2018-10-29T13:30:00.000Z",
                "job_date_utc": "2018-10-29T00:00:00.000Z",
                "total_distance_travelled": null,
                "form_id": null,
                "customer_rating": null,
                "driver_comment": null,
                "remarks": null,
                "barcode": null,
                "ride_type": 0,
                "matched_pickup_delivery_relationship": null,
                "fields": {
                    "app_optional_fields": [
                        {
                            "label": "accept",
                            "value": "1"
                        },
                        {
                            "label": "notes",
                            "value": 1,
                            "required": 0
                        },
                        {
                            "label": "images",
                            "value": 1,
                            "required": 0
                        },
                        {
                            "label": "barcode",
                            "value": 0,
                            "required": 0
                        },
                        {
                            "label": "signature",
                            "value": 1,
                            "required": 0
                        },
                        {
                            "label": "images_caption",
                            "value": 0,
                            "required": 0
                        },
                        {
                            "label": "slider",
                            "value": 1
                        },
                        {
                            "label": "arrived",
                            "value": 1
                        },
                        {
                            "label": "cancel_btn",
                            "value": 0
                        },
                        {
                            "label": "failed_btn",
                            "value": 0
                        },
                        {
                            "label": "confirm",
                            "value": 0
                        },
                        {
                            "label": "fleet_notification",
                            "value": 1
                        },
                        {
                            "label": "masking",
                            "value": 1
                        },
                        {
                            "label": "disable_rating",
                            "value": 0
                        },
                        {
                            "label": "single_tracking",
                            "value": 1
                        },
                        {
                            "label": "auto_arrival_distance",
                            "value": -1
                        },
                        {
                            "label": "team_level_auto_assignment",
                            "value": 0
                        },
                        {
                            "label": "is_delivery_disabled",
                            "value": 0
                        }
                    ],
                    "custom_field": [],
                    "extras": {},
                    "ref_images": [
                        "http://tookanapp.com/wp-content/uploads/2015/11/logo_dark.png",
                        "http://tookanapp.com/wp-content/uploads/2015/11/logo_dark.png"
                    ],
                    "req_popup": "",
                    "auto_assign": {
                        "broadcast_type": 2,
                        "is_enabled": 1,
                        "expires_in": 20,
                        "startingRadius": 5,
                        "incRadius": 10,
                        "radiusLimit": 50,
                        "batchTime": 20,
                        "acceptTime": 40,
                        "batchSize": 5,
                        "attemptLimit": 5,
                        "tasks": 10,
                        "radius": 30,
                        "send_to_all_expires_in": 30,
                        "offline_agents": 0,
                        "retryLimit": 0,
                        "put_agent_busy": 0,
                        "jobAndFleetStatus": {},
                        "ride_type": 0,
                        "clubbing_parameters": {
                            "delivery_distance": 10000,
                            "preparation_time": 0,
                            "max_clubbed_orders": 5,
                            "clubbing_enable": 1
                        }
                    },
                    "geofence_reference_id": [],
                    "tracking_link": "https://k7ggd.app.goo.gl/HMF9Q",
                    "is_rating_comment_enabled": 1
                },
                "related_job_count": 2,
                "related_job_type": 2
            },
            {
                "job_id": 123457,
                "created_by": 5,
                "order_id": null,
                "recurring_id": "0",
                "recurring_count": 0,
                "partner_order_id": null,
                "team_id": 0,
                "vertical": 0,
                "merchant_id": 0,
                "geofence": 1,
                "tags": "",
                "auto_assignment": 2,
                "dispatcher_id": null,
                "job_hash": "c2008de635f5895279b9c5c2fe02",
                "has_pickup": 1,
                "has_delivery": 1,
                "is_routed": 0,
                "pickup_delivery_relationship": "229315408060285612612",
                "job_description": "groceries delivery",
                "job_pickup_datetime": "2018-10-29T19:00:00.000Z",
                "job_pickup_name": "7 Eleven Store",
                "job_pickup_phone": "+1 201555555",
                "job_delivery_datetime": "2018-10-29T21:00:00.000Z",
                "job_pickup_latitude": "30.7299586",
                "job_pickup_longitude": "76.8101038",
                "job_pickup_address": "Sector 26, Chandigarh, India",
                "job_pickup_email": "",
                "job_latitude": "30.7339583",
                "job_longitude": "76.77261969999999",
                "customer_username": "John Doe",
                "customer_email": "john@example.com",
                "customer_phone": "+1 201-555-5555",
                "job_address": "Sector 22, Chandigarh, India",
                "creation_datetime": "2018-10-29T09:40:29.000Z",
                "fleet_id": null,
                "user_id": 123,
                "fleet_rating": 0,
                "customer_comment": null,
                "is_customer_rated": 0,
                "customer_id": 292131,
                "arrived_datetime": "0000-00-00 00:00:00",
                "started_datetime": "0000-00-00 00:00:00",
                "completed_datetime": "0000-00-00 00:00:00",
                "acknowledged_datetime": "0000-00-00 00:00:00",
                "job_status": 6,
                "is_active": 1,
                "job_type": 1,
                "completed_by_admin": 0,
                "open_tracking_link": 0,
                "timezone": "-330",
                "job_time": "2018-10-29T21:00:00.000Z",
                "job_date": "2018-10-29T00:00:00.000Z",
                "job_time_utc": "2018-10-29T15:30:00.000Z",
                "job_date_utc": "2018-10-29T00:00:00.000Z",
                "total_distance_travelled": null,
                "form_id": null,
                "customer_rating": null,
                "driver_comment": null,
                "remarks": null,
                "barcode": null,
                "ride_type": 0,
                "matched_pickup_delivery_relationship": null,
                "fields": {
                    "app_optional_fields": [
                        {
                            "label": "accept",
                            "value": "1"
                        },
                        {
                            "label": "notes",
                            "value": 1,
                            "required": 0
                        },
                        {
                            "label": "images",
                            "value": 1,
                            "required": 0
                        },
                        {
                            "label": "barcode",
                            "value": 0,
                            "required": 0
                        },
                        {
                            "label": "signature",
                            "value": 1,
                            "required": 0
                        },
                        {
                            "label": "images_caption",
                            "value": 0,
                            "required": 0
                        },
                        {
                            "label": "slider",
                            "value": 1
                        },
                        {
                            "label": "arrived",
                            "value": 1
                        },
                        {
                            "label": "cancel_btn",
                            "value": 0
                        },
                        {
                            "label": "failed_btn",
                            "value": 0
                        },
                        {
                            "label": "confirm",
                            "value": 0
                        },
                        {
                            "label": "fleet_notification",
                            "value": 1
                        },
                        {
                            "label": "masking",
                            "value": 1
                        },
                        {
                            "label": "disable_rating",
                            "value": 0
                        },
                        {
                            "label": "single_tracking",
                            "value": 1
                        },
                        {
                            "label": "auto_arrival_distance",
                            "value": -1
                        },
                        {
                            "label": "team_level_auto_assignment",
                            "value": 0
                        },
                        {
                            "label": "is_delivery_disabled",
                            "value": 0
                        }
                    ],
                    "custom_field": [],
                    "extras": {},
                    "ref_images": [
                        "http://tookanapp.com/wp-content/uploads/2015/11/logo_dark.png",
                        "http://tookanapp.com/wp-content/uploads/2015/11/logo_dark.png"
                    ],
                    "req_popup": "",
                    "auto_assign": {
                        "broadcast_type": 2,
                        "is_enabled": 1,
                        "expires_in": 20,
                        "startingRadius": 5,
                        "incRadius": 10,
                        "radiusLimit": 50,
                        "batchTime": 20,
                        "acceptTime": 40,
                        "batchSize": 5,
                        "attemptLimit": 5,
                        "tasks": 10,
                        "radius": 30,
                        "send_to_all_expires_in": 30,
                        "offline_agents": 0,
                        "retryLimit": 0,
                        "put_agent_busy": 0,
                        "jobAndFleetStatus": {},
                        "ride_type": 0,
                        "clubbing_parameters": {
                            "delivery_distance": 10000,
                            "preparation_time": 0,
                            "max_clubbed_orders": 5,
                            "clubbing_enable": 1
                        }
                    },
                    "geofence_reference_id": [],
                    "tracking_link": "https://k7ggd.app.goo.gl/1gCU9",
                    "is_rating_comment_enabled": 1
                },
                "related_job_count": 2,
                "related_job_type": 1
            }
    ]
}
        
## Get Task Statistics [/user_task_stats]

### Get Task Statistics [POST]

This API is used to get stats related to tasks.

Request Body Parametrs:

<table>
<tr><td style="padding-left: 0;" colspan="2"><strong>Name</strong><td><strong>Type</strong></td><td><strong>Description</strong></td></tr>
<tr><td style="padding-left: 0;" colspan="2">api_key</td><td>string</td><td> You can get a key from settings(Login>Menu>Settings>API Keys) in your tookan account. Or <a href="https://app.tookanapp.com/#/app/settings/apikey">click here</a> to get API key</td></tr>
<tr><td style="padding-left: 0;" colspan="2">job_status</td><td>array (optional)</td><td>Filter the list of tasks via their status.</td></tr>
<tr><td style="padding-left: 0;" colspan="2">job_type</td><td>number (optional)</td><td>Filter via Job Type - 0 for Pick Up, 1 for Delivery, 2 for Appointment and 3 for FOS.</td></tr>
<tr><td style="padding-left: 0;" colspan="2">start_date</td><td>date (optional)</td><td>Start Date for the date range.</td></tr>
<tr><td style="padding-left: 0;" colspan="2">end_date</td><td>date (optional)</td><td>End Date for the date range.</td></tr>
<tr><td style="padding-left: 0;" colspan="2">team_id</td><td>number (optional)</td><td>Filter the list of tasks w.r.t team.</td></tr>

</table>

+ Request (application/json)


        {
            "api_key":"e1ecdd2fd7aaa26547e195b459a7c2d2", 
            "job_status":[2,3]
        }


+ Response 200 (application/json)


        {
            "message": "Successful",
            "status": 200,
            "data": [
                {
                    "job_status": 2,
                    "job_count": 740,
                    "job_status_value": "Successful"
                },
                {
                    "job_status": 3,
                    "job_count": 34,
                    "job_status_value": "Failed"
                }
            ]
        }
        
        
## Get Route Details [/get_route_details_for_date]

### Get Route Details [POST]

This API is used to get the routes after route optimization for a particular date.

Request Body Parameters:
<table>
<tr><td style="padding-left: 0;" colspan="2"><strong>Name</strong><td><strong>Type</strong></td><td><strong>Description</strong></td></tr>
<tr><td style="padding-left: 0;" colspan="2">api_key</td><td>string</td><td> You can get a key from settings(Login>Menu>Settings>API Keys) in your tookan account. Or <a href="https://app.tookanapp.com/#/app/settings/apikey">click here</a> to get API key</td></tr>
<tr><td style="padding-left: 0;" colspan="2">date*</td><td>date</td><td>Enter the date for which you want to get the routes.</td></tr>
</table>
+ Request (application/json)

            {
                "api_key": "2b997be77e2cc22becfd4c66426ef504",
                "date": "2019-05-21"
            }

+ Response 200 (application/json)

+ Body

        {
    "message": "Successful",
    "status": 200,
    "data": [
        {
            "_id": "5ce3bb5b17f6662f519b712e",
            "fleet_id": "19246",
            "user_id": 7756,
            "date": "2019-05-21",
            "routed": [
                "35466703",
                "35478849"
            ],
            "polylines": [
                "k_opy@o|isqCSo_@sN?_yg@kRoFka@sNkR{JcB?kCf@cBbBoK~M{EjH{@fO_NzaF{Ef_BcBf|@f@bj@oAnd@?zToAnPsDn_@wV~`CwQfdBcBvQwGn}@wBnd@g@rtA?rl@SfYjCf@zEjCrDzEbBvGf@bGSzEgEnKoFfEkHbB{@?kCzEoFvLgc@ziBgJrb@{YvaBcG~k@gObzBsIj}A{Er{@{Ef|@kCjk@RjM?nFnAf@vBbB~CvGnAvG?fEcBfJcBrD_DjC_DbBsDz@wBzJoAfO{@b[z@rhBbL~hDnKnzDzJnrCbGrDjC~H?nFcBvG_DfE{Ez@oF{@kCwBwB_Dg_BrNct@rIgO~CkMrD_]~Hg|@zOsIvBgE~CwB~CsDrIgEfOoAvL?zO~CrNjHbe@rDzh@sSfbCwGns@kM~z@wBrNcGrSgr@fuAwcAntB{w@vwAsNj\\sIr]{Eb[oZbzBbVjp@vVnFnPfE~_FbcAoFbo@sIvt@kM~_AoAvGwBzEsNbLka@bVoK~M_pCnqF{pAzlCg^ns@v[zTfkA~z@vuBv|Arq@nd@f^bVzh@bVnPbGjWzOzEfEzTzYzJzO~HrIjsAfaAct@rv@cVnUjC~CvBf@~CcBbBcBcBbB_DbBwBg@kC_DbVoUbt@sv@ksAgaA_IsI{J{O{T{Y{EgEkW{OoPcG{h@cVgm@w`@_q@od@ssDcnCw[{TkWbe@oK~Mod@zc@sInKgTvQskCw~EgTc`@{JwBka@cBwQnPcuB~vBcsCbsCoKzO{EnFRz@RvB?vB{@zEwB~CcBvB_Dz@sD?cBSg@SsSnKkoCjjC{fA~dA_eAvcAcLnK{EjHf@jC?jCoAjHkCrDcBf@sDz@{Eg@oA{@cL~HktCfgCw_CrwBce@rg@f@vGcB~H{ErDoFz@oFoA{@{@sDbBsSnPk\\nZstFbyEco@rl@sb@j\\{eDbnC_kC~vB_IzJoFjMRbB?zEg@nFsDfJcGzE{EnAsDR{JwB_DwBwQ~Hc}C~{B_uCfxB_]vVwBbBRz@f@vB?vBg@nFwBrD_DvB{Ef@{EoAsDsDoAgE?{Ez@gEf@g@oAgEoZsl@{bC{rE{Y{h@kHkRgEcG_IjHsIvGsNbLcLvLcLnU{O~WkHfJk\\~W{YvQoKzERvBSjC{@bBcBz@wB?cB{@{@cBSS_DRoPjCkHjCoUfOgsBf_Brg@nlAs]rSwcAjp@kiAfw@_]kp@_cBreAgOfJ_Xkp@zYcQvG~MnAvBoAwBwG_N{YbQ~Wjp@fOgJ~bBseA~\\jp@jiAgw@~iAwt@jWgOvzBbmFnKbVbBg@zE?fEnAvBvBnAjCf@vGg@bGg@vBg@z@bL~Rni@~dA~sArfC~qBbvDk\\jWwLzJolAns@sXvQoPgYcLjH"
            ],
            "route_id": "72455",
            "jobs": [
                {
                    "job_id": 35466703,
                    "created_by": 0,
                    "order_id": null,
                    "recurring_id": "5c9b5eb87dbd287f7c455bb5",
                    "recurring_count": 44,
                    "partner_order_id": null,
                    "team_id": 10397,
                    "vertical": 0,
                    "merchant_id": 0,
                    "geofence": 0,
                    "tags": "",
                    "auto_assignment": 0,
                    "dispatcher_id": null,
                    "job_hash": "8ff62929f77352e69123b670fbd358c5",
                    "has_pickup": 1,
                    "has_delivery": 0,
                    "is_routed": 1,
                    "pickup_delivery_relationship": "3546670315583986019382205",
                    "job_description": null,
                    "job_pickup_datetime": "2019-05-21T17:45:00.000Z",
                    "job_pickup_name": "",
                    "job_pickup_phone": "",
                    "job_delivery_datetime": "0000-00-00 00:00:00",
                    "job_pickup_latitude": "30.70549299999999",
                    "job_pickup_longitude": "76.80125610000005",
                    "job_pickup_address": "Elante Mall, Purv Marg, Industrial Area Phase I, Chandigarh, India",
                    "job_pickup_email": null,
                    "job_latitude": "30.70549299999999",
                    "job_longitude": "76.80125610000005",
                    "customer_username": "",
                    "customer_email": null,
                    "customer_phone": "",
                    "job_address": "Elante Mall, Purv Marg, Industrial Area Phase I, Chandigarh, India",
                    "creation_datetime": "2019-05-21T00:29:50.000Z",
                    "fleet_id": 19246,
                    "user_id": 7756,
                    "fleet_rating": 0,
                    "customer_comment": null,
                    "is_customer_rated": 0,
                    "customer_id": 4783123,
                    "arrived_datetime": "0000-00-00 00:00:00",
                    "started_datetime": "0000-00-00 00:00:00",
                    "completed_datetime": "0000-00-00 00:00:00",
                    "acknowledged_datetime": "2019-05-21T05:00:12.000Z",
                    "job_status": 7,
                    "is_active": 1,
                    "job_type": 0,
                    "completed_by_admin": 0,
                    "open_tracking_link": 0,
                    "timezone": "-330",
                    "job_time": "2019-05-21T17:45:00.000Z",
                    "job_date": "2019-05-21T00:00:00.000Z",
                    "job_time_utc": "2019-05-21T12:15:00.000Z",
                    "job_date_utc": "2019-05-21T00:00:00.000Z",
                    "total_distance_travelled": null,
                    "form_id": null,
                    "customer_rating": null,
                    "driver_comment": null,
                    "remarks": null,
                    "barcode": null,
                    "ride_type": 0,
                    "matched_pickup_delivery_relationship": null
                },
                {
                    "job_id": 35478849,
                    "created_by": 5,
                    "order_id": "",
                    "recurring_id": "0",
                    "recurring_count": 0,
                    "partner_order_id": null,
                    "team_id": 10397,
                    "vertical": 0,
                    "merchant_id": 0,
                    "geofence": 0,
                    "tags": "",
                    "auto_assignment": 2,
                    "dispatcher_id": null,
                    "job_hash": "eddcf223c709473182defe9fffd6fb8a",
                    "has_pickup": 1,
                    "has_delivery": 0,
                    "is_routed": 1,
                    "pickup_delivery_relationship": "3547884915584148713490600",
                    "job_description": "test desc",
                    "job_pickup_datetime": "2019-05-21T09:30:00.000Z",
                    "job_pickup_name": "Test14",
                    "job_pickup_phone": "",
                    "job_delivery_datetime": "0000-00-00 00:00:00",
                    "job_pickup_latitude": "30.7583236",
                    "job_pickup_longitude": "76.7841443",
                    "job_pickup_address": "Sector 11, Chandigarh, Punjab, India",
                    "job_pickup_email": "",
                    "job_latitude": "30.7583236",
                    "job_longitude": "76.7841443",
                    "customer_username": "Test14",
                    "customer_email": "",
                    "customer_phone": "",
                    "job_address": "Sector 11, Chandigarh, Punjab, India",
                    "creation_datetime": "2019-05-21T05:00:59.000Z",
                    "fleet_id": 19246,
                    "user_id": 7756,
                    "fleet_rating": 0,
                    "customer_comment": null,
                    "is_customer_rated": 0,
                    "customer_id": 4783123,
                    "arrived_datetime": "0000-00-00 00:00:00",
                    "started_datetime": "0000-00-00 00:00:00",
                    "completed_datetime": "0000-00-00 00:00:00",
                    "acknowledged_datetime": "2019-05-21T05:01:25.000Z",
                    "job_status": 7,
                    "is_active": 1,
                    "job_type": 0,
                    "completed_by_admin": 0,
                    "open_tracking_link": 0,
                    "timezone": "-330",
                    "job_time": "2019-05-21T09:30:00.000Z",
                    "job_date": "2019-05-21T00:00:00.000Z",
                    "job_time_utc": "2019-05-21T04:00:00.000Z",
                    "job_date_utc": "2019-05-21T00:00:00.000Z",
                    "total_distance_travelled": null,
                    "form_id": null,
                    "customer_rating": null,
                    "driver_comment": null,
                    "remarks": null,
                    "barcode": null,
                    "ride_type": 0,
                    "matched_pickup_delivery_relationship": null
                }
            ]
        }
    ]
}

## Get Fare Estimate [/get_fare_estimate]

### Get Fare Estimate [POST]

This API is used to get fare estimate of a task.

Request Body Parametrs:

<table>
<tr><td style="padding-left: 0;" colspan="2"><strong>Name</strong><td><strong>Type</strong></td><td><strong>Description</strong></td></tr>
<tr><td style="padding-left: 0;" colspan="2">api_key</td><td>string</td><td> You can get a key from settings(Login>Menu>Settings>API Keys) in your tookan account. Or <a href="https://app.tookanapp.com/#/app/settings/apikey">click here</a> to get API key</td></tr>
<tr><td style="padding-left: 0;" colspan="2">template_name*</td><td>string</td><td>Name of the template with spaces replaced by underscore.</td></tr>
<tr><td style="padding-left: 0;" colspan="2">pickup_latitude</td><td>string</td><td>Pickup Latitude.</td></tr>
<tr><td style="padding-left: 0;" colspan="2">pickup_longitude</td><td>string</td><td>Pickup Longitude.</td></tr>
<tr><td style="padding-left: 0;" colspan="2">delivery_latitude</td><td>string</td><td>Delivery Latitude.</td></tr>
<tr><td style="padding-left: 0;" colspan="2">delivery_longitude</td><td>string</td><td>Delivery Longitude.</td></tr>
<tr><td style="padding-left: 0;" colspan="2">formula_type</td><td>number</td><td>Set 1 for Earning, 2 for Pricing and 3 for Both.</td></tr>
<tr><td style="padding-left: 0;" colspan="2">map_keys</td><td>object</td><td>This contains 'map_plan_type' which is to be set as 1 and 'google_api_key' which should be your Google Api Key.</td></tr>
</table>

+ Request (application/json)

        { 
            "template_name": "Order_Details", 
            "pickup_longitude": "75.78459531068802", 
            "pickup_latitude": "30.878816612716466", 
            "api_key": "YOUR_API_KEY", 
            "delivery_latitude": "30.911338899788063", 
            "delivery_longitude": "75.79901956021786", 
            "formula_type": 3, 
            "map_keys":{
                "map_plan_type":1,
                "google_api_key":"GOOGLE_API_KEY"
                } 
            }

+ Response 200 (application/json)

        {
"message":"Successful",
"status":200,
"data":{
"distance":1122,
"time":210,
"formula_fields":{
"1":[
{
"display_name":"Base Fare",
"key":"base_fare",
"type":1,
"surge":"1.00",
"multiplying_value":"40.00",
"expression":"40.00*1.00",
"sum":40
},
{
"display_name":"Duration Fare",
"key":"duration_charge",
"type":1,
"start_value":0,
"surge":"1.00",
"multiplying_value":"0.00",
"expression":"0.00*1.00*({{{total_time_in_seconds}}}/60-0)",
"sum":0
},
{
"display_name":"Waiting Fare",
"key":"waiting_charge",
"type":1,
"start_value":"0",
"multiplying_value":"0.00",
"surge":"1.00",
"expression":"0.00*1.00*({{{waiting_time_in_seconds}}}/60-0)",
"sum":0
},
{
"display_name":"Distance Fare",
"key":"distance_fare",
"type":1,
"start_value":"2.00",
"surge":"1.00",
"multiplying_value":"7.50",
"expression":"7.50*1.00*({{{job_distance}}}/1000-2.00)",
"sum":0
},
{
"display_name":"Deduction",
"key":"commission",
"type":1,
"multiplying_value":"30.00",
"expression":"30.00/100*(-1)*({{{{distance_fare}}}}+{{{{duration_charge}}}}+{{{{base_fare}}}}+{{{{waiting_charge}}}})",
"sum":-12
}
],
"2":[
{
"display_name":"Base Fare",
"key":"base_fare",
"type":1,
"surge":"1.00",
"multiplying_value":"40.00",
"expression":"40.00*1.00",
"sum":40
},
{
"display_name":"Duration Fare",
"key":"duration_charge",
"type":1,
"start_value":"0.00",
"surge":"1.00",
"multiplying_value":"0.00",
"expression":"0.00*1.00*({{{total_time_in_seconds}}}/60-0.00)",
"sum":0
},
{
"display_name":"Waiting Fare",
"key":"waiting_charge",
"type":1,
"start_value":"0.00",
"multiplying_value":"0.00",
"surge":"1.00",
"expression":"0.00*1.00*({{{waiting_time_in_seconds}}}/60-0.00)",
"sum":0
},
{
"display_name":"Distance Fare",
"key":"distance_fare",
"type":1,
"start_value":"1.50",
"surge":"1.00",
"multiplying_value":"15.00",
"expression":"15.00*1.00*({{{job_distance}}}/1000-1.50)",
"sum":0
},
{
"display_name":"Deduction",
"key":"commission",
"type":1,
"multiplying_value":"0.00",
"expression":"0.00/100*(-1)*({{{{distance_fare}}}}+{{{{duration_charge}}}}+{{{{base_fare}}}}+{{{{waiting_charge}}}})",
"sum":0
}
]
},
"total_fields":{
"1":28,
"2":40
}
}
}

# Group Agent

## Get All Agents [/get_all_fleets]

### Get All Agents  [POST]

This API is used to get all the Agents/drivers/fleets information with respect to a location. The response array contains a status key for each of the fleet, which shows the current status of the fleet - 0 for available, 1 for offline and 2 for busy, taking into account the location, connectivity, ON-Duty/OFF-Duty status and if they are presently working a task.

Request Body Parameters:
<table>
<tr><td style="padding-left: 0;" colspan="2"><strong>Name</strong><td><strong>Type</strong></td><td><strong>Description</strong></td></tr>
<tr><td style="padding-left: 0;" colspan="2">api_key<td>string</td><td>You can get a key from settings(Login>Menu>Settings>API Keys) in your tookan account. Or <a href="https://app.tookanapp.com/#/app/settings/apikey">click here</a> to get API key</td></tr>
<tr><td style="padding-left: 0;" colspan="2">tags<td>string</td><td>You can pass the tags, comma separated, if you want to filter the list of agents via tags.</td></tr>
<tr><td style="padding-left: 0;" colspan="2">name<td>string</td><td>Enter name, if you want to get list of agents matching this name string.</td></tr>
<tr><td style="padding-left: 0;" colspan="2">fleet_ids<td>array</td><td>You can specify array of fleet ids for getting information of only those fleets in response.</td></tr>
<tr><td style="padding-left: 0;" colspan="2">include_any_tag<td>number</td><td>Provide this key along with tags key in request body. Set value of this key to 1 if you want to agents having any of the tags provided in tags key, else set value of this key to 0 if you want the list of agents having all the tags you have provided in request body.</td></tr>
<tr><td style="padding-left: 0;" colspan="2">status<td>number</td><td>Pass 0 for getting agents who are free and Pass 1 for getting agents who are busy.</td></tr>
<tr><td style="padding-left: 0;" colspan="2">fleet_type<td>number</td><td>Pass 1 for getting agents with fleet type "capative", Pass 2 for getting agents with fleet type "freelancer"</td></tr>
<tr><td style="padding-left: 0;" colspan="2">include_team_id<td>number</td><td>Pass 1 for getting agents with team id , Pass 0 for getting agents without team id </td></tr>
<tr><td style="padding-left: 0;" colspan="2">region_ids<td>string</td><td>region ids are the geofence ids , use these ids to get the fleets of that perticular regionn only , go to setings->geofence to get the region ids .</td></tr>
<tr><td style="padding-left: 0;" colspan="2">include_rule<td>string</td><td>Pass 1 for getting Agent's Rule_id in the response body. </td></tr>
<tr><td style="padding-left: 0;" colspan="2">include_regions<td>string</td><td>Pass 1 for getting Agent's Assigned Region in the response body. </td></tr>
</table>


+ Request (application/json)

           {
            "api_key": "2b997be77e2becfd4c66426ef504",
            "tags": "mini,suv",
            "name": "manish",
            "fleet_ids": [49322, 42947],
            "include_any_tag": 1,
            "status": 0,
            "fleet_type": 1,
            "include_team_id": 0,
            "include_rule": 1, 
            "include_regions": 1
    }



+ Response 200 (application/json)

        {
            "message": "Successful",
            "status": 200,
            "data": [
        {
            "fleet_id": 15500,
            "device_type": 3,
            "total_rating": 50,
            "total_rated_tasks": 10,
            "is_active": 1,
            "has_gps_accuracy": 1,
            "username": "manish",
            "name": "manish",
            "login_id": "mannish",
            "transport_type": 1,
            "transport_desc": "Swift",
            "license": "123123",
            "email": "manish.sharma@tookanapp.com",
            "phone": "+917087034232",
            "battery_level": 20,
            "registration_status": 1,
            "location_update_datetime":"2017-05-25T19:27:04.000Z",
            "latitude": "30.755838886863323",
            "is_available": 0,
            "longitude": "76.64949079051301",
            "tags": "mini,suv",
            "fleet_thumb_image": "https://tookan.s3.amazonaws.com/fleet_thumb_profile/thumb-QxUG1536819089055-6MwT1536819087649nature31.jpg",
            "fleet_image": "https://tookan.s3.amazonaws.com/fleet_profile/6MwT1536819087649-nature31.jpg",
            "status": 0,
            "timezone": "-330",
            "fleet_type": 1,
            "rule_id": 317932, 
            "region_ids": "27957,27957"
        }
        ]
        }

## Add Agent [/add_agent]

### Add Agent  [POST]

This API is used to register a new Agent in your account.

Request Body Parameters:
<table>
<tr><td style="padding-left: 0;" colspan="2"><strong>Name</strong><td><strong>Type</strong></td><td><strong>Description</strong></td></tr>
<tr><td style="padding-left: 0;" colspan="2">api_key</td><td>string</td><td> You can get a key from settings(Login>Menu>Settings>API Keys) in your tookan account. Or <a href="https://app.tookanapp.com/#/app/settings/apikey">click here</a> to get API key</td></tr>
<tr><td style="padding-left: 0;" colspan="2">email</td><td>string</td><td>email of your agent.</td></tr>
<tr><td style="padding-left: 0;" colspan="2">phone*</td><td>string</td><td>add the phone number of the agent. He will get a notification with the links and credentials to download the app</td></tr>
<tr><td style="padding-left: 0;" colspan="2">transport_type</td><td>string</td><td> Send 1 for Car, 2 for Motor Cycle, 3 for Bicycle, 4 for Scooter, 5 for Foot, 6 for Truck</td></tr>
<tr><td style="padding-left: 0;" colspan="2">transport_desc</td><td>string</td><td></td></tr>
<tr><td style="padding-left: 0;" colspan="2">license</td><td>string</td><td></td></tr>
<tr><td style="padding-left: 0;" colspan="2">color</td><td>string</td><td></td></tr>
<tr><td style="padding-left: 0;" colspan="2">timezone*</td><td>string</td><td></td></tr>
<tr><td style="padding-left: 0;" colspan="2">team_id*</td><td>string</td><td>You need to pass a team of which the agent will be a part of. Team Id will be visible on the All teams page</td></tr>
<tr><td style="padding-left: 0;" colspan="2">password*</td><td>string</td><td>You can set the password yourself, or leave it empty, in which case the system will auto-generate the password</td></tr>
<tr><td style="padding-left: 0;" colspan="2">username*</td><td>string</td><td>Unique username, which the agent will use to login to the Tookan Agent App</td></tr>
<tr><td style="padding-left: 0;" colspan="2">first_name*</td><td>string</td><td></td></tr>
<tr><td style="padding-left: 0;" colspan="2">last_name</td><td>string</td><td></td></tr>
<tr><td style="padding-left: 0;" colspan="2">rule_id</td><td>number</td><td>You can find rule id in the Access Control page for the agents named as Role ID.</td></tr>
<tr><td style="padding-left: 0;" colspan="2">fleet_type</td><td>number</td><td>Send 1 for captive agents and 2 for freelancer agents. Default value is 1.</td></tr>
<tr><td style="padding-left: 0;" colspan="2">profile_url</td><td>string</td><td>Send url of agent profile image.</td></tr>
<tr><td style="padding-left: 0;" colspan="2">profile_thumb_url</td><td>string</td><td>Send url of agent  profile Thumbnail.</td></tr>
<tr><td style="padding-left: 0;" colspan="2">region_ids</td><td>string</td><td>Enter the Region id to Assign the Geofence to the Agent</td></tr>

</table>

+ Request (application/json)

            {
              "api_key": "1fc5defefb668fcf820bac29e7b7aa05",
              "email": "abc@xyz.com",
              "phone": "919999999999",
              "transport_type": "1",
              "transport_desc": "auto",
              "license": "demo",
              "color": "blue",
              "timezone": "-330",
              "team_id": "Your Team ID",
              "password": "abcdefg",
              "username": "username",
              "first_name": "Decimate",
              "last_name": "abc",
              "rule_id":123,
              "profile_url" : "https://tookan.s3.amazonaws.com/fleet_profile/user.png",
              "profile_thumb_url" : "https://tookan.s3.amazonaws.com/fleet_thumb_profile/user.png",
              "region_ids": "123,5353"
            }
+ Response 200 (application/json)

            {
                "message": "Successful",
                "status": 200,
                "data": {}
            }
            
## Edit Agent [/edit_agent]

### Edit Agent  [POST]

This API is used to update particular agent of your account.

Request Body Parameters:
<table>
<tr><td style="padding-left: 0;" colspan="2"><strong>Name</strong><td><strong>Type</strong></td><td><strong>Description</strong></td></tr>
<tr><td style="padding-left: 0;" colspan="2">api_key</td><td>string</td><td> You can get a key from settings(Login>Menu>Settings>API Keys) in your tookan account. Or <a href="https://app.tookanapp.com/#/app/settings/apikey">click here</a> to get API key</td></tr>
<tr><td style="padding-left: 0;" colspan="2">fleet_id*</td><td>string</td><td>Agent Id of your agent. You will get this from agent list in dashboard.</td></tr>
<tr><td style="padding-left: 0;" colspan="2">email</td><td>string</td><td>Email of your agent.</td></tr>
<tr><td style="padding-left: 0;" colspan="2">phone</td><td>string</td><td>Add the phone number of the agent.</td></tr>
<tr><td style="padding-left: 0;" colspan="2">transport_type</td><td>string</td><td> Send 1 for Car, 2 for Motor Cycle, 3 for Bicycle, 4 for Scooter, 5 for Foot, 6 for Truck</td></tr>
<tr><td style="padding-left: 0;" colspan="2">transport_desc</td><td>string</td><td></td></tr>
<tr><td style="padding-left: 0;" colspan="2">license</td><td>string</td><td></td></tr>
<tr><td style="padding-left: 0;" colspan="2">color</td><td>string</td><td></td></tr>
<tr><td style="padding-left: 0;" colspan="2">timezone</td><td>string</td><td></td></tr>
<tr><td style="padding-left: 0;" colspan="2">team_id</td><td>string</td><td>You need to pass a team of which the agent will be a part of. Team Id will be visible on the All teams page</td></tr>
<tr><td style="padding-left: 0;" colspan="2">password</td><td>string</td><td>You can set the password yourself, or leave it empty, in which case the system will auto-generate the password</td></tr>
<tr><td style="padding-left: 0;" colspan="2">first_name</td><td>string</td><td></td></tr>
<tr><td style="padding-left: 0;" colspan="2">last_name</td><td>string</td><td></td></tr>
<tr><td style="padding-left: 0;" colspan="2">rule_id</td><td>number</td><td>You can find rule id in the Access Control page for the agents named as Role ID.</td></tr>
<tr><td style="padding-left: 0;" colspan="2">fleet_type</td><td>number</td><td>Send 1 for captive agents and 2 for freelancer agents. Default value is 1.</td></tr>
<tr><td style="padding-left: 0;" colspan="2">profile_url</td><td>string</td><td>Send url of agent profile image.</td></tr>
<tr><td style="padding-left: 0;" colspan="2">profile_thumb_url</td><td>string</td><td>Send url of agent  profile Thumbnail.</td></tr>
<tr><td style="padding-left: 0;" colspan="2">region_ids</td><td>string</td><td>Assign a new Region id or delete the existing Region id aligned with the Agent</td></tr>
</table>

+ Request (application/json)

            {
              "api_key": "1fc5defefb668fcf820bac29e7b7aa05",
              "fleet_id": "12",
              "email": "abc@xyz.com",
              "phone": "919999999999",
              "transport_type": "1",
              "transport_desc": "auto",
              "license": "demo",
              "color": "blue",
              "timezone": "-330",
              "team_id": "1",
              "password": "abcdefg",
              "first_name": "Decimate",
              "last_name": "abc",
              "rule_id":123,
              "profile_url" : "https://tookan.s3.amazonaws.com/fleet_profile/user.png",
              "profile_thumb_url" : "https://tookan.s3.amazonaws.com/fleet_thumb_profile/user.png",
              "region_ids": "123,5353"

            }
+ Response 200 (application/json)

            {
                "message": "Successful",
                "status": 200,
                "data": {}
            }
            
## Block/Unblock Agent [/block_and_unblock_fleet]

### Block/Unblock Agent [POST]

This API is used to block/unblock the Agent in your account.

Request Body Parameters:
<table>
<tr><td style="padding-left: 0;" colspan="2"><strong>Name</strong><td><strong>Type</strong></td><td><strong>Description</strong></td></tr>
<tr><td style="padding-left: 0;" colspan="2">api_key</td><td>string</td><td> You can get a key from settings(Login>Menu>Settings>API Keys) in your Tookan account. Or <a href="https://app.tookanapp.com/#/app/settings/apikey">click here</a> to get API Key.</td></tr>
<tr><td style="padding-left: 0;" colspan="2">fleet_id*</td><td>string</td><td>Enter fleet ids of the agents (comma sperated string).</td></tr>
<tr><td style="padding-left: 0;" colspan="2">block_status*</td><td>number</td><td>Enter 0 or 1. 0 for block and 1 for unblock the agent.</td></tr>
<tr><td style="padding-left: 0;" colspan="2">block_reason</td><td>text (optional)</td><td>Enter block reason</td></tr>
<tr><td style="padding-left: 0;" colspan="2">unblock_on_date</td><td>date (optional)</td><td>Agent will be automatically unblocked on this date. If not entered, the agent will remain blocked forever. Date format must be - 'YYYY-MM-DD'.</td></tr>
</table>

+ Request (application/json)

            {
              "api_key": "1fc5defefb668fcf820bac29e7b7aa05",
              "fleet_id": "60048,60047",
              "block_status":0,
              "block_reason":"agent not available for some time sapin",
              "unblock_on_date" : "2020-09-28"
            }
+ Response 200 (application/json)

            {
                "message": "ACTION_COMPLETE",
                "status": 200,
                "data": {}
            }

## Delete Agent [/delete_fleet_account]

### Delete Agent  [POST]

This API is used to delete the Agent in your account.

Request Body Parameters:
<table>
<tr><td style="padding-left: 0;" colspan="2"><strong>Name</strong><td><strong>Type</strong></td><td><strong>Description</strong></td></tr>
<tr><td style="padding-left: 0;" colspan="2">api_key</td><td>string</td><td> You can get a key from settings(Login>Menu>Settings>API Keys) in your Tookan account. Or <a href="https://app.tookanapp.com/#/app/settings/apikey">click here</a> to get API key.</td></tr>
<tr><td style="padding-left: 0;" colspan="2">fleet_id*</td><td>number</td><td>Enter fleet id of the agent.</td></tr>
</table>

+ Request (application/json)

            {
              "api_key": "1fc5defefb668fcf820bac29e7b7aa05",
              "fleet_id": "49644"
            }
+ Response 200 (application/json)

            {
                "message": "The Agent 'John' has been deleted.",
                "status": 200,
                "data": {}
            }

## View Agent Profile [/view_fleet_profile]

### View Agent Profile [POST]

This API is used to view agent's profile.

Request Body Parameters:

<table>
<tr><td style="padding-left: 0;" colspan="2"><strong>Name</strong><td><strong>Type</strong></td><td><strong>Description</strong></td></tr>
<tr><td style="padding-left: 0;" colspan="2">api_key</td><td>string</td><td> You can get a key from settings(Login>Menu>Settings>API Keys) in your tookan account. Or <a href="https://app.tookanapp.com/#/app/settings/apikey">click here</a> to get API key.</td></tr>
<tr><td style="padding-left: 0;" colspan="2">fleet_id*</td><td>string</td><td>You can get it from your tookan account or you can use 'Get All Agents' API for retrieving list from your account.</td></tr>
</table>

+ Request (application/json)

        {
            "api_key":"e1ecdd2fd7aaa26547e195b459a7c2d2", 
            "fleet_id":17846
        }

+ Response 200 (application/json)

        {
            "message":"Successful",
            "status":200,
            "data":{
                "fleet_details":[
                    {
                        "fleet_id":17846,
                        "is_deleted":0,
                        "dispatcher_id":null,
                        "email":"guri@tookanapp.com",
                        "login_id":"guri",
                        "tags":"basic",
                        "access_token":"f788e6872919f82df609e98f3926ead0",
                        "first_name":"Guri",
                        "last_name":"",
                        "username":"Guri ",
                        "password":"e10adc3949ba59abbe56e057f20f883e",
                        "phone":"+919988552266",
                        "lang":"en",
                        "home_address":null,
                        "home_latitude":null,
                        "home_longitude":null,
                        latitude":"30.71857504083842",
                        "longitude":"76.81032425731124",
                        "bearing":null,
                        "location_update_datetime":"2017-05-25T19:27:04.000Z",
                        "last_updated_local_time":null,
                        "fleet_image":"undefined",
                        "fleet_thumb_image":"https://tookan.s3.amazonaws.com/fleet_thumb_profile/thumb-J1In1494324987908-UF1V1494324987134laundry1.jpg",
                        "device_type":1,
                        "device_token":null,
                        "voice_token":null,
                        "device_os":"iOS",
                        "device_desc":"10.3.1 IOS iPhone 82",
                        "has_gps_accuracy":1,
                        "has_network":1,
                        "has_mock_loc":1,
                        "battery_level":16,
                        "imei_number":null,
                        "app_versioncode":"300",
                        "store_version":"3.0",
                        "verification_token":null,
                        "registration_status":1,
                        "transport_type":6,
                        "transport_desc":"2016 , honda",
                        "license":"HP 22 1234",
                        "color":"Red",
                        "user_id":1717,
                        "is_active":1,
                        "is_available":0,
                        "is_bcrypt":0,
                        "status":0,
                        "total_rating":222,
                        "total_rated_tasks":49,
                        "noti_tone":"ping.caf",
                        "creation_datetime":"2017-01-25T07:23:25.000Z",
                        "last_login_datetime":"2017-05-25T19:09:34.000Z",
                        "timezone":"-330",
                        "external_fleet_id":null,
                        "ignore_distance_check":0,
                        "disable_request":0,
                        "terms_and_conditions":0,
                        "is_first_time_login":1,
                        "monibyte_id":null,
                        "total_capacity": 9999,
                        "available_capacity": 4999
                    }
                ],
                "jobs":[
                    {
                        "email":"guri@tookanapp.com",
                        "phone":"+919988552266",
                        "fleet_id":17846,
                        "fleet_name":"Guri ",
                        "fleet_image":"undefined",
                        "fleet_thumb_image":"https://tookan.s3.amazonaws.com/fleet_thumb_profile/thumb-J1In1494324987908-UF1V1494324987134laundry1.jpg",
                        "job_pickup_name":"ankit",
                        "job_pickup_phone":"+91 70426 15785",
                        "job_latitude":"30.7188157",
                        "job_longitude":"76.8105657",
                        "job_address":"Plot No. 5, Madhya Marg, Sector 28 B, Chandigarh, India, 160028",
                        "job_status":0,
                        "job_description":"",
                        "has_pickup":1,
                        "pickup_delivery_relationship":"28132415096208382653078",
                        "team_id":0,
                        "job_pickup_datetime":"11/02/2017 04:25 pm",
                        "job_id":281324,
                        "job_delivery_datetime":"0000-00-00 00:00:00",
                        "job_type":0,
                        "job_pickup_latitude":"30.7188157",
                        "job_pickup_longitude":"76.8105657",
                        "job_pickup_address":"Plot No. 5, Madhya Marg, Sector 28 B, Chandigarh, India, 160028",
                        "job_pickup_email":"ankit@tookanapp.com",
                        "customer_id":6532,
                        "customer_username":"-",
                        "customer_phone":"-",
                        "customer_email":"-"
                    }
                ]
            }
        }

## View Agent Stripe Details [/get_fleet_stripe_details]

### View Agent Stripe Details [POST]

This API is used to view agent's stripe account details.

Request Body Parameters:

<table>
<tr><td style="padding-left: 0;" colspan="2"><strong>Name</strong><td><strong>Type</strong></td><td><strong>Description</strong></td></tr>
<tr><td style="padding-left: 0;" colspan="2">api_key</td><td>string</td><td> You can get a key from settings(Login>Menu>Settings>API Keys) in your tookan account. Or <a href="https://app.tookanapp.com/#/app/settings/apikey">click here</a> to get API key.</td></tr>
<tr><td style="padding-left: 0;" colspan="2">fleet_id*</td><td>string</td><td>You can get it from your tookan account or you can use 'Get All Agents' API for retrieving list from your account.</td></tr>
</table>

+ Request (application/json)

        {
            "api_key":"e1ecdd2fd7aaa26547e195b459a7c2d2", 
            "fleet_id":17846
        }

+ Response 200 (application/json)

        {
            "message":"Successful",
            "status":200,
            "data":{
                "legal_entity": {
            "additional_owners": [],
            "address": {
                "city": "Toronto",
                "line1": "",
                "line2": "",
                "postal_code": "646565",
                "state": ""
            },
            "business_name": "Ruhan",
            "dob": {
                "day": 5,
                "month": 9,
                "year": 1994
            },
            "first_name": "Nadeem",
            "last_name": "Khan",
            "personal_address": {
                "city": null,
                "line1": null,
                "line2": null,
                "postal_code": null,
                "state": null
            },
            "type": "company",
            "verification": {
                "details": null,
                "details_code": null,
                "document": null,
                "document_back": null,
                "status": 3
            },
            "business_tax_id": 0
        },
        "bank_details": {
            "country": "US",
            "currency": "usd",
            "account_number": "6789",
            "routing_number": "110000000"
        },
        "fields_needed": [],
        "account_id": ""
            }
        }        
## Update Agent Tags [/update_fleet_tags]

### Update Agent Tags [POST]

This API is used to update agent's tags.

Request Body Parameters:

<table>
<tr><td style="padding-left: 0;" colspan="2"><strong>Name</strong><td><strong>Type</strong></td><td><strong>Description</strong></td></tr>
<tr><td style="padding-left: 0;" colspan="2">api_key</td><td>string</td><td> You can get a key from settings(Login>Menu>Settings>API Keys) in your tookan account. Or <a href="https://app.tookanapp.com/#/app/settings/apikey">click here</a> to get API key</td></tr>
<tr><td style="padding-left: 0;" colspan="2">fleet_id*</td><td>string</td><td>You can get it from your tookan account or you can use 'Get All Agents' API for retrieving list from your account.</td></tr>
<tr><td style="padding-left: 0;" colspan="2">tags*</td><td>string</td><td>Comma Separated Values of tags to be assigned to the agent.</td></tr>
</table>

+ Request (application/json)


        {
            "api_key":"e1ecdd2fd7aaa26547e195b459a7c2d2", 
            "fleet_id":17846,
            "tags":"basic,premium"
        }

+ Response 200 (application/json)


        {
            "message": "Successful",
            "status": 200,
            "data": {}
        }

## Get Agent Tags [/get_fleet_tags]

### Get Agent Tags [POST]

This API is used to view the list of agent tags.

Request Body Parameters:

<table>
<tr><td style="padding-left: 0;" colspan="2"><strong>Name</strong><td><strong>Type</strong></td><td><strong>Description</strong></td></tr>
<tr><td style="padding-left: 0;" colspan="2">api_key</td><td>string</td><td> You can get a key from settings(Login>Menu>Settings>API Keys) in your tookan account. Or <a href="https://app.tookanapp.com/#/app/settings/apikey">click here</a> to get API key.</td></tr>
<tr><td style="padding-left: 0;" colspan="2">fleet_id*</td><td>string (optional)</td><td>You can get it from your tookan account or you can use 'Get All Agents' API for retrieving list from your account.</td></tr>
<tr><td style="padding-left: 0;" colspan="2">team_id</td><td>string (optional)</td><td>This is the Unique id of every team. You can get it from the dashBoard. More>teams>respective id of the team will displayed.</td></tr>
</table>

+ Request (application/json)

         {
            "api_key":"e1ecdd2fd7aaa26547e195b459a7c2d2", 
            "fleet_id":17846
        }
        
+ Response 200 (application/json)
    
        {
            "message": "Successful",
            "status": 200,
            "data": [
                "premium",
                "basic"
            ]
        }

## Get Agent Logs [/get_agent_duty_logs]

### Get Agent Logs [POST]

This API is used to get Agent logs. It returns details about when your agents went offline and online.

Request Body Parameters:
<table>
<tr><td style="padding-left: 0;" colspan="2"><strong>Name</strong><td><strong>Type</strong></td><td><strong>Description</strong></td></tr>
<tr><td style="padding-left: 0;" colspan="2">api_key</td><td>string</td><td> You can get a key from settings(Login>Menu>Settings>API Keys) in your Tookan account. Or <a href="https://app.tookanapp.com/#/app/settings/apikey">click here</a> to get API key.</td></tr>
<tr><td style="padding-left: 0;" colspan="2">date*</td><td>date</td><td>Enter the date for which you want to get the agent logs.</td></tr>
<tr><td style="padding-left: 0;" colspan="2">team_ids*</td><td>array(optional)</td><td>Enter the team ids for which you want to get the agent logs.</td></tr>
</table>

+ Request (application/json)

        {
            "api_key":"2b997be77e2cc22becfd4c66426ef504",
            "date":"2017-01-25",
            "team_ids": ["123","456"]
        }

+ Response 200 (application/json)

        {
            "message":"Successful",
            "status":200,
            "data":[
            {     
                "fleet_id":17847,
                "first_name":"rakshit",
                "last_name":"",
                "email":"rakshit@tookanapp.com",
                "phone":"+917042615785",
                "imei_number":"861116036220459",
                "status":1,
                "creation_datetime":"2017-01-25T11:19:12.000Z",
                "team_id": 123,
                "team_name": "Team A"
            }, 
            {
                "fleet_id":17847,
                "first_name":"rakshit",
                "last_name":"",
                "email":"rakshit@tookanapp.com",
                "phone":"+917042615785",
                "imei_number":"861116036220459",
                "status":0,
                "creation_datetime":"2017-01-25T15:16:50.000Z",
                "team_id": 456,
                "team_name": "Team 8"
            }]
        }

## Get Agent Location [/get_fleet_location]

### Get Agent Location [POST]

This API is used to get an agent's location coordinates.

Request Body Parametrs:

<table>
<tr><td style="padding-left: 0;" colspan="2"><strong>Name</strong><td><strong>Type</strong></td><td><strong>Description</strong></td></tr>
<tr><td style="padding-left: 0;" colspan="2">api_key</td><td>string</td><td> You can get a key from settings(Login>Menu>Settings>API Keys) in your tookan account. Or <a href="https://app.tookanapp.com/#/app/settings/apikey">click here</a> to get API key</td></tr>
<tr><td style="padding-left: 0;" colspan="2">fleet_id*</td><td>string (optional)</td><td>You can get it from your tookan account or you can use 'Get All Agents' API for retrieving list from your account.</td></tr>
</table>

+ Request (application/json)


        {
            "api_key":"e1ecdd2fd7aaa26547e195b459a7c2d2", 
            "fleet_id":17846
        }

+ Response 200 (application/json)


        {
            "message": "Successful",
            "status": 200,
            "data": [
                {
                    "latitude": "30.71857504083842",
                    "longitude": "76.81032425731124"
                }
            ]
        }

## Send Notification [/send_notification]

### Send Notification  [POST]

This API is used to send push notifications to logged in agent(s). Same message cannot be sent to same agent again in same day. Maximum push notification limit per agent is:
<ul><li>50 notifications per day.</li>
<li>150 notifications per week.</li>
<li>300 notifications per month.</li></ul>

Request Body Parameters:
<table>
<tr><td style="padding-left: 0;" colspan="2"><strong>Name</strong><td><strong>Type</strong></td><td><strong>Description</strong></td></tr>
<tr><td style="padding-left: 0;" colspan="2">api_key</td><td>string</td><td> You can get a key from settings(Login>Menu>Settings>API Keys) in your Tookan account. Or <a href="https://app.tookanapp.com/#/app/settings/apikey">click here</a> to get API key.</td></tr>
<tr><td style="padding-left: 0;" colspan="2">fleet_ids*</td><td>array</td><td>Agent Id of your agent(s). You will get this from agent list in dashboard.</td></tr>
<tr><td style="padding-left: 0;" colspan="2">message*</td><td>string</td><td>Message that you want to send in push. Minimun character length should be 4 and maximum 160</td></tr>
</table>

+ Request (application/json)

            {
              "api_key": "1fc5defefb668fcf820bac29e7b7aa05",
              "fleet_ids": [1112,1011],
              "message" : "Welcome.."
            }
+ Response 200 (application/json)

            {
            "message": "Successful",
            "status": 200,
            "data": {
                     "total_fleets": 2,
                     "valid_fleets": 2,
                     "logged_in_fleets": 2,
                     "logged_in_fleet_ids": [1001, 1010],
                     "push_limit_reached_fleets": [],
                     "duplicate_push_fleets": []
                     }
            }

## Get Agent Schedule [/get_fleets_availability]

### Get Agent Schedule  [POST]

This API is used to get the agent schedule for a particular date.
<ul><li>available_status: 1 defines agent is not available for that particular time.</li>
<li>available_status: 0 defines agent is available for that particular time.</li></ul>

Request Body Parameters:
<table>
<tr><td style="padding-left: 0;" colspan="2"><strong>Name</strong><td><strong>Type</strong></td><td><strong>Description</strong></td></tr>
<tr><td style="padding-left: 0;" colspan="2">api_key</td><td>string</td><td> You can get a key from settings(Login>Menu>Settings>API Keys) in your tookan account. Or <a href="https://app.tookanapp.com/#/app/settings/apikey">click here</a> to get API key</td></tr>
<tr><td style="padding-left: 0;" colspan="2">local_date_time*</td><td>date</td><td>Enter date for which you want to get the agent schedule</td></tr>
<tr><td style="padding-left: 0;" colspan="2">limit</td><td>number</td><td>It used to get the number of agents from total agents. If the value is 0, it returns first 10 results. If it is 1, it returns next 10 records and so on.</td></tr>
</table>

+ Request (application/json)

        {
          "api_key": "1fc5defefb668fcf820bac29e7b7aa05",
          "local_date_time": "2018-04-19",
          "limit" : 6
        }
+ Response 200 (application/json)

        {
        "message": "Successful",
        "status": 200,
        "data": {
            "date_time": "2018-04-19T00:00:00.000Z",
            "day_id": 4,
            "fleets": [
                {
                    "fleet_id": 85772,
                    "username": "Manish",
                    "is_available": 1,
                    "team_id": 7780,
                    "team_name": "Team A",
                    "fleet_image": "https://tookan.s3.amazonaws.com/fleet_profile/user.png",
                    "fleet_thumb_image": "https://tookan.s3.amazonaws.com/fleet_thumb_profile/user.png",
                    "slots": [
                        {
                            "slot_timming": "00:00",
                            "available_status": 1,
                            "jobs": [],
                            "slot_start_time": "2018-04-19T00:00:00.000Z",
                            "slot_end_time": "2018-04-19T00:15:00.000Z"
                        },
                        {
                            "slot_timming": "00:15",
                            "available_status": 1,
                            "jobs": [],
                            "slot_start_time": "2018-04-19T00:15:00.000Z",
                            "slot_end_time": "2018-04-19T00:30:00.000Z"
                        },
                        {
                            "slot_timming": "00:30",
                            "available_status": 1,
                            "jobs": [],
                            "slot_start_time": "2018-04-19T00:30:00.000Z",
                            "slot_end_time": "2018-04-19T00:45:00.000Z"
                        },
                        {
                            "slot_timming": "00:45",
                            "available_status": 1,
                            "jobs": [],
                            "slot_start_time": "2018-04-19T00:45:00.000Z",
                            "slot_end_time": "2018-04-19T01:00:00.000Z"
                        },
                        {
                            "slot_timming": "01:00",
                            "available_status": 1,
                            "jobs": [],
                            "slot_start_time": "2018-04-19T01:00:00.000Z",
                            "slot_end_time": "2018-04-19T01:15:00.000Z"
                        },
                        {
                            "slot_timming": "01:15",
                            "available_status": 1,
                            "jobs": [],
                            "slot_start_time": "2018-04-19T01:15:00.000Z",
                            "slot_end_time": "2018-04-19T01:30:00.000Z"
                        },
                        {
                            "slot_timming": "01:30",
                            "available_status": 1,
                            "jobs": [],
                            "slot_start_time": "2018-04-19T01:30:00.000Z",
                            "slot_end_time": "2018-04-19T01:45:00.000Z"
                        },
                        {
                            "slot_timming": "01:45",
                            "available_status": 1,
                            "jobs": [],
                            "slot_start_time": "2018-04-19T01:45:00.000Z",
                            "slot_end_time": "2018-04-19T02:00:00.000Z"
                        },
                        {
                            "slot_timming": "02:00",
                            "available_status": 1,
                            "jobs": [],
                            "slot_start_time": "2018-04-19T02:00:00.000Z",
                            "slot_end_time": "2018-04-19T02:15:00.000Z"
                        },
                        {
                            "slot_timming": "02:15",
                            "available_status": 1,
                            "jobs": [],
                            "slot_start_time": "2018-04-19T02:15:00.000Z",
                            "slot_end_time": "2018-04-19T02:30:00.000Z"
                        },
                        {
                            "slot_timming": "02:30",
                            "available_status": 1,
                            "jobs": [],
                            "slot_start_time": "2018-04-19T02:30:00.000Z",
                            "slot_end_time": "2018-04-19T02:45:00.000Z"
                        },
                        {
                            "slot_timming": "02:45",
                            "available_status": 1,
                            "jobs": [],
                            "slot_start_time": "2018-04-19T02:45:00.000Z",
                            "slot_end_time": "2018-04-19T03:00:00.000Z"
                        },
                        {
                            "slot_timming": "03:00",
                            "available_status": 1,
                            "jobs": [],
                            "slot_start_time": "2018-04-19T03:00:00.000Z",
                           "slot_end_time": "2018-04-19T03:15:00.000Z"
                        },
                        {
                            "slot_timming": "03:15",
                            "available_status": 1,
                            "jobs": [],
                            "slot_start_time": "2018-04-19T03:15:00.000Z",
                            "slot_end_time": "2018-04-19T03:30:00.000Z"
                        },
                        {
                            "slot_timming": "03:30",
                            "available_status": 1,
                            "jobs": [],
                            "slot_start_time": "2018-04-19T03:30:00.000Z",
                            "slot_end_time": "2018-04-19T03:45:00.000Z"
                        },
                        {
                            "slot_timming": "03:45",
                            "available_status": 1,
                            "jobs": [],
                            "slot_start_time": "2018-04-19T03:45:00.000Z",
                            "slot_end_time": "2018-04-19T04:00:00.000Z"
                        },
                        {
                            "slot_timming": "04:00",
                            "available_status": 1,
                            "jobs": [],
                            "slot_start_time": "2018-04-19T04:00:00.000Z",
                            "slot_end_time": "2018-04-19T04:15:00.000Z"
                        },
                        {
                            "slot_timming": "04:15",
                            "available_status": 1,
                            "jobs": [],
                            "slot_start_time": "2018-04-19T04:15:00.000Z",
                            "slot_end_time": "2018-04-19T04:30:00.000Z"
                        },
                        {
                            "slot_timming": "04:30",
                            "available_status": 1,
                            "jobs": [],
                            "slot_start_time": "2018-04-19T04:30:00.000Z",
                            "slot_end_time": "2018-04-19T04:45:00.000Z"
                        },
                        {
                            "slot_timming": "04:45",
                            "available_status": 1,
                            "jobs": [],
                            "slot_start_time": "2018-04-19T04:45:00.000Z",
                            "slot_end_time": "2018-04-19T05:00:00.000Z"
                        },
                        {
                            "slot_timming": "05:00",
                            "available_status": 1,
                            "jobs": [],
                            "slot_start_time": "2018-04-19T05:00:00.000Z",
                            "slot_end_time": "2018-04-19T05:15:00.000Z"
                        },
                        {
                            "slot_timming": "05:15",
                            "available_status": 1,
                            "jobs": [],
                            "slot_start_time": "2018-04-19T05:15:00.000Z",
                            "slot_end_time": "2018-04-19T05:30:00.000Z"
                        },
                        {
                            "slot_timming": "05:30",
                            "available_status": 1,
                            "jobs": [],
                            "slot_start_time": "2018-04-19T05:30:00.000Z",
                            "slot_end_time": "2018-04-19T05:45:00.000Z"
                        },
                        {
                            "slot_timming": "05:45",
                            "available_status": 1,
                            "jobs": [],
                            "slot_start_time": "2018-04-19T05:45:00.000Z",
                            "slot_end_time": "2018-04-19T06:00:00.000Z"
                        },
                        {
                            "slot_timming": "06:00",
                            "available_status": 1,
                            "jobs": [],
                            "slot_start_time": "2018-04-19T06:00:00.000Z",
                            "slot_end_time": "2018-04-19T06:15:00.000Z"
                        },
                        {
                            "slot_timming": "06:15",
                            "available_status": 1,
                            "jobs": [],
                            "slot_start_time": "2018-04-19T06:15:00.000Z",
                            "slot_end_time": "2018-04-19T06:30:00.000Z"
                        },
                        {
                            "slot_timming": "06:30",
                            "available_status": 1,
                            "jobs": [],
                            "slot_start_time": "2018-04-19T06:30:00.000Z",
                            "slot_end_time": "2018-04-19T06:45:00.000Z"
                        },
                        {
                            "slot_timming": "06:45",
                            "available_status": 1,
                            "jobs": [],
                            "slot_start_time": "2018-04-19T06:45:00.000Z",
                            "slot_end_time": "2018-04-19T07:00:00.000Z"
                        },  
                        {
                            "slot_timming": "07:00",
                            "available_status": 1,
                            "jobs": [],
                            "slot_start_time": "2018-04-19T07:00:00.000Z",
                            "slot_end_time": "2018-04-19T07:15:00.000Z"
                        },  
                        {
                            "slot_timming": "07:15",
                            "available_status": 1,
                            "jobs": [],
                            "slot_start_time": "2018-04-19T07:15:00.000Z",
                            "slot_end_time": "2018-04-19T07:30:00.000Z"
                        },
                        {
                            "slot_timming": "07:30",
                            "available_status": 1,
                            "jobs": [],
                            "slot_start_time": "2018-04-19T07:30:00.000Z",
                            "slot_end_time": "2018-04-19T07:45:00.000Z"
                        },
                        {
                            "slot_timming": "07:45",
                            "available_status": 1,
                            "jobs": [],
                            "slot_start_time": "2018-04-19T07:45:00.000Z",
                            "slot_end_time": "2018-04-19T08:00:00.000Z"
                        },
                        {
                            "slot_timming": "08:00",
                            "available_status": 1,
                            "jobs": [],
                            "slot_start_time": "2018-04-19T08:00:00.000Z",
                            "slot_end_time": "2018-04-19T08:15:00.000Z"
                        },
                        {
                            "slot_timming": "08:15",
                            "available_status": 1,
                            "jobs": [],
                            "slot_start_time": "2018-04-19T08:15:00.000Z",
                            "slot_end_time": "2018-04-19T08:30:00.000Z"
                        },
                        {
                            "slot_timming": "08:30",
                            "available_status": 1,
                            "jobs": [],
                            "slot_start_time": "2018-04-19T08:30:00.000Z",
                            "slot_end_time": "2018-04-19T08:45:00.000Z"
                        },
                        {
                            "slot_timming": "08:45",
                            "available_status": 1,
                            "jobs": [],
                            "slot_start_time": "2018-04-19T08:45:00.000Z",
                            "slot_end_time": "2018-04-19T09:00:00.000Z"
                        },
                        {
                            "slot_timming": "09:00",
                            "available_status": 0,
                            "jobs": [],
                            "slot_start_time": "2018-04-19T09:00:00.000Z",
                            "slot_end_time": "2018-04-19T09:15:00.000Z"
                        },
                        {
                            "slot_timming": "09:15",
                            "available_status": 0,
                            "jobs": [],
                            "slot_start_time": "2018-04-19T09:15:00.000Z",
                            "slot_end_time": "2018-04-19T09:30:00.000Z"
                        },
                        {
                            "slot_timming": "09:30",
                            "available_status": 0,
                            "jobs": [],
                            "slot_start_time": "2018-04-19T09:30:00.000Z",
                            "slot_end_time": "2018-04-19T09:45:00.000Z"
                        },
                        {
                            "slot_timming": "09:45",
                            "available_status": 0,
                            "jobs": [],
                            "slot_start_time": "2018-04-19T09:45:00.000Z",
                            "slot_end_time": "2018-04-19T10:00:00.000Z"
                        },
                        {
                            "slot_timming": "10:00",
                            "available_status": 0,
                            "jobs": [],
                            "slot_start_time": "2018-04-19T10:00:00.000Z",
                            "slot_end_time": "2018-04-19T10:15:00.000Z"
                        },
                        {
                            "slot_timming": "10:15",
                            "available_status": 0,
                            "jobs": [],
                            "slot_start_time": "2018-04-19T10:15:00.000Z",
                            "slot_end_time": "2018-04-19T10:30:00.000Z"
                        },
                        {
                            "slot_timming": "23:45",
                            "available_status": 1,
                            "jobs": [],
                            "slot_start_time": "2018-04-19T23:45:00.000Z",
                            "slot_end_time": "2018-04-20T00:00:00.000Z"
                        }
                    ]
                }
            ]}
        }

## Set Agent Schedule [/set_fleet_day_availability]

### Set Agent Schedule  [POST]

This API is used to set the agent schedule for a particular date.

The period between the start time and end time will be marked as 'Available', while the period between the break start time and break end time will be marked as 'Unavailable'.

Request Body Parameters:
<table>
<tr><td style="padding-left: 0;" colspan="2"><strong>Name</strong><td><strong>Type</strong></td><td><strong>Description</strong></td></tr>
<tr><td style="padding-left: 0;" colspan="2">api_key</td><td>string</td><td> You can get a key from settings(Login>Menu>Settings>API Keys) in your tookan account. Or <a href="https://app.tookanapp.com/#/app/settings/apikey">click here</a> to get API key</td></tr>
<tr><td style="padding-left: 0;" colspan="2">date*</td><td>date</td><td>Enter date for which you want to set the agent schedule</td></tr>
<tr><td style="padding-left: 0;" colspan="2">fleet_ids*</td><td>array</td><td>You can specify array of fleet ids for setting the schedule.</td></tr>
<tr><td style="padding-left: 0;" colspan="2">availability_schedule</td><td>json array</td><td>This array of objects contains the schedules for agents, specifying their availability with start and end times and their non-availability periods defined by break start and end times.</td></tr>
</table>

+ Request (application/json)

        {
          "api_key": "1fc5defefb668fcf820bac29e7b7aa05",
          "date": "2024-06-07",
          "fleet_ids" : [34434,42242,422444]
          "availability_schedule" :[
            {
                "start_time": "08:00",
                "end_time": "19:00",
                "break_start_time": "13:00",
                "break_end_time": "14:00"
            }
          ]
        }
+ Response 200 (application/json)

        {
            "message": "Successful",
            "status": 200,
            "data": {}
        }

## Get Agent Activity Timeline [/fleet_activity_timeline]

### Get Agent Activity Timeline [POST]

This API is used to get an agent's daily activity timeline.

Request Body Parametrs:

<table>
<tr><td style="padding-left: 0;" colspan="2"><strong>Name</strong><td><strong>Type</strong></td><td><strong>Description</strong></td></tr>
<tr><td style="padding-left: 0;" colspan="2">api_key</td><td>string</td><td> You can get a key from settings(Login>Menu>Settings>API Keys) in your tookan account. Or <a href="https://app.tookanapp.com/#/app/settings/apikey">click here</a> to get API key</td></tr>
<tr><td style="padding-left: 0;" colspan="2">fleet_id*</td><td>string</td><td>You can get it from your tookan account or you can use 'Get All Agents' API for retrieving list from your account.</td></tr>
<tr><td style="padding-left: 0;" colspan="2">date*</td><td>date</td><td>Enter the date for which you want to get the agent activity timeline.</td></tr>
<tr><td style="padding-left: 0;" colspan="2">timezone*</td><td> string </td><td>Timezone difference with UTC in minutes for e.g., For PST:<code>+480</code> (PDT: <code>+420</code>),For MST <code>+420</code> (MDT:<code>+360</code>) for EST: <code>+300</code>(EDT:<code>+240</code>), for AEST: <code>-600</code> (AEDT: <code>-660</code>), for IST: <code>-330</code>, for CST: <code>+360</code> (CDT:<code>+300</code>)</td></tr>
<tr><td style="padding-left: 0;" colspan="2">start_time*</td><td>date time</td><td>Start Date time for the date range.</td></tr>
<tr><td style="padding-left: 0;" colspan="2">end_time*</td><td>date time</td><td>End Date time for the date range.</td></tr>



</table>

+ Request (application/json)


        {
            "api_key":"YOUR_API_KEY", 
            "fleet_id":17846,
            "timezone":-330,
            "date":"2018-11-04",
            "start_time":"2018-11-04 00:00:00",
            "end_time":"2018-11-04 23:59:59"
        }

+ Response 200 (application/json)


        {
            "message": "Successful",
            "status": 200,
            "data": [
                       {
                                "end_lat":0,
                                "end_long":0,
                                "distance":0,
                                "seconds":0,
                                "start_time":"2018-11-04T09:50:44.591Z",
                                "end_time":"2018-11-04T09:50:44.591Z",
                                "start_time_stamp":1541325044591,
                                "end_time_stamp":1541325044591,
                                "stop_or_move_flag":2,
                                "tasks":[
                                {
                                "task":1,
                                "job_id":23326865,
                                "type":"state_changed",
                                "description":"Assign Manish30 to task - 7756",
                                "latitude":"30.7187701",
                                "longitude":"76.8106131",
                                "creation_datetime":"2018-11-04T09:32:42.000Z",
                                "timestamp":1541323962000,
                                "extra_fields":null,
                                "label_description":"<span class='assigned'>ASSIGNED</span>Assign Manish30 to task - 7756"
                                },
                                {
                                "task":1,
                                "job_id":23326865,
                                "type":"state_changed",
                                "description":"Accepted at",
                                "latitude":"30.7187561",
                                "longitude":"76.8106254",
                                "creation_datetime":"2018-11-04T09:32:55.000Z",
                                "timestamp":1541323975000,
                                "extra_fields":null,
                                "label_description":"<span class='accepted'>ACCEPTED</span>at"
                                },
                                {
                                "task":1,
                                "job_id":23326865,
                                "type":"state_changed",
                                "description":"Started at",
                                "latitude":"30.7187561",
                                "longitude":"76.8106254",
                                "creation_datetime":"2018-11-04T09:32:58.000Z",
                                "timestamp":1541323978000,
                                "extra_fields":null,
                                "label_description":"<span class='started'>STARTED</span>at"
                                },
                                {
                                "task":1,
                                "job_id":23326865,
                                "type":"state_changed",
                                "description":"Arrived at",
                                "latitude":"30.7187561",
                                "longitude":"76.8106254",
                                "creation_datetime":"2018-11-04T09:33:05.000Z",
                                "timestamp":1541323985000,
                                "extra_fields":null,
                                "label_description":"<span class='arrived'>ARRIVED</span>at"
                                }
                                ]
                                },
                                {
                                "end_lat":30.7187493,
                                "end_long":76.8106329,
                                "distance":0,
                                "seconds":13339,
                                "start_time":"2018-11-04T09:50:44.591Z",
                                "end_time":"2018-11-04T13:33:04.018Z",
                                "start_time_stamp":1541325044591,
                                "end_time_stamp":1541338384018,
                                "stop_or_move_flag":0,
                                "tasks":[
                                {
                                "task":1,
                                "job_id":23326865,
                                "type":"state_changed",
                                "description":"Failed at#-#fh",
                                "latitude":"30.7187501",
                                "longitude":"76.810632",
                                "creation_datetime":"2018-11-04T11:29:53.000Z",
                                "timestamp":1541330993000,
                                "extra_fields":null,
                                "label_description":"<span class='failed'>FAILED</span>at#-#fh"
                                },
                                {
                                "task":1,
                                "job_id":23330155,
                                "type":"state_changed",
                                "description":"Accepted at",
                                "latitude":"30.7187501",
                                "longitude":"76.810632",
                                "creation_datetime":"2018-11-04T11:55:05.000Z",
                                "timestamp":1541332505000,
                                "extra_fields":null,
                                "label_description":"<span class='accepted'>ACCEPTED</span>at"
                                }
                                ]
                                },
                                {
                                "end_lat":30.66253663,
                                "end_long":76.81815817,
                                "distance":6403,
                                "seconds":366.14,
                                "start_time":"2018-11-04T13:33:04.018Z",
                                "end_time":"2018-11-04T13:39:10.158Z",
                                "start_time_stamp":1541338384018,
                                "end_time_stamp":1541338750158,
                                "stop_or_move_flag":1,
                                "tasks":[
                                {
                                "task":1,
                                "job_id":23326866,
                                "type":"state_changed",
                                "description":"Started at",
                                "latitude":"30.67830618",
                                "longitude":"76.80821761",
                                "creation_datetime":"2018-11-04T13:37:03.000Z",
                                "timestamp":1541338623000,
                                "extra_fields":null,
                                "label_description":"<span class='started'>STARTED</span>at"
                                },
                                {
                                "task":1,
                                "job_id":23326866,
                                "type":"state_changed",
                                "description":"Arrived at",
                                "latitude":"30.67679369",
                                "longitude":"76.80901483",
                                "creation_datetime":"2018-11-04T13:37:13.000Z",
                                "timestamp":1541338633000,
                                "extra_fields":null,
                                "label_description":"<span class='arrived'>ARRIVED</span>at"
                                },
                                {
                                "task":1,
                                "job_id":23326866,
                                "type":"state_changed",
                                "description":"Successful at",
                                "latitude":"30.67371866",
                                "longitude":"76.81086691",
                                "creation_datetime":"2018-11-04T13:37:27.000Z",
                                "timestamp":1541338647000,
                                "extra_fields":null,
                                "label_description":"<span class='successful'>SUCCESSFUL</span>at"
                                }
                                ],
                                "polyline":"{pmzDa}xsMYwBjBwDv@_B`E|@zDrCbBlAtAbApA~@lAz@lA|@rA`AbBlAzAhA~AjAfBpAhBrAfBpAbBnAzAfAzAfAlA|@jAz@bBlAjAz@jAz@pA~@vAbAtAbA|AfArA~@jAz@bBlAjAx@hAx@bBlAjAx@bBlApAx@nAn@fB}@bAmAlAwAxAeBtAaBnAyAnAwArAmAjB{@tBm@lBi@fBe@xAa@pBi@zAa@pBi@bBe@hBg@nBi@zBm@dI{BbI_CnHuClHsCzB}@lH_DpHsDrH}DhHyDhH{DzGwD`H{DpAu@jHeEfHgEjGuDvBoA",
                                "last_timestamp":1541338751323,
                                "last_requesttime":1541338754183,
                                "last_task_time":"2018-11-04T13:37:27.000Z"
                        }
                    ]
        }

## Get Agent Ratings And Reviews [/fleet_ratings_and_reviews]

### Get Agent Ratings And Reviews [POST]

This API is used to get  agent's overall rating and reviews given by customers.

Request Body Parametrs:

<table>
<tr><td style="padding-left: 0;" colspan="2"><strong>Name</strong><td><strong>Type</strong></td><td><strong>Description</strong></td></tr>
<tr><td style="padding-left: 0;" colspan="2">api_key</td><td>string</td><td> You can get a key from settings(Login>Menu>Settings>API Keys) in your tookan account. Or <a href="https://app.tookanapp.com/#/app/settings/apikey">click here</a> to get API key</td></tr>
<tr><td style="padding-left: 0;" colspan="2">fleet_ids*</td><td>array</td><td>You can get it from your tookan account or you can use 'Get All Agents' API for retrieving list from your account.</td></tr>



</table>

+ Request (application/json)


        {
            "api_key":"YOUR_API_KEY", 
            "fleet_ids":[17846,23451]
        }

+ Response 200 (application/json)


       {
    "message": "ACTION_COMPLETE",
    "status": 200,
    "data": [
        {
            "fleet_id": 17846,
            "username": "Agent1",
            "customer_ratings": 4,
            "reviews_count": 1,
            "customer_comments": [
                "WELL DONE"
            ],
            "comments_details": [
                {
                    "customer_comment": "Very professional and did a great job.",
                    "customer_username": "Customer1",
                    "utc_date_time": "2018-10-03 19:56:02",
                    "local_date_time": "2018-10-03 12:56:02",
                    "rating": 5
                },
                {
                    "customer_comment": "",
                    "customer_username": "Customer2",
                    "utc_date_time": "2018-03-26 17:26:19",
                    "local_date_time": "2018-03-26 10:26:19",
                    "rating": 3
                }
            ]
        },
        {
            "fleet_id": 23451,
            "username": "Agent46",
            "customer_ratings": 5,
            "reviews_count": 1,
            "customer_comments": [
                "EXCELLENT",
                "GOOD",
                "GOOD"
            ],
            "comments_details": [
                {
                    "customer_comment": "Very professional and did a great job.",
                    "customer_username": "Customer1",
                    "utc_date_time": "2018-10-03 19:56:02",
                    "local_date_time": "2018-10-03 12:56:02",
                    "rating": 5
                },
                {
                    "customer_comment": "",
                    "customer_username": "Customer2",
                    "utc_date_time": "2018-03-26 17:26:19",
                    "local_date_time": "2018-03-26 10:26:19",
                    "rating": 3
                }
            ]
        }
    ]
}
## Get Agent Activity Timeline [/fleet_activity_timeline]

### Get Agent Activity Timeline [POST]

This API is used to get an agent's daily activity timeline.

Request Body Parametrs:

<table>
<tr><td style="padding-left: 0;" colspan="2"><strong>Name</strong><td><strong>Type</strong></td><td><strong>Description</strong></td></tr>
<tr><td style="padding-left: 0;" colspan="2">api_key</td><td>string</td><td> You can get a key from settings(Login>Menu>Settings>API Keys) in your tookan account. Or <a href="https://app.tookanapp.com/#/app/settings/apikey">click here</a> to get API key</td></tr>
<tr><td style="padding-left: 0;" colspan="2">fleet_id*</td><td>string</td><td>You can get it from your tookan account or you can use 'Get All Agents' API for retrieving list from your account.</td></tr>
<tr><td style="padding-left: 0;" colspan="2">date*</td><td>date</td><td>Enter the date for which you want to get the agent activity timeline.</td></tr>
<tr><td style="padding-left: 0;" colspan="2">timezone*</td><td> string </td><td>Timezone difference with UTC in minutes for e.g., For PST:<code>+480</code> (PDT: <code>+420</code>),For MST <code>+420</code> (MDT:<code>+360</code>) for EST: <code>+300</code>(EDT:<code>+240</code>), for AEST: <code>-600</code> (AEDT: <code>-660</code>), for IST: <code>-330</code>, for CST: <code>+360</code> (CDT:<code>+300</code>)</td></tr>
<tr><td style="padding-left: 0;" colspan="2">start_time*</td><td>date time</td><td>Start Date time for the date range.</td></tr>
<tr><td style="padding-left: 0;" colspan="2">end_time*</td><td>date time</td><td>End Date time for the date range.</td></tr>



</table>

+ Request (application/json)


        {
            "api_key":"YOUR_API_KEY", 
            "fleet_id":17846,
            "timezone":-330,
            "date":"2018-11-04",
            "start_time":"2018-11-04 00:00:00",
            "end_time":"2018-11-04 23:59:59"
        }

+ Response 200 (application/json)


        {
            "message": "Successful",
            "status": 200,
            "data": [
                       {
                                "end_lat":0,
                                "end_long":0,
                                "distance":0,
                                "seconds":0,
                                "start_time":"2018-11-04T09:50:44.591Z",
                                "end_time":"2018-11-04T09:50:44.591Z",
                                "start_time_stamp":1541325044591,
                                "end_time_stamp":1541325044591,
                                "stop_or_move_flag":2,
                                "tasks":[
                                {
                                "task":1,
                                "job_id":23326865,
                                "type":"state_changed",
                                "description":"Assign Manish30 to task - 7756",
                                "latitude":"30.7187701",
                                "longitude":"76.8106131",
                                "creation_datetime":"2018-11-04T09:32:42.000Z",
                                "timestamp":1541323962000,
                                "extra_fields":null,
                                "label_description":"<span class='assigned'>ASSIGNED</span>Assign Manish30 to task - 7756"
                                },
                                {
                                "task":1,
                                "job_id":23326865,
                                "type":"state_changed",
                                "description":"Accepted at",
                                "latitude":"30.7187561",
                                "longitude":"76.8106254",
                                "creation_datetime":"2018-11-04T09:32:55.000Z",
                                "timestamp":1541323975000,
                                "extra_fields":null,
                                "label_description":"<span class='accepted'>ACCEPTED</span>at"
                                },
                                {
                                "task":1,
                                "job_id":23326865,
                                "type":"state_changed",
                                "description":"Started at",
                                "latitude":"30.7187561",
                                "longitude":"76.8106254",
                                "creation_datetime":"2018-11-04T09:32:58.000Z",
                                "timestamp":1541323978000,
                                "extra_fields":null,
                                "label_description":"<span class='started'>STARTED</span>at"
                                },
                                {
                                "task":1,
                                "job_id":23326865,
                                "type":"state_changed",
                                "description":"Arrived at",
                                "latitude":"30.7187561",
                                "longitude":"76.8106254",
                                "creation_datetime":"2018-11-04T09:33:05.000Z",
                                "timestamp":1541323985000,
                                "extra_fields":null,
                                "label_description":"<span class='arrived'>ARRIVED</span>at"
                                }
                                ]
                                },
                                {
                                "end_lat":30.7187493,
                                "end_long":76.8106329,
                                "distance":0,
                                "seconds":13339,
                                "start_time":"2018-11-04T09:50:44.591Z",
                                "end_time":"2018-11-04T13:33:04.018Z",
                                "start_time_stamp":1541325044591,
                                "end_time_stamp":1541338384018,
                                "stop_or_move_flag":0,
                                "tasks":[
                                {
                                "task":1,
                                "job_id":23326865,
                                "type":"state_changed",
                                "description":"Failed at#-#fh",
                                "latitude":"30.7187501",
                                "longitude":"76.810632",
                                "creation_datetime":"2018-11-04T11:29:53.000Z",
                                "timestamp":1541330993000,
                                "extra_fields":null,
                                "label_description":"<span class='failed'>FAILED</span>at#-#fh"
                                },
                                {
                                "task":1,
                                "job_id":23330155,
                                "type":"state_changed",
                                "description":"Accepted at",
                                "latitude":"30.7187501",
                                "longitude":"76.810632",
                                "creation_datetime":"2018-11-04T11:55:05.000Z",
                                "timestamp":1541332505000,
                                "extra_fields":null,
                                "label_description":"<span class='accepted'>ACCEPTED</span>at"
                                }
                                ]
                                },
                                {
                                "end_lat":30.66253663,
                                "end_long":76.81815817,
                                "distance":6403,
                                "seconds":366.14,
                                "start_time":"2018-11-04T13:33:04.018Z",
                                "end_time":"2018-11-04T13:39:10.158Z",
                                "start_time_stamp":1541338384018,
                                "end_time_stamp":1541338750158,
                                "stop_or_move_flag":1,
                                "tasks":[
                                {
                                "task":1,
                                "job_id":23326866,
                                "type":"state_changed",
                                "description":"Started at",
                                "latitude":"30.67830618",
                                "longitude":"76.80821761",
                                "creation_datetime":"2018-11-04T13:37:03.000Z",
                                "timestamp":1541338623000,
                                "extra_fields":null,
                                "label_description":"<span class='started'>STARTED</span>at"
                                },
                                {
                                "task":1,
                                "job_id":23326866,
                                "type":"state_changed",
                                "description":"Arrived at",
                                "latitude":"30.67679369",
                                "longitude":"76.80901483",
                                "creation_datetime":"2018-11-04T13:37:13.000Z",
                                "timestamp":1541338633000,
                                "extra_fields":null,
                                "label_description":"<span class='arrived'>ARRIVED</span>at"
                                },
                                {
                                "task":1,
                                "job_id":23326866,
                                "type":"state_changed",
                                "description":"Successful at",
                                "latitude":"30.67371866",
                                "longitude":"76.81086691",
                                "creation_datetime":"2018-11-04T13:37:27.000Z",
                                "timestamp":1541338647000,
                                "extra_fields":null,
                                "label_description":"<span class='successful'>SUCCESSFUL</span>at"
                                }
                                ],
                                "polyline":"{pmzDa}xsMYwBjBwDv@_B`E|@zDrCbBlAtAbApA~@lAz@lA|@rA`AbBlAzAhA~AjAfBpAhBrAfBpAbBnAzAfAzAfAlA|@jAz@bBlAjAz@jAz@pA~@vAbAtAbA|AfArA~@jAz@bBlAjAx@hAx@bBlAjAx@bBlApAx@nAn@fB}@bAmAlAwAxAeBtAaBnAyAnAwArAmAjB{@tBm@lBi@fBe@xAa@pBi@zAa@pBi@bBe@hBg@nBi@zBm@dI{BbI_CnHuClHsCzB}@lH_DpHsDrH}DhHyDhH{DzGwD`H{DpAu@jHeEfHgEjGuDvBoA",
                                "last_timestamp":1541338751323,
                                "last_requesttime":1541338754183,
                                "last_task_time":"2018-11-04T13:37:27.000Z"
                        }
                    ]
        }
## Get Nearby Agents [/getNearbyAgents]

### Get Nearby Agents [POST]

This API is used to get available agent's near the given latitude longitude up to 100kms.

Request Body Parameters:

<table>
<tr><td style="padding-left: 0;" colspan="2"><strong>Name</strong><td><strong>Type</strong></td><td><strong>Description</strong></td></tr>
<tr><td style="padding-left: 0;" colspan="2">api_key</td><td>string</td><td> You can get a key from settings(Login>Menu>Settings>API Keys) in your tookan account. Or <a href="https://app.tookanapp.com/#/app/settings/apikey">click here</a> to get API key</td></tr>
<tr><td style="padding-left: 0;" colspan="2">latitude*</td><td>number</td><td>The latitude of the location from where you want nearby available fleets.</td></tr>
<tr><td style="padding-left: 0;" colspan="2">longitude*</td><td>number</td><td>The longitude of the location from where you want nearby available fleets.</td></tr>
<tr><td style="padding-left: 0;" colspan="2">radius_in_metres*</td><td>number</td><td>Some radius in metre</td></tr>


</table>

+ Request (application/json)


      {
    "api_key": "YOUR_API_KEY",
    "latitude": 32.5555,
    "longitude": 72.5555
  "radius_in_metres": 100
}

+ Response 200 (application/json)


       {
  "message": "ACTION_COMPLETE",
  "status": 200,
  "data": []
}


## Get Agents Near Customer [/get_fleets_near_customer]

### Get Agents Near Customer [POST]

This API is used to get available agent's near customers.

Request Body Parametrs:

<table>
<tr><td style="padding-left: 0;" colspan="2"><strong>Name</strong><td><strong>Type</strong></td><td><strong>Description</strong></td></tr>
<tr><td style="padding-left: 0;" colspan="2">api_key</td><td>string</td><td> You can get a key from settings(Login>Menu>Settings>API Keys) in your tookan account. Or <a href="https://app.tookanapp.com/#/app/settings/apikey">click here</a> to get API key</td></tr>
<tr><td style="padding-left: 0;" colspan="2">customer_id*</td><td>number</td><td>You can get it from your tookan account or you can use 'Get All Customer' API for retrieving list from your account.</td></tr>
<tr><td style="padding-left: 0;" colspan="2">radius_in_metres*</td><td>number</td><td>Some radius in metre</td></tr>



</table>

+ Request (application/json)


        {
            "api_key":"YOUR_API_KEY", 
            "customer_id": 12345,
            "radius_in_metres" : 100
        }

+ Response 200 (application/json)


       {
    "message": "ACTION_COMPLETE",
    "status": 200,
    "data": [
        
    ]
}

## Assign Agent To Task [/assign_fleet_to_task]

### Assign Agent To Task [POST]

This API is used to assign an agent to your task.

Request Body Parameters : 

<table class="humanColumnApiDescription markdown formalTheme">
<tr><td colspan="1"><strong>Name</strong><td colspan="1"><strong>Type</strong><td colspan="1"><strong>Description</strong></td></tr>
<tr><td style="padding-right: 40px; width: 140px;">api_key</td><td>string</td> <td> You can generate a key from settings(Login>Menu>Settings>API Keys) in your tookan account. Or <a href="https://app.tookanapp.com/#/app/settings/apikey">click here</a> to get API key</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">job_id*</td><td>number</td> <td>This is the unique id given to every job which is returned while creating a task.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">fleet_id*</td><td>number</td> <td>This is unique agent id given to each agent, if given the task will be assigned to the respective agent. You can get it from dashboard Menu>More>agents.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">team_id*</td><td>number</td> <td>This is the Unique id of every team. You can get it from the dashBoard. More>teams>respective id of the team will displayed.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">notify</td><td>0/1</td> <td>This is used to enable the notifications.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">geofence</td><td>0/1</td> <td>This is used to enable the geofencing.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">job_status</td><td>string</td> <td>Refer status codes section above for various statuses available.</td></tr>
</table>

+ Request (application/json)

        {
            "api_key":"55631.076225def01849131c152c3017162c431fe4c4fe2c",
            "job_id":20813248,
            "team_id":72193,
            "fleet_id":165932,
            "notify":1,
            "geofence":0,
            "job_status":"0"
        }
        
+ Response 200 (application/json)

        {
            "message":"The Agent 'test agent' has been assigned to task '20813248'",
            "status":200,
            "data":{}
        }

## Assign Agent To Related Tasks [/assign_fleet_to_related_tasks]

### Assign Agent To Related Tasks [POST]

This API is used to assign an agent to related task.

Request Body Parameters : 
<table class="humanColumnApiDescription markdown formalTheme">
<tr><td colspan="1"><strong>Name</strong><td colspan="1"><strong>Type</strong><td colspan="1"><strong>Description</strong></td></tr>
<tr><td style="padding-right: 40px; width: 140px;">api_key</td><td>string</td> <td> You can generate a key from settings(Login>Menu>Settings>API Keys) in your tookan account. Or <a href="https://app.tookanapp.com/#/app/settings/apikey">click here</a> to get API key</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">team_id*</td><td>number</td> <td>This is the Unique id of every team. You can get it from the dashBoard. More>teams>respective id of the team will displayed.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">notify</td><td>0/1 (optional)</td> <td>This is used to enable the notifications.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">geofence</td><td>0/1 (optional)</td> <td>This is used to enable the geofencing.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">job_status</td><td>string (optional)</td> <td>Refer status codes section above for various statuses available.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">merchant_id</td><td>number (optional)</td> <td>This is the unique ID given to each merchant. If you want to assign a task to merchant's team/agent, send the corresponding merchant_id. You can get it from dashboard Menu>More>Merchant.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">pickup_delivery_relationship*</td> <td>string</td> <td>This is the relationship key between pickup and delivery tasks. Either send this or the job_id</td></tr>
</table>

+ Request (application/json) 

         {
            "api_key":"55631.076225def1849131c152c3017162c431fe4c4fe2c",
            "pickup_delivery_relationship": "230604115408992882073152"
            "team_id":72193,
            "fleet_id":165932,
            "notify":1,
            "geofence":0,
            "job_status":"0"
        }
        
+ Response 200 (application/json)

        {
          "message": "Successful",
          "status": 200,
          "data": {}
        } 
        
## Reassign Multiple Tasks To Agent [/reassign_open_tasks]

### Reassign Multiple Tasks To Agent [POST]

This API is used to reassign multiple tasks to agent.

Request Body Parameters : 
<table class="humanColumnApiDescription markdown formalTheme">
<tr><td colspan="1"><strong>Name</strong><td colspan="1"><strong>Type</strong><td colspan="1"><strong>Description</strong></td></tr>
<tr><td style="padding-right: 40px; width: 140px;">api_key</td><td>string</td> <td> You can generate a key from settings(Login>Menu>Settings>API Keys) in your tookan account. Or <a href="https://app.tookanapp.com/#/app/settings/apikey">click here</a> to get API key</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">team_id</td><td>number (Optional)</td> <td>This is the unique id of every team. You can get it from the Dashboard>Menu>Settings>Teams>respective id of the team will be displayed.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">fleet_id*</td><td>number</td> <td>This is the unique id of every agent. You can get it from the Dashboard>Menu>Agent>respective id of the agent will be displayed.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">job_ids*</td><td>Array</td> <td>Enter array of task ids.</td></tr>
</table>

+ Request (application/json) 

         {
            "api_key":"25def1849131c152c3017162c431fe4c4fe2c",
            "user_id": 12345,
            "team_id": 123,
            "fleet_id": 123456,
            "job_ids":[123,1234,12345,123456]
        }
        
+ Response 200 (application/json)

        {
          "message": "Bulk assignment in progress, may take several minutes.",
          "status": 200,
          "data": {}
        }

## Get Monthly Agent Schedule [/get_fleets_monthly_availability]

### Get Monthly Agent Schedule [POST]

This API is used to get an agent's schedule within date range.

Request Body Parameters : 
<table class="humanColumnApiDescription markdown formalTheme">
<tr><td colspan="1"><strong>Name</strong><td colspan="1"><strong>Type</strong><td colspan="1"><strong>Description</strong></td></tr>
<tr><td style="padding-right: 40px; width: 140px;">api_key</td><td>string</td> <td> You can generate a key from settings(Login>Menu>Settings>API Keys) in your tookan account. Or <a href="https://app.tookanapp.com/#/app/settings/apikey">click here</a> to get API key</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">fleet_id*</td><td>string</td> <td>This is the unique id of every agent. You can get it from the Dashboard>Menu>Agent>respective id of the agent will be displayed.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">start_date*</td><td>string</td> <td>Start date specified in YYYY-MM-DD format.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">end_date*</td><td>string</td> <td>End date specified in YYYY-MM-DD format.</td></tr>
</table>

+ Request (application/json) 

         {
            "api_key": "25def1849131c152c3017162c431fe4c4fe2c",
            "fleet_id": "12345",
            "start_date": "2020-03-01",
            "end_date": "2020-03-31"
        }
        
+ Response 200 (application/json)

        {
    "message": "Successful",
    "status": 200,
    "data": {
        "fleet": {
            "fleet_id": 54019,
            "username": "mukul",
            "email": "",
            "is_available": 0,
            "fleet_image": "app/img/user.png",
            "fleet_thumb_image": "https://tookan.s3.amazonaws.com/fleet_thumb_profile/user.png"
        },
        "datewise_availability": [
            "2020-03-01",
            "2020-03-02",
            "2020-03-03",
            "2020-03-04"
        ],
        "detailed_slots": [
            {
                "date": "2020-03-01",
                "slots": [
                    {
                        "slot_timming": "00:00",
                        "available_status": 1,
                        "slot_start_time": "2020-03-01 00:01:00 AM",
                        "slot_end_time": "2020-03-01 00:15:00 AM"
                    },
                    {
                        "slot_timming": "00:15",
                        "available_status": 1,
                        "slot_start_time": "2020-03-01 00:16:00 AM",
                        "slot_end_time": "2020-03-01 00:30:00 AM"
                    },
                    {
                        "slot_timming": "00:30",
                        "available_status": 1,
                        "slot_start_time": "2020-03-01 00:31:00 AM",
                        "slot_end_time": "2020-03-01 00:45:00 AM"
                    },
                    {
                        "slot_timming": "00:45",
                        "available_status": 1,
                        "slot_start_time": "2020-03-01 00:46:00 AM",
                        "slot_end_time": "2020-03-01 01:00:00 AM"
                    },
                    {
                        "slot_timming": "01:00",
                        "available_status": 1,
                        "slot_start_time": "2020-03-01 01:01:00 AM",
                        "slot_end_time": "2020-03-01 01:15:00 AM"
                    },
                    {
                        "slot_timming": "01:15",
                        "available_status": 1,
                        "slot_start_time": "2020-03-01 01:16:00 AM",
                        "slot_end_time": "2020-03-01 01:30:00 AM"
                    },
                    {
                        "slot_timming": "01:30",
                        "available_status": 1,
                        "slot_start_time": "2020-03-01 01:31:00 AM",
                        "slot_end_time": "2020-03-01 01:45:00 AM"
                    },
                    {
                        "slot_timming": "01:45",
                        "available_status": 1,
                        "slot_start_time": "2020-03-01 01:46:00 AM",
                        "slot_end_time": "2020-03-01 02:00:00 AM"
                    },
                    {
                        "slot_timming": "02:00",
                        "available_status": 1,
                        "slot_start_time": "2020-03-01 02:01:00 AM",
                        "slot_end_time": "2020-03-01 02:15:00 AM"
                    },
                    {
                        "slot_timming": "02:15",
                        "available_status": 1,
                        "slot_start_time": "2020-03-01 02:16:00 AM",
                        "slot_end_time": "2020-03-01 02:30:00 AM"
                    },
                    {
                        "slot_timming": "02:30",
                        "available_status": 1,
                        "slot_start_time": "2020-03-01 02:31:00 AM",
                        "slot_end_time": "2020-03-01 02:45:00 AM"
                    },
                    {
                        "slot_timming": "02:45",
                        "available_status": 1,
                        "slot_start_time": "2020-03-01 02:46:00 AM",
                        "slot_end_time": "2020-03-01 03:00:00 AM"
                    },
                    {
                        "slot_timming": "03:00",
                        "available_status": 1,
                        "slot_start_time": "2020-03-01 03:01:00 AM",
                        "slot_end_time": "2020-03-01 03:15:00 AM"
                    },
                    {
                        "slot_timming": "03:15",
                        "available_status": 1,
                        "slot_start_time": "2020-03-01 03:16:00 AM",
                        "slot_end_time": "2020-03-01 03:30:00 AM"
                    },
                    {
                        "slot_timming": "03:30",
                        "available_status": 1,
                        "slot_start_time": "2020-03-01 03:31:00 AM",
                        "slot_end_time": "2020-03-01 03:45:00 AM"
                    },
                    {
                        "slot_timming": "03:45",
                        "available_status": 1,
                        "slot_start_time": "2020-03-01 03:46:00 AM",
                        "slot_end_time": "2020-03-01 04:00:00 AM"
                    },
                    {
                        "slot_timming": "04:00",
                        "available_status": 1,
                        "slot_start_time": "2020-03-01 04:01:00 AM",
                        "slot_end_time": "2020-03-01 04:15:00 AM"
                    },
                    {
                        "slot_timming": "04:15",
                        "available_status": 1,
                        "slot_start_time": "2020-03-01 04:16:00 AM",
                        "slot_end_time": "2020-03-01 04:30:00 AM"
                    },
                    {
                        "slot_timming": "04:30",
                        "available_status": 1,
                        "slot_start_time": "2020-03-01 04:31:00 AM",
                        "slot_end_time": "2020-03-01 04:45:00 AM"
                    },
                    {
                        "slot_timming": "04:45",
                        "available_status": 1,
                        "slot_start_time": "2020-03-01 04:46:00 AM",
                        "slot_end_time": "2020-03-01 05:00:00 AM"
                    },
                    {
                        "slot_timming": "05:00",
                        "available_status": 1,
                        "slot_start_time": "2020-03-01 05:01:00 AM",
                        "slot_end_time": "2020-03-01 05:15:00 AM"
                    },
                    {
                        "slot_timming": "05:15",
                        "available_status": 1,
                        "slot_start_time": "2020-03-01 05:16:00 AM",
                        "slot_end_time": "2020-03-01 05:30:00 AM"
                    },
                    {
                        "slot_timming": "05:30",
                        "available_status": 1,
                        "slot_start_time": "2020-03-01 05:31:00 AM",
                        "slot_end_time": "2020-03-01 05:45:00 AM"
                    },
                    {
                        "slot_timming": "05:45",
                        "available_status": 1,
                        "slot_start_time": "2020-03-01 05:46:00 AM",
                        "slot_end_time": "2020-03-01 06:00:00 AM"
                    },
                    {
                        "slot_timming": "06:00",
                        "available_status": 1,
                        "slot_start_time": "2020-03-01 06:01:00 AM",
                        "slot_end_time": "2020-03-01 06:15:00 AM"
                    },
                    {
                        "slot_timming": "06:15",
                        "available_status": 1,
                        "slot_start_time": "2020-03-01 06:16:00 AM",
                        "slot_end_time": "2020-03-01 06:30:00 AM"
                    },
                    {
                        "slot_timming": "06:30",
                        "available_status": 1,
                        "slot_start_time": "2020-03-01 06:31:00 AM",
                        "slot_end_time": "2020-03-01 06:45:00 AM"
                    },
                    {
                        "slot_timming": "06:45",
                        "available_status": 1,
                        "slot_start_time": "2020-03-01 06:46:00 AM",
                        "slot_end_time": "2020-03-01 07:00:00 AM"
                    },
                    {
                        "slot_timming": "07:00",
                        "available_status": 1,
                        "slot_start_time": "2020-03-01 07:01:00 AM",
                        "slot_end_time": "2020-03-01 07:15:00 AM"
                    },
                    {
                        "slot_timming": "07:15",
                        "available_status": 1,
                        "slot_start_time": "2020-03-01 07:16:00 AM",
                        "slot_end_time": "2020-03-01 07:30:00 AM"
                    },
                    {
                        "slot_timming": "07:30",
                        "available_status": 1,
                        "slot_start_time": "2020-03-01 07:31:00 AM",
                        "slot_end_time": "2020-03-01 07:45:00 AM"
                    },
                    {
                        "slot_timming": "07:45",
                        "available_status": 1,
                        "slot_start_time": "2020-03-01 07:46:00 AM",
                        "slot_end_time": "2020-03-01 08:00:00 AM"
                    },
                    {
                        "slot_timming": "08:00",
                        "available_status": 1,
                        "slot_start_time": "2020-03-01 08:01:00 AM",
                        "slot_end_time": "2020-03-01 08:15:00 AM"
                    },
                    {
                        "slot_timming": "08:15",
                        "available_status": 1,
                        "slot_start_time": "2020-03-01 08:16:00 AM",
                        "slot_end_time": "2020-03-01 08:30:00 AM"
                    },
                    {
                        "slot_timming": "08:30",
                        "available_status": 1,
                        "slot_start_time": "2020-03-01 08:31:00 AM",
                        "slot_end_time": "2020-03-01 08:45:00 AM"
                    },
                    {
                        "slot_timming": "08:45",
                        "available_status": 0,
                        "slot_start_time": "2020-03-01 08:46:00 AM",
                        "slot_end_time": "2020-03-01 09:00:00 AM"
                    },
                    {
                        "slot_timming": "09:00",
                        "available_status": 0,
                        "slot_start_time": "2020-03-01 09:01:00 AM",
                        "slot_end_time": "2020-03-01 09:15:00 AM"
                    },
                    {
                        "slot_timming": "09:15",
                        "available_status": 0,
                        "slot_start_time": "2020-03-01 09:16:00 AM",
                        "slot_end_time": "2020-03-01 09:30:00 AM"
                    },
                    {
                        "slot_timming": "09:30",
                        "available_status": 0,
                        "slot_start_time": "2020-03-01 09:31:00 AM",
                        "slot_end_time": "2020-03-01 09:45:00 AM"
                    },
                    {
                        "slot_timming": "09:45",
                        "available_status": 0,
                        "slot_start_time": "2020-03-01 09:46:00 AM",
                        "slot_end_time": "2020-03-01 10:00:00 AM"
                    },
                    {
                        "slot_timming": "10:00",
                        "available_status": 0,
                        "slot_start_time": "2020-03-01 10:01:00 AM",
                        "slot_end_time": "2020-03-01 10:15:00 AM"
                    },
                    {
                        "slot_timming": "10:15",
                        "available_status": 0,
                        "slot_start_time": "2020-03-01 10:16:00 AM",
                        "slot_end_time": "2020-03-01 10:30:00 AM"
                    },
                    {
                        "slot_timming": "10:30",
                        "available_status": 0,
                        "slot_start_time": "2020-03-01 10:31:00 AM",
                        "slot_end_time": "2020-03-01 10:45:00 AM"
                    },
                    {
                        "slot_timming": "10:45",
                        "available_status": 0,
                        "slot_start_time": "2020-03-01 10:46:00 AM",
                        "slot_end_time": "2020-03-01 11:00:00 AM"
                    },
                    {
                        "slot_timming": "11:00",
                        "available_status": 0,
                        "slot_start_time": "2020-03-01 11:01:00 AM",
                        "slot_end_time": "2020-03-01 11:15:00 AM"
                    },
                    {
                        "slot_timming": "11:15",
                        "available_status": 0,
                        "slot_start_time": "2020-03-01 11:16:00 AM",
                        "slot_end_time": "2020-03-01 11:30:00 AM"
                    },
                    {
                        "slot_timming": "11:30",
                        "available_status": 0,
                        "slot_start_time": "2020-03-01 11:31:00 AM",
                        "slot_end_time": "2020-03-01 11:45:00 AM"
                    },
                    {
                        "slot_timming": "11:45",
                        "available_status": 0,
                        "slot_start_time": "2020-03-01 11:46:00 AM",
                        "slot_end_time": "2020-03-01 12:00:00 PM"
                    },
                    {
                        "slot_timming": "12:00",
                        "available_status": 0,
                        "slot_start_time": "2020-03-01 12:01:00 PM",
                        "slot_end_time": "2020-03-01 12:15:00 PM"
                    },
                    {
                        "slot_timming": "12:15",
                        "available_status": 0,
                        "slot_start_time": "2020-03-01 12:16:00 PM",
                        "slot_end_time": "2020-03-01 12:30:00 PM"
                    },
                    {
                        "slot_timming": "12:30",
                        "available_status": 0,
                        "slot_start_time": "2020-03-01 12:31:00 PM",
                        "slot_end_time": "2020-03-01 12:45:00 PM"
                    },
                    {
                        "slot_timming": "12:45",
                        "available_status": 0,
                        "slot_start_time": "2020-03-01 12:46:00 PM",
                        "slot_end_time": "2020-03-01 13:00:00 PM"
                    },
                    {
                        "slot_timming": "13:00",
                        "available_status": 0,
                        "slot_start_time": "2020-03-01 13:01:00 PM",
                        "slot_end_time": "2020-03-01 13:15:00 PM"
                    },
                    {
                        "slot_timming": "13:15",
                        "available_status": 0,
                        "slot_start_time": "2020-03-01 13:16:00 PM",
                        "slot_end_time": "2020-03-01 13:30:00 PM"
                    },
                    {
                        "slot_timming": "13:30",
                        "available_status": 0,
                        "slot_start_time": "2020-03-01 13:31:00 PM",
                        "slot_end_time": "2020-03-01 13:45:00 PM"
                    },
                    {
                        "slot_timming": "13:45",
                        "available_status": 0,
                        "slot_start_time": "2020-03-01 13:46:00 PM",
                        "slot_end_time": "2020-03-01 14:00:00 PM"
                    },
                    {
                        "slot_timming": "14:00",
                        "available_status": 0,
                        "slot_start_time": "2020-03-01 14:01:00 PM",
                        "slot_end_time": "2020-03-01 14:15:00 PM"
                    },
                    {
                        "slot_timming": "14:15",
                        "available_status": 0,
                        "slot_start_time": "2020-03-01 14:16:00 PM",
                        "slot_end_time": "2020-03-01 14:30:00 PM"
                    },
                    {
                        "slot_timming": "14:30",
                        "available_status": 0,
                        "slot_start_time": "2020-03-01 14:31:00 PM",
                        "slot_end_time": "2020-03-01 14:45:00 PM"
                    },
                    {
                        "slot_timming": "14:45",
                        "available_status": 0,
                        "slot_start_time": "2020-03-01 14:46:00 PM",
                        "slot_end_time": "2020-03-01 15:00:00 PM"
                    },
                    {
                        "slot_timming": "15:00",
                        "available_status": 0,
                        "slot_start_time": "2020-03-01 15:01:00 PM",
                        "slot_end_time": "2020-03-01 15:15:00 PM"
                    },
                    {
                        "slot_timming": "15:15",
                        "available_status": 0,
                        "slot_start_time": "2020-03-01 15:16:00 PM",
                        "slot_end_time": "2020-03-01 15:30:00 PM"
                    },
                    {
                        "slot_timming": "15:30",
                        "available_status": 0,
                        "slot_start_time": "2020-03-01 15:31:00 PM",
                        "slot_end_time": "2020-03-01 15:45:00 PM"
                    },
                    {
                        "slot_timming": "15:45",
                        "available_status": 0,
                        "slot_start_time": "2020-03-01 15:46:00 PM",
                        "slot_end_time": "2020-03-01 16:00:00 PM"
                    },
                    {
                        "slot_timming": "16:00",
                        "available_status": 0,
                        "slot_start_time": "2020-03-01 16:01:00 PM",
                        "slot_end_time": "2020-03-01 16:15:00 PM"
                    },
                    {
                        "slot_timming": "16:15",
                        "available_status": 0,
                        "slot_start_time": "2020-03-01 16:16:00 PM",
                        "slot_end_time": "2020-03-01 16:30:00 PM"
                    },
                    {
                        "slot_timming": "16:30",
                        "available_status": 0,
                        "slot_start_time": "2020-03-01 16:31:00 PM",
                        "slot_end_time": "2020-03-01 16:45:00 PM"
                    },
                    {
                        "slot_timming": "16:45",
                        "available_status": 1,
                        "slot_start_time": "2020-03-01 16:46:00 PM",
                        "slot_end_time": "2020-03-01 17:00:00 PM"
                    },
                    {
                        "slot_timming": "17:00",
                        "available_status": 1,
                        "slot_start_time": "2020-03-01 17:01:00 PM",
                        "slot_end_time": "2020-03-01 17:15:00 PM"
                    },
                    {
                        "slot_timming": "17:15",
                        "available_status": 1,
                        "slot_start_time": "2020-03-01 17:16:00 PM",
                        "slot_end_time": "2020-03-01 17:30:00 PM"
                    },
                    {
                        "slot_timming": "17:30",
                        "available_status": 1,
                        "slot_start_time": "2020-03-01 17:31:00 PM",
                        "slot_end_time": "2020-03-01 17:45:00 PM"
                    },
                    {
                        "slot_timming": "17:45",
                        "available_status": 1,
                        "slot_start_time": "2020-03-01 17:46:00 PM",
                        "slot_end_time": "2020-03-01 18:00:00 PM"
                    },
                    {
                        "slot_timming": "18:00",
                        "available_status": 1,
                        "slot_start_time": "2020-03-01 18:01:00 PM",
                        "slot_end_time": "2020-03-01 18:15:00 PM"
                    },
                    {
                        "slot_timming": "18:15",
                        "available_status": 1,
                        "slot_start_time": "2020-03-01 18:16:00 PM",
                        "slot_end_time": "2020-03-01 18:30:00 PM"
                    },
                    {
                        "slot_timming": "18:30",
                        "available_status": 1,
                        "slot_start_time": "2020-03-01 18:31:00 PM",
                        "slot_end_time": "2020-03-01 18:45:00 PM"
                    },
                    {
                        "slot_timming": "18:45",
                        "available_status": 1,
                        "slot_start_time": "2020-03-01 18:46:00 PM",
                        "slot_end_time": "2020-03-01 19:00:00 PM"
                    },
                    {
                        "slot_timming": "19:00",
                        "available_status": 1,
                        "slot_start_time": "2020-03-01 19:01:00 PM",
                        "slot_end_time": "2020-03-01 19:15:00 PM"
                    },
                    {
                        "slot_timming": "19:15",
                        "available_status": 1,
                        "slot_start_time": "2020-03-01 19:16:00 PM",
                        "slot_end_time": "2020-03-01 19:30:00 PM"
                    },
                    {
                        "slot_timming": "19:30",
                        "available_status": 1,
                        "slot_start_time": "2020-03-01 19:31:00 PM",
                        "slot_end_time": "2020-03-01 19:45:00 PM"
                    },
                    {
                        "slot_timming": "19:45",
                        "available_status": 1,
                        "slot_start_time": "2020-03-01 19:46:00 PM",
                        "slot_end_time": "2020-03-01 20:00:00 PM"
                    },
                    {
                        "slot_timming": "20:00",
                        "available_status": 1,
                        "slot_start_time": "2020-03-01 20:01:00 PM",
                        "slot_end_time": "2020-03-01 20:15:00 PM"
                    },
                    {
                        "slot_timming": "20:15",
                        "available_status": 1,
                        "slot_start_time": "2020-03-01 20:16:00 PM",
                        "slot_end_time": "2020-03-01 20:30:00 PM"
                    },
                    {
                        "slot_timming": "20:30",
                        "available_status": 1,
                        "slot_start_time": "2020-03-01 20:31:00 PM",
                        "slot_end_time": "2020-03-01 20:45:00 PM"
                    },
                    {
                        "slot_timming": "20:45",
                        "available_status": 1,
                        "slot_start_time": "2020-03-01 20:46:00 PM",
                        "slot_end_time": "2020-03-01 21:00:00 PM"
                    },
                    {
                        "slot_timming": "21:00",
                        "available_status": 1,
                        "slot_start_time": "2020-03-01 21:01:00 PM",
                        "slot_end_time": "2020-03-01 21:15:00 PM"
                    },
                    {
                        "slot_timming": "21:15",
                        "available_status": 1,
                        "slot_start_time": "2020-03-01 21:16:00 PM",
                        "slot_end_time": "2020-03-01 21:30:00 PM"
                    },
                    {
                        "slot_timming": "21:30",
                        "available_status": 1,
                        "slot_start_time": "2020-03-01 21:31:00 PM",
                        "slot_end_time": "2020-03-01 21:45:00 PM"
                    },
                    {
                        "slot_timming": "21:45",
                        "available_status": 1,
                        "slot_start_time": "2020-03-01 21:46:00 PM",
                        "slot_end_time": "2020-03-01 22:00:00 PM"
                    },
                    {
                        "slot_timming": "22:00",
                        "available_status": 1,
                        "slot_start_time": "2020-03-01 22:01:00 PM",
                        "slot_end_time": "2020-03-01 22:15:00 PM"
                    },
                    {
                        "slot_timming": "22:15",
                        "available_status": 1,
                        "slot_start_time": "2020-03-01 22:16:00 PM",
                        "slot_end_time": "2020-03-01 22:30:00 PM"
                    },
                    {
                        "slot_timming": "22:30",
                        "available_status": 1,
                        "slot_start_time": "2020-03-01 22:31:00 PM",
                        "slot_end_time": "2020-03-01 22:45:00 PM"
                    },
                    {
                        "slot_timming": "22:45",
                        "available_status": 1,
                        "slot_start_time": "2020-03-01 22:46:00 PM",
                        "slot_end_time": "2020-03-01 23:00:00 PM"
                    },
                    {
                        "slot_timming": "23:00",
                        "available_status": 1,
                        "slot_start_time": "2020-03-01 23:01:00 PM",
                        "slot_end_time": "2020-03-01 23:15:00 PM"
                    },
                    {
                        "slot_timming": "23:15",
                        "available_status": 1,
                        "slot_start_time": "2020-03-01 23:16:00 PM",
                        "slot_end_time": "2020-03-01 23:30:00 PM"
                    },
                    {
                        "slot_timming": "23:30",
                        "available_status": 1,
                        "slot_start_time": "2020-03-01 23:31:00 PM",
                        "slot_end_time": "2020-03-01 23:45:00 PM"
                    },
                    {
                        "slot_timming": "23:45",
                        "available_status": 1,
                        "slot_start_time": "2020-03-01 23:46:00 PM",
                        "slot_end_time": "2020-03-02 00:00:00 AM"
                    }
                ]
            },
            {
                "date": "2020-03-02",
                "slots": [
                    {
                        "slot_timming": "00:00",
                        "available_status": 1,
                        "slot_start_time": "2020-03-02 00:01:00 AM",
                        "slot_end_time": "2020-03-02 00:15:00 AM"
                    },
                    {
                        "slot_timming": "00:15",
                        "available_status": 1,
                        "slot_start_time": "2020-03-02 00:16:00 AM",
                        "slot_end_time": "2020-03-02 00:30:00 AM"
                    },
                    {
                        "slot_timming": "00:30",
                        "available_status": 1,
                        "slot_start_time": "2020-03-02 00:31:00 AM",
                        "slot_end_time": "2020-03-02 00:45:00 AM"
                    },
                    {
                        "slot_timming": "00:45",
                        "available_status": 1,
                        "slot_start_time": "2020-03-02 00:46:00 AM",
                        "slot_end_time": "2020-03-02 01:00:00 AM"
                    },
                    {
                        "slot_timming": "01:00",
                        "available_status": 1,
                        "slot_start_time": "2020-03-02 01:01:00 AM",
                        "slot_end_time": "2020-03-02 01:15:00 AM"
                    },
                    {
                        "slot_timming": "01:15",
                        "available_status": 1,
                        "slot_start_time": "2020-03-02 01:16:00 AM",
                        "slot_end_time": "2020-03-02 01:30:00 AM"
                    },
                    {
                        "slot_timming": "01:30",
                        "available_status": 1,
                        "slot_start_time": "2020-03-02 01:31:00 AM",
                        "slot_end_time": "2020-03-02 01:45:00 AM"
                    },
                    {
                        "slot_timming": "01:45",
                        "available_status": 1,
                        "slot_start_time": "2020-03-02 01:46:00 AM",
                        "slot_end_time": "2020-03-02 02:00:00 AM"
                    },
                    {
                        "slot_timming": "02:00",
                        "available_status": 1,
                        "slot_start_time": "2020-03-02 02:01:00 AM",
                        "slot_end_time": "2020-03-02 02:15:00 AM"
                    },
                    {
                        "slot_timming": "02:15",
                        "available_status": 1,
                        "slot_start_time": "2020-03-02 02:16:00 AM",
                        "slot_end_time": "2020-03-02 02:30:00 AM"
                    },
                    {
                        "slot_timming": "02:30",
                        "available_status": 1,
                        "slot_start_time": "2020-03-02 02:31:00 AM",
                        "slot_end_time": "2020-03-02 02:45:00 AM"
                    },
                    {
                        "slot_timming": "02:45",
                        "available_status": 1,
                        "slot_start_time": "2020-03-02 02:46:00 AM",
                        "slot_end_time": "2020-03-02 03:00:00 AM"
                    },
                    {
                        "slot_timming": "03:00",
                        "available_status": 1,
                        "slot_start_time": "2020-03-02 03:01:00 AM",
                        "slot_end_time": "2020-03-02 03:15:00 AM"
                    },
                    {
                        "slot_timming": "03:15",
                        "available_status": 1,
                        "slot_start_time": "2020-03-02 03:16:00 AM",
                        "slot_end_time": "2020-03-02 03:30:00 AM"
                    },
                    {
                        "slot_timming": "03:30",
                        "available_status": 1,
                        "slot_start_time": "2020-03-02 03:31:00 AM",
                        "slot_end_time": "2020-03-02 03:45:00 AM"
                    },
                    {
                        "slot_timming": "03:45",
                        "available_status": 1,
                        "slot_start_time": "2020-03-02 03:46:00 AM",
                        "slot_end_time": "2020-03-02 04:00:00 AM"
                    },
                    {
                        "slot_timming": "04:00",
                        "available_status": 1,
                        "slot_start_time": "2020-03-02 04:01:00 AM",
                        "slot_end_time": "2020-03-02 04:15:00 AM"
                    },
                    {
                        "slot_timming": "04:15",
                        "available_status": 1,
                        "slot_start_time": "2020-03-02 04:16:00 AM",
                        "slot_end_time": "2020-03-02 04:30:00 AM"
                    },
                    {
                        "slot_timming": "04:30",
                        "available_status": 1,
                        "slot_start_time": "2020-03-02 04:31:00 AM",
                        "slot_end_time": "2020-03-02 04:45:00 AM"
                    },
                    {
                        "slot_timming": "04:45",
                        "available_status": 1,
                        "slot_start_time": "2020-03-02 04:46:00 AM",
                        "slot_end_time": "2020-03-02 05:00:00 AM"
                    },
                    {
                        "slot_timming": "05:00",
                        "available_status": 1,
                        "slot_start_time": "2020-03-02 05:01:00 AM",
                        "slot_end_time": "2020-03-02 05:15:00 AM"
                    },
                    {
                        "slot_timming": "05:15",
                        "available_status": 1,
                        "slot_start_time": "2020-03-02 05:16:00 AM",
                        "slot_end_time": "2020-03-02 05:30:00 AM"
                    },
                    {
                        "slot_timming": "05:30",
                        "available_status": 1,
                        "slot_start_time": "2020-03-02 05:31:00 AM",
                        "slot_end_time": "2020-03-02 05:45:00 AM"
                    },
                    {
                        "slot_timming": "05:45",
                        "available_status": 1,
                        "slot_start_time": "2020-03-02 05:46:00 AM",
                        "slot_end_time": "2020-03-02 06:00:00 AM"
                    },
                    {
                        "slot_timming": "06:00",
                        "available_status": 1,
                        "slot_start_time": "2020-03-02 06:01:00 AM",
                        "slot_end_time": "2020-03-02 06:15:00 AM"
                    },
                    {
                        "slot_timming": "06:15",
                        "available_status": 1,
                        "slot_start_time": "2020-03-02 06:16:00 AM",
                        "slot_end_time": "2020-03-02 06:30:00 AM"
                    },
                    {
                        "slot_timming": "06:30",
                        "available_status": 1,
                        "slot_start_time": "2020-03-02 06:31:00 AM",
                        "slot_end_time": "2020-03-02 06:45:00 AM"
                    },
                    {
                        "slot_timming": "06:45",
                        "available_status": 1,
                        "slot_start_time": "2020-03-02 06:46:00 AM",
                        "slot_end_time": "2020-03-02 07:00:00 AM"
                    },
                    {
                        "slot_timming": "07:00",
                        "available_status": 1,
                        "slot_start_time": "2020-03-02 07:01:00 AM",
                        "slot_end_time": "2020-03-02 07:15:00 AM"
                    },
                    {
                        "slot_timming": "07:15",
                        "available_status": 1,
                        "slot_start_time": "2020-03-02 07:16:00 AM",
                        "slot_end_time": "2020-03-02 07:30:00 AM"
                    },
                    {
                        "slot_timming": "07:30",
                        "available_status": 1,
                        "slot_start_time": "2020-03-02 07:31:00 AM",
                        "slot_end_time": "2020-03-02 07:45:00 AM"
                    },
                    {
                        "slot_timming": "07:45",
                        "available_status": 1,
                        "slot_start_time": "2020-03-02 07:46:00 AM",
                        "slot_end_time": "2020-03-02 08:00:00 AM"
                    },
                    {
                        "slot_timming": "08:00",
                        "available_status": 1,
                        "slot_start_time": "2020-03-02 08:01:00 AM",
                        "slot_end_time": "2020-03-02 08:15:00 AM"
                    },
                    {
                        "slot_timming": "08:15",
                        "available_status": 1,
                        "slot_start_time": "2020-03-02 08:16:00 AM",
                        "slot_end_time": "2020-03-02 08:30:00 AM"
                    },
                    {
                        "slot_timming": "08:30",
                        "available_status": 1,
                        "slot_start_time": "2020-03-02 08:31:00 AM",
                        "slot_end_time": "2020-03-02 08:45:00 AM"
                    },
                    {
                        "slot_timming": "08:45",
                        "available_status": 0,
                        "slot_start_time": "2020-03-02 08:46:00 AM",
                        "slot_end_time": "2020-03-02 09:00:00 AM"
                    },
                    {
                        "slot_timming": "09:00",
                        "available_status": 0,
                        "slot_start_time": "2020-03-02 09:01:00 AM",
                        "slot_end_time": "2020-03-02 09:15:00 AM"
                    },
                    {
                        "slot_timming": "09:15",
                        "available_status": 0,
                        "slot_start_time": "2020-03-02 09:16:00 AM",
                        "slot_end_time": "2020-03-02 09:30:00 AM"
                    },
                    {
                        "slot_timming": "09:30",
                        "available_status": 0,
                        "slot_start_time": "2020-03-02 09:31:00 AM",
                        "slot_end_time": "2020-03-02 09:45:00 AM"
                    },
                    {
                        "slot_timming": "09:45",
                        "available_status": 0,
                        "slot_start_time": "2020-03-02 09:46:00 AM",
                        "slot_end_time": "2020-03-02 10:00:00 AM"
                    },
                    {
                        "slot_timming": "10:00",
                        "available_status": 0,
                        "slot_start_time": "2020-03-02 10:01:00 AM",
                        "slot_end_time": "2020-03-02 10:15:00 AM"
                    },
                    {
                        "slot_timming": "10:15",
                        "available_status": 0,
                        "slot_start_time": "2020-03-02 10:16:00 AM",
                        "slot_end_time": "2020-03-02 10:30:00 AM"
                    },
                    {
                        "slot_timming": "10:30",
                        "available_status": 0,
                        "slot_start_time": "2020-03-02 10:31:00 AM",
                        "slot_end_time": "2020-03-02 10:45:00 AM"
                    },
                    {
                        "slot_timming": "10:45",
                        "available_status": 0,
                        "slot_start_time": "2020-03-02 10:46:00 AM",
                        "slot_end_time": "2020-03-02 11:00:00 AM"
                    },
                    {
                        "slot_timming": "11:00",
                        "available_status": 0,
                        "slot_start_time": "2020-03-02 11:01:00 AM",
                        "slot_end_time": "2020-03-02 11:15:00 AM"
                    },
                    {
                        "slot_timming": "11:15",
                        "available_status": 0,
                        "slot_start_time": "2020-03-02 11:16:00 AM",
                        "slot_end_time": "2020-03-02 11:30:00 AM"
                    },
                    {
                        "slot_timming": "11:30",
                        "available_status": 0,
                        "slot_start_time": "2020-03-02 11:31:00 AM",
                        "slot_end_time": "2020-03-02 11:45:00 AM"
                    },
                    {
                        "slot_timming": "11:45",
                        "available_status": 0,
                        "slot_start_time": "2020-03-02 11:46:00 AM",
                        "slot_end_time": "2020-03-02 12:00:00 PM"
                    },
                    {
                        "slot_timming": "12:00",
                        "available_status": 0,
                        "slot_start_time": "2020-03-02 12:01:00 PM",
                        "slot_end_time": "2020-03-02 12:15:00 PM"
                    },
                    {
                        "slot_timming": "12:15",
                        "available_status": 0,
                        "slot_start_time": "2020-03-02 12:16:00 PM",
                        "slot_end_time": "2020-03-02 12:30:00 PM"
                    },
                    {
                        "slot_timming": "12:30",
                        "available_status": 0,
                        "slot_start_time": "2020-03-02 12:31:00 PM",
                        "slot_end_time": "2020-03-02 12:45:00 PM"
                    },
                    {
                        "slot_timming": "12:45",
                        "available_status": 0,
                        "slot_start_time": "2020-03-02 12:46:00 PM",
                        "slot_end_time": "2020-03-02 13:00:00 PM"
                    },
                    {
                        "slot_timming": "13:00",
                        "available_status": 0,
                        "slot_start_time": "2020-03-02 13:01:00 PM",
                        "slot_end_time": "2020-03-02 13:15:00 PM"
                    },
                    {
                        "slot_timming": "13:15",
                        "available_status": 0,
                        "slot_start_time": "2020-03-02 13:16:00 PM",
                        "slot_end_time": "2020-03-02 13:30:00 PM"
                    },
                    {
                        "slot_timming": "13:30",
                        "available_status": 0,
                        "slot_start_time": "2020-03-02 13:31:00 PM",
                        "slot_end_time": "2020-03-02 13:45:00 PM"
                    },
                    {
                        "slot_timming": "13:45",
                        "available_status": 0,
                        "slot_start_time": "2020-03-02 13:46:00 PM",
                        "slot_end_time": "2020-03-02 14:00:00 PM"
                    },
                    {
                        "slot_timming": "14:00",
                        "available_status": 0,
                        "slot_start_time": "2020-03-02 14:01:00 PM",
                        "slot_end_time": "2020-03-02 14:15:00 PM"
                    },
                    {
                        "slot_timming": "14:15",
                        "available_status": 0,
                        "slot_start_time": "2020-03-02 14:16:00 PM",
                        "slot_end_time": "2020-03-02 14:30:00 PM"
                    },
                    {
                        "slot_timming": "14:30",
                        "available_status": 0,
                        "slot_start_time": "2020-03-02 14:31:00 PM",
                        "slot_end_time": "2020-03-02 14:45:00 PM"
                    },
                    {
                        "slot_timming": "14:45",
                        "available_status": 0,
                        "slot_start_time": "2020-03-02 14:46:00 PM",
                        "slot_end_time": "2020-03-02 15:00:00 PM"
                    },
                    {
                        "slot_timming": "15:00",
                        "available_status": 0,
                        "slot_start_time": "2020-03-02 15:01:00 PM",
                        "slot_end_time": "2020-03-02 15:15:00 PM"
                    },
                    {
                        "slot_timming": "15:15",
                        "available_status": 0,
                        "slot_start_time": "2020-03-02 15:16:00 PM",
                        "slot_end_time": "2020-03-02 15:30:00 PM"
                    },
                    {
                        "slot_timming": "15:30",
                        "available_status": 0,
                        "slot_start_time": "2020-03-02 15:31:00 PM",
                        "slot_end_time": "2020-03-02 15:45:00 PM"
                    },
                    {
                        "slot_timming": "15:45",
                        "available_status": 0,
                        "slot_start_time": "2020-03-02 15:46:00 PM",
                        "slot_end_time": "2020-03-02 16:00:00 PM"
                    },
                    {
                        "slot_timming": "16:00",
                        "available_status": 0,
                        "slot_start_time": "2020-03-02 16:01:00 PM",
                        "slot_end_time": "2020-03-02 16:15:00 PM"
                    },
                    {
                        "slot_timming": "16:15",
                        "available_status": 0,
                        "slot_start_time": "2020-03-02 16:16:00 PM",
                        "slot_end_time": "2020-03-02 16:30:00 PM"
                    },
                    {
                        "slot_timming": "16:30",
                        "available_status": 0,
                        "slot_start_time": "2020-03-02 16:31:00 PM",
                        "slot_end_time": "2020-03-02 16:45:00 PM"
                    },
                    {
                        "slot_timming": "16:45",
                        "available_status": 1,
                        "slot_start_time": "2020-03-02 16:46:00 PM",
                        "slot_end_time": "2020-03-02 17:00:00 PM"
                    },
                    {
                        "slot_timming": "17:00",
                        "available_status": 1,
                        "slot_start_time": "2020-03-02 17:01:00 PM",
                        "slot_end_time": "2020-03-02 17:15:00 PM"
                    },
                    {
                        "slot_timming": "17:15",
                        "available_status": 1,
                        "slot_start_time": "2020-03-02 17:16:00 PM",
                        "slot_end_time": "2020-03-02 17:30:00 PM"
                    },
                    {
                        "slot_timming": "17:30",
                        "available_status": 1,
                        "slot_start_time": "2020-03-02 17:31:00 PM",
                        "slot_end_time": "2020-03-02 17:45:00 PM"
                    },
                    {
                        "slot_timming": "17:45",
                        "available_status": 1,
                        "slot_start_time": "2020-03-02 17:46:00 PM",
                        "slot_end_time": "2020-03-02 18:00:00 PM"
                    },
                    {
                        "slot_timming": "18:00",
                        "available_status": 1,
                        "slot_start_time": "2020-03-02 18:01:00 PM",
                        "slot_end_time": "2020-03-02 18:15:00 PM"
                    },
                    {
                        "slot_timming": "18:15",
                        "available_status": 1,
                        "slot_start_time": "2020-03-02 18:16:00 PM",
                        "slot_end_time": "2020-03-02 18:30:00 PM"
                    },
                    {
                        "slot_timming": "18:30",
                        "available_status": 1,
                        "slot_start_time": "2020-03-02 18:31:00 PM",
                        "slot_end_time": "2020-03-02 18:45:00 PM"
                    },
                    {
                        "slot_timming": "18:45",
                        "available_status": 1,
                        "slot_start_time": "2020-03-02 18:46:00 PM",
                        "slot_end_time": "2020-03-02 19:00:00 PM"
                    },
                    {
                        "slot_timming": "19:00",
                        "available_status": 1,
                        "slot_start_time": "2020-03-02 19:01:00 PM",
                        "slot_end_time": "2020-03-02 19:15:00 PM"
                    },
                    {
                        "slot_timming": "19:15",
                        "available_status": 1,
                        "slot_start_time": "2020-03-02 19:16:00 PM",
                        "slot_end_time": "2020-03-02 19:30:00 PM"
                    },
                    {
                        "slot_timming": "19:30",
                        "available_status": 1,
                        "slot_start_time": "2020-03-02 19:31:00 PM",
                        "slot_end_time": "2020-03-02 19:45:00 PM"
                    },
                    {
                        "slot_timming": "19:45",
                        "available_status": 1,
                        "slot_start_time": "2020-03-02 19:46:00 PM",
                        "slot_end_time": "2020-03-02 20:00:00 PM"
                    },
                    {
                        "slot_timming": "20:00",
                        "available_status": 1,
                        "slot_start_time": "2020-03-02 20:01:00 PM",
                        "slot_end_time": "2020-03-02 20:15:00 PM"
                    },
                    {
                        "slot_timming": "20:15",
                        "available_status": 1,
                        "slot_start_time": "2020-03-02 20:16:00 PM",
                        "slot_end_time": "2020-03-02 20:30:00 PM"
                    },
                    {
                        "slot_timming": "20:30",
                        "available_status": 1,
                        "slot_start_time": "2020-03-02 20:31:00 PM",
                        "slot_end_time": "2020-03-02 20:45:00 PM"
                    },
                    {
                        "slot_timming": "20:45",
                        "available_status": 1,
                        "slot_start_time": "2020-03-02 20:46:00 PM",
                        "slot_end_time": "2020-03-02 21:00:00 PM"
                    },
                    {
                        "slot_timming": "21:00",
                        "available_status": 1,
                        "slot_start_time": "2020-03-02 21:01:00 PM",
                        "slot_end_time": "2020-03-02 21:15:00 PM"
                    },
                    {
                        "slot_timming": "21:15",
                        "available_status": 1,
                        "slot_start_time": "2020-03-02 21:16:00 PM",
                        "slot_end_time": "2020-03-02 21:30:00 PM"
                    },
                    {
                        "slot_timming": "21:30",
                        "available_status": 1,
                        "slot_start_time": "2020-03-02 21:31:00 PM",
                        "slot_end_time": "2020-03-02 21:45:00 PM"
                    },
                    {
                        "slot_timming": "21:45",
                        "available_status": 1,
                        "slot_start_time": "2020-03-02 21:46:00 PM",
                        "slot_end_time": "2020-03-02 22:00:00 PM"
                    },
                    {
                        "slot_timming": "22:00",
                        "available_status": 1,
                        "slot_start_time": "2020-03-02 22:01:00 PM",
                        "slot_end_time": "2020-03-02 22:15:00 PM"
                    },
                    {
                        "slot_timming": "22:15",
                        "available_status": 1,
                        "slot_start_time": "2020-03-02 22:16:00 PM",
                        "slot_end_time": "2020-03-02 22:30:00 PM"
                    },
                    {
                        "slot_timming": "22:30",
                        "available_status": 1,
                        "slot_start_time": "2020-03-02 22:31:00 PM",
                        "slot_end_time": "2020-03-02 22:45:00 PM"
                    },
                    {
                        "slot_timming": "22:45",
                        "available_status": 1,
                        "slot_start_time": "2020-03-02 22:46:00 PM",
                        "slot_end_time": "2020-03-02 23:00:00 PM"
                    },
                    {
                        "slot_timming": "23:00",
                        "available_status": 1,
                        "slot_start_time": "2020-03-02 23:01:00 PM",
                        "slot_end_time": "2020-03-02 23:15:00 PM"
                    },
                    {
                        "slot_timming": "23:15",
                        "available_status": 1,
                        "slot_start_time": "2020-03-02 23:16:00 PM",
                        "slot_end_time": "2020-03-02 23:30:00 PM"
                    },
                    {
                        "slot_timming": "23:30",
                        "available_status": 1,
                        "slot_start_time": "2020-03-02 23:31:00 PM",
                        "slot_end_time": "2020-03-02 23:45:00 PM"
                    },
                    {
                        "slot_timming": "23:45",
                        "available_status": 1,
                        "slot_start_time": "2020-03-02 23:46:00 PM",
                        "slot_end_time": "2020-03-03 00:00:00 AM"
                    }
                ]
            },
            {
                "date": "2020-03-03",
                "slots": [
                    {
                        "slot_timming": "00:00",
                        "available_status": 1,
                        "slot_start_time": "2020-03-03 00:01:00 AM",
                        "slot_end_time": "2020-03-03 00:15:00 AM"
                    },
                    {
                        "slot_timming": "00:15",
                        "available_status": 1,
                        "slot_start_time": "2020-03-03 00:16:00 AM",
                        "slot_end_time": "2020-03-03 00:30:00 AM"
                    },
                    {
                        "slot_timming": "00:30",
                        "available_status": 1,
                        "slot_start_time": "2020-03-03 00:31:00 AM",
                        "slot_end_time": "2020-03-03 00:45:00 AM"
                    },
                    {
                        "slot_timming": "00:45",
                        "available_status": 1,
                        "slot_start_time": "2020-03-03 00:46:00 AM",
                        "slot_end_time": "2020-03-03 01:00:00 AM"
                    },
                    {
                        "slot_timming": "01:00",
                        "available_status": 1,
                        "slot_start_time": "2020-03-03 01:01:00 AM",
                        "slot_end_time": "2020-03-03 01:15:00 AM"
                    },
                    {
                        "slot_timming": "01:15",
                        "available_status": 1,
                        "slot_start_time": "2020-03-03 01:16:00 AM",
                        "slot_end_time": "2020-03-03 01:30:00 AM"
                    },
                    {
                        "slot_timming": "01:30",
                        "available_status": 1,
                        "slot_start_time": "2020-03-03 01:31:00 AM",
                        "slot_end_time": "2020-03-03 01:45:00 AM"
                    },
                    {
                        "slot_timming": "01:45",
                        "available_status": 1,
                        "slot_start_time": "2020-03-03 01:46:00 AM",
                        "slot_end_time": "2020-03-03 02:00:00 AM"
                    },
                    {
                        "slot_timming": "02:00",
                        "available_status": 1,
                        "slot_start_time": "2020-03-03 02:01:00 AM",
                        "slot_end_time": "2020-03-03 02:15:00 AM"
                    },
                    {
                        "slot_timming": "02:15",
                        "available_status": 1,
                        "slot_start_time": "2020-03-03 02:16:00 AM",
                        "slot_end_time": "2020-03-03 02:30:00 AM"
                    },
                    {
                        "slot_timming": "02:30",
                        "available_status": 1,
                        "slot_start_time": "2020-03-03 02:31:00 AM",
                        "slot_end_time": "2020-03-03 02:45:00 AM"
                    },
                    {
                        "slot_timming": "02:45",
                        "available_status": 1,
                        "slot_start_time": "2020-03-03 02:46:00 AM",
                        "slot_end_time": "2020-03-03 03:00:00 AM"
                    },
                    {
                        "slot_timming": "03:00",
                        "available_status": 1,
                        "slot_start_time": "2020-03-03 03:01:00 AM",
                        "slot_end_time": "2020-03-03 03:15:00 AM"
                    },
                    {
                        "slot_timming": "03:15",
                        "available_status": 1,
                        "slot_start_time": "2020-03-03 03:16:00 AM",
                        "slot_end_time": "2020-03-03 03:30:00 AM"
                    },
                    {
                        "slot_timming": "03:30",
                        "available_status": 1,
                        "slot_start_time": "2020-03-03 03:31:00 AM",
                        "slot_end_time": "2020-03-03 03:45:00 AM"
                    },
                    {
                        "slot_timming": "03:45",
                        "available_status": 1,
                        "slot_start_time": "2020-03-03 03:46:00 AM",
                        "slot_end_time": "2020-03-03 04:00:00 AM"
                    },
                    {
                        "slot_timming": "04:00",
                        "available_status": 1,
                        "slot_start_time": "2020-03-03 04:01:00 AM",
                        "slot_end_time": "2020-03-03 04:15:00 AM"
                    },
                    {
                        "slot_timming": "04:15",
                        "available_status": 1,
                        "slot_start_time": "2020-03-03 04:16:00 AM",
                        "slot_end_time": "2020-03-03 04:30:00 AM"
                    },
                    {
                        "slot_timming": "04:30",
                        "available_status": 1,
                        "slot_start_time": "2020-03-03 04:31:00 AM",
                        "slot_end_time": "2020-03-03 04:45:00 AM"
                    },
                    {
                        "slot_timming": "04:45",
                        "available_status": 1,
                        "slot_start_time": "2020-03-03 04:46:00 AM",
                        "slot_end_time": "2020-03-03 05:00:00 AM"
                    },
                    {
                        "slot_timming": "05:00",
                        "available_status": 1,
                        "slot_start_time": "2020-03-03 05:01:00 AM",
                        "slot_end_time": "2020-03-03 05:15:00 AM"
                    },
                    {
                        "slot_timming": "05:15",
                        "available_status": 1,
                        "slot_start_time": "2020-03-03 05:16:00 AM",
                        "slot_end_time": "2020-03-03 05:30:00 AM"
                    },
                    {
                        "slot_timming": "05:30",
                        "available_status": 1,
                        "slot_start_time": "2020-03-03 05:31:00 AM",
                        "slot_end_time": "2020-03-03 05:45:00 AM"
                    },
                    {
                        "slot_timming": "05:45",
                        "available_status": 1,
                        "slot_start_time": "2020-03-03 05:46:00 AM",
                        "slot_end_time": "2020-03-03 06:00:00 AM"
                    },
                    {
                        "slot_timming": "06:00",
                        "available_status": 1,
                        "slot_start_time": "2020-03-03 06:01:00 AM",
                        "slot_end_time": "2020-03-03 06:15:00 AM"
                    },
                    {
                        "slot_timming": "06:15",
                        "available_status": 1,
                        "slot_start_time": "2020-03-03 06:16:00 AM",
                        "slot_end_time": "2020-03-03 06:30:00 AM"
                    },
                    {
                        "slot_timming": "06:30",
                        "available_status": 1,
                        "slot_start_time": "2020-03-03 06:31:00 AM",
                        "slot_end_time": "2020-03-03 06:45:00 AM"
                    },
                    {
                        "slot_timming": "06:45",
                        "available_status": 1,
                        "slot_start_time": "2020-03-03 06:46:00 AM",
                        "slot_end_time": "2020-03-03 07:00:00 AM"
                    },
                    {
                        "slot_timming": "07:00",
                        "available_status": 1,
                        "slot_start_time": "2020-03-03 07:01:00 AM",
                        "slot_end_time": "2020-03-03 07:15:00 AM"
                    },
                    {
                        "slot_timming": "07:15",
                        "available_status": 1,
                        "slot_start_time": "2020-03-03 07:16:00 AM",
                        "slot_end_time": "2020-03-03 07:30:00 AM"
                    },
                    {
                        "slot_timming": "07:30",
                        "available_status": 1,
                        "slot_start_time": "2020-03-03 07:31:00 AM",
                        "slot_end_time": "2020-03-03 07:45:00 AM"
                    },
                    {
                        "slot_timming": "07:45",
                        "available_status": 1,
                        "slot_start_time": "2020-03-03 07:46:00 AM",
                        "slot_end_time": "2020-03-03 08:00:00 AM"
                    },
                    {
                        "slot_timming": "08:00",
                        "available_status": 1,
                        "slot_start_time": "2020-03-03 08:01:00 AM",
                        "slot_end_time": "2020-03-03 08:15:00 AM"
                    },
                    {
                        "slot_timming": "08:15",
                        "available_status": 1,
                        "slot_start_time": "2020-03-03 08:16:00 AM",
                        "slot_end_time": "2020-03-03 08:30:00 AM"
                    },
                    {
                        "slot_timming": "08:30",
                        "available_status": 1,
                        "slot_start_time": "2020-03-03 08:31:00 AM",
                        "slot_end_time": "2020-03-03 08:45:00 AM"
                    },
                    {
                        "slot_timming": "08:45",
                        "available_status": 0,
                        "slot_start_time": "2020-03-03 08:46:00 AM",
                        "slot_end_time": "2020-03-03 09:00:00 AM"
                    },
                    {
                        "slot_timming": "09:00",
                        "available_status": 0,
                        "slot_start_time": "2020-03-03 09:01:00 AM",
                        "slot_end_time": "2020-03-03 09:15:00 AM"
                    },
                    {
                        "slot_timming": "09:15",
                        "available_status": 0,
                        "slot_start_time": "2020-03-03 09:16:00 AM",
                        "slot_end_time": "2020-03-03 09:30:00 AM"
                    },
                    {
                        "slot_timming": "09:30",
                        "available_status": 0,
                        "slot_start_time": "2020-03-03 09:31:00 AM",
                        "slot_end_time": "2020-03-03 09:45:00 AM"
                    },
                    {
                        "slot_timming": "09:45",
                        "available_status": 0,
                        "slot_start_time": "2020-03-03 09:46:00 AM",
                        "slot_end_time": "2020-03-03 10:00:00 AM"
                    },
                    {
                        "slot_timming": "10:00",
                        "available_status": 0,
                        "slot_start_time": "2020-03-03 10:01:00 AM",
                        "slot_end_time": "2020-03-03 10:15:00 AM"
                    },
                    {
                        "slot_timming": "10:15",
                        "available_status": 0,
                        "slot_start_time": "2020-03-03 10:16:00 AM",
                        "slot_end_time": "2020-03-03 10:30:00 AM"
                    },
                    {
                        "slot_timming": "10:30",
                        "available_status": 0,
                        "slot_start_time": "2020-03-03 10:31:00 AM",
                        "slot_end_time": "2020-03-03 10:45:00 AM"
                    },
                    {
                        "slot_timming": "10:45",
                        "available_status": 0,
                        "slot_start_time": "2020-03-03 10:46:00 AM",
                        "slot_end_time": "2020-03-03 11:00:00 AM"
                    },
                    {
                        "slot_timming": "11:00",
                        "available_status": 0,
                        "slot_start_time": "2020-03-03 11:01:00 AM",
                        "slot_end_time": "2020-03-03 11:15:00 AM"
                    },
                    {
                        "slot_timming": "11:15",
                        "available_status": 0,
                        "slot_start_time": "2020-03-03 11:16:00 AM",
                        "slot_end_time": "2020-03-03 11:30:00 AM"
                    },
                    {
                        "slot_timming": "11:30",
                        "available_status": 0,
                        "slot_start_time": "2020-03-03 11:31:00 AM",
                        "slot_end_time": "2020-03-03 11:45:00 AM"
                    },
                    {
                        "slot_timming": "11:45",
                        "available_status": 0,
                        "slot_start_time": "2020-03-03 11:46:00 AM",
                        "slot_end_time": "2020-03-03 12:00:00 PM"
                    },
                    {
                        "slot_timming": "12:00",
                        "available_status": 0,
                        "slot_start_time": "2020-03-03 12:01:00 PM",
                        "slot_end_time": "2020-03-03 12:15:00 PM"
                    },
                    {
                        "slot_timming": "12:15",
                        "available_status": 0,
                        "slot_start_time": "2020-03-03 12:16:00 PM",
                        "slot_end_time": "2020-03-03 12:30:00 PM"
                    },
                    {
                        "slot_timming": "12:30",
                        "available_status": 0,
                        "slot_start_time": "2020-03-03 12:31:00 PM",
                        "slot_end_time": "2020-03-03 12:45:00 PM"
                    },
                    {
                        "slot_timming": "12:45",
                        "available_status": 0,
                        "slot_start_time": "2020-03-03 12:46:00 PM",
                        "slot_end_time": "2020-03-03 13:00:00 PM"
                    },
                    {
                        "slot_timming": "13:00",
                        "available_status": 0,
                        "slot_start_time": "2020-03-03 13:01:00 PM",
                        "slot_end_time": "2020-03-03 13:15:00 PM"
                    },
                    {
                        "slot_timming": "13:15",
                        "available_status": 0,
                        "slot_start_time": "2020-03-03 13:16:00 PM",
                        "slot_end_time": "2020-03-03 13:30:00 PM"
                    },
                    {
                        "slot_timming": "13:30",
                        "available_status": 0,
                        "slot_start_time": "2020-03-03 13:31:00 PM",
                        "slot_end_time": "2020-03-03 13:45:00 PM"
                    },
                    {
                        "slot_timming": "13:45",
                        "available_status": 0,
                        "slot_start_time": "2020-03-03 13:46:00 PM",
                        "slot_end_time": "2020-03-03 14:00:00 PM"
                    },
                    {
                        "slot_timming": "14:00",
                        "available_status": 0,
                        "slot_start_time": "2020-03-03 14:01:00 PM",
                        "slot_end_time": "2020-03-03 14:15:00 PM"
                    },
                    {
                        "slot_timming": "14:15",
                        "available_status": 0,
                        "slot_start_time": "2020-03-03 14:16:00 PM",
                        "slot_end_time": "2020-03-03 14:30:00 PM"
                    },
                    {
                        "slot_timming": "14:30",
                        "available_status": 0,
                        "slot_start_time": "2020-03-03 14:31:00 PM",
                        "slot_end_time": "2020-03-03 14:45:00 PM"
                    },
                    {
                        "slot_timming": "14:45",
                        "available_status": 0,
                        "slot_start_time": "2020-03-03 14:46:00 PM",
                        "slot_end_time": "2020-03-03 15:00:00 PM"
                    },
                    {
                        "slot_timming": "15:00",
                        "available_status": 0,
                        "slot_start_time": "2020-03-03 15:01:00 PM",
                        "slot_end_time": "2020-03-03 15:15:00 PM"
                    },
                    {
                        "slot_timming": "15:15",
                        "available_status": 0,
                        "slot_start_time": "2020-03-03 15:16:00 PM",
                        "slot_end_time": "2020-03-03 15:30:00 PM"
                    },
                    {
                        "slot_timming": "15:30",
                        "available_status": 0,
                        "slot_start_time": "2020-03-03 15:31:00 PM",
                        "slot_end_time": "2020-03-03 15:45:00 PM"
                    },
                    {
                        "slot_timming": "15:45",
                        "available_status": 0,
                        "slot_start_time": "2020-03-03 15:46:00 PM",
                        "slot_end_time": "2020-03-03 16:00:00 PM"
                    },
                    {
                        "slot_timming": "16:00",
                        "available_status": 0,
                        "slot_start_time": "2020-03-03 16:01:00 PM",
                        "slot_end_time": "2020-03-03 16:15:00 PM"
                    },
                    {
                        "slot_timming": "16:15",
                        "available_status": 0,
                        "slot_start_time": "2020-03-03 16:16:00 PM",
                        "slot_end_time": "2020-03-03 16:30:00 PM"
                    },
                    {
                        "slot_timming": "16:30",
                        "available_status": 0,
                        "slot_start_time": "2020-03-03 16:31:00 PM",
                        "slot_end_time": "2020-03-03 16:45:00 PM"
                    },
                    {
                        "slot_timming": "16:45",
                        "available_status": 1,
                        "slot_start_time": "2020-03-03 16:46:00 PM",
                        "slot_end_time": "2020-03-03 17:00:00 PM"
                    },
                    {
                        "slot_timming": "17:00",
                        "available_status": 1,
                        "slot_start_time": "2020-03-03 17:01:00 PM",
                        "slot_end_time": "2020-03-03 17:15:00 PM"
                    },
                    {
                        "slot_timming": "17:15",
                        "available_status": 1,
                        "slot_start_time": "2020-03-03 17:16:00 PM",
                        "slot_end_time": "2020-03-03 17:30:00 PM"
                    },
                    {
                        "slot_timming": "17:30",
                        "available_status": 1,
                        "slot_start_time": "2020-03-03 17:31:00 PM",
                        "slot_end_time": "2020-03-03 17:45:00 PM"
                    },
                    {
                        "slot_timming": "17:45",
                        "available_status": 1,
                        "slot_start_time": "2020-03-03 17:46:00 PM",
                        "slot_end_time": "2020-03-03 18:00:00 PM"
                    },
                    {
                        "slot_timming": "18:00",
                        "available_status": 1,
                        "slot_start_time": "2020-03-03 18:01:00 PM",
                        "slot_end_time": "2020-03-03 18:15:00 PM"
                    },
                    {
                        "slot_timming": "18:15",
                        "available_status": 1,
                        "slot_start_time": "2020-03-03 18:16:00 PM",
                        "slot_end_time": "2020-03-03 18:30:00 PM"
                    },
                    {
                        "slot_timming": "18:30",
                        "available_status": 1,
                        "slot_start_time": "2020-03-03 18:31:00 PM",
                        "slot_end_time": "2020-03-03 18:45:00 PM"
                    },
                    {
                        "slot_timming": "18:45",
                        "available_status": 1,
                        "slot_start_time": "2020-03-03 18:46:00 PM",
                        "slot_end_time": "2020-03-03 19:00:00 PM"
                    },
                    {
                        "slot_timming": "19:00",
                        "available_status": 1,
                        "slot_start_time": "2020-03-03 19:01:00 PM",
                        "slot_end_time": "2020-03-03 19:15:00 PM"
                    },
                    {
                        "slot_timming": "19:15",
                        "available_status": 1,
                        "slot_start_time": "2020-03-03 19:16:00 PM",
                        "slot_end_time": "2020-03-03 19:30:00 PM"
                    },
                    {
                        "slot_timming": "19:30",
                        "available_status": 1,
                        "slot_start_time": "2020-03-03 19:31:00 PM",
                        "slot_end_time": "2020-03-03 19:45:00 PM"
                    },
                    {
                        "slot_timming": "19:45",
                        "available_status": 1,
                        "slot_start_time": "2020-03-03 19:46:00 PM",
                        "slot_end_time": "2020-03-03 20:00:00 PM"
                    },
                    {
                        "slot_timming": "20:00",
                        "available_status": 1,
                        "slot_start_time": "2020-03-03 20:01:00 PM",
                        "slot_end_time": "2020-03-03 20:15:00 PM"
                    },
                    {
                        "slot_timming": "20:15",
                        "available_status": 1,
                        "slot_start_time": "2020-03-03 20:16:00 PM",
                        "slot_end_time": "2020-03-03 20:30:00 PM"
                    },
                    {
                        "slot_timming": "20:30",
                        "available_status": 1,
                        "slot_start_time": "2020-03-03 20:31:00 PM",
                        "slot_end_time": "2020-03-03 20:45:00 PM"
                    },
                    {
                        "slot_timming": "20:45",
                        "available_status": 1,
                        "slot_start_time": "2020-03-03 20:46:00 PM",
                        "slot_end_time": "2020-03-03 21:00:00 PM"
                    },
                    {
                        "slot_timming": "21:00",
                        "available_status": 1,
                        "slot_start_time": "2020-03-03 21:01:00 PM",
                        "slot_end_time": "2020-03-03 21:15:00 PM"
                    },
                    {
                        "slot_timming": "21:15",
                        "available_status": 1,
                        "slot_start_time": "2020-03-03 21:16:00 PM",
                        "slot_end_time": "2020-03-03 21:30:00 PM"
                    },
                    {
                        "slot_timming": "21:30",
                        "available_status": 1,
                        "slot_start_time": "2020-03-03 21:31:00 PM",
                        "slot_end_time": "2020-03-03 21:45:00 PM"
                    },
                    {
                        "slot_timming": "21:45",
                        "available_status": 1,
                        "slot_start_time": "2020-03-03 21:46:00 PM",
                        "slot_end_time": "2020-03-03 22:00:00 PM"
                    },
                    {
                        "slot_timming": "22:00",
                        "available_status": 1,
                        "slot_start_time": "2020-03-03 22:01:00 PM",
                        "slot_end_time": "2020-03-03 22:15:00 PM"
                    },
                    {
                        "slot_timming": "22:15",
                        "available_status": 1,
                        "slot_start_time": "2020-03-03 22:16:00 PM",
                        "slot_end_time": "2020-03-03 22:30:00 PM"
                    },
                    {
                        "slot_timming": "22:30",
                        "available_status": 1,
                        "slot_start_time": "2020-03-03 22:31:00 PM",
                        "slot_end_time": "2020-03-03 22:45:00 PM"
                    },
                    {
                        "slot_timming": "22:45",
                        "available_status": 1,
                        "slot_start_time": "2020-03-03 22:46:00 PM",
                        "slot_end_time": "2020-03-03 23:00:00 PM"
                    },
                    {
                        "slot_timming": "23:00",
                        "available_status": 1,
                        "slot_start_time": "2020-03-03 23:01:00 PM",
                        "slot_end_time": "2020-03-03 23:15:00 PM"
                    },
                    {
                        "slot_timming": "23:15",
                        "available_status": 1,
                        "slot_start_time": "2020-03-03 23:16:00 PM",
                        "slot_end_time": "2020-03-03 23:30:00 PM"
                    },
                    {
                        "slot_timming": "23:30",
                        "available_status": 1,
                        "slot_start_time": "2020-03-03 23:31:00 PM",
                        "slot_end_time": "2020-03-03 23:45:00 PM"
                    },
                    {
                        "slot_timming": "23:45",
                        "available_status": 1,
                        "slot_start_time": "2020-03-03 23:46:00 PM",
                        "slot_end_time": "2020-03-04 00:00:00 AM"
                    }
                ]
            },
            {
                "date": "2020-03-04",
                "slots": [
                    {
                        "slot_timming": "00:00",
                        "available_status": 1,
                        "slot_start_time": "2020-03-04 00:01:00 AM",
                        "slot_end_time": "2020-03-04 00:15:00 AM"
                    },
                    {
                        "slot_timming": "00:15",
                        "available_status": 1,
                        "slot_start_time": "2020-03-04 00:16:00 AM",
                        "slot_end_time": "2020-03-04 00:30:00 AM"
                    },
                    {
                        "slot_timming": "00:30",
                        "available_status": 1,
                        "slot_start_time": "2020-03-04 00:31:00 AM",
                        "slot_end_time": "2020-03-04 00:45:00 AM"
                    },
                    {
                        "slot_timming": "00:45",
                        "available_status": 1,
                        "slot_start_time": "2020-03-04 00:46:00 AM",
                        "slot_end_time": "2020-03-04 01:00:00 AM"
                    },
                    {
                        "slot_timming": "01:00",
                        "available_status": 1,
                        "slot_start_time": "2020-03-04 01:01:00 AM",
                        "slot_end_time": "2020-03-04 01:15:00 AM"
                    },
                    {
                        "slot_timming": "01:15",
                        "available_status": 1,
                        "slot_start_time": "2020-03-04 01:16:00 AM",
                        "slot_end_time": "2020-03-04 01:30:00 AM"
                    },
                    {
                        "slot_timming": "01:30",
                        "available_status": 1,
                        "slot_start_time": "2020-03-04 01:31:00 AM",
                        "slot_end_time": "2020-03-04 01:45:00 AM"
                    },
                    {
                        "slot_timming": "01:45",
                        "available_status": 1,
                        "slot_start_time": "2020-03-04 01:46:00 AM",
                        "slot_end_time": "2020-03-04 02:00:00 AM"
                    },
                    {
                        "slot_timming": "02:00",
                        "available_status": 1,
                        "slot_start_time": "2020-03-04 02:01:00 AM",
                        "slot_end_time": "2020-03-04 02:15:00 AM"
                    },
                    {
                        "slot_timming": "02:15",
                        "available_status": 1,
                        "slot_start_time": "2020-03-04 02:16:00 AM",
                        "slot_end_time": "2020-03-04 02:30:00 AM"
                    },
                    {
                        "slot_timming": "02:30",
                        "available_status": 1,
                        "slot_start_time": "2020-03-04 02:31:00 AM",
                        "slot_end_time": "2020-03-04 02:45:00 AM"
                    },
                    {
                        "slot_timming": "02:45",
                        "available_status": 1,
                        "slot_start_time": "2020-03-04 02:46:00 AM",
                        "slot_end_time": "2020-03-04 03:00:00 AM"
                    },
                    {
                        "slot_timming": "03:00",
                        "available_status": 1,
                        "slot_start_time": "2020-03-04 03:01:00 AM",
                        "slot_end_time": "2020-03-04 03:15:00 AM"
                    },
                    {
                        "slot_timming": "03:15",
                        "available_status": 1,
                        "slot_start_time": "2020-03-04 03:16:00 AM",
                        "slot_end_time": "2020-03-04 03:30:00 AM"
                    },
                    {
                        "slot_timming": "03:30",
                        "available_status": 1,
                        "slot_start_time": "2020-03-04 03:31:00 AM",
                        "slot_end_time": "2020-03-04 03:45:00 AM"
                    },
                    {
                        "slot_timming": "03:45",
                        "available_status": 1,
                        "slot_start_time": "2020-03-04 03:46:00 AM",
                        "slot_end_time": "2020-03-04 04:00:00 AM"
                    },
                    {
                        "slot_timming": "04:00",
                        "available_status": 1,
                        "slot_start_time": "2020-03-04 04:01:00 AM",
                        "slot_end_time": "2020-03-04 04:15:00 AM"
                    },
                    {
                        "slot_timming": "04:15",
                        "available_status": 1,
                        "slot_start_time": "2020-03-04 04:16:00 AM",
                        "slot_end_time": "2020-03-04 04:30:00 AM"
                    },
                    {
                        "slot_timming": "04:30",
                        "available_status": 1,
                        "slot_start_time": "2020-03-04 04:31:00 AM",
                        "slot_end_time": "2020-03-04 04:45:00 AM"
                    },
                    {
                        "slot_timming": "04:45",
                        "available_status": 1,
                        "slot_start_time": "2020-03-04 04:46:00 AM",
                        "slot_end_time": "2020-03-04 05:00:00 AM"
                    },
                    {
                        "slot_timming": "05:00",
                        "available_status": 1,
                        "slot_start_time": "2020-03-04 05:01:00 AM",
                        "slot_end_time": "2020-03-04 05:15:00 AM"
                    },
                    {
                        "slot_timming": "05:15",
                        "available_status": 1,
                        "slot_start_time": "2020-03-04 05:16:00 AM",
                        "slot_end_time": "2020-03-04 05:30:00 AM"
                    },
                    {
                        "slot_timming": "05:30",
                        "available_status": 1,
                        "slot_start_time": "2020-03-04 05:31:00 AM",
                        "slot_end_time": "2020-03-04 05:45:00 AM"
                    },
                    {
                        "slot_timming": "05:45",
                        "available_status": 1,
                        "slot_start_time": "2020-03-04 05:46:00 AM",
                        "slot_end_time": "2020-03-04 06:00:00 AM"
                    },
                    {
                        "slot_timming": "06:00",
                        "available_status": 1,
                        "slot_start_time": "2020-03-04 06:01:00 AM",
                        "slot_end_time": "2020-03-04 06:15:00 AM"
                    },
                    {
                        "slot_timming": "06:15",
                        "available_status": 1,
                        "slot_start_time": "2020-03-04 06:16:00 AM",
                        "slot_end_time": "2020-03-04 06:30:00 AM"
                    },
                    {
                        "slot_timming": "06:30",
                        "available_status": 1,
                        "slot_start_time": "2020-03-04 06:31:00 AM",
                        "slot_end_time": "2020-03-04 06:45:00 AM"
                    },
                    {
                        "slot_timming": "06:45",
                        "available_status": 1,
                        "slot_start_time": "2020-03-04 06:46:00 AM",
                        "slot_end_time": "2020-03-04 07:00:00 AM"
                    },
                    {
                        "slot_timming": "07:00",
                        "available_status": 1,
                        "slot_start_time": "2020-03-04 07:01:00 AM",
                        "slot_end_time": "2020-03-04 07:15:00 AM"
                    },
                    {
                        "slot_timming": "07:15",
                        "available_status": 1,
                        "slot_start_time": "2020-03-04 07:16:00 AM",
                        "slot_end_time": "2020-03-04 07:30:00 AM"
                    },
                    {
                        "slot_timming": "07:30",
                        "available_status": 1,
                        "slot_start_time": "2020-03-04 07:31:00 AM",
                        "slot_end_time": "2020-03-04 07:45:00 AM"
                    },
                    {
                        "slot_timming": "07:45",
                        "available_status": 1,
                        "slot_start_time": "2020-03-04 07:46:00 AM",
                        "slot_end_time": "2020-03-04 08:00:00 AM"
                    },
                    {
                        "slot_timming": "08:00",
                        "available_status": 1,
                        "slot_start_time": "2020-03-04 08:01:00 AM",
                        "slot_end_time": "2020-03-04 08:15:00 AM"
                    },
                    {
                        "slot_timming": "08:15",
                        "available_status": 1,
                        "slot_start_time": "2020-03-04 08:16:00 AM",
                        "slot_end_time": "2020-03-04 08:30:00 AM"
                    },
                    {
                        "slot_timming": "08:30",
                        "available_status": 1,
                        "slot_start_time": "2020-03-04 08:31:00 AM",
                        "slot_end_time": "2020-03-04 08:45:00 AM"
                    },
                    {
                        "slot_timming": "08:45",
                        "available_status": 0,
                        "slot_start_time": "2020-03-04 08:46:00 AM",
                        "slot_end_time": "2020-03-04 09:00:00 AM"
                    },
                    {
                        "slot_timming": "09:00",
                        "available_status": 0,
                        "slot_start_time": "2020-03-04 09:01:00 AM",
                        "slot_end_time": "2020-03-04 09:15:00 AM"
                    },
                    {
                        "slot_timming": "09:15",
                        "available_status": 0,
                        "slot_start_time": "2020-03-04 09:16:00 AM",
                        "slot_end_time": "2020-03-04 09:30:00 AM"
                    },
                    {
                        "slot_timming": "09:30",
                        "available_status": 0,
                        "slot_start_time": "2020-03-04 09:31:00 AM",
                        "slot_end_time": "2020-03-04 09:45:00 AM"
                    },
                    {
                        "slot_timming": "09:45",
                        "available_status": 0,
                        "slot_start_time": "2020-03-04 09:46:00 AM",
                        "slot_end_time": "2020-03-04 10:00:00 AM"
                    },
                    {
                        "slot_timming": "10:00",
                        "available_status": 0,
                        "slot_start_time": "2020-03-04 10:01:00 AM",
                        "slot_end_time": "2020-03-04 10:15:00 AM"
                    },
                    {
                        "slot_timming": "10:15",
                        "available_status": 0,
                        "slot_start_time": "2020-03-04 10:16:00 AM",
                        "slot_end_time": "2020-03-04 10:30:00 AM"
                    },
                    {
                        "slot_timming": "10:30",
                        "available_status": 0,
                        "slot_start_time": "2020-03-04 10:31:00 AM",
                        "slot_end_time": "2020-03-04 10:45:00 AM"
                    },
                    {
                        "slot_timming": "10:45",
                        "available_status": 0,
                        "slot_start_time": "2020-03-04 10:46:00 AM",
                        "slot_end_time": "2020-03-04 11:00:00 AM"
                    },
                    {
                        "slot_timming": "11:00",
                        "available_status": 0,
                        "slot_start_time": "2020-03-04 11:01:00 AM",
                        "slot_end_time": "2020-03-04 11:15:00 AM"
                    },
                    {
                        "slot_timming": "11:15",
                        "available_status": 0,
                        "slot_start_time": "2020-03-04 11:16:00 AM",
                        "slot_end_time": "2020-03-04 11:30:00 AM"
                    },
                    {
                        "slot_timming": "11:30",
                        "available_status": 0,
                        "slot_start_time": "2020-03-04 11:31:00 AM",
                        "slot_end_time": "2020-03-04 11:45:00 AM"
                    },
                    {
                        "slot_timming": "11:45",
                        "available_status": 0,
                        "slot_start_time": "2020-03-04 11:46:00 AM",
                        "slot_end_time": "2020-03-04 12:00:00 PM"
                    },
                    {
                        "slot_timming": "12:00",
                        "available_status": 0,
                        "slot_start_time": "2020-03-04 12:01:00 PM",
                        "slot_end_time": "2020-03-04 12:15:00 PM"
                    },
                    {
                        "slot_timming": "12:15",
                        "available_status": 0,
                        "slot_start_time": "2020-03-04 12:16:00 PM",
                        "slot_end_time": "2020-03-04 12:30:00 PM"
                    },
                    {
                        "slot_timming": "12:30",
                        "available_status": 0,
                        "slot_start_time": "2020-03-04 12:31:00 PM",
                        "slot_end_time": "2020-03-04 12:45:00 PM"
                    },
                    {
                        "slot_timming": "12:45",
                        "available_status": 0,
                        "slot_start_time": "2020-03-04 12:46:00 PM",
                        "slot_end_time": "2020-03-04 13:00:00 PM"
                    },
                    {
                        "slot_timming": "13:00",
                        "available_status": 0,
                        "slot_start_time": "2020-03-04 13:01:00 PM",
                        "slot_end_time": "2020-03-04 13:15:00 PM"
                    },
                    {
                        "slot_timming": "13:15",
                        "available_status": 0,
                        "slot_start_time": "2020-03-04 13:16:00 PM",
                        "slot_end_time": "2020-03-04 13:30:00 PM"
                    },
                    {
                        "slot_timming": "13:30",
                        "available_status": 0,
                        "slot_start_time": "2020-03-04 13:31:00 PM",
                        "slot_end_time": "2020-03-04 13:45:00 PM"
                    },
                    {
                        "slot_timming": "13:45",
                        "available_status": 0,
                        "slot_start_time": "2020-03-04 13:46:00 PM",
                        "slot_end_time": "2020-03-04 14:00:00 PM"
                    },
                    {
                        "slot_timming": "14:00",
                        "available_status": 0,
                        "slot_start_time": "2020-03-04 14:01:00 PM",
                        "slot_end_time": "2020-03-04 14:15:00 PM"
                    },
                    {
                        "slot_timming": "14:15",
                        "available_status": 0,
                        "slot_start_time": "2020-03-04 14:16:00 PM",
                        "slot_end_time": "2020-03-04 14:30:00 PM"
                    },
                    {
                        "slot_timming": "14:30",
                        "available_status": 0,
                        "slot_start_time": "2020-03-04 14:31:00 PM",
                        "slot_end_time": "2020-03-04 14:45:00 PM"
                    },
                    {
                        "slot_timming": "14:45",
                        "available_status": 0,
                        "slot_start_time": "2020-03-04 14:46:00 PM",
                        "slot_end_time": "2020-03-04 15:00:00 PM"
                    },
                    {
                        "slot_timming": "15:00",
                        "available_status": 0,
                        "slot_start_time": "2020-03-04 15:01:00 PM",
                        "slot_end_time": "2020-03-04 15:15:00 PM"
                    },
                    {
                        "slot_timming": "15:15",
                        "available_status": 0,
                        "slot_start_time": "2020-03-04 15:16:00 PM",
                        "slot_end_time": "2020-03-04 15:30:00 PM"
                    },
                    {
                        "slot_timming": "15:30",
                        "available_status": 0,
                        "slot_start_time": "2020-03-04 15:31:00 PM",
                        "slot_end_time": "2020-03-04 15:45:00 PM"
                    },
                    {
                        "slot_timming": "15:45",
                        "available_status": 0,
                        "slot_start_time": "2020-03-04 15:46:00 PM",
                        "slot_end_time": "2020-03-04 16:00:00 PM"
                    },
                    {
                        "slot_timming": "16:00",
                        "available_status": 0,
                        "slot_start_time": "2020-03-04 16:01:00 PM",
                        "slot_end_time": "2020-03-04 16:15:00 PM"
                    },
                    {
                        "slot_timming": "16:15",
                        "available_status": 0,
                        "slot_start_time": "2020-03-04 16:16:00 PM",
                        "slot_end_time": "2020-03-04 16:30:00 PM"
                    },
                    {
                        "slot_timming": "16:30",
                        "available_status": 0,
                        "slot_start_time": "2020-03-04 16:31:00 PM",
                        "slot_end_time": "2020-03-04 16:45:00 PM"
                    },
                    {
                        "slot_timming": "16:45",
                        "available_status": 1,
                        "slot_start_time": "2020-03-04 16:46:00 PM",
                        "slot_end_time": "2020-03-04 17:00:00 PM"
                    },
                    {
                        "slot_timming": "17:00",
                        "available_status": 1,
                        "slot_start_time": "2020-03-04 17:01:00 PM",
                        "slot_end_time": "2020-03-04 17:15:00 PM"
                    },
                    {
                        "slot_timming": "17:15",
                        "available_status": 1,
                        "slot_start_time": "2020-03-04 17:16:00 PM",
                        "slot_end_time": "2020-03-04 17:30:00 PM"
                    },
                    {
                        "slot_timming": "17:30",
                        "available_status": 1,
                        "slot_start_time": "2020-03-04 17:31:00 PM",
                        "slot_end_time": "2020-03-04 17:45:00 PM"
                    },
                    {
                        "slot_timming": "17:45",
                        "available_status": 1,
                        "slot_start_time": "2020-03-04 17:46:00 PM",
                        "slot_end_time": "2020-03-04 18:00:00 PM"
                    },
                    {
                        "slot_timming": "18:00",
                        "available_status": 1,
                        "slot_start_time": "2020-03-04 18:01:00 PM",
                        "slot_end_time": "2020-03-04 18:15:00 PM"
                    },
                    {
                        "slot_timming": "18:15",
                        "available_status": 1,
                        "slot_start_time": "2020-03-04 18:16:00 PM",
                        "slot_end_time": "2020-03-04 18:30:00 PM"
                    },
                    {
                        "slot_timming": "18:30",
                        "available_status": 1,
                        "slot_start_time": "2020-03-04 18:31:00 PM",
                        "slot_end_time": "2020-03-04 18:45:00 PM"
                    },
                    {
                        "slot_timming": "18:45",
                        "available_status": 1,
                        "slot_start_time": "2020-03-04 18:46:00 PM",
                        "slot_end_time": "2020-03-04 19:00:00 PM"
                    },
                    {
                        "slot_timming": "19:00",
                        "available_status": 1,
                        "slot_start_time": "2020-03-04 19:01:00 PM",
                        "slot_end_time": "2020-03-04 19:15:00 PM"
                    },
                    {
                        "slot_timming": "19:15",
                        "available_status": 1,
                        "slot_start_time": "2020-03-04 19:16:00 PM",
                        "slot_end_time": "2020-03-04 19:30:00 PM"
                    },
                    {
                        "slot_timming": "19:30",
                        "available_status": 1,
                        "slot_start_time": "2020-03-04 19:31:00 PM",
                        "slot_end_time": "2020-03-04 19:45:00 PM"
                    },
                    {
                        "slot_timming": "19:45",
                        "available_status": 1,
                        "slot_start_time": "2020-03-04 19:46:00 PM",
                        "slot_end_time": "2020-03-04 20:00:00 PM"
                    },
                    {
                        "slot_timming": "20:00",
                        "available_status": 1,
                        "slot_start_time": "2020-03-04 20:01:00 PM",
                        "slot_end_time": "2020-03-04 20:15:00 PM"
                    },
                    {
                        "slot_timming": "20:15",
                        "available_status": 1,
                        "slot_start_time": "2020-03-04 20:16:00 PM",
                        "slot_end_time": "2020-03-04 20:30:00 PM"
                    },
                    {
                        "slot_timming": "20:30",
                        "available_status": 1,
                        "slot_start_time": "2020-03-04 20:31:00 PM",
                        "slot_end_time": "2020-03-04 20:45:00 PM"
                    },
                    {
                        "slot_timming": "20:45",
                        "available_status": 1,
                        "slot_start_time": "2020-03-04 20:46:00 PM",
                        "slot_end_time": "2020-03-04 21:00:00 PM"
                    },
                    {
                        "slot_timming": "21:00",
                        "available_status": 1,
                        "slot_start_time": "2020-03-04 21:01:00 PM",
                        "slot_end_time": "2020-03-04 21:15:00 PM"
                    },
                    {
                        "slot_timming": "21:15",
                        "available_status": 1,
                        "slot_start_time": "2020-03-04 21:16:00 PM",
                        "slot_end_time": "2020-03-04 21:30:00 PM"
                    },
                    {
                        "slot_timming": "21:30",
                        "available_status": 1,
                        "slot_start_time": "2020-03-04 21:31:00 PM",
                        "slot_end_time": "2020-03-04 21:45:00 PM"
                    },
                    {
                        "slot_timming": "21:45",
                        "available_status": 1,
                        "slot_start_time": "2020-03-04 21:46:00 PM",
                        "slot_end_time": "2020-03-04 22:00:00 PM"
                    },
                    {
                        "slot_timming": "22:00",
                        "available_status": 1,
                        "slot_start_time": "2020-03-04 22:01:00 PM",
                        "slot_end_time": "2020-03-04 22:15:00 PM"
                    },
                    {
                        "slot_timming": "22:15",
                        "available_status": 1,
                        "slot_start_time": "2020-03-04 22:16:00 PM",
                        "slot_end_time": "2020-03-04 22:30:00 PM"
                    },
                    {
                        "slot_timming": "22:30",
                        "available_status": 1,
                        "slot_start_time": "2020-03-04 22:31:00 PM",
                        "slot_end_time": "2020-03-04 22:45:00 PM"
                    },
                    {
                        "slot_timming": "22:45",
                        "available_status": 1,
                        "slot_start_time": "2020-03-04 22:46:00 PM",
                        "slot_end_time": "2020-03-04 23:00:00 PM"
                    },
                    {
                        "slot_timming": "23:00",
                        "available_status": 1,
                        "slot_start_time": "2020-03-04 23:01:00 PM",
                        "slot_end_time": "2020-03-04 23:15:00 PM"
                    },
                    {
                        "slot_timming": "23:15",
                        "available_status": 1,
                        "slot_start_time": "2020-03-04 23:16:00 PM",
                        "slot_end_time": "2020-03-04 23:30:00 PM"
                    },
                    {
                        "slot_timming": "23:30",
                        "available_status": 1,
                        "slot_start_time": "2020-03-04 23:31:00 PM",
                        "slot_end_time": "2020-03-04 23:45:00 PM"
                    },
                    {
                        "slot_timming": "23:45",
                        "available_status": 1,
                        "slot_start_time": "2020-03-04 23:46:00 PM",
                        "slot_end_time": "2020-03-05 00:00:00 AM"
                    }
                ]
            }
        ]
    }
}

## Create Fleet Wallet Transaction [/fleet/wallet/create_transaction]

### Create Fleet Wallet Transaction [POST]

This API is used to transact amount to or from agent wallet.

Request Body Parameters : 
<table class="humanColumnApiDescription markdown formalTheme">
<tr><td colspan="1"><strong>Name</strong><td colspan="1"><strong>Type</strong><td colspan="1"><strong>Description</strong></td></tr>
<tr><td style="padding-right: 40px; width: 140px;">api_key</td><td>string</td> <td> You can generate a key from settings(Login>Menu>Settings>API Keys) in your tookan account. Or <a href="https://app.tookanapp.com/#/app/settings/apikey">click here</a> to get API key</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">fleet_id*</td><td>number</td> <td>This is the unique id of every agent. You can get it from the Dashboard>Menu>Agent>respective id of the agent will be displayed.
<tr><td style="padding-right: 40px; width: 140px;">amount*</td><td>number</td> <td>Amount must be greater than 0.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">reference_id</td><td>string (optional)</td> <td>This is optional reference id for the transaction.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">transaction_type*</td><td>number</td> <td>Send 1 for debit and 2 for credit.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">wallet_type*</td><td>number</td> <td>Send 1 if you want to transact to/from wallet and 2 for credits.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">description</td> <td>string (optional)</td> <td>This is optional description field for the transction.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">remarks</td> <td>string (optional)</td> <td>This is optional remarks field for the transction.</td></tr>
</table>

+ Request (application/json) 

         {
            "api_key":"55631.076225def1849131c152c3017162c431fe4c4fe2c",
            "fleet_id":165932,
            "amount":55,
            "transaction_type" : 1,
            "wallet_type" : 2,
            "description" : "this is a test transaction"
        }
        
+ Response 200 (application/json)

        {
          "message": "Successful",
          "status": 200,
          "data": {}
        } 
        


## Get Fleet Wallet Transaction [/fleet/wallet/read_transaction_history]

### Get Fleet Wallet Transaction History [POST]

This API is used to get agent wallet transaction history.

Request Body Parameters : 
<table class="humanColumnApiDescription markdown formalTheme">
<tr><td colspan="1"><strong>Name</strong><td colspan="1"><strong>Type</strong><td colspan="1"><strong>Description</strong></td></tr>
<tr><td style="padding-right: 40px; width: 140px;">api_key</td><td>string</td> <td> You can generate a key from settings(Login>Menu>Settings>API Keys) in your tookan account. Or <a href="https://app.tookanapp.com/#/app/settings/apikey">click here</a> to get API key</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">fleet_id*</td><td>number</td> <td>This is the unique id of every agent. You can get it from the Dashboard>Menu>Agent>respective id of the agent will be displayed.
<tr><td style="padding-right: 40px; width: 140px;">starting_date</td><td>date</td> <td>Start date specified in YYYY-MM-DD format</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">ending_date</td><td>date</td> <td>End date specified in YYYY-MM-DD format</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">wallet_type</td><td>number</td> <td>Send 1 for agent wallet and 2 for credits.</td></tr>
</table>

+ Request (application/json) 

         {
            "api_key":"55631.076225def1849131c152c3017162c431fe4c4fe2c",
            "fleet_id":165932,
            "wallet_type" : 2,
            "starting_date" : "2019-12-31",
            "ending_date" : "2020-01-05"
        }
        
+ Response 200 (application/json)

        {
"message":"Successful",
"status":200,
"data":{
"transaction_history":[
{
"id":544006,
"fleet_id":56782,
"reference_id":"B040420",
"transaction_type":1,
"amount":14700,
"description":"test description",
"remarks":null,
"creation_datetime":"2020-01-02T01:43:19.000Z",
"wallet_type":2,
"username":"S. Borin"
}
],
"wallet_balance":[
{
"wallet_type":1,
"wallet_balance":33000
},
{
"wallet_type":2,
"wallet_balance":718600
}
],
"total_count":1
}
}
        
        

# Group Team

## Create Team [/create_team]

### Create Team [POST]

This API is used to create a team

Body Parameters:
<table>
<tr><td style="padding-left: 0;" colspan="2"><strong>Name</strong><td><strong>Type</strong></td><td><strong>Description</strong></td></tr>
<tr><td style="padding-left: 0;" colspan="2">api_key</td><td>string</td><td> You can generate a key from settings(Login>Menu>Settings>API Keys) in your Tookan account. Or <a href="https://app.tookanapp.com/#/app/settings/apikey">click here</a> to get API Key.</td></tr>
<tr><td style="padding-left: 0;" colspan="2">team_name*</td><td>string</td><td> This is the name of the team to be created.</td></tr>
<tr><td style="padding-left: 0;" colspan="2">battery_usage</td><td>string</td><td> This is parameter decides the battery usage and accuracy level of agent's mobile. If '0', it is low. If '1', it is Medium. If '2' It is High.</td></tr>
<tr><td style="padding-left: 0;" colspan="2">address</td><td>string</td><td> This is the address of the team to be created.</td></tr>
<tr><td style="padding-left: 0;" colspan="2">tags</td><td>string</td><td>This is tags that you can mention for any team.</td></tr>
</table>

+ Request (application/json)

            {
                "api_key": "7eeca84b5e1df27d15f8422949314db6",
                "team_name":"Test Team",
                "battery_usage":0,
                "address":"Chandigarh, India",
                "tags":"tag1,tag2"
            }

+ Response 200 (application/json)

        {
          "message": "Successful",
          "status": 200,
          "data": 1
        }
        
## Update Team [/update_team]

### Update Team [POST]

This API is used to update a team.

Body Parameters:
<table>
<tr><td style="padding-left: 0;" colspan="2"><strong>Name</strong><td><strong>Type</strong></td><td><strong>Description</strong></td></tr>
<tr><td style="padding-left: 0;" colspan="2">api_key</td><td>string</td><td> You can generate a key from settings(Login>Menu>Settings>API Keys) in your Tookan account. Or <a href="https://app.tookanapp.com/#/app/settings/apikey">click here</a> to get API Key.</td></tr>
<tr><td style="padding-left: 0;" colspan="2">team_name</td><td>string</td><td> This is the name of the team to be created.</td></tr>
<tr><td style="padding-left: 0;" colspan="2">battery_usage</td><td>number</td><td> This is parameter decides the battery usage and accuracy level of agent's mobile. If '0', it is low. If '1', it is Medium. If '2' It is High.</td></tr>
<tr><td style="padding-left: 0;" colspan="2">tags</td><td>string</td><td>This is tags that you can mention for any team.</td></tr>
<tr><td style="padding-left: 0;" colspan="2">team_id*</td><td>number</td><td>This is team_id that you can mention for any team.</td></tr>
</table>

+ Request (application/json)

            {
                "api_key": "7eeca84b5e1df27d15f8422949314db6",
                "team_name":"Test Team",
                "battery_usage":0,
                "tags":"tag1,tag2",
                "team_id":49928
            }

+ Response 200 (application/json)

        {
          "message": "Successful",
          "status": 200,
          "data": {}
        }

## Delete Team [/delete_team]

### Delete Team [POST]

This API is used to delete a team.

Body Parameters:
<table>
<tr><td style="padding-left: 0;" colspan="2"><strong>Name</strong><td><strong>Type</strong></td><td><strong>Description</strong></td></tr>
<tr><td style="padding-left: 0;" colspan="2">api_key</td><td>string</td><td> You can generate a key from settings(Login>Menu>Settings>API Keys) in your Tookan account. Or <a href="https://app.tookanapp.com/#/app/settings/apikey">click here</a> to get API Key.</td></tr>
<tr><td style="padding-left: 0;" colspan="2">team_id*</td><td>number</td><td>This is team_id that you can mention for any team.</td></tr>
</table>

+ Request (application/json)

            {
                "api_key": "7eeca84b5e1df27d15f8422949314db6",
                "team_id": 49928
            }

+ Response 200 (application/json)

        {
          "message": "Successful",
          "status": 200,
          "data": {}
        }
## Get Team Details [/view_teams]

### Get Team Details [POST]

This API is used to get the all the team details along with their agents' data

Request Body Parameters:
<table>
<tr><td style="padding-left: 0;" colspan="2"><strong>Name</strong><td><strong>Type</strong></td><td><strong>Description</strong></td></tr>
<tr><td style="padding-left: 0;" colspan="2">api_key</td><td>string</td><td> You can generate a key from settings(Login>Menu>Settings>API Keys) in your tookan account. Or <a href="https://app.tookanapp.com/#/app/settings/apikey">click here</a> to get API key</td></tr>
</table>

+ Request (application/json)

            {
                "api_key": "7eeca84b5e1df27d15f8422949314db6"
            }

+ Response 200 (application/json)

        {
          "message": "Successful",
          "status": 200,
          "data": [
            {
              "team_id": 229,
              "team_name": "Bay Area",
              "fleets": [
                {
                  "fleet_id": 541,
                  "fleet_name": "Theresa Brigham",
                  "fleet_image": "https://tookan.s3.amazonaws.com/fleet_profile/eSbp1440069054278-51.jpg",
                  "fleet_thumb_image": "https://tookan.s3.amazonaws.com/fleet_thumb_profile/thumb-hrIr1440069054689-eSbp1440069054278-51.jpg",
                  "is_deleted": 0,
                  "status": 0,
                  "email": "contact+f7@tookanapp.com",
                  "is_available": 1,
                  "is_active": 1,
                  "latitude": "37.7900273",
                  "longitude": "-122.4574444",
                  "last_updated_location_time": "Connection Lost",
                  "last_updated_timings": 10807986,
                  "registration_status": 1
                },
                {
                  "fleet_id": 542,
                  "fleet_name": "Eric Edmundson",
                  "fleet_image": "https://tookan.s3.amazonaws.com/fleet_profile/Sq2a1440068934631-77.jpg",
                  "fleet_thumb_image": "https://tookan.s3.amazonaws.com/fleet_thumb_profile/thumb-XRbq1440068935079-Sq2a1440068934631-77.jpg",
                  "is_deleted": 0,
                  "status": 0,
                  "email": "contact+f6@tookanapp.com",
                  "is_available": 1,
                  "is_active": 1,
                  "latitude": "37.751424",
                  "longitude": "-122.488425",
                  "last_updated_location_time": "Connection Lost",
                  "last_updated_timings": 10807585,
                  "registration_status": 1
                },
                {
                  "fleet_id": 543,
                  "fleet_name": "Michael Obryan",
                  "fleet_image": "https://tookan.s3.amazonaws.com/fleet_profile/baMf1440068853977-64.jpg",
                  "fleet_thumb_image": "https://tookan.s3.amazonaws.com/fleet_thumb_profile/thumb-qpBN1440068854485-baMf1440068853977-64.jpg",
                  "is_deleted": 0,
                  "status": 0,
                  "email": "contact+f1@tookanapp.com",
                  "is_available": 1,
                  "is_active": 1,
                  "latitude": "37.718329",
                  "longitude": "-122.470461",
                  "last_updated_location_time": "Connection Lost",
                  "last_updated_timings": 10807691,
                  "registration_status": 1
                },
                {
                  "fleet_id": 544,
                  "fleet_name": "John Wright",
                  "fleet_image": "https://tookan.s3.amazonaws.com/fleet_profile/f7tr1440068791338-37.jpg",
                  "fleet_thumb_image": "https://tookan.s3.amazonaws.com/fleet_thumb_profile/thumb-dbk61440068791719-f7tr1440068791338-37.jpg",
                  "is_deleted": 0,
                  "status": 0,
                  "email": "contact+f2@tookanapp.com",
                  "is_available": 1,
                  "is_active": 1,
                  "latitude": "37.747614",
                  "longitude": " -122.444841",
                  "last_updated_location_time": "Connection Lost",
                  "last_updated_timings": 10805966,
                  "registration_status": 1
                },
                {
                  "fleet_id": 545,
                  "fleet_name": "Ricky Palmer",
                  "fleet_image": "https://tookan.s3.amazonaws.com/fleet_profile/wnuw1440068822665-7.jpg",
                  "fleet_thumb_image": "https://tookan.s3.amazonaws.com/fleet_thumb_profile/thumb-2TW81440068823091-wnuw1440068822665-7.jpg",
                  "is_deleted": 0,
                  "status": 0,
                  "email": "contact+f3@tookanapp.com",
                  "is_available": 1,
                  "is_active": 1,
                  "latitude": "37.758369",
                  "longitude": " -122.424066",
                  "last_updated_location_time": "Connection Lost",
                  "last_updated_timings": 10805735,
                  "registration_status": 1
                },
                {
                  "fleet_id": 547,
                  "fleet_name": "Elmer Gray",
                  "fleet_image": "https://tookan.s3.amazonaws.com/fleet_profile/kmet1440064617466-111.jpg",
                  "fleet_thumb_image": "https://tookan.s3.amazonaws.com/fleet_thumb_profile/thumb-YIBZ1440064617919-kmet1440064617466-111.jpg",
                  "is_deleted": 0,
                  "status": 0,
                  "email": "contact+f4@tookanapp.com",
                  "is_available": 1,
                  "is_active": 1,
                  "latitude": "37.765408",
                  "longitude": " -122.440389",
                  "last_updated_location_time": "Connection Lost",
                  "last_updated_timings": 10805341,
                  "registration_status": 1
                },
                {
                  "fleet_id": 2957,
                  "fleet_name": "Mike Frugan",
                  "fleet_image": "https://tookan.s3.amazonaws.com/fleet_profile/user.png",
                  "fleet_thumb_image": "https://tookan.s3.amazonaws.com/fleet_thumb_profile/user.png",
                  "is_deleted": 0,
                  "status": 0,
                  "email": "mike@gmail.com",
                  "is_available": 1,
                  "is_active": 1,
                  "latitude": null,
                  "longitude": null,
                  "last_updated_location_time": "Not updated.",
                  "last_updated_timings": 999999999999999,
                  "registration_status": 0
                }
              ]
            },
            {
              "team_id": 230,
              "team_name": "South Bay",
              "fleets": [
                {
                  "fleet_id": 541,
                  "fleet_name": "Theresa Brigham",
                  "fleet_image": "https://tookan.s3.amazonaws.com/fleet_profile/eSbp1440069054278-51.jpg",
                  "fleet_thumb_image": "https://tookan.s3.amazonaws.com/fleet_thumb_profile/thumb-hrIr1440069054689-eSbp1440069054278-51.jpg",
                  "is_deleted": 0,
                  "status": 0,
                  "email": "contact+f7@tookanapp.com",
                  "is_available": 1,
                  "is_active": 1,
                  "latitude": "37.7900273",
                  "longitude": "-122.4574444",
                  "last_updated_location_time": "Connection Lost",
                  "last_updated_timings": 10807986,
                  "registration_status": 1
                },
                {
                  "fleet_id": 542,
                  "fleet_name": "Eric Edmundson",
                  "fleet_image": "https://tookan.s3.amazonaws.com/fleet_profile/Sq2a1440068934631-77.jpg",
                  "fleet_thumb_image": "https://tookan.s3.amazonaws.com/fleet_thumb_profile/thumb-XRbq1440068935079-Sq2a1440068934631-77.jpg",
                  "is_deleted": 0,
                  "status": 0,
                  "email": "contact+f6@tookanapp.com",
                  "is_available": 1,
                  "is_active": 1,
                  "latitude": "37.751424",
                  "longitude": "-122.488425",
                  "last_updated_location_time": "Connection Lost",
                  "last_updated_timings": 10807585,
                  "registration_status": 1
                },
                {
                  "fleet_id": 543,
                  "fleet_name": "Michael Obryan",
                  "fleet_image": "https://tookan.s3.amazonaws.com/fleet_profile/baMf1440068853977-64.jpg",
                  "fleet_thumb_image": "https://tookan.s3.amazonaws.com/fleet_thumb_profile/thumb-qpBN1440068854485-baMf1440068853977-64.jpg",
                  "is_deleted": 0,
                  "status": 0,
                  "email": "contact+f1@tookanapp.com",
                  "is_available": 1,
                  "is_active": 1,
                  "latitude": "37.718329",
                  "longitude": "-122.470461",
                  "last_updated_location_time": "Connection Lost",
                  "last_updated_timings": 10807691,
                  "registration_status": 1
                },
                {
                  "fleet_id": 544,
                  "fleet_name": "John Wright",
                  "fleet_image": "https://tookan.s3.amazonaws.com/fleet_profile/f7tr1440068791338-37.jpg",
                  "fleet_thumb_image": "https://tookan.s3.amazonaws.com/fleet_thumb_profile/thumb-dbk61440068791719-f7tr1440068791338-37.jpg",
                  "is_deleted": 0,
                  "status": 0,
                  "email": "contact+f2@tookanapp.com",
                  "is_available": 1,
                  "is_active": 1,
                  "latitude": "37.747614",
                  "longitude": " -122.444841",
                  "last_updated_location_time": "Connection Lost",
                  "last_updated_timings": 10805966,
                  "registration_status": 1
                },
                {
                  "fleet_id": 545,
                  "fleet_name": "Ricky Palmer",
                  "fleet_image": "https://tookan.s3.amazonaws.com/fleet_profile/wnuw1440068822665-7.jpg",
                  "fleet_thumb_image": "https://tookan.s3.amazonaws.com/fleet_thumb_profile/thumb-2TW81440068823091-wnuw1440068822665-7.jpg",
                  "is_deleted": 0,
                  "status": 0,
                  "email": "contact+f3@tookanapp.com",
                  "is_available": 1,
                  "is_active": 1,
                  "latitude": "37.758369",
                  "longitude": " -122.424066",
                  "last_updated_location_time": "Connection Lost",
                  "last_updated_timings": 10805735,
                  "registration_status": 1
                },
                {
                  "fleet_id": 2602,
                  "fleet_name": "Bikram Singh",
                  "fleet_image": "https://tookan.s3.amazonaws.com/fleet_profile/user.png",
                  "fleet_thumb_image": "https://tookan.s3.amazonaws.com/fleet_thumb_profile/user.png",
                  "is_deleted": 0,
                  "status": 0,
                  "email": null,
                  "is_available": 1,
                  "is_active": 1,
                  "latitude": "30.7191912",
                  "longitude": "76.8102377",
                  "last_updated_location_time": "GPS Turned Off",
                  "last_updated_timings": 441891,
                  "registration_status": 1
                }
              ]
            },
            {
              "team_id": 908,
              "team_name": "Chandigarh",
              "fleets": [
                {
                  "fleet_id": 1252,
                  "fleet_name": "Arsh singh",
                  "fleet_image": "https://tookan.s3.amazonaws.com/fleet_profile/Pybe1448642328371-TOOKAN_27112015_100638.jpg",
                  "fleet_thumb_image": "https://tookan.s3.amazonaws.com/fleet_thumb_profile/thumb-5h5t1448642329089-Pybe1448642328371-TOOKAN_27112015_100638.jpg",
                  "is_deleted": 0,
                  "status": 0,
                  "email": "arsh@tookanapp.com",
                  "is_available": 0,
                  "is_active": 1,
                  "latitude": "30.7187664422466",
                  "longitude": "76.8101314889743",
                  "last_updated_location_time": "7 days ago",
                  "last_updated_timings": 624237,
                  "registration_status": 1
                },
                {
                  "fleet_id": 2121,
                  "fleet_name": "AutoTest",
                  "fleet_image": "https://tookan.s3.amazonaws.com/fleet_profile/user.png",
                  "fleet_thumb_image": "https://tookan.s3.amazonaws.com/fleet_thumb_profile/user.png",
                  "is_deleted": 0,
                  "status": 0,
                  "email": "arsh+11@tookanapp.com",
                  "is_available": 0,
                  "is_active": 0,
                  "latitude": "30.7193366",
                  "longitude": "76.8106833",
                  "last_updated_location_time": "50 days ago",
                  "last_updated_timings": 4335749,
                  "registration_status": 1
                },
                {
                  "fleet_id": 2247,
                  "fleet_name": "Gagan",
                  "fleet_image": "https://tookan.s3.amazonaws.com/fleet_profile/user.png",
                  "fleet_thumb_image": "https://tookan.s3.amazonaws.com/fleet_thumb_profile/user.png",
                  "is_deleted": 0,
                  "status": 1,
                  "email": "gagandeep.kaur@gmail.com",
                  "is_available": 0,
                  "is_active": 1,
                  "latitude": "30.7189253",
                  "longitude": "76.81",
                  "last_updated_location_time": "45 days ago",
                  "last_updated_timings": 3974182,
                  "registration_status": 1
                },
                {
                  "fleet_id": 2345,
                  "fleet_name": "Sanjay",
                  "fleet_image": "https://tookan.s3.amazonaws.com/fleet_profile/user.png",
                  "fleet_thumb_image": "https://tookan.s3.amazonaws.com/fleet_thumb_profile/user.png",
                  "is_deleted": 0,
                  "status": 0,
                  "email": "sanjay+123@tookanapp.com",
                  "is_available": 0,
                  "is_active": 1,
                  "latitude": "30.7188902",
                  "longitude": "76.8100486",
                  "last_updated_location_time": "35 days ago",
                  "last_updated_timings": 3038886,
                  "registration_status": 1
                },
                {
                  "fleet_id": 2900,
                  "fleet_name": "Ravi Kirpane",
                  "fleet_image": "https://tookan.s3.amazonaws.com/fleet_profile/user.png",
                  "fleet_thumb_image": "https://tookan.s3.amazonaws.com/fleet_thumb_profile/user.png",
                  "is_deleted": 0,
                  "status": 0,
                  "email": "rkirpane@gmail.com",
                  "is_available": 0,
                  "is_active": 1,
                  "latitude": "19.0535788",
                  "longitude": "72.9157975",
                  "last_updated_location_time": "4 hours ago",
                  "last_updated_timings": 17019,
                  "registration_status": 1
                },
                {
                  "fleet_id": 3032,
                  "fleet_name": "Sapna G",
                  "fleet_image": "https://tookan.s3.amazonaws.com/fleet_profile/user.png",
                  "fleet_thumb_image": "https://tookan.s3.amazonaws.com/fleet_thumb_profile/user.png",
                  "is_deleted": 0,
                  "status": 0,
                  "email": "goyal.sapna@gmail.com",
                  "is_available": 1,
                  "is_active": 1,
                  "latitude": "28.45986105504302",
                  "longitude": "77.10491848185389",
                  "last_updated_location_time": "Connection Lost",
                  "last_updated_timings": 78159,
                  "registration_status": 1
                }
              ]
            }
          ]
        }
        
## Get All Teams [/view_all_team_only]

### Get All Teams [POST]

This API is used to get the all teams details without their agent's data.

Request Body Parameters:
<table>
<tr><td style="padding-left: 0;" colspan="2"><strong>Name</strong><td><strong>Type</strong></td><td><strong>Description</strong></td></tr>
<tr><td style="padding-left: 0;" colspan="2">api_key</td><td>string</td><td> You can generate a key from settings(Login>Menu>Settings>API Keys) in your tookan account. Or <a href="https://app.tookanapp.com/#/app/settings/apikey">click here</a> to get API key</td></tr>
</table>

+ Request (application/json)

            {
                "api_key": "7eeca84b5e1df27d15f8422949314db6"
            }

+ Response 200 (application/json)

{
    "message": "Successful",
    "status": 200,
    "data": [
        {
            "tags": "",
            "battery_usage": 2,
            "team_id": 123,
            "team_name": "Team A",
            "address": "San Francisco, CA, USA",
            "latitude": "37.767206",
            "longitude": "-122.433905"
        },
        {
            "tags": "",
            "battery_usage": 2,
            "team_id": 456,
            "team_name": "Team B",
            "address": "Oakland, CA, USA",
            "latitude": "37.807473",
            "longitude": "-122.2737525"
        },
        {
            "tags": "",
            "battery_usage": 2,
            "team_id": 789,
            "team_name": "Team C",
            "address": "",
            "latitude": "",
            "longitude": ""
        }
    ]
}

## Get Job and Agent Details [/get_job_and_fleet_details]

### Get Job and Agent Details [POST]

This API is used to get the job and agent details related to a team.

Request Body Prameters:

<table>
<tr><td style="padding-left: 0;" colspan="2"><strong>Name</strong><td><strong>Type</strong></td><td><strong>Description</strong></td></tr>
<tr><td style="padding-left: 0;" colspan="2">api_key</td><td>string</td><td>You can generate a key from settings(Login>Menu>Settings>API Keys) in your tookan account. Or <a href="https://app.tookanapp.com/#/app/settings/apikey">click here</a> to get API key</td></tr>
<tr><td style="padding-left: 0;" colspan="2">date*</td><td>date</td><td>Enter date for which you want to view the deatils.</td></tr>
<tr><td style="padding-left: 0;" colspan="2">team_id*</td><td>integer</td><td>This is the Unique id of every team. You can get it from the dashBoard. More>teams>respective id of the team will displayed.</td></tr>
<tr><td style="padding-left: 0;" colspan="2">fleet_id</td><td>string (optional)</td><td>This is unique agent id given to each agent, if given the task will be assigned to the respective agent. You can get it from dashboard Menu>More>agents.</td></tr>
<tr><td style="padding-left: 0;" colspan="2">unzip</td><td>boolean (optional)</td><td>Send 1 if you want data to be zipped, otherwise 0.</td></tr>
<tr><td style="padding-left: 0;" colspan="2">sorting</td><td>string (optional)</td><td>Enter “ASC” or “DESC” to sort data in ascending or descending order. Default is ascending.</td></tr>
<tr><td style="padding-left: 0;" colspan="2">ignore_fleets</td><td>boolean (optional)</td><td>Either 0 or 1. Enter value 1 if you don’t want to view fleet details. The default value is 0.</td></tr>
<tr><td style="padding-left: 0;" colspan="2">has_agent_module</td><td>boolean (optional)</td><td>Either 0 or 1. Enter value 1 if you want to view external fleet details. The default value is 0.</td></tr>
<tr><td style="padding-left: 0;" colspan="2">is_offline</td><td>boolean (optional)</td><td>Either 0 or 1. Enter value 1 if you want to view offline external fleet details. The default value is 0.</td></tr>
<tr><td style="padding-left: 0;" colspan="2">search_string</td><td>string (optional)</td><td>Enter any string that you want to search in the data.</td></tr>
<tr><td style="padding-left: 0;" colspan="2">form_id</td><td>number (optional)</td><td>Enter id to filter data on the basis of form id.</td></tr>
</table>

+ Request (application/json)

        {
            "api_key":"e1ecdd2fd7aaa26547e195b459a7c2d2",
            "team_id":"0",
            "date":"2016-12-22"
        }
        
+ Response 200 (application/json)


        {
            "message": "Successful",
            "status": 200,
            "data": {
                "teams": {
                    "0": {
                        "jobs": [
                            {
                                "job_id": 117697,
                                "job_description": "qrwerew",
                                "team_id": 0,
                                "recurring_id": "0",
                                "auto_assignment": 2,
                                "job_status": 0,
                                "job_type": 1,
                                "fleet_id": 24,
                                "fleet_name": "Driver",
                                "job_pickup_name": "",
                                "job_latitude": "37.7922841",
                                "job_longitude": "-122.39796030000002",
                                "job_address": "388 Market Street, Suite 1300, San Francisco, CA 94111, USA",
                                "is_routed": 0,
                                "job_pickup_latitude": "0",
                                "job_pickup_longitude": "0",
                                "job_pickup_address": "",
                                "pickup_delivery_relationship": "edcffb883d8b25807294d3afe4b96f4a17741",
                                "job_delivery_datetime": "2016-12-22 23:59:00",
                                "job_pickup_datetime": "0000-00-00 00:00:00",
                                "partner_order_id": null,
                                "customer_username": "ankit",
                                "tags": "",
                                "status": 0,
                                "is_available": 0,
                                "fleet_thumb_image": "",
                                "form_id": null,
                                "domain_name": null,
                                "timezone": "-330",
                                "started_datetime": "0000-00-00 00:00:00",
                                "completed_datetime": "0000-00-00 00:00:00",
                                "fleet_status_color": null,
                                "job_time": 1482451140000
                            }
                        ],
                        "route": {},
                        "unrouted": {},
                        "fleets": {},
                        "partner_jobs": {},
                        "recurringTasks": []
                    }
                },
                "animate": 1,
                "fleet_data": {
                    "total_fleets": 3,
                    "active_fleets": 0,
                    "unassigned_fleets": 0,
                    "unavailable_fleets": 3
                }
            }
        }

# Group Manager

## Create Manager [/add_manager]

### Create Manager [POST]

This API is used to Create a Manager.

Body Parameters:

<table>
<tr><td style="padding-left: 0;" colspan="2"><strong>Name</strong><td><strong>Type</strong></td><td><strong>Description</strong></td></tr>
<tr><td style="padding-left: 0;" colspan="2">api_key</td><td>string</td><td> You can generate a key from settings(Login>Menu>Settings>API Keys) in your tookan account. Or <a href="https://app.tookanapp.com/#/app/settings/apikey">click here</a> to get API key</td></tr>
<tr><td style="padding-left: 0;" colspan="2">email*</td><td>string(Optional)</td><td> This is email of the manager to be added which is used while Login.</td></tr>
<tr><td style="padding-left: 0;" colspan="2">password*</td><td>string(Optional)</td><td>This is the password for the manager account to login.</td></tr>
<tr><td style="padding-left: 0;" colspan="2">first_name*</td><td>string(Optional)</td><td> This is the First name of the manager to be added.</td></tr>
<tr><td style="padding-left: 0;" colspan="2">last_name</td><td>string(Optional)</td><td> This is the Last name of the manager to be added.</td></tr>
<tr><td style="padding-left: 0;" colspan="2">phone*</td><td>string(Optional)</td><td> This is the phone number of the manager to be added. </td></tr>
<tr><td style="padding-left: 0;" colspan="2">timezone*</td><td>string(Optional)</td><td> Timezone difference with UTC in minutes for e.g., For PST:+480 (PDT: +420),For MST +420 (MDT:+360) for EST: +300(EDT:+240), for AEST: -600 (AEDT: -660), for IST: -330, for CST: +360 (CDT:+300)</td></tr>
<tr><td style="padding-left: 0;" colspan="2">task_access*</td><td>string(Optional)</td><td> This is to give access for the unasigned tasks. Set this to '1' to give access and '0' not to give the access </td></tr>
<tr><td style="padding-left: 0;" colspan="2">add_driver_access</td><td>string(Optional)</td><td> This is to give access for the manager to create Agents. Set this to '1' to give access and '0' not to give the access </td></tr>
<tr><td style="padding-left: 0;" colspan="2">dispatcher_teams*</td><td>string(Optional)</td><td> Pass the team_ids in this parameter with comma seperated values to which the manager can access.</td></tr>
<tr><td style="padding-left: 0;" colspan="2">rule_id</td><td>Number(Optional)</td><td> This is the rule  that you want to assign to your manager , you can get the rule id from dashboard when you create a rule from settings->access control .</td></tr>
</table>

+ Request (application/json)

            {
                "api_key":"eaac56717958fa6664a9c5a0a29a43810a30fcda90be26a3e023b2f70f9ffa05",
                "email":"Test@tookanapp.com",
                "password":"123456",
                "first_name" : "John",
                "last_name" : "Doe",
                "phone":"+919986906722",
                "timezone":"-330",
                "task_access" : 1,
                "add_driver_access" : 1,
                "dispatcher_teams" : "255,509"
            }

+ Response 200 (application/json)

        {
            "message": "The manager 'John' has been created.",
            "status": 200,
            "data": {}
        }
        
## View All Managers [/view_all_manager]

### View All Managers [POST]

This API is used to view details of all the managers.

Request Parameters:

<table>
<tr><td style="padding-left: 0;" colspan="2"><strong>Name</strong><td><strong>Type</strong></td><td><strong>Description</strong></td></tr>
<tr><td style="padding-left: 0;" colspan="2">api_key</td><td>string</td><td> You can generate a key from settings(Login>Menu>Settings>API Keys) in your tookan account. Or <a href="https://app.tookanapp.com/#/app/settings/apikey">click here</a> to get API key</td></tr>
<tr><td style="padding-left: 0;" colspan="2">team_id</td><td>integer (optional)</td><td>This is the Unique id of every team. You can get it from the dashBoard. More>teams>respective id of the team will displayed. Use  this to filter managers on the basis of team_id.</td></tr>
<tr><td style="padding-left: 0;" colspan="2">form_id</td><td>integer (optional)</td><td>Enter id to filter managers on the basis of form_id.</td></tr>
<tr><td style="padding-left: 0;" colspan="2">name</td><td>string (optional)</td><td>Enter username of manager here to search for a particular manager.</td></tr>
</table>

+ Request (application/json)

        {
            "api_key":"eaac56717958fa6664a9c5a0a29a43810a0fcda90be26a3e023b2f70f9ffa05"
        }
        
+ Response 200 (application/json)

        {
            "message":"Successful",
            "status":200,
            "data":[
                {
                    "dispatcher_id":1842,
                    "username":"vinay prakash",
                    "first_name":"vinay",
                    "last_name":"prakash",
                    "email":"vinay@gmail.com",
                    "phone":"+918976543210",
                    "view_driver":0,
                    "view_team":0,
                    "view_notification":0,
                    "view_task":1,
                    "create_driver":1,
                    "create_task":1,
                    "edit_task":1,
                    "update_notification":0,
                    "create_team":0,
                    "view_auto_allocation":0,
                    "edit_fleet_wallet":0,
                    "view_status":1,
                    "edit_status":0,
                    "teams":[],
                    "forms":[]
                },
                {
                    "dispatcher_id":1909,
                    "username":"ankit bhatt",
                    "first_name":"ankit",
                    "last_name":"bhatt",
                    "email":"ankit.bhatt+3@mail.click-labs.com",
                    "phone":"+919034860340",
                    "view_driver":0,
                    "view_team":0,
                    "view_notification":0,
                    "view_task":1,
                    "create_driver":1,
                    "create_task":1,
                    "edit_task":1,
                    "update_notification":0,
                    "create_team":0,
                    "view_auto_allocation":0,
                    "edit_fleet_wallet":0,
                    "view_status":1,
                    "edit_status":0,
                    "teams":[],
                    "forms":[]
                },
                {
                    "dispatcher_id":27425,
                    "username":"John Doe",
                    "first_name":"John",
                    "last_name":"Doe",
                    "email":"abcffgf@a.com",
                    "phone":"+919986906722",
                    "view_driver":0,
                    "view_team":0,
                    "view_notification":0,
                    "view_task":1,
                    "create_driver":1,
                    "create_task":1,
                    "edit_task":1,
                    "update_notification":0,
                    "create_team":0,
                    "view_auto_allocation":0,
                    "edit_fleet_wallet":0,
                    "view_status":0,
                    "edit_status":0,
                    "teams":[],
                    "forms":[]
                }
            ]
        }

## Delete Manager [/delete_manager]

### Delete Manager [POST]

This API is used to delete a manager.

Request Parameters:

<table>
<tr><td style="padding-left: 0;" colspan="2"><strong>Name</strong><td><strong>Type</strong></td><td><strong>Description</strong></td></tr>
<tr><td style="padding-left: 0;" colspan="2">api_key</td><td>string</td><td> You can generate a key from settings(Login>Menu>Settings>API Keys) in your tookan account. Or <a href="https://app.tookanapp.com/#/app/settings/apikey">click here</a> to get API key</td></tr>
<tr><td style="padding-left: 0;" colspan="2">dispatcher_id*</td><td>integer</td><td>Id of the manager to be deleted</td></tr>
</table>

+ Request (application/json)

        {
            "api_key":"4e993d502f98498f451abece6f9d4a2d",
            "dispatcher_id":36774
        }
        
+ Response 200 (application/json)

        {
            "message": "DISP_DELETION",
            "status": 200,
            "data": {},
            "values": {
                "DISP_NAME": "James Jordan"
            }
        }



# Group Customers

## Get Customers [/get_all_customers]

### Get Customers [POST]

This API is used to get the all the Customer details.

Request Body Parameters:
<table>
<tr><td style="padding-left: 0;" colspan="2"><strong>Name</strong><td><strong>Type</strong></td><td><strong>Description</strong></td></tr>
<tr><td style="padding-left: 0;" colspan="2">api_key</td><td>string</td><td> You can generate a key from settings(Login>Menu>Settings>API Keys) in your tookan account. Or <a href="https://app.tookanapp.com/#/app/settings/apikey">click here</a> to get API key</td></tr>
<tr><td style="padding-left: 0;" colspan="2">customer_username</td><td>string(Optional)</td><td>This is used to search with customer name.</td></tr>
<tr><td style="padding-left: 0;" colspan="2">customer_phone</td><td>string(Optional)</td><td>This is used to search with customer phone number.</td></tr>
<tr><td style="padding-left: 0;" colspan="2">is_pagination</td><td>Boolean</td><td>You can set this as 1 to enable pagination.</td></tr>
<tr><td style="padding-left: 0;" colspan="2">requested_page</td><td>number(Optional)</td><td>Current(Which) page according to the page number of customer list.</td></tr>
<tr><td style="padding-left: 0;" colspan="2">vendor_id</td><td>number(Optional)</td><td>This is used to search Form user.</td></tr>
</table>

+ Request (application/json)

        {
            "api_key":"eaac56717958fa6664a9c5a0a29a43810a0fcda90be26a3e023b2f70f9ffa05",
            "customer_username":"aa",
            "customer_phone":"99895545",
            "is_pagination" : 1,
            "requested_page" : 1,
            "vendor_id" : 1
        }

+ Response 200 (application/json)

        {
          "message": "Successful",
          "status": 200,
          "data": {<Array of Customer data>}
        }
        
## Add Customer [/customer/add]

### Add Customer [POST]

This API is used to add customer.

Request Body Parameters:
<table>
<tr><td style="padding-left: 0;" colspan="2"><strong>Name</strong><td><strong>Type</strong></td><td><strong>Description</strong></td></tr>
<tr><td style="padding-left: 0;" colspan="2">api_key</td><td>string</td><td> You can generate a key from settings(Login>Menu>Settings>API Keys) in your tookan account. Or <a href="https://app.tookanapp.com/#/app/settings/apikey">click here</a> to get API key</td></tr>
<tr><td style="padding-left: 0;" colspan="2">user_type*</td><td>number</td><td>It should be 0.</td></tr>
<tr><td style="padding-left: 0;" colspan="2">name*</td><td>string</td><td>Enter customer's name.</td></tr>
<tr><td style="padding-left: 0;" colspan="2">phone*</td><td>string</td><td>Enter customer's phone number.</td></tr>
<tr><td style="padding-left: 0;" colspan="2">email</td><td>string(Optional)</td><td>Enter customer's email address.</td></tr>
<tr><td style="padding-left: 0;" colspan="2">address</td><td>string((Optional))</td><td>Enter customer's address location.</td></tr>
<tr><td style="padding-left: 0;" colspan="2">latitude</td><td>number(Optional)</td><td>Enter latitiude of the customer's location.</td></tr>
<tr><td style="padding-left: 0;" colspan="2">longitude</td><td>number(Optional)</td><td>Enter longitiude of the customer's location.</td></tr>
</table>

+ Request (application/json)

        {
            "api_key":"eaac56717958fa6664a9c5a0a29a43810a30fcda90be26a3e023b2f70f9ffa05",
            "user_type": 0,
            "name": "Manish",
            "phone": "+919876543210",
            "email": "manish.sharma@jungleworks.com",
            "address": "CDCL, Madhya Marg, 28B, Sector 28B, Chandigarh, India",
            "latitude": 30.7188978,
            "longitude": 76.81029809999995
        }

+ Response 200 (application/json)

        {
          "message": "Successful",
          "status": 200,
          "data": {"customer_id": 4129902}
        }
        
## Edit Customer [/customer/edit]

### Edit Customer [POST]

This API is used to edit customer details.

Request Body Parameters:
<table>
<tr><td style="padding-left: 0;" colspan="2"><strong>Name</strong><td><strong>Type</strong></td><td><strong>Description</strong></td></tr>
<tr><td style="padding-left: 0;" colspan="2">api_key</td><td>string</td><td> You can generate a key from settings(Login>Menu>Settings>API Keys) in your tookan account. Or <a href="https://app.tookanapp.com/#/app/settings/apikey">click here</a> to get API key</td></tr>
<tr><td style="padding-left: 0;" colspan="2">user_type*</td><td>number</td><td>It should be 0.</td></tr>
<tr><td style="padding-left: 0;" colspan="2">customer_id*</td><td>number</td><td>Enter customer id that you want to edit. You will get the customer id while adding the customer.</td></tr>
<tr><td style="padding-left: 0;" colspan="2">name</td><td>string</td><td>Enter customer's name.</td></tr>
<tr><td style="padding-left: 0;" colspan="2">phone</td><td>number</td><td>Enter customer's phone number.</td></tr>
<tr><td style="padding-left: 0;" colspan="2">email</td><td>string(Optional)</td><td>Enter customer's email address.</td></tr>
<tr><td style="padding-left: 0;" colspan="2">address</td><td>string((Optional))</td><td>Enter customer's address location.</td></tr>
<tr><td style="padding-left: 0;" colspan="2">latitude</td><td>number(Optional)</td><td>Enter latitiude of the customer's location.</td></tr>
<tr><td style="padding-left: 0;" colspan="2">longitude</td><td>number(Optional)</td><td>Enter longitiude of the customer's location.</td></tr>
</table>

+ Request (application/json)

        {
            "api_key":"eaac56717958fa6664a9c5a0a29a43810a30fcda9be26a3e023b2f70f9ffa05",
            "user_type": 0,
            "customer_id": "4129567",
            "name": "Manish",
            "phone": "+919876543210",
            "email": "manish.sharma@jungleworks.com",
            "address": "CDCL, Madhya Marg, 28B, Sector 28B, Chandigarh, India",
            "latitude": 30.7188978,
            "longitude": 76.81029809999995
        }

+ Response 200 (application/json)

        {
          "message": "Successful",
          "status": 200,
          "data": {}
        }

## Delete Customer [/delete_customer]

### Delete Customer [POST]

This API is used to delete an existing customer.

Request Body Parametrs:

<table>
<tr><td style="padding-left: 0;" colspan="2"><strong>Name</strong><td><strong>Type</strong></td><td><strong>Description</strong></td></tr>
<tr><td style="padding-left: 0;" colspan="2">api_key</td><td>string</td><td> You can generate a key from settings(Login>Menu>Settings>API Keys) in your tookan account. Or <a href="https://app.tookanapp.com/#/app/settings/apikey">click here</a> to get API key</td></tr>
<tr><td style="padding-left: 0;" colspan="2">customer_id*</td><td>number</td><td>Enter customer id that you want to delete. You will get the customer id while adding the customer.</td></tr>
</table>

+ Request (application/json)


        {
            "api_key":"e1ecdd2fd7aaa26547e195b459a7c2d2",
            "customer_id":75
        }
        
+ Response 200 (application/json)

        {
            "message": "Successful",
            "status": 200,
            "data": {}
        }

## Find Customer with Phone [/find_customer_with_phone]

### Find Customer with Phone Number [POST]

This API is used to search for a customer using his phone number.

Request Body Parameters:

<table>
<tr><td style="padding-left: 0;" colspan="2"><strong>Name</strong><td><strong>Type</strong></td><td><strong>Description</strong></td></tr>
<tr><td style="padding-left: 0;" colspan="2">api_key</td><td>string</td><td> You can generate a key from settings(Login>Menu>Settings>API Keys) in your tookan account. Or <a href="https://app.tookanapp.com/#/app/settings/apikey">click here</a> to get API key</td></tr>
<tr><td style="padding-left: 0;" colspan="2">customer_phone*</td><td>string</td><td>Enter the customer’s phone number here whose details you want to search.</td></tr>
</table>

+ Request (application/json)

        {
            “api_key”:”2b997be77e2cc22becfd4c66426ef504”,
            “customer_phone”:”9897416008”
        }
        
+ Response 200 (application/json)


        {
            "message":"Successful",
            "status":200,
            "data":[
                {
                    "customer_id":101,
                    "customer_username":"Text Four",
                    "access_token":"cdae5bdfec7dc42e8b3790619310a264",
                    "customer_email":"test4@tookanapp.com",
                    "customer_phone":"+1 9897416008",
                    "authentic_phone_no":"+19897416008",
                    "customer_address":null,
                    "customer_latitude":"30.7187702",
                    "customer_longitude":"76.8105969",
                    "user_id":1717,
                    "creation_datetime":"2018-04-26T10:49:47.000Z",
                    "is_active":1,
                    "avg_rating":0,
                    "rated_task_count":0,
                    "vendor_id":20348,
                    "is_deleted":0,
                    "first_name":"Text",
                    "last_name":"Four",
                    "email":"test4@tookanapp.com",
                    "phone_no":"+1 9897416008",
                    "description":"",
                    "password":"d8578edf8458ce06fbc5bb76a58c5ca4",
                    "company":"",
                    "address":"",
                    "password_reset_token":null,
                    "is_blocked":0,
                    "latitude":"30.7187702",
                    "longitude":"76.8105969",
                    "vendor_image":null,
                    "device_type":"78",
                    "device_token":"cnnLtckUR04:APA91bGxS-Usg9gckT93kZiQ_84bxa27oUr_0ncYsOz7xhZcEXJFv2DgqdKAGMF8BtmWQ-hcHkInkZKZtex3PJ9M98JqI8rq2aEQTE7cHhrxo6acMQUhxc6J7eMjTCwZRmxU9_nwfx6f",
                    "app_versioncode":"108",
                    "app_access_token":"bc016892a67cad68aa13554689a07772",
                    "language":null,
                    "last_login_date_time":"2018-04-27T09:53:42.000Z",
                    "vendor_api_key":null,
                    "fb_token":"",
                    "otp":"",
                    "is_phone_verified":0,
                    "credits":0,
                    "pending_amount":0,
                    "successful_task_count":0,
                    "referral_code":"",
                    "referrer_id":0,
                    "reference_id":null,
                    "is_first_login":1,
                    "registration_status":3,
                    "paytm_enabled":null,
                    "unverified_phone":null,
                    "favorite_fleets":null
                }
            ]
        }

## Find Customer with Name [/find_customer_with_name]

### Find Customer with Name [POST]

This API is used to search for a customer using his name.

Request Body Parameters:

<table>
<tr><td style="padding-left: 0;" colspan="2"><strong>Name</strong><td><strong>Type</strong></td><td><strong>Description</strong></td></tr>
<tr><td style="padding-left: 0;" colspan="2">api_key</td><td>string</td><td> You can generate a key from settings(Login>Menu>Settings>API Keys) in your tookan account. Or <a href="https://app.tookanapp.com/#/app/settings/apikey">click here</a> to get API key</td></tr>
<tr><td style="padding-left: 0;" colspan="2">customer_name*</td><td>string</td><td>Enter the customer’s name here whose details you want to search.</td></tr>
</table>

+ Request (application/json)

        {
            “api_key”:”2b997be77e2cc22becfd4c66426ef504”,
            “customer_name”:”Four”
        }

+ Response 200 (application/json)


        {
            "message":"Successful",
            "status":200,
            "data":[
                {
                    "customer_id":101,
                    "customer_username":"Text Four",
                    "access_token":"cdae5bdfec7dc42e8b3790619310a264",
                    "customer_email":"test4@tookanapp.com",
                    "customer_phone":"+1 9897416008",
                    "authentic_phone_no":"+19897416008",
                    "customer_address":null,
                    "customer_latitude":"30.7187702",
                    "customer_longitude":"76.8105969",
                    "user_id":1717,
                    "creation_datetime":"2018-04-26T10:49:47.000Z",
                    "is_active":1,
                    "avg_rating":0,
                    "rated_task_count":0,
                    "vendor_id":20348,
                    "is_deleted":0,
                    "first_name":"Text",
                    "last_name":"Four",
                    "email":"test4@tookanapp.com",
                    "phone_no":"+1 9897416008",
                    "description":"",
                    "password":"d8578edf8458ce06fbc5bb76a58c5ca4",
                    "company":"",
                    "address":"",
                    "password_reset_token":null,
                    "is_blocked":0,
                    "latitude":"30.7187702",
                    "longitude":"76.8105969",
                    "vendor_image":null,
                    "device_type":"78",
                    "device_token":"cnnLtckUR04:APA91bGxS-Usg9gckT93kZiQ_84bxa27oUr_0ncYsOz7xhZcEXJFv2DgqdKAGMF8BtmWQ-hcHkInkZKZtex3PJ9M98JqI8rq2aEQTE7cHhrxo6acMQUhxc6J7eMjTCwZRmxU9_nwfx6f",
                    "app_versioncode":"108",
                    "app_access_token":"bc016892a67cad68aa13554689a07772",
                    "language":null,
                    "last_login_date_time":"2018-04-27T09:53:42.000Z",
                    "vendor_api_key":null,
                    "fb_token":"",
                    "otp":"",
                    "is_phone_verified":0,
                    "credits":0,
                    "pending_amount":0,
                    "successful_task_count":0,
                    "referral_code":"",
                    "referrer_id":0,
                    "reference_id":null,
                    "is_first_login":1,
                    "registration_status":3,
                    "paytm_enabled":null,
                    "unverified_phone":null,
                    "favorite_fleets":null
                }
            ]
        }

## View Customer Profile [/view_customer_profile]

### View Customer Profile [POST]

This API is used to view profile details of a customer.

Request Body Parameters:

<table>
<tr><td style="padding-left: 0;" colspan="2"><strong>Name</strong><td><strong>Type</strong></td><td><strong>Description</strong></td></tr>
<tr><td style="padding-left: 0;" colspan="2">api_key</td><td>string</td><td> You can generate a key from settings(Login>Menu>Settings>API Keys) in your tookan account. Or <a href="https://app.tookanapp.com/#/app/settings/apikey">click here</a> to get API key</td></tr>
<tr><td style="padding-left: 0;" colspan="2">customer_id*</td><td>number</td><td>Enter id of the customer whose details you want to see. You will get the customer id while adding the customer.</td></tr>
</table>

+ Request (application/json)

        {
            "api_key":"2b997be77e2cc22becfd4c66426ef504",
            "customer_id":3718
        }

+ Response 200 (application/json)

        {
        "message":"Successful",
        "status":200,
        "data":{
        "cust_details":[
            {
                "customer_id":3718,
                "customer_username":"Siddhartha",
                "access_token":"a6896a9dd1483e6003d43671c5c68605",
                "customer_email":"siddhartha.narang+1@jugnoo.in",
                "customer_phone":"+91 1236547896",
                "authentic_phone_no":"+911236547896",
                "customer_address":null,
                "customer_latitude":"30.7187548",
                "customer_longitude":"76.810595",
                "user_id":1717,
                "creation_datetime":"2018-07-12T12:21:29.000Z",
                "is_active":1,
                "avg_rating":0,
                "rated_task_count":0,
                "vendor_id":20745,
                "is_deleted":0,
                "first_name":"Siddhartha",
                "last_name":"",
                "email":"siddhartha.narang+1@jugnoo.in",
                "phone_no":"+91 1236547896",
                "description":"",
                "password":"e10adc3949ba59abbe56e057f20f883e",
                "company":"",
                "address":"",
                "password_reset_token":null,
                "is_blocked":0,
                "latitude":"30.7187548",
                "longitude":"76.810595",
                "vendor_image":null,
                "device_type":"68",
                "device_token":"cDpRyzZM8Ww:APA91bG_DCs8SMaLDycPOD0bVuTaxFmtJTwX97YzVE23stsRXk3aYUCPyQV_lXQwPEyELRG4QGajJVJrFAjyt0mt0jcG2-YYWUNa-1xKacX0kuYHnX45wfNmZO8rTNVwdDN11oKQrzIR",
                "app_versioncode":"108",
                "app_access_token":"f39dc0856174ced8213e529d3372a3e5",
                "language":null,
                "last_login_date_time":"2018-07-13T06:02:30.000Z",
                "vendor_api_key":null,
                "fb_token":"",
                "otp":"",
                "is_phone_verified":0,
                "credits":0,
                "pending_amount":0,
                "successful_task_count":0,
                "referral_code":"",
                "referrer_id":0,
                "reference_id":null,
                "is_first_login":1,
                "registration_status":1,
                "paytm_enabled":null,
                "unverified_phone":null,
                "favorite_fleets":null,
                "source":"1"
            }
        ],
        "jobs":[]
        }
        }

# Group User


## Update Phone Number [/edit_phone]

### Update Phone Number [POST]

This API is used to update user's phone number.

Request Body Parameters:

<table>
<tr><td style="padding-left: 0;" colspan="2"><strong>Name</strong><td><strong>Type</strong></td><td><strong>Description</strong></td></tr>
<tr><td style="padding-left: 0;" colspan="2">api_key</td><td>string</td><td> You can generate a key from settings(Login>Menu>Settings>API Keys) in your tookan account. Or <a href="https://app.tookanapp.com/#/app/settings/apikey">click here</a> to get API key.</td></tr>
<tr><td style="padding-left: 0;" colspan="2">phone*</td><td>string</td><td>Enter user's new phone number here.</td></tr>
</table>

+ Request (application/json)

        {
            "api_key":"e1ecdd2fd7aaa26547e195b459a7c2d2", 
            "phone":"8989898989"
        }

+ Response 200 (application/json)

        {
            "message": "Successful",
            "status": 200,
            "data": {}
        }

## Change Password [/users_change_password]

### Change Password [POST]

This API is used to change user's password.

<table>
<tr><td style="padding-left: 0;" colspan="2"><strong>Name</strong><td><strong>Type</strong></td><td><strong>Description</strong></td></tr>
<tr><td style="padding-left: 0;" colspan="2">api_key</td><td>string</td><td> You can generate a key from settings(Login>Menu>Settings>API Keys) in your tookan account. Or <a href="https://app.tookanapp.com/#/app/settings/apikey">click here</a> to get API key.</td></tr>
<tr><td style="padding-left: 0;" colspan="2">old_password*</td><td>string</td><td>This is user's old password.</td></tr>
<tr><td style="padding-left: 0;" colspan="2">new_password*</td><td>string</td><td>This is user's new password.</td></tr>
</table>

+ Request (application/json)

        {
            "api_key":"56626584f30a4c1d18516d6a41fe6c3f82bdc783a5814", 
            "old_password":"zxcvbnm",
            "new_password":"asdcvb99"
        }
        
+ Response 200 (application/josn)

        {
            "message": "Your password has been updated.",
            "status": 200,
            "data": {
                "access_token": "143734d0a61152d3b1716264018edcdf829"
            }
        }

## Check Email [/check_email_exists]

### Check Email [POST]

This API is used to check if your email is already registered or not.

Request Body Parameters:

<table>
<tr><td style="padding-left: 0;" colspan="2"><strong>Name</strong><td><strong>Type</strong></td><td><strong>Description</strong></td></tr>
<tr><td style="padding-left: 0;" colspan="2">email*</td><td>string</td><td>Enter your email here.</td></tr>
</table>

+ Request (application/json)

        {
            "email":"yukta@gmail.com"
        }

+ Response 404 (application/json)
        
        {
            "message": "This email ID is already registered",
            "status": 404,
            "data": {}
        }

## Get User Details [/get_user_details]

### Get User Details [POST]

This API is used to get the Tookan user details.

Request Body Parameters:

<table>
<tr><td style="padding-left: 0;" colspan="2">api_key</td><td>string</td><td> You can generate a key from settings(Login>Menu>Settings>API Keys) in your tookan account. Or <a href="https://app.tookanapp.com/#/app/settings/apikey">click here</a> to get API key</td></tr>
</table>

+ Request (application/json)

        {
           "api_key": "5363648cf04056051e186d6d5c59254318e3c3f928da7a3a5"
        }

+ Response 404 (application/json)
        
        {
            "message": "Successful",
            "status": 200,
            "data": {
            "user_id": 1234,
            "email": "contact@jungleworks.com",
            "username": "Manish Sharma",
            "company_name": "Manish Co.",
            "company_address": "Chandigarh, India"
    }
        }

# Group Merchant

Merchant is basically the seller or service provider on a marketplace. Merchants can log in to their own dashboard from where they can manage their agents, tasks and other functionalities. The admin has full access to all of the details and activities of the merchant, including, but not limited to tasks and agents. To create merchants you need to activate <b>Multi Merchant Marketplace</b> addon from Tookan Marketplace.

## Create Merchant [/merchant/sign_up]

### Create Merchant [POST]

This API is used to add a merchant to your account.

Request Body Parameters:

<table>
<tr><td style="padding-left: 0;" colspan="1"><strong>Name</strong><td><strong>Type</strong></td><td><strong>Description</strong></td></tr>
<tr><td style="padding-right: 40px; width: 140px;">api_key</td><td>string</td> <td> You can generate a key from settings(Login>Menu>Settings>API Keys) in your tookan account. Or <a href="https://app.tookanapp.com/#/app/settings/apikey">click here</a> to get API key</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">user_id*</td><td>number</td><td>You can get it from account details page in <a href="https://app.tookanapp.com/#/app/account">Tookan dashboard</a>.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">name*</td><td>string</td> <td>Enter the full name of merchant here.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">first_name*</td><td>string</td> <td>Enter the first name of merchant here.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">last_name </td><td>string</td> <td>Enter the last name of merchant here.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">company_name*</td><td>string</td><td>This is your company’s name.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">company_address*</td><td>string</td><td>This is your company’s address</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">email*</td><td>string</td> <td>Enter the email of merchant here.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">timezone*</td><td> string </td><td>Timezone difference with UTC in minutes for e.g., For PST:<code>+480</code> (PDT: <code>+420</code>),For MST <code>+420</code> (MDT:<code>+360</code>) for EST: <code>+300</code>(EDT:<code>+240</code>), for AEST: <code>-600</code> (AEDT: <code>-660</code>), for IST: <code>-330</code>, for CST: <code>+360</code> (CDT:<code>+300</code>)</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">phone_directory*</td><td>json object</td> <td>This include two key value pairs named, <b>phoneNo</b> which is the contact number of merchant and <b>countryCode</b> which is the country code for the phone number.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">merchant_permission</td><td>json object</td> <td>Various permissions are granted to the merchant. The default value is 1. Set 1 to give permission, otherwise 0. These are : view_task, add_task, add_team, view_team, add_region, view_region, add_agent, view_agent, view_fleet_avalibility, edit_fleet_avalibility.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">commission_percentage*</td><td>number</td> <td>This is the percentage of commision that the merchant will be earning.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">password*</td><td>string</td> <td>Set login password for merchant here.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">geofence</td><td>json object</td> <td>This includes parameters related to geofence of the merchant like region_name, region_description, region_data, is_force. All the fields are optional.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">rule_id</td><td>number</td> <td>This is the role id of access control.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">shared_teams</td><td>string</td> <td>The admin's account team id's which you want to share with merchants.</td></tr>
</table>

+ Request (application/json)

        {
            "name":"merchant test",
            "first_name":"merchant",
            "last_name":"test",
            "company_address":"CDCL, Madhya Marg, 28B, Sector 28B, Chandigarh, India",
            "company_name":"jungleworks",
            "email":"yukta231merchant@gmail.com",
            "timezone":-330,
            "phone_directory":{
                "phone":"+919467664844",
                "country_code":"in"
            },
            "merchant_permission":{
                "view_task":0,
                "add_task":0,
                "add_team":0,
                "view_team":0,
                "add_region":0,
                "view_region":0,
                "add_agent":0,
                "view_agent":0,
                "view_fleet_avalibility":0,
                "edit_fleet_avalibility":0
            },
            "commission_percentage":10,
            "password":"123456",
            "geofence":{},
            "rule_id": 123,
            "shared_teams": "123,456",
            "api_key":"55631.076225def01849131c152c3017162c431fe4c4fe2c",
            "user_id":55631
        }

+ Response 200 (application/json)
        
        {
            "message":"Successful",
            "status":200,
            "data":{}
        }

## View Merchants [/merchant/get_merchant]

### View Merchants [POST]

This API is used to view the list of all merchants under the admin.

Request Body Parameters :

<table>
<tr><td style="padding-left: 0;" colspan="1"><strong>Name</strong><td><strong>Type</strong></td><td><strong>Description</strong></td></tr>
<tr><td style="padding-right: 40px; width: 140px;">api_key</td><td>string</td> <td> You can generate a key from settings(Login>Menu>Settings>API Keys) in your tookan account. Or <a href="https://app.tookanapp.com/#/app/settings/apikey">click here</a> to get API key</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">user_id*</td><td>number</td><td>You can get it from account details page in <a href="https://app.tookanapp.com/#/app/account">Tookan dashboard</a>.</td></tr>
</table>

+ Request (application/json)

        {
            "api_key":"55631.076225def01849131c152c3017162c431fe4c4fe2c",
            "user_id":55631
        }
        
+ Response 200 (application/json)

        {
            "message":"Successful",
            "status":200,
            "data":[{
                "user_id":73532,
                "username":"merchant test"
            }]
        }

## Edit Merchant [/merchant/edit_merchant]

### Edit Merchant [POST]

This API is used to edit the details of a merchant.

Request Body Parameters:

The request body parameters of this API are same as that of Create Merchant. The only parameters that should be added while editing a merchant are shown below.

<table>
<tr><td style="padding-left: 0;" colspan="1"><strong>Name</strong><td><strong>Type</strong></td><td><strong>Description</strong></td></tr>
<tr><td style="padding-right: 40px; width: 140px;">merchant_id*</td><td>number</td> <td>This is the unique ID given to each merchant. Enter the ID of the merchant whose details you want to edit. You can get it from dashboard Menu>More>Merchant.</td></tr></table>
</table>

+ Request (application/json)

        {
            "name":"merchant test",
            "first_name":"merchant",
            "last_name":"test",
            "company_address":"CDCL",
            "company_name":"click labs",
            "email":"yukta231merchant@gmail.com",
            "timezone":-330,
            "phone_directory":{
                "phone":"+919467664843",
                "country_code":"in"
            },
            "merchant_permission" : {
                "view_task":0,
                "add_task":0,
                "add_team":0,
                "view_team":0,
                "add_region":0,
                "view_region":0,
                "add_agent":0,
                "view_agent":0,
                "view_fleet_avalibility":0,
                "edit_fleet_avalibility":0
            },
            "commission_percentage":20,
            "merchant_id":73532,
            "rule_id": 123,
            "shared_teams": "123,456",
            "api_key":"55631.076225def01849131c152c3017162c431fe4c4fe2c",
            "user_id":55631
        }
        
+ Response 200 (application/json)

        {
            "message":"Successful",
            "status":200,
            "data":{}
        }

## Get Merchant Details [/merchant/get_merchant_data{?api_key,user_id}]

### Get Merchant Details [GET]

This API is used to get the details of a particular merchant.

Query Parameters : 

<table>
<tr><td style="padding-left: 0;" colspan="1"><strong>Name</strong><td><strong>Type</strong></td><td><strong>Description</strong></td></tr>
<tr><td style="padding-right: 40px; width: 140px;">api_key</td><td>string</td> <td> You can generate a key from settings(Login>Menu>Settings>API Keys) in your tookan account. Or <a href="https://app.tookanapp.com/#/app/settings/apikey">click here</a> to get API key</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">user_id*</td><td>number</td><td>This is the ID of the merchant whose details you wan to view.</td></tr>
</table>

+ Parameters
    + api_key - Enter your api key here.
    + user_id - Enter merchant id here.

+ Response 200 (application/json)

        {
            "message":"Successful",
            "status":200,
            "data":{
                "first_name":"merchant",
                "last_name":"test",
                "email":"yukta231merchant@gmail.com",
                "phone_directory":{
                    "label":"Phone",
                    "phone":"+919467664843",
                    "country_code":"in"
                },
                "company_name":"click labs",
                "company_address":"CDCL",
                "country":null,
                "custom_fields":[],
                "commission_percentage":20,
                "merchant_permission":{
                    "merchant_permission_id":111,
                    "merchant_id":73532,
                    "add_task":0,
                    "view_task":0,
                    "add_team":0,
                    "view_team":0,
                    "add_region":0,
                    "view_region":0,
                    "add_agent":0,
                    "view_agent":0,
                    "view_fleet_avalibility":0,
                    "edit_fleet_avalibility":0,
                    "creation_date":"2018-09-17T04:23:38.000Z",
                    "updation_date":"2018-09-17T04:23:38.000Z"
                },
                "geofence":[]
            }
        }

## Get Merchant Report [/merchant/report{?api_key,user_id,merchant_id}]

### Get Merchant Report [GET]

This API is used to get a merchant report related to is tasks and performance.

Query Parameters:

<table>
<tr><td style="padding-left: 0;" colspan="1"><strong>Name</strong><td><strong>Type</strong></td><td><strong>Description</strong></td></tr>
<tr><td style="padding-right: 40px; width: 140px;">api_key</td><td>string</td> <td> You can generate a key from settings(Login>Menu>Settings>API Keys) in your tookan account. Or <a href="https://app.tookanapp.com/#/app/settings/apikey">click here</a> to get API key</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">user_id*</td><td>number</td><td>You can get it from account details page in Tookan dashboard.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">merchant_id*</td><td>number</td><td>This is the unique ID given to each merchant. Enter the ID of the merchant whose details you want to edit. You can get it from dashboard Menu>More>Merchant.</td></tr>
</table>

+ Parameters
    + api_key - Enter your api key here.
    + user_id - Enter user id here.
    + merchant_id - Enter merchant id here.
    
+ Response 200 (application/json)

        {
            "message":"Successful",
            "status":200,
            "data":{
                "merchant_id":73533,
                "first_name":"merchant",
                "last_name":"test",
                "email":"yuktamerchant@gmail.com",
                "address":"CDCL, Madhya Marg, 28B, Sector 28B, Chandigarh, India",
                "document":[],
                "completed_task":1,
                "failed_task":1,
                "total_agents":1,
                "merchant_rating":"0.00",
                "geofence":[]
            }
        }

## Get Merchant Teams [/merchant/get_merchant_teams]

### Get Merchant Teams [POST]

This API is used to fetch teams related to a merchant.

Request body Parameters :

<table>
<tr><td style="padding-left: 0;" colspan="1"><strong>Name</strong><td><strong>Type</strong></td><td><strong>Description</strong></td></tr>
<tr><td style="padding-right: 40px; width: 140px;">api_key</td><td>string</td> <td> You can generate a key from settings(Login>Menu>Settings>API Keys) in your tookan account. Or <a href="https://app.tookanapp.com/#/app/settings/apikey">click here</a> to get API key</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">get_team_flag</td><td>2 (fixed)</td><td>Set this values as 2 to get merchant teams.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">merchant_id*</td><td>number</td><td>This is the array containg single merchant id whose teams you want to view.</td></tr>
</table>

+ Request (application/json)

        {
            "api_key":"55631.076225def01849131c152c3017162c431fe4c4fe2c",
            "get_team_flag":2,
            "merchant_id":[73533]
        }

+ Response 200 (application/json)

        {
            "message":"Successful",
            "status":200,
            "data":{
                "merchant_teams":[{
                    "user_id":73533,
                    "team_name":"Default Team",
                    "team_id":72193
                }]
            }
        }

## Block/Unblock Merchant [/merchant/block_merchant]

### Block/Unblock Merchant [POST]

This API is used to block or unblock any merchant's account.

Request Body Parameters :

<table>
<tr><td style="padding-left: 0;" colspan="1"><strong>Name</strong><td><strong>Type</strong></td><td><strong>Description</strong></td></tr>
<tr><td style="padding-right: 40px; width: 140px;">api_key</td><td>string</td> <td> You can generate a key from settings(Login>Menu>Settings>API Keys) in your tookan account. Or <a href="https://app.tookanapp.com/#/app/settings/apikey">click here</a> to get API key</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">merchant_id*</td><td>number</td> <td> This is the unique ID given to each merchant. Enter the ID of the merchant whose task you want to create. You can get it from dashboard Menu>More>Merchant.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">is_blocked*</td><td>number</td> <td>Set is_blocked as 0 to block merchant, 1 to unblock merchant.</td></tr>
</table>

+ Request (application/json)

        {
            "api_key":"55631.076225def01849131c152c3017162c431fe4c4fe2c",
            "merchant_id":73532,
            "is_blocked":0
        }
        
+ Response 200 (application/json) 

        {
            "message":"The merchant ' merchant test ' has been blocked .",
            "status":200,
            "data":{}
        }

## Assign Merchant To Task [/merchant/assign_merchant_to_task]

### Assign Merchant To Task [POST]

This API is used to assign a particular task to a merchant.

Request Body Parameters :

<table>
<tr><td style="padding-left: 0;" colspan="1"><strong>Name</strong><td><strong>Type</strong></td><td><strong>Description</strong></td></tr>
<tr><td style="padding-right: 40px; width: 140px;">api_key</td><td>string</td> <td> You can generate a key from settings(Login>Menu>Settings>API Keys) in your tookan account. Or <a href="https://app.tookanapp.com/#/app/settings/apikey">click here</a> to get API key</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">user_id</td><td>number</td><td>You can get it from account details page in Tookan dashboard.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">merchant_id*</td><td>number</td><td>This is the unique ID given to each merchant. Enter the ID of the merchant whose details you want to edit. You can get it from dashboard Menu>More>Merchant.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">team_id</td><td>integer</td> <td>This is the Unique id of every team. You can get it from the dashBoard. More>teams>respective id of the team will displayed.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">job_id</td><td>string</td><td>This is the unique id given to every job which is returned while creating a task</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">job_status</td><td>number</td><td>Refer status codes section above for various statuses available.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">fleet_id</td><td>number (optional)</td> <td> This is unique agent id given to each agent, if given the task will be assigned to the respective agent. You can get it from dashboard Menu>More>agents.</td></tr>
</table>

+ Request (application/json)

        {
            "api_key":"55631.076225def01849131c152c3017162c431fe4c4fe2c",
            "merchant_id":73533,
            "user_id":55631,
            "team_id":72193,
            "job_id":20812404,
            "job_status":"6"
        }

+ Response 200 (application/json)

        {
            "message":"Successful",
            "status":200,
            "data":{}
        }

## Delete Merchant [/merchant/delete]

### Delete Merchant [POST]

This API is used to delete a merchant.

Request Body Parameters : 

<table>
<tr><td style="padding-left: 0;" colspan="1"><strong>Name</strong><td><strong>Type</strong></td><td><strong>Description</strong></td></tr>
<tr><td style="padding-right: 40px; width: 140px;">api_key</td><td>string</td> <td> You can generate a key from settings(Login>Menu>Settings>API Keys) in your tookan account. Or <a href="https://app.tookanapp.com/#/app/settings/apikey">click here</a> to get API key</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">merchant_id*</td><td>number</td><td>This is the unique ID given to each merchant. Enter the ID of the merchant whose details you want to edit. You can get it from dashboard Menu>More>Merchant.</td></tr>
</table>

+ Request (application/json)

        {
            "api_key":"55631.076225def01849131c152c3017162c431fe4c4fe2c",
            "merchant_id":"73532"
        }

+ Response 200 (application/json)

        {
            "message":"Successful",
            "status":200,
            "data":{}
        }
        
## Get All Agents [/get_all_fleets]

### Get All Agents  [POST]

This API is used to get all the Agents/drivers/fleets information with respect to a location. The response array contains a status key for each of the fleet, which shows the current status of the fleet - 0 for available, 1 for offline and 2 for busy, taking into account the location, connectivity, ON-Duty/OFF-Duty status and if they are presently working a task.

Request Body Parameters:
<table>
<tr><td style="padding-left: 0;" colspan="2"><strong>Name</strong><td><strong>Type</strong></td><td><strong>Description</strong></td></tr>
<tr><td style="padding-left: 0;" colspan="2">api_key<td>string</td><td>You can get a key from settings(Login>Menu>Settings>API Keys) in your tookan account. Or <a href="https://app.tookanapp.com/#/app/settings/apikey">click here</a> to get API key</td></tr>
<tr><td style="padding-left: 0;" colspan="2">tags<td>string</td><td>You can pass the tags, comma separated, if you want to filter the list of agents via tags.</td></tr>
<tr><td style="padding-left: 0;" colspan="2">name<td>string</td><td>Enter name, if you want to get list of agents matching this name string.</td></tr>
<tr><td style="padding-left: 0;" colspan="2">fleet_ids<td>array</td><td>You can specify array of fleet ids for getting information of only those fleets in response.</td></tr>
<tr><td style="padding-left: 0;" colspan="2">include_any_tag<td>number</td><td>Provide this key along with tags key in request body. Set value of this key to 1 if you want to agents having any of the tags provided in tags key, else set value of this key to 0 if you want the list of agents having all the tags you have provided in request body.</td></tr>
<tr><td style="padding-left: 0;" colspan="2">status<td>number</td><td>Pass 0 for getting agents who are free and Pass 1 for getting agents who are busy.</td></tr>
<tr><td style="padding-left: 0;" colspan="2">fleet_type<td>number</td><td>Pass 1 for getting agents with fleet type "capative", Pass 2 for getting agents with fleet type "freelancer"</td></tr>
<tr><td style="padding-left: 0;" colspan="2">merchant_id</td><td>number</td><td> Enter merchant id to get agents under that merchant.</td></tr>
</table>


+ Request (application/json)

           {
            "api_key": "2b997be77e2becfd4c66426ef504",
            "tags": "mini,suv",
            "name": "manish",
            "fleet_ids": [49322, 42947],
            "include_any_tag": 1,
            "status": 0,
            "fleet_type": 1,
            "merchant_id":1234
        }



+ Response 200 (application/json)

+ Body


        {
            "message": "Successful",
            "status": 200,
            "data": [
        {
            "fleet_id": 15500,
            "device_type": 3,
            "total_rating": 50,
            "total_rated_tasks": 10,
            "is_active": 1,
            "has_gps_accuracy": 1,
            "username": "manish",
            "name": "manish",
            "login_id": "mannish",
            "transport_type": 1,
            "transport_desc": "Swift",
            "license": "123123",
            "email": "manish.sharma@tookanapp.com",
            "phone": "+917087034232",
            "battery_level": 20,
            "registration_status": 1,
            "latitude": "30.755838886863323",
            "is_available": 0,
            "longitude": "76.64949079051301",
            "tags": "mini,suv",
            "fleet_thumb_image": "https://tookan.s3.amazonaws.com/fleet_thumb_profile/thumb-QxUG1536819089055-6MwT1536819087649nature31.jpg",
            "fleet_image": "https://tookan.s3.amazonaws.com/fleet_profile/6MwT1536819087649-nature31.jpg",
            "status": 0,
            "timezone": "-330",
            "fleet_type": 1
        }
        ]
        }

## Add Agent [/add_agent]

### Add Agent  [POST]

This API is used to register a new Agent in your account.

Request Body Parameters:
<table>
<tr><td style="padding-left: 0;" colspan="2"><strong>Name</strong><td><strong>Type</strong></td><td><strong>Description</strong></td></tr>
<tr><td style="padding-left: 0;" colspan="2">api_key</td><td>string</td><td> You can get a key from settings(Login>Menu>Settings>API Keys) in your tookan account. Or <a href="https://app.tookanapp.com/#/app/settings/apikey">click here</a> to get API key</td></tr>
<tr><td style="padding-left: 0;" colspan="2">email</td><td>string</td><td>email of your agent.</td></tr>
<tr><td style="padding-left: 0;" colspan="2">phone</td><td>string</td><td>add the phone number of the agent. He will get a notification with the links and credentials to download the app</td></tr>
<tr><td style="padding-left: 0;" colspan="2">transport_type</td><td>string</td><td> Send 1 for Car, 2 for Motor Cycle, 3 for Bicycle, 4 for Scooter, 5 for Foot, 6 for Truck</td></tr>
<tr><td style="padding-left: 0;" colspan="2">transport_desc</td><td>string</td><td></td></tr>
<tr><td style="padding-left: 0;" colspan="2">license</td><td>string</td><td></td></tr>
<tr><td style="padding-left: 0;" colspan="2">color</td><td>string</td><td></td></tr>
<tr><td style="padding-left: 0;" colspan="2">timezone*</td><td>string</td><td></td></tr>
<tr><td style="padding-left: 0;" colspan="2">team_ids*</td><td>string</td><td>You need to pass a team of which the agent will be a part of. Team Id will be visible on the All teams page</td></tr>
<tr><td style="padding-left: 0;" colspan="2">password*</td><td>string</td><td>You can set the password yourself, or leave it empty, in which case the system will auto-generate the password</td></tr>
<tr><td style="padding-left: 0;" colspan="2">username*</td><td>string</td><td>Unique username, which the agent will use to login to the Tookan Agent App</td></tr>
<tr><td style="padding-left: 0;" colspan="2">first_name*</td><td>string</td><td></td></tr>
<tr><td style="padding-left: 0;" colspan="2">last_name</td><td>string</td><td></td></tr>
<tr><td style="padding-left: 0;" colspan="2">rule_id</td><td>number</td><td>You can find rule id in the Access Control page for the agents named as Role ID.</td></tr>
<tr><td style="padding-left: 0;" colspan="2">fleet_type*</td><td>number</td><td>Send 1 for captive agents and 2 for freelancer agents. Default value is 1.</td></tr>
<tr><td style="padding-left: 0;" colspan="2">merchant_id</td><td>number</td><td>Enter merchant id to add the agent under that merchant.</td></tr>
</table>

+ Request (application/json)

            {
              "api_key": "1fc5defefb668fcf820bac29e7b7aa05",
              "email": "abc@xyz.com",
              "phone": "919999999999",
              "transport_type": "1",
              "transport_desc": "auto",
              "license": "demo",
              "color": "blue",
              "timezone": "-330",
              "team_id": "Your Team ID",
              "password": "abcdefg",
              "username": "username",
              "first_name": "Decimate",
              "last_name": "abc",
              "rule_id":123,
              "merchant_id":1234
            }
+ Response 200 (application/json)

            {
                "message": "Successful",
                "status": 200,
                "data": {}
            }
            
## Edit Agent [/edit_agent]

### Edit Agent  [POST]

This API is used to update particular agent of your account.

Request Body Parameters:
<table>
<tr><td style="padding-left: 0;" colspan="2"><strong>Name</strong><td><strong>Type</strong></td><td><strong>Description</strong></td></tr>
<tr><td style="padding-left: 0;" colspan="2">api_key</td><td>string</td><td> You can get a key from settings(Login>Menu>Settings>API Keys) in your tookan account. Or <a href="https://app.tookanapp.com/#/app/settings/apikey">click here</a> to get API key</td></tr>
<tr><td style="padding-left: 0;" colspan="2">fleet_id*</td><td>string</td><td>Agent Id of your agent. You will get this from agent list in dashboard.</td></tr>
<tr><td style="padding-left: 0;" colspan="2">email</td><td>string</td><td>Email of your agent.</td></tr>
<tr><td style="padding-left: 0;" colspan="2">phone</td><td>string</td><td>Add the phone number of the agent.</td></tr>
<tr><td style="padding-left: 0;" colspan="2">transport_type</td><td>string</td><td> Send 1 for Car, 2 for Motor Cycle, 3 for Bicycle, 4 for Scooter, 5 for Foot, 6 for Truck</td></tr>
<tr><td style="padding-left: 0;" colspan="2">transport_desc</td><td>string</td><td></td></tr>
<tr><td style="padding-left: 0;" colspan="2">license</td><td>string</td><td></td></tr>
<tr><td style="padding-left: 0;" colspan="2">color</td><td>string</td><td></td></tr>
<tr><td style="padding-left: 0;" colspan="2">timezone</td><td>string</td><td></td></tr>
<tr><td style="padding-left: 0;" colspan="2">team_id</td><td>string</td><td>You need to pass a team of which the agent will be a part of. Team Id will be visible on the All teams page</td></tr>
<tr><td style="padding-left: 0;" colspan="2">password</td><td>string</td><td>You can set the password yourself, or leave it empty, in which case the system will auto-generate the password</td></tr>
<tr><td style="padding-left: 0;" colspan="2">first_name</td><td>string</td><td></td></tr>
<tr><td style="padding-left: 0;" colspan="2">last_name</td><td>string</td><td></td></tr>
<tr><td style="padding-left: 0;" colspan="2">rule_id</td><td>number</td><td>You can find rule id in the Access Control page for the agents named as Role ID.</td></tr>
<tr><td style="padding-left: 0;" colspan="2">fleet_type</td><td>number</td><td>Send 1 for captive agents and 2 for freelancer agents. Default value is 1.</td></tr>
<tr><td style="padding-left: 0;" colspan="2">merchant_id</td><td>number</td><td>Enter merchant id to edit the agent under that merchant.</td></tr>
</table>

+ Request (application/json)

            {
              "api_key": "1fc5defefb668fcf820bac29e7b7aa05",
              "fleet_id": "12",
              "email": "abc@xyz.com",
              "phone": "919999999999",
              "transport_type": "1",
              "transport_desc": "auto",
              "license": "demo",
              "color": "blue",
              "timezone": "-330",
              "team_id": "1",
              "password": "abcdefg",
              "first_name": "Decimate",
              "last_name": "abc",
              "rule_id":123,
              "merchant_id":12345
            }
+ Response 200 (application/json)

            {
                "message": "Successful",
                "status": 200,
                "data": {}
            }
            


## Assign Agent To Task [/assign_fleet_to_task]

### Assign Agent To Task [POST]

This API is used to assign a merchant's agent to your task.

Request Body Parameters : 

<table class="humanColumnApiDescription markdown formalTheme">
<tr><td colspan="1"><strong>Name</strong><td colspan="1"><strong>Type</strong><td colspan="1"><strong>Description</strong></td></tr>
<tr><td style="padding-right: 40px; width: 140px;">api_key</td><td>string</td> <td> You can generate a key from settings(Login>Menu>Settings>API Keys) in your tookan account. Or <a href="https://app.tookanapp.com/#/app/settings/apikey">click here</a> to get API key</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">merchant_id</td><td>number</td> <td> This is the unique ID given to each merchant. Enter the ID of the merchant whose task you want to create. You can get it from dashboard Menu>More>Merchant.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">job_id*</td><td>number</td> <td>This is the unique id given to every job which is returned while creating a task.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">fleet_id*</td><td>number</td> <td>This is unique agent id given to each agent, if given the task will be assigned to the respective agent. You can get it from dashboard Menu>More>agents.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">team_id*</td><td>number</td> <td>This is the Unique id of every team. You can get it from the dashBoard. More>teams>respective id of the team will displayed.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">notify</td><td>0/1</td> <td>This is used to enable the notifications.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">geofence</td><td>0/1</td> <td>This is used to enable the geofencing.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">job_status</td><td>string</td> <td>Refer status codes section above for various statuses available.</td></tr>
</table>

+ Request (application/json)

        {
            "api_key":"55631.076225def01849131c152c3017162c431fe4c4fe2c",
             "merchant_id":73533,
            "job_id":20813248,
            "team_id":72193,
            "fleet_id":165932,
            "notify":1,
            "geofence":0,
            "job_status":"0"
        }
        
+ Response 200 (application/json)

        {
            "message":"The Agent 'merchant test' has been assigned to task '20813248'",
            "status":200,
            "data":{}
        }

## Create Merchant Task [/create_task]

There are different types of tasks can be created inside Tookan depending on the workflow you have selected in your account for e.g. - pick & delivery task, appointment task etc. Please refer to appropriate API below according to your requirement. In case of any doubt, feel free to reach out to us at contact@tookanapp.com.

### Create a Pickup Task [POST]

This API is used to create a pickup task for merchant.
<br>

Request Body Parameters:
<table class="humanColumnApiDescription markdown formalTheme">
<tr><td colspan="1"><strong>Name</strong><td colspan="1"><strong>Type</strong><td colspan="1"><strong>Description</strong></td></tr>
<tr><td style="padding-right: 40px; width: 140px;">api_key</td><td>string</td> <td> You can generate a key from settings(Login>Menu>Settings>API Keys) in your tookan account. Or <a href="https://app.tookanapp.com/#/app/settings/apikey">click here</a> to get API key</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">merchant_id*</td><td>string</td> <td> This is the unique ID given to each merchant. Enter the ID of the merchant whose task you want to create. You can get it from dashboard Menu>More>Merchant.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">order_id</td><td>string</td> <td>Your can pass this key as your own transaction number which can be used to identify tasks in tookan</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">job_description</td><td> String </td><td>The description of the task to be done</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">job_pickup_phone</td><td>string</td><td> The contact number of the person from whom the pickup should be collected</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">job_pickup_name</td><td>string<br/>(optional)</td><td> The name of the person from whom the pickup should be collected</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">job_pickup_email</td><td>string <br/> (optional)</td><td> The email of the person from whom the pickup should be collected</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">job_pickup_address*</td><td>string</td><td>The address from which the pickup should be collected.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">job_pickup_latitude</td><td>string <br/> (optional)</td><td> This is the latitiude of the  pickup location</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">job_pickup_longitude</td><td>string <br/> (optional)</td><td>This is the longitude of the  pickup location</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">job_pickup_datetime*</td><td>string</td><td> This is time before which the pickup should be collected</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">has_pickup*</td><td> boolean <br/> (Fixed)</td><td>For a Pickup task, this is fixed to <code>1</code</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">has_delivery*</td><td>boolean <br/> (Fixed)</td><td>For a Pickup task this is fixed to <code>0</code></td></tr>
<tr><td style="padding-right: 40px; width: 140px;">layout_type*</td><td> integer <br/> (Fixed)</td><td>For a Pickup task this is fixed to <code>0</code></td></tr>
<tr><td style="padding-right: 40px; width: 140px;">tracking_link</td><td> boolean </td><td>If this value is <code>1</code> it will return a url in the response where the driver's movement can be tracked.if not no url will be returned </td></tr>
<tr><td style="padding-right: 40px; width: 140px;">timezone</td><td> string </td><td>Timezone difference with UTC in minutes for e.g., For PST:<code>+480</code> (PDT: <code>+420</code>),For MST <code>+420</code> (MDT:<code>+360</code>) for EST: <code>+300</code>(EDT:<code>+240</code>), for AEST: <code>-600</code> (AEDT: <code>-660</code>), for IST: <code>-330</code>, for CST: <code>+360</code> (CDT:<code>+300</code>)</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">pickup_custom_field_template</td><td>string</td> <td>This is the custom fields template name that is pre-defined in your workflow page in the admin account and you just need to replace space in template with underscore(_).</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">pickup_meta_data</td><td>json array</td> <td>This is array of object containing label and data where label defines the custom field name and data will be his value.(Provided label should be in specified template.)</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">team_id</td><td>integer</td> <td>This is the Unique id of every team. You can get it from the dashBoard. More>teams>respective id of the team will displayed.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">auto_assignment</td><td>boolean</td> <td> If this value is <code>1</code> The task will be auto assigned to the members of the specific team mentioned. or if this value is <code>0</code> it will be unassigned task created. </td></tr>
<tr><td style="padding-right: 40px; width: 140px;">fleet_id</td><td>string</td> <td> This is unique agent id given to each agent, if given the task will be assigned to the respective agent. You can get it from dashboard Menu>More>agents.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">p_ref_images</td><td>Array</td><td> This is an array of strings containing links of images.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">notify</td><td>integer</td><td>This is used to enable the notifications.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">geofence</td><td>integer</td><td>This is used to enable the geofencing.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">tags</td><td>string</td><td> This is a string containing comma separated tags as filters for agents in auto assignment.</td></tr>
</table>


+ Request (application/json)

            {
                "api_key":"2b997be77e2cc22becfd4c66426ef504",
                "merchant_id":"356253",
                "order_id":"654321",
                "job_description":"groceries delivery",
                "job_pickup_phone":"+1201555555",
                "job_pickup_name":"7 Eleven Store",
                "job_pickup_email":"",
                "job_pickup_address":"114, sansome street, San Francisco",
                "job_pickup_latitude":"30.7188978",
                "job_pickup_longitude":"76.810296",
                "job_pickup_datetime":"2016-08-14 19:00:00",
                "pickup_custom_field_template":"Template_1",
                "pickup_meta_data": [{"label":"Price","data":"100"},{"label":"Quantity","data":"100"}],
                "team_id":"",
                "auto_assignment":"0",
                "has_pickup":"1",
                "has_delivery":"0",
                "layout_type":"0",
                "tracking_link":1,
                "timezone":"300",
                "fleet_id":"",
                "p_ref_images": ["http://tookanapp.com/wp-content/uploads/2015/11/logo_dark.png"],
                "notify":1,
                "tags":"",
                "geofence":0
            }

+ Response 200 (application/json)


    + Body

                {
                  "message": "The task has been created.",
                  "status": 200,
                  "data": {
                    "tracking_link": "http://bit.ly/1LwzMJS",
                    "job_id": 5265,
                    "job_hash": "f02aac468aebde6ef46ed90532b4a417",
                    "job_token": "1444849200000",
                    "job_pickup_name": "7 Eleven Store",
                    "job_pickup_address": "frigate bay 1"
                  }
                }

### Create a Delivery Task [POST]

This API is used to create a Delivery Task for merchant.
<br>

Request Body Parameters :
<table class="humanColumnApiDescription markdown formalTheme">
<tr><td colspan="1"><strong>name</strong><td colspan="1"><strong>Type</strong><td colspan="1"><strong>Description</strong></td></tr>
<tr><td style="padding-right: 40px; width: 140px;">api_key</td><td>string</td> <td> You can generate a key from settings(Login>Menu>Settings>API Keys) in your tookan account. Or <a href="https://app.tookanapp.com/#/app/settings/apikey">click here</a> to get API key</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">merchant_id*</td><td>string</td> <td> This is the unique ID given to each merchant. Enter the ID of the merchant whose task you want to create. You can get it from dashboard Menu>More>Merchant.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">order_id</td><td>string</td> <td>Your can pass this key as your own transaction number which can be used to identify tasks in tookan</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">job_description</td><td> String </td><td>The description of the task to be done</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">job_pickup_phone</td><td>string</td><td> The contact number of the person from whom the pickup should be collected</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">customer_email</td><td> email <br/> (optional)</td><td>  This is email of the customer to whom the product should be delivered</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">customer_username</td><td>String<br/>(optional)</td><td>This is the name of the customer to whom the product should be delivered</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">customer_phone</td><td> String </td><td>This is the contact number of the customer to whom the product should be delivered</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">customer_address*</td><td>String </td><td>This is the address of the customer to whom the product should be delivered</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">latitude</td><td>String  <br/> (optional)</td><td> This is the latitiude of the  pickup location if you have it. Otherwise leave it blank. We will get it through geocoding API</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">longitude</td><td>String  <br/> (optional)</td><td>This is the latitiude of the  pickup location if you have it. Otherwise leave it blank. We will get it through geocoding API</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">job_delivery_datetime*</td><td> Date/String </td><td>This is time before which the product should be delivered</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">has_pickup*</td><td> boolean<br/> (Fixed)</td><td>For a delivery task this value is <code>0</code></td></tr>
<tr><td style="padding-right: 40px; width: 140px;">has_delivery*</td><td>boolean<br/> (Fixed)</td><td>For a delivery task this value is <code>1</code></td></tr>
<tr><td style="padding-right: 40px; width: 140px;">layout_type*</td><td> integer<br/> (Fixed)</td><td>For a delivery task this value is <code>0</code></td></tr>
<tr><td style="padding-right: 40px; width: 140px;">tracking_link</td><td> boolean</td><td>If this value is <code>1</code> it will return a url in the respone where the driver's movement can be tracked. </td></tr>
<tr><td style="padding-right: 40px; width: 140px;">timezone*</td><td> string </td><td>Timezone difference with UTC in minutes for e.g., For PST:<code>+480</code> (PDT: <code>+420</code>),For MST <code>+420</code> (MDT:<code>+360</code>) for EST: <code>+300</code>(EDT:<code>+240</code>), for AEST: <code>-600</code> (AEDT: <code>-660</code>), for IST: <code>-330</code></td></tr>
<tr><td style="padding-right: 40px; width: 140px;">custom_field_template</td><td>string</td><td>This is the custom fields template name that is pre-defined in your workflow page in the admin account and you just need to replace space in template with underscore(_).</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">meta_data</td><td>json array</td> <td>This is array of object containing label and data where label defines the custom field name and data will be his value.(Provided label should be in specified template.)</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">team_id</td><td>integer</td> <td>This is the Unique id of every team. You can get it from the dashBoard. More>teams>respective id of the team will displayed.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">auto_assignment</td><td>boolean</td> <td> If this value is <code>1</code> The task will be auto assigned to the members of the specific team mentioned. or if this value is <code>0</code> it will be unassigned task created. </td></tr>
<tr><td style="padding-right: 40px; width: 140px;">fleet_id</td><td>string</td> <td> This is unique agent id given to each agent, if given the task will be assigned to the respective agent. You can get it from dashboard Menu>More>agents.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">ref_images</td><td>Array</td><td> This is an array of strings containing links of images.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">notify</td><td>integer</td><td>This is used to enable the notifications.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">geofence</td><td>integer</td><td>This is used to enable the geofencing.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">tags</td><td>string</td><td> This is a string containing comma separated tags as filters for agents in auto assignment.</td></tr>
</table>
+ Request (application/json)

            {
                "api_key":"2b997be77e2cc22becfd4c66426ef504",
                "merchant_id":"356253",
                "order_id":"654321",
                "job_description":"groceries delivery",
                "customer_email":"john@example.com",
                "customer_username":"John Doe",
                "customer_phone":"+12015555555",
                "customer_address":"frigate bay 2",
                "latitude":"30.7188978",
                "longitude":"76.810298",
                "job_delivery_datetime":"2016-08-14 21:00:00",
                "custom_field_template":"Template_1",
                "meta_data": [{"label":"Price","data":"100"},{"label":"Quantity","data":"100"}],
                "team_id":"",
                "auto_assignment":"0",
                "has_pickup":"0",
                "has_delivery":"1",
                "layout_type":"0",
                "tracking_link":1,
                "timezone":"-330",
                "fleet_id":"636",
                "ref_images": ["http://tookanapp.com/wp-content/uploads/2015/11/logo_dark.png","http://tookanapp.com/wp-content/uploads/2015/11/logo_dark.png"],
                "notify":1,
                "tags":"",
                "geofence":0
            }

+ Response 200 (application/json)


    + Body

                {
                  "message": "The task has been created.",
                  "status": 200,
                  "data": {
                    "tracking_link": "http://bit.ly/1OqtCS9",
                    "job_id": 5268,
                    "job_hash": "6e419074d9cbaa2ec52754e852b91e21",
                    "job_token": "1444856400000",
                    "customer_name": "John Doe",
                    "customer_address": "frigate bay 2"
                  }
                }

### Create a Pickup and Delivery Task [POST]

This api is used to create Pickup and Delivery task for merchant.
<br>

Request Body Parameters :
<table class="humanColumnApiDescription markdown formalTheme">
<tr><td colspan="1"><strong>name</strong><td colspan="1"><strong>Type</strong><td colspan="1"><strong>Description</strong></td></tr>
<tr><td style="padding-right: 40px; width: 140px;">api_key</td><td>string</td> <td> You can get a key from settings(Login>Menu>Settings>API Keys) in your tookan account. Or <a href="https://app.tookanapp.com/#/app/settings/apikey">click here</a> to get API key</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">merchant_id*</td><td>string</td> <td> This is the unique ID given to each merchant. Enter the ID of the merchant whose task you want to create. You can get it from dashboard Menu>More>Merchant.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">order_id</td><td>string</td> <td>Your can pass this key as your own transaction number which can be used to identify tasks in tookan</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">team_id</td><td>integer</td> <td>This is the Unique id of every team. You can get it from the dashBoard. More>teams>respective id of the team will displayed.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">auto_assignment</td><td>boolean</td> <td> If this value is <code>1</code> The task will be auto assigned to the members of the specific team mentioned. or if this value is <code>0</code> it will be unassigned task created. </td></tr>
<tr><td style="padding-right: 40px; width: 140px;">job_description</td><td> String </td><td>The description of the task to be done</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">job_pickup_phone</td><td>string</td><td> The contact number of the person from whom the pickup should be collected</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">job_pickup_name</td><td>string <br/> (optional) </td><td> The name of the person from whom the pickup should be collected</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">job_pickup_email</td><td>string <br/> (optional)</td><td> The email of the person from whom the pickup should be collected</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">job_pickup_address*</td><td>string</td><td>The address from which the pickup should be collected.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">job_pickup_latitude</td><td>string <br/> (optional)</td><td> This is the latitiude of the  pickup location</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">job_pickup_longitude</td><td>string <br/> (optional)</td><td>This is the longitude of the  pickup location</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">job_pickup_datetime*</td><td>string</td><td> This is time before which the pickup should be collected</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">pickup_custom_field_template</td><td>string</td> <td>This is the custom fields template name that is pre-defined in your workflow page in the admin account and you just need to replace space in template with underscore(_).</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">pickup_meta_data</td><td>json array</td> <td>This is array of object containing label and data where label defines the custom field name and data will be his value.(Provided label should be in specified template.)</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">customer_email</td><td> email <br/> (optional)</td><td>  This is email of the customer to whom the product should be delivered</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">customer_username</td><td>String <br/> (optional)</td><td>This is the name of the customer to whom the product should be delivered</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">customer_phone</td><td> String </td><td>This is the contact number of the customer to whom the product should be delivered</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">customer_address*</td><td>String </td><td>This is the address of the customer to whom the product should be delivered</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">latitude</td><td>String <br/> (optional) </td><td> This is the latitiude of the  delivery location </td></tr>
<tr><td style="padding-right: 40px; width: 140px;">longitude</td><td>String <br/> (optional) </td><td>This is the longitude of the  delivery location</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">job_delivery_datetime*</td><td> Date/String </td><td>This is time before which the product should be delivered</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">custom_field_template</td><td>string</td> <td>This is the custom fields template name that is pre-defined in your workflow page in the admin account and you just need to replace space in template with underscore(_).</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">meta_data</td><td>json array</td> <td>This is array of object containing label and data where label defines the custom field name and data will be his value.(Provided label should be in specified template.)</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">timezone*</td><td> Integer</td><td>Timezone difference with UTC in minutes for e.g., For PST:<code>+480</code> (PDT: <code>+420</code>),For MST <code>+420</code> (MDT:<code>+360</code>) for EST: <code>+300</code>(EDT:<code>+240</code>), for AEST: <code>-600</code> (AEDT: <code>-660</code>), for IST: <code>-330</code></td></tr>
<tr><td style="padding-right: 40px; width: 140px;">has_pickup*</td><td> boolean<br/> (Fixed)</td><td>For a pickup and delivery task this value is fixed to <code>1</code></td></tr>
<tr><td style="padding-right: 40px; width: 140px;">has_delivery*</td><td>boolean<br/> (Fixed)</td><td>For a pickup and delivery task this value is fixed to <code>1</code></td></tr>
<tr><td style="padding-right: 40px; width: 140px;">layout_type*</td><td> integer<br/> (Fixed)</td><td>For a pickup and delivery task this value is fixed to <code>0</code></td></tr>
<tr><td style="padding-right: 40px; width: 140px;">tracking_link</td><td> boolean</td><td>If this value is <code>1</code> it will return a url in the respone where the driver's movement can be tracked. </td></tr>
<tr><td style="padding-right: 40px; width: 140px;">fleet_id</td><td>string</td> <td> This is unique agent id given to each agent, if given the task will be assigned to the respective agent. You can get it from dashboard Menu>More>agents.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">p_ref_images</td><td>Array</td><td>(Pickup) This is an array of strings containing links of images.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">ref_images</td><td>Array</td><td>(Delivery) This is an array of strings containing links of images.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">notify</td><td>integer</td><td>This is used to enable the notifications.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">geofence</td><td>integer</td><td>This is used to enable the geofencing.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">tags</td><td>string</td><td> This is a string containing comma separated tags as filters for agents in auto assignment.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">ride_type</td><td>number</td><td>0 for Non-Pool Task, 1 for Pool Task.</td></tr>
</table>

<br>

Response Body Parameters : 
<table>
<tr><td colspan="1"><strong>Name</strong><td colspan="1"><strong>Type</strong><td colspan="1"><strong>Description</strong></td></tr>
<tr><td style="padding-right: 40px; width: 140px;">message</td><td>string</td><tdThis says whether the request is successful or not></td></tr>
<tr><td style="padding-right: 40px; width: 140px;">status</td><td>number</td><td>This should be mapped with the error codes mention in error codes section above.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">data</td><td>Object</td> <td>This gives the information about the task like pickup_tracking_link,delivery_tracing_link,job_id, job_token,
pickup_hash, delivery_hash</td></tr>
</table>

+ Request (application/json)

            {
                "api_key":"2b997be77e2cc22becfd4c66426ef504",
                "merchant_id":"356253",
                "order_id":"654321",
                "team_id":"",
                "auto_assignment":"0",
                "job_description":"groceries delivery",
                "job_pickup_phone":"+1201555555",
                "job_pickup_name":"7 Eleven Store",
                "job_pickup_email":"",
                "job_pickup_address":"frigate bay 1",
                "job_pickup_latitude":"30.7188978",
                "job_pickup_longitude":"76.810296",
                "job_pickup_datetime":"2016-08-14 19:00:00",
                "customer_email":"john@example.com",
                "customer_username":"John Doe",
                "customer_phone":"+12015555555",
                "customer_address":"frigate bay 2",
                "latitude":"30.7188978",
                "longitude":"76.810298",
                "job_delivery_datetime":"2016-08-14 21:00:00",
                "has_pickup":"1",
                "has_delivery":"1",
                "layout_type":"0",
                "tracking_link":1,
                "timezone":"-330",
                "custom_field_template":"Template_1",
                "meta_data": [{"label":"Price","data":"100"},{"label":"Quantity","data":"100"}],
                "pickup_custom_field_template":"Template_2",
                "pickup_meta_data": [{"label":"Price","data":"100"},{"label":"Quantity","data":"100"}],
                "fleet_id":"",
                "p_ref_images": ["http://tookanapp.com/wp-content/uploads/2015/11/logo_dark.png","http://tookanapp.com/wp-content/uploads/2015/11/logo_dark.png"],
                "ref_images": ["http://tookanapp.com/wp-content/uploads/2015/11/logo_dark.png","http://tookanapp.com/wp-content/uploads/2015/11/logo_dark.png"],
                "notify":1,
                "tags":"",
                "geofence":0,
                "ride_type":0
            }

+ Response 200 (application/json)


    + Body

                {
                  "message": "The task has been created.",
                  "status": 200,
                  "data": {
                            "pickup_tracking_link": "http://bit.ly/1htQjX9",
                            "delivery_tracing_link": "http://bit.ly/1jSBizX",
                            "job_id": 5233,
                            "job_token": "1444849200000",
                            "pickup_hash": "e70c492a098f1e741bd47c44ba5a8530",
                            "delivery_hash": "f30a06756a922ee36b3fcc58ec5072ea",
                            "customer_name": "John Doe",
                            "customer_address": "frigate bay 2"
                          }
                }

### Create an Appointment Task [POST]

This api is used to create an Appointment task for merchant.
<br>

Request Body Parameters :
<table class="humanColumnApiDescription markdown formalTheme">
<tr><td colspan="1"><strong>name</strong><td colspan="1"><strong>Type</strong><td colspan="1"><strong>Description</strong></td></tr>
<tr><td style="padding-right: 40px; width: 140px;">api_key</td><td>string</td><td> You can get a key from settings(Login>Menu>Settings>API Keys) in your tookan account. Or <a href="https://app.tookanapp.com/#/app/settings/apikey">click here</a> to get API key</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">merchant_id*</td><td>string</td> <td> This is the unique ID given to each merchant. Enter the ID of the merchant whose task you want to create. You can get it from dashboard Menu>More>Merchant.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">order_id</td><td>string</td> <td>Your can pass this key as your own transaction number which can be used to identify tasks in tookan</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">customer_email</td><td> email <br/> (optional)</td><td> Customer email</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">customer_username</td><td>String</td><td>customer name to whom the product should be delivered.</tr>
<tr><td style="padding-right: 40px; width: 140px;">customer_phone</td><td> String</td><td> The contact number of the customer to whom the product should be delivered</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">customer_address*</td><td>String </td><td>The address to which the product should be delivered.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">latitude</td><td>number  <br/> (optional)</td><td>The latitude of the location of customer address</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">longitude</td><td>number  <br/> (optional)</td><td>The longitude of the location of customer address</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">job_description</td><td> String </td><td> The description of the task to be done</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">job_pickup_datetime*</td><td> Date/String </td><td> This is the start time of the appointment.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">job_delivery_datetime*</td><td> Date/String </td><td> Time before which the appointment should be completed</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">timezone*</td><td> Integer</td><td> Timezone difference with UTC in minutes for e.g., For PST:<code>+480</code> (PDT: <code>+420</code>),For MST <code>+420</code> (MDT:<code>+360</code>) for EST: <code>+300</code>(EDT:<code>+240</code>), for AEST: <code>-600</code> (AEDT: <code>-660</code>), for IST: <code>-330</code></td></tr>
<tr><td style="padding-right: 40px; width: 140px;">custom_field_template</td><td>string</td> <td>This is the custom fields template name that is pre-defined in your workflow page in the admin account and you just need to replace space in template with underscore(_).</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">meta_data</td><td>json array</td> <td>This is array of object containing label and data where label defines the custom field name and data will be his value.(Provided label should be in specified template.)</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">has_pickup*</td><td>boolean<br/> (Fixed)</td><td>For an appointment task this value is fixed to <code>0</code></td></tr>
<tr><td style="padding-right: 40px; width: 140px;">has_delivery*</td><td> boolean <br/> (Fixed)</td><td>For an appointment task this value is fixed to <code>0</code></td></tr>
<tr><td style="padding-right: 40px; width: 140px;">layout_type*</td><td> number <br/> (Fixed)</td><td>For an appointment task this value is fixed to <code>1</code></td></tr>
<tr><td style="padding-right: 40px; width: 140px;">tracking_link</td><td> boolean</td><td> If this value is <code>1</code> it will return a url in the respone where the driver's movement can be tracked</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">team_id</td><td>integer</td> <td>This is the Unique id of every team. You can get it from the dashBoard. More>teams>respective id of the team will displayed.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">auto_assignment</td><td>boolean</td> <td> If this value is <code>1</code> The task will be auto assigned to the members of the specific team mentioned. or if this value is <code>0</code> it will be unassigned task created. </td></tr>
<tr><td style="padding-right: 40px; width: 140px;">fleet_id</td><td>string</td> <td> This is unique agent id given to each agent, if given the task will be assigned to the respective agent. You can get it from dashboard Menu>More>agents.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">ref_images</td><td>Array</td><td>This is an array of strings containing links of images.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">notify</td><td>integer</td><td>This is used to enable the notifications.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">geofence</td><td>integer</td><td>This is used to enable the geofencing.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">tags</td><td>string</td><td> This is a string containing comma separated tags as filters for agents in auto assignment.</td></tr>
</table>
+ Request (application/json)

            {
                "customer_email":"john@example.com",
                "merchant_id":"356253",
                "order_id":"654321",
                "customer_username":"John Doe",
                "customer_phone":"+919999999999",
                "customer_address":"Powai Lake, Powai, Mumbai, Maharashtra, India",
                "latitude":"28.5494489",
                "longitude":"77.2001368",
                "job_description":"Beauty services",
                "job_pickup_datetime":"2016-10-30 16:00:00",
                "job_delivery_datetime":"2016-10-30 17:00:00",
                "has_pickup":"0",
                "has_delivery":"0",
                "layout_type":"1",
                "tracking_link":1,
                "timezone":"-330",
                "custom_field_template":"Template_1",
                "meta_data": [{"label":"Price","data":"100"},{"label":"Quantity","data":"100"}],
                "api_key":"2b997be77e2cc22becfd4c66426ef504",
                "team_id":"",
                "auto_assignment":"0",
                "fleet_id":"",
                "ref_images": ["http://tookanapp.com/wp-content/uploads/2015/11/logo_dark.png","http://tookanapp.com/wp-content/uploads/2015/11/logo_dark.png"],
                "notify":1,
                "tags":"",
                "geofence":0
            }

+ Response 200 (application/json)


    + Body

                {
                  "message": "The task has been created.",
                  "status": 200,
                  "data": {
                            "tracking_link": "http://bit.ly/1GA4z7e",
                            "job_id": 5236,
                            "job_hash": "67657b3ed35c5548d7806d9eafd22e43",
                            "job_token": "1446220800000",
                            "customer_name": "John Doe",
                            "customer_address": "Powai Lake, Powai, Mumbai, Maharashtra, India"
                            }
                }
                
## Multiple Merchant Tasks [/create_multiple_tasks]

### Create Multiple Pickup And Delivery Tasks [POST]
This API is used to create multiple pickup and delivery merchant tasks for the fleets at once. 

Request Body Parameters:

<table class="humanColumnApiDescription markdown formalTheme">
<tr><td colspan="1"><strong>name</strong><td colspan="1"><strong>Type</strong><td colspan="1"><strong>Description</strong></td></tr>
<tr><td style="padding-right: 40px; width: 140px;">api_key</td><td>string</td> <td> You can generate a key from settings(Login>Menu>Settings>API Keys) in your tookan account. Or <a href="https://app.tookanapp.com/#/app/settings/apikey">click here</a> to get API key</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">merchant_id*</td><td>string</td> <td> This is the unique ID given to each merchant. Enter the ID of the merchant whose task you want to create. You can get it from dashboard Menu>More>Merchant.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">fleet_id</td><td> String </td><td>Id of the fleet to which this task is to be assigned, optional.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">timezone*</td><td>string</td><td>Timezone of the country or location in numerical format. Eg - timezone for India = -330.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">has_pickup*</td><td>boolean</td> <td> Boolean key containing 1 if these are pickup tasks.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">has_delivery*</td><td>boolean</td><td>Boolean key containing 1 if these are delivery tasks.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">layout_type*</td><td>string</td><td>Set it as 0 (PICKUP_AND_DELIVERY), 1 (APPOINTMENT) or 2 (FOS) depending upon the type of layout.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">geofence</td><td>string</td> <td> This is used to enable the geofencing.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">auto_assignment</td><td>boolean</td><td>Boolean key containing the value 0 if the task is not to be assigned automatically to the fleet.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">tags</td><td> String </td><td>This is a string containing comma separated tags as filters for agents in auto assignment.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">deliveries*</td><td>JSON array</td><td>Array of objects containing address, name, job_description, latitude, longitude, tie, phone, template_name, template_data, ref_images, email, order_id where address defines the address of the customer to whom the product should be delivered, name defines the name  of the customer, job_description defines the description of the task, latitude defines the latitude of the pickup location if you have it, otherwise leave it blank. We'll get it through geocoding API, longitude and latitude defines the long and lat of the pick up, time defines the time before the pickup should be collected, phone defines the contact number of the customer, template_name defines the custom fields template name that is predefined in your workflow page in the admin account and you just need to replace space in template with underscore(_), template_data defines an array of object containing label and data where label defines the custom field name and data will be his value. (Provided label should be in specified template.),ref_images defines an array of strings containing links of images,email defines the  email of the customer to whom the product should be delivered,order_id can be  passed as your own transaction number which can be used to identify tasks in tookan.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">pickups*</td><td>JSON array</td><td>Array of objects containing address, name, job_description, latitude, longitude, time, phone, template_name, template_data, ref_images, email, order_id where address defines the address from which the pickup should be collected, name defines the name of the person from whom the pickup should be collected, job_description defines the description of the task to be done, latitude and longitude defines the lat and long of the pick up location, time defines the time before which the pickup should be collected,phone defines the contact number of the person from whom the pickup should be collected,template_name defines the custom fields template name that is pre-defined in your workflow page in the admin account and you just need to replace space in template with underscore(_), template_data defines an array of object containing label and data where label defines the custom field name and data will be his value.(Provided label should be in specified template.),ref_images defines an array of strings containing links of images,email defines the email of the person from whom the pickup should be collected,order_id can be  passed as your own transaction number which can be used to identify tasks in tookan.</td></tr>
</table>


+ Request (application/json)   

        {
          "api_key": "c3e46bc0bbdc2d6cdf22f4dae426581259435bd522fd98b30f5baf939b9ce2ba",
          "merchant_id": "452362",
          "fleet_id": 19750,
          "timezone": -330,
          "has_pickup": 1,
          "has_delivery": 1,
          "layout_type": 0,
          "geofence": 0,
          "auto_assignment": 0,
          "tags": "",
          "pickups": [{
            "address": "Chandigarh International Airport, Sahibzada Ajit Singh Nagar, Punjab, India",
            "latitude": 30.7333148,
            "longitude": 76.7794179,
            "time": "2017-08-14 17:24:00",
            "phone": "+911234567890",
            "template_name": "Template_1",
            "template_data": [{
                "label": "Price",
                "data": "100"
             }, {
                "label": "Quantity",
                "data": "100"
            }],
            "ref_images": ["http://tookanapp.com/wp-content/uploads/2015/11/logo_dark.png"],
            "name": "Saurabh",
            "email": "saurabh@saurabh.com",
            "order_id": "12234556",
            "job_description": "Job description goes here"
          }],
          "deliveries": [{
            "address": "Chandigarh Railway Station, Daria, Chandigarh, India",
            "latitude": 30.7022191,
            "longitude": 76.82247009999992,
            "time": "2017-08-14 17:30:00",
            "phone": "+913242342342",
            "template_name": "Template_1",
            "template_data": [
            {
              "label": "Price",
              "data": "100"
            },
            {
              "label": "Quantity",
              "data": "100"
            }
            ],
            "ref_images": ["http://tookanapp.com/wp-content/uploads/2015/11/logo_dark.png"],
            "name": "Saurabh",
            "email": "saurabh@saurabh.com",
            "order_id": "123456",
            "job_description": "Job description goes here"
          }]
        }
        
        
+ Response 200 (application/json)

        {
            "message":"Successful",
            "status":200,
            "data":{
                "pickups":[{
                    "job_id":254737,
                    "job_hash":"fc0f4e89d604a180bcb33a5aebdcd146",
                    "job_token":"25473715022796802388950",
                    "status":true,
                    "auto_assignment_data":0,
                    "order_id":"12234556",
                    "result_tracking_link":"https://goo.gl/53jKDJ",
                    "new_agent_task_insertion_data":[]
                }],
                "deliveries":[{
                    "job_id":254738,
                    "job_hash":"bc41a6e7dcfd3716d8540fbcd6e32fb9",
                    "job_token":"25473715022796802388950",
                    "status":true,
                    "auto_assignment_data":0,
                    "order_id":"123456",
                    "result_tracking_link":"https://goo.gl/r3Gj4L",
                    "new_agent_task_insertion_data":[]
                }]
            }
        }

### Create Multiple Pickup Tasks [POST]
This API is used to create multiple pickup merchant tasks for the fleets at once.

Request Body Parameters:

<table class="humanColumnApiDescription markdown formalTheme">
<tr><td colspan="1"><strong>name</strong><td colspan="1"><strong>Type</strong><td colspan="1"><strong>Description</strong></td></tr>
<tr><td style="padding-right: 40px; width: 140px;">api_key</td><td>string</td> <td> You can generate a key from settings(Login>Menu>Settings>API Keys) in your tookan account. Or <a href="https://app.tookanapp.com/#/app/settings/apikey">click here</a> to get API key</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">merchant_id*</td><td>string</td> <td> This is the unique ID given to each merchant. Enter the ID of the merchant whose task you want to create. You can get it from dashboard Menu>More>Merchant.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">fleet_id</td><td> String </td><td>Id of the fleet to which this task is to be assigned, optional.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">timezone*</td><td>string</td><td>Timezone of the country or location in numerical format. Eg - timezone for India = -330.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">has_pickup*</td><td>boolean</td> <td> Boolean key containing 1 if these are pickup tasks.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">has_delivery*</td><td>boolean</td><td>Boolean key containing 1 if these are delivery tasks.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">layout_type*</td><td>string</td><td>Set it as 0(PICKUP_AND_DELIVERY), 1(APPOINTMENT) or 2(FOS) depending upon the type of layout.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">geofence</td><td>string</td> <td> This is used to enable the geofencing.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">auto_assignment</td><td>boolean</td><td>Boolean key containing the value 0 if the task is not to be assigned automatically to the fleet.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">tags</td><td> String </td><td>This is a string containing comma separated tags as filters for agents in auto assignment.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">pickups*</td><td>JSON array</td><td>Array of objects containing address, name, job_description, latitude, longitude, time, phone, template_name, template_data, ref_images, email, order_id where address defines the address from which the pickup should be collected, name defines the name of the person from whom the pickup should be collected, job_description defines the description of the task to be done, latitude and longitude defines the lat and long of the pick up location, time defines the time before which the pickup should be collected,phone defines the contact number of the person from whom the pickup should be collected,template_name defines the custom fields template name that is pre-defined in your workflow page in the admin account and you just need to replace space in template with underscore(_), template_data defines an array of object containing label and data where label defines the custom field name and data will be his value.(Provided label should be in specified template.),ref_images defines an array of strings containing links of images,email defines the email of the person from whom the pickup should be collected,order_id can be  passed as your own transaction number which can be used to identify tasks in tookan.</td></tr>
</table>


+ Request (application/json)   

        {
          "api_key": "c3e46bc0bbdc2d6cdf22f4dae426581259435bd522fd98b30f5baf939b9ce2ba",
          "merchant_id": "45652",
          "fleet_id": "",
          "timezone": -330,
          "has_pickup": 1,
          "has_delivery": 0,
          "layout_type": 0,
          "geofence": 0,
          "auto_assignment": 0,
          "tags": "",
          "pickups": [{
            "address": "Chandigarh International Airport, Sahibzada Ajit Singh Nagar, Punjab, India",
            "name": "Saurabh",
            "latitude": "30.7333148",
            "longitude": "76.7794179",
            "time": "2017-08-14 17:29:00",
            "phone": "+911234567890",
            "template_name": "Template_1",
            "template_data": [
            {
              "label": "Price",
              "data": "100"
            },
            {
              "label": "Quantity",
              "data": "100"
            }
            ],
            "ref_images": ["http://tookanapp.com/wp-content/uploads/2015/11/logo_dark.png"],
            "order_id": "123456",
            "job_description": "Job description goes here"
          }]
        }
        
        
+ Response 200 (application/json)

        {
            "message":"Successful",
            "status":200,
            "data":{
                "pickups":[{
                    "job_id":254746,
                    "job_hash":"4e77cf8abc38bb1a81facaf7e4499550",
                    "job_token":"25474615022800065310310",
                    "status":true,
                    "auto_assignment_data":0,
                    "order_id":"123456",
                    "result_tracking_link":"https://goo.gl/GMYjmy",
                    "new_agent_task_insertion_data":[]
                }]
            }
        }

### Create Multiple Delivery Tasks [POST]

This API is used to create multiple delivery merchant tasks for the fleets at once.

Request Body Parameters:

<table class="humanColumnApiDescription markdown formalTheme">
<tr><td colspan="1"><strong>name</strong><td colspan="1"><strong>Type</strong><td colspan="1"><strong>Description</strong></td></tr>
<tr><td style="padding-right: 40px; width: 140px;">api_key</td><td>string</td> <td> You can generate a key from settings(Login>Menu>Settings>API Keys) in your tookan account. Or <a href="https://app.tookanapp.com/#/app/settings/apikey">click here</a> to get API key</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">merchant_id*</td><td>string</td> <td> This is the unique ID given to each merchant. Enter the ID of the merchant whose task you want to create. You can get it from dashboard Menu>More>Merchant.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">fleet_id</td><td> String </td><td>Id of the fleet to which this task is to be assigned, optional.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">timezone*</td><td>string</td><td>Timezone of the country or location in numerical format. Eg - timezone for India = -330.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">has_pickup*</td><td>boolean</td> <td> Boolean key containing 1 if these are pickup tasks.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">has_delivery*</td><td>boolean</td><td>Boolean key containing 1 if these are delivery tasks.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">layout_type*</td><td>string</td><td>Set it as 0(PICKUP_AND_DELIVERY), 1(APPOINTMENT) or 2(FOS) depending upon the type of layout.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">geofence</td><td>string</td> <td> This is used to enable the geofencing.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">auto_assignment</td><td>boolean</td><td>Boolean key containing the value 0 if the task is not to be assigned automatically to the fleet.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">tags</td><td> String </td><td>This is a string containing comma separated tags as filters for agents in auto assignment.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">deliveries*</td><td>JSON array</td><td>Array of objects containing address, name, job_description, latitude, longitude, tie, phone, template_name, template_data, ref_images, email, order_id where address defines the address of the customer to whom the product should be delivered, name defines the name  of the customer, job_description defines the description of the task, latitude defines the latitude of the pickup location if you have it, otherwise leave it blank. We'll get it through geocoding API, longitude and latitude defines the long and lat of the pick up, time defines the time before the pickup should be collected, phone defines the contact number of the customer, template_name defines the custom fields template name that is predefined in your workflow page in the admin account and you just need to replace space in template with underscore(_), template_data defines an array of object containing label and data where label defines the custom field name and data will be his value. (Provided label should be in specified template.),ref_images defines an array of strings containing links of images,email defines the  email of the customer to whom the product should be delivered,order_id can be  passed as your own transaction number which can be used to identify tasks in tookan.</td></tr>
</table>


+ Request (application/json)   

        {
          "api_key": "c3e46bc0bbdc2d6cdf22f4dae426581259435bd522fd98b30f5baf939b9ce2ba",
          "merchant_id": "45265",
          "fleet_id": "",
          "timezone": -330,
          "has_pickup": 0,
          "has_delivery": 1,
          "layout_type": 0,
          "geofence": 0,
          "auto_assignment": 0,
          "tags": "",
          "deliveries": [{
            "address": "Chandigarh International Airport, Sahibzada Ajit Singh Nagar, Punjab, India",
            "name": "Saurabh",
            "latitude": 30.66776609999999,
            "longitude": 76.78622870000004,
            "time": "2017-08-14 17:31:00",
            "phone": "+911234567890",
            "template_name": "Template_1",
            "template_data": [
            {
              "label": "Price",
              "data": "100"
            },
            {
              "label": "Quantity",
              "data": "100"
            }
            ],
            "ref_images": ["http://tookanapp.com/wp-content/uploads/2015/11/logo_dark.png"],
            "email": null,
            "order_id": "123345566",
            "job_description": "Job description goes here"
          }]
        }
        
        
+ Response 200 (application/json)

        {
            "message":"Successful",
            "status":200,
            "data":
                {
                "deliveries":[
                    {
                        "job_id":254751,
                        "job_hash":"5e0e634e7bd29fe36319b53617698a2a",
                        "job_token":"25475115022801325504460",
                        "status":true,
                        "auto_assignment_data":0,
                        "order_id":"123345566",
                        "result_tracking_link":"https://goo.gl/agt8MV",
                        "new_agent_task_insertion_data":[]
                    }
                ]
                }
        }


## Edit Merchant Task [/edit_task]

### Edit Merchant Task [POST]

This api used to edit a task that has already been added to the merchant account.
<br>

Request Body Parameters : Every parameter is same as while creating a merchant task the only parameter that should added while editing a task is shown below.
<table>
<tr><td style="padding-left: 0;" colspan="1"><strong>Name</strong><td style="padding-left: 0;" colspan="1"><strong>Type</strong></td><td style="padding-left: 0;" colspan="1"><strong>Description</strong></td></tr>
<tr><td style="padding-right: 40px; width: 140px;">job_id*</td><td>string</td><td>This is the unique id given to every job which is returned while creating a task</td></tr>
</table>
+ Request (application/json)

            {
                "customer_email":"john@example.com",
                "customer_username":"John Doe",
                "customer_phone":"+919999999999",
                "customer_address":"Powai Lake, Powai, Mumbai, Maharashtra, India",
                "latitude":"28.5494489",
                "longitude":"77.2001368",
                "job_description":"Beauty services",
                "job_pickup_datetime":"2016-09-30 16:00:00",
                "job_delivery_datetime":"2016-09-30 17:00:00",
                "has_pickup":"0",
                "has_delivery":"0",
                "layout_type":"1",
                "tracking_link":1,
                "timezone":"-330",
                "api_key":"2b997be77e2cc22becfd4c66426ef504",
                "job_id":2952,
                "merchant_id":"25635",
                "notify": 1
            }

+ Response 200 (application/json)


    + Body

                {
                  "message": "The task has been updated ",
                  "status": 200,
                  "data": {}
                }
##  View  Merchant Tasks [/get_all_tasks]

### View Merchant Tasks  [POST]

This API is used to get all the tasks of merchant as per the filters. Start Date and End Date range refer to Task Date.

Request Body Parameters:
<table>
<tr><td style="padding-left: 0;" colspan="2"><strong>Name</strong><td><strong>Type</strong></td><td><strong>Description</strong></td></tr>
<tr><td style="padding-left: 0;" colspan="2">api_key</td><td>string</td><td> You can get a key from settings(Login>Menu>Settings>API Keys) in your tookan account. Or <a href="https://app.tookanapp.com/#/app/settings/apikey">click here</a> to get API key</td></tr>
<tr><td style="padding-left: 0;" colspan="2">job_status</td><td>number</td><td>Filter the list of tasks via their status</td></tr>
<tr><td style="padding-left: 0;" colspan="2">job_type*</td><td>number(mandatory)</td><td>Filter via Job Type - 0 for Pick Up, 1 for Delivery, 2 for Appointment and 3 for FOS</td></tr>
<tr><td style="padding-left: 0;" colspan="2">start_date</td><td>number</td><td>Start Date for the date range</td></tr>
<tr><td style="padding-left: 0;" colspan="2">end_date</td><td>number</td><td>End Date for the date range</td></tr>
<tr><td style="padding-left: 0;" colspan="2">custom_fields</td><td>number</td><td>You can pass this flag as 1, if you want the custom fields data to be included in the response. default is 0</td></tr>
<tr><td style="padding-left: 0;" colspan="2">is_pagination</td><td>Boolean</td><td>You can set this as 1 to enable pagination. </td></tr>
<tr><td style="padding-left: 0;" colspan="2">requested_page</td><td>number</td><td>Current(Which) page according to the page number of tasks in the filter.</td></tr>
<tr><td style="padding-left: 0;" colspan="2">customer_id</td><td>number</td><td> Filter the list based on the customer id.</td></tr>
<tr><td style="padding-left: 0;" colspan="2">fleet_id</td><td>number</td><td> Filter the list based on the agent id.</td></tr>
<tr><td style="padding-left: 0;" colspan="2">job_id</td><td>array</td><td> Filter the list based on the job ids.</td></tr>
<tr><td style="padding-left: 0;" colspan="2">order_id</td><td>array</td><td> Filter the list based on the order ids.</td></tr>
<tr><td style="padding-left: 0;" colspan="2">team_id</td><td>number</td><td> Filter the list based on the team id.</td></tr>
<tr><td style="padding-left: 0;" colspan="2">is_merchant</td><td>number</td><td> Set this key to 1.</td></tr>
<tr><td style="padding-left: 0;" colspan="2">merchant_id</td><td>number</td><td> This is the unique ID given to each merchant. Enter the ID of the merchant whose task you want to create. You can get it from dashboard Menu>More>Merchant.</td></tr>
</table>
    
+ Request (application/json)

        {
          "api_key": "00be7353ba73d5cb9812b9b9af404f8b",
          "job_status": 1,
          "job_type": 1,
          "start_date": "2016-08-20",
          "end_date": "2016-08-20",
          "custom_fields": 0,
          "is_pagination":1,
          "requested_page":1,
          "customer_id":"",
          "fleet_id": 1234,
          "job_id": [123, 456, 789],
          "order_id": ["123", "Y-456", "O_789"],
          "team_id":123,
          "is_merchant" : 1,
          "merchant_id" : 2653
        }

+ Response 200 (application/json)

        {
          "message": "Successful",
          "status": 200,
          "data": {<Array of task data>}
        }
        
# Group Geofence

## Add Region [/add_region]

### Add Region [POST]
This API is used add regions for fleets.

Request Body Parameters :

<table>
<tr><td style="padding-left: 0;" colspan="1"><strong>Name</strong><td><strong>Type</strong></td><td><strong>Description</strong></td></tr>
<tr><td style="padding-right: 40px; width: 140px;">api_key</td><td>string</td> <td> You can generate a key from settings(Login>Menu>Settings>API Keys) in your tookan account. Or <a href="https://app.tookanapp.com/#/app/settings/apikey">click here</a> to get API key</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">region_name*</td><td>string</td> <td>This is the name of your region.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">region_data*</td><td>string</td> <td>Enter comma-seperated latitude longitude here that decribe the outline of the region. For Example : "30.71890702340647 76.80553835246496,31.72091770495563 76.81113880488806"</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">region_description</td><td>string</td> <td>Enter description about your region here/</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">fleet_id*</td><td>string</td> <td>Enter comma-seperated fleet ids here whom you want to assign this region.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">selected_team_id</td><td>array</td> <td>If you want to assign a region to whole team, then enter its team_id here.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">user_id*</td><td>number</td><td>You can get it from account details page in <a href="https://app.tookanapp.com/#/app/account">Tookan dashboard</a>.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">is_force</td><td>0/1 (optional)</td> <td>If the region is overlapping with other regions, the response will be a error message with status 410. If you still want to create this geofence, then set this parameter to 1.</td></tr>
</table>

+ Request (application/json)

        {
            "api_key":"56616586f71342011c116e6a5210214518ecc7fb23da733e5a15",
            "user_id":42537,
            "region_name":"test2",
            "region_description":"",
            "region_data":"30.71890702340647 76.80553835246496,31.72091770495563 76.81113880488806,30.717892443406022 76.81193273875647,30.716951641503226 76.80663269374304,30.71890702340647 76.80553835246496",
            "selected_team_id":[11167],
            "fleet_id":"33990",
            "is_force":0
        }

+ Response 200 (application/json)

        {
            "message":"The geo-fence 'test2' has been created.",
            "status":200,"data":{}
        }

## Edit Region [/edit_region]

### Edit Region [POST]
This API is used to edit a geofence's details.

Request Body Parameters : Every parameter is same as while adding a region the only parameter that should added while editing a region is shown below.

<table>
<tr><td style="padding-left: 0;" colspan="1"><strong>Name</strong><td><strong>Type</strong></td><td><strong>Description</strong></td></tr>
<tr><td style="padding-right: 40px; width: 140px;">region_id*</td><td>number</td> <td>You can get region ids using the View Regions api.</td></tr>
</table>

+ Request (application/json)

        {
            "api_key":"56616586f71342011c116e6a5210214518ecc7fb23da733e5a15",
            "user_id":42537,
            "region_name":"test1",
            "region_description":"",
            "region_data":"30.717274466719996 76.71020208287769,30.723324933677052 76.73251806188159,30.702072838333677 76.71758352208667,30.717274466719996 76.71020208287769",
            "selected_team_id":[11167],
            "fleet_id":"33990,34361,34362",
            "region_id":1244,
            "is_force":0
        }
        
+ Response 200 (application/json)

        {
            "message":"The geo-fence 'test1' has been updated",
            "status":200,
            "data":{}
        }
        
## View Regions [/view_regions]

### View Regions [POST]

This API is used to view the Geofences and their respective agents.

Request Body Parameters :

<table>
<tr><td style="padding-left: 0;" colspan="1"><strong>Name</strong><td><strong>Type</strong></td><td><strong>Description</strong></td></tr>
<tr><td style="padding-right: 40px; width: 140px;">api_key</td><td>string</td> <td> You can generate a key from settings(Login>Menu>Settings>API Keys) in your tookan account. Or <a href="https://app.tookanapp.com/#/app/settings/apikey">click here</a> to get API key</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">user_id*</td><td>number</td><td>You can get it from account details page in <a href="https://app.tookanapp.com/#/app/account">Tookan dashboard</a>.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">region_id</td><td>number(Optional)</td> <td>This will get the data of particular Geofence region. You can get this region id from the response when all Geofences called.</td></tr>
</table>

+ Request (application/json)

        {
            "api_key":"076225def01849131c152c3017162c431fe4c4fe2c",
            "user_id":1234,
            "region_id":9874
        }
        
+ Response 200 (application/json)

        {
            "message": "Successful",
            "status": 200,
            "data": [
            {
                "user_id": 1234,
                "region_id": 9874,
                "region_name": "United States",
                "region_description": "",
                "region_data": [
                    {
                        "x": 30.66629589544139,
                        "y": 76.74439889714176
                    },
                    {
                        "x": 30.663342751242116,
                        "y": 76.82919961735661
                    },
                    {
                        "x": 30.697003243996004,
                        "y": 76.82919961735661
                    },
                    {
                        "x": 30.702316986005894,
                        "y": 76.7955539874738
                    },
                    {
                        "x": 30.68046973119217,
                        "y": 76.75813180729801
                    },
                    {
                        "x": 30.66629589544139,
                        "y": 76.74439889714176
                    }
                ],
                "created_by": 1234,
                "is_active": 1,
                "last_updated_at": "2018-09-19T14:41:42.000Z",
                "fleets": [
                    {
                        "fleet_id": 1254,
                        "fleet_thumb_image": "https://tookan.s3.amazonaws.com/fleet_thumb_profile/thumb-aQMC1536819115209-YZa815368191143077103245orig.jpg",
                        "fleet_name": "Aman"
                    }
                ],
                "selected_team_id": []
            } ]   
        }
        
## View Region Details [/view_regions_only]   

### View Region Details [POST]
This API is used to view a particular region's details.

Requset Body Parameters : 

<table>
<tr><td style="padding-left: 0;" colspan="1"><strong>Name</strong><td><strong>Type</strong></td><td><strong>Description</strong></td></tr>
<tr><td style="padding-right: 40px; width: 140px;">api_key</td><td>string</td> <td> You can generate a key from settings(Login>Menu>Settings>API Keys) in your tookan account. Or <a href="https://app.tookanapp.com/#/app/settings/apikey">click here</a> to get API key</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">user_id*</td><td>number</td><td>You can get it from account details page in <a href="https://app.tookanapp.com/#/app/account">Tookan dashboard</a>.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">region_id</td><td>number</td> <td>You can get region ids using the View Regions api.</td></tr>
</table>


+ Request (application/json)

        {
            "api_key":"56616586f71342011c116e6a5210214518ecc7fb23da733e5a15",
            "user_id":42537,
            "region_id":1243
        }
        
+ Response 200 (application/json) 

        {
            "message": "Successful",
            "status": 200,
            "data": [{
                "region_id": 1243,
                "region_name": "test4",
                "region_description": "",
                "is_active": 1,
                "last_updated_at": "2018-09-20T07:18:52.000Z"
            }]
        }

## Remove Region For Agent [/remove_region_for_agent]

### Remove Region For Agent [POST]
This API is used to remove a region for a particular agent/fleet/driver.

Request Body Parameters :

<table>
<tr><td style="padding-left: 0;" colspan="1"><strong>Name</strong><td><strong>Type</strong></td><td><strong>Description</strong></td></tr>
<tr><td style="padding-right: 40px; width: 140px;">api_key</td><td>string</td> <td> You can generate a key from settings(Login>Menu>Settings>API Keys) in your tookan account. Or <a href="https://app.tookanapp.com/#/app/settings/apikey">click here</a> to get API key</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">user_id*</td><td>number</td><td>You can get it from account details page in <a href="https://app.tookanapp.com/#/app/account">Tookan dashboard</a>.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">region_id*</td><td>number</td> <td>You can get region ids using the View Regions api.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">fleet_id*</td><td>string</td> <td> This is unique agent id given to each agent, if given the task will be assigned to the respective agent. You can get it from dashboard Menu>More>agents.</td></tr>
</table>

+ Request (application/json)

        {
            "api_key":"56616586f71342011c116e6a5210214518ecc7fb23da733e5a15",
            "user_id":42537,
            "region_id":1243,
            "fleet_id":33990
        }

+ Response 200 (application/json)

        {
            "message":"The geo-fence 'test1' has been deleted",
            "status":200,
            "data":{}
        }
        
## Delete Region [/remove_region]

### Delete Region [POST]

This API is used to delete a region.

Request Body Parameters : 

<table>
<tr><td style="padding-left: 0;" colspan="1"><strong>Name</strong><td><strong>Type</strong></td><td><strong>Description</strong></td></tr>
<tr><td style="padding-right: 40px; width: 140px;">api_key</td><td>string</td> <td> You can generate a key from settings(Login>Menu>Settings>API Keys) in your tookan account. Or <a href="https://app.tookanapp.com/#/app/settings/apikey">click here</a> to get API key</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">user_id*</td><td>number</td><td>You can get it from account details page in <a href="https://app.tookanapp.com/#/app/account">Tookan dashboard</a>.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">region_id*</td><td>number</td> <td>You can get region ids using the View Regions api.</td></tr>
</table>

+ Request (application/json)

        {
            "api_key":"56616586f71342011c116e6a5210214518ecc7fb23da733e5a15",
            "user_id":42537,
            "region_id":1242
        }
        
+ Response 200 (application/json)

        {
            "message":"The geo-fence 'test1' has been deleted",
            "status":200,
            "data":{}
        }
        
## Find Region From Points [/find_region_from_points]

### Find Region From Points [POST]

This API is used to find geofence region using latitude and longitude as points.

Request Body Parameters : 

<table>
<tr><td style="padding-left: 0;" colspan="1"><strong>Name</strong><td><strong>Type</strong></td><td><strong>Description</strong></td></tr>
<tr><td style="padding-right: 40px; width: 140px;">api_key</td><td>string</td> <td> You can generate a key from settings(Login>Menu>Settings>API Keys) in your tookan account. Or <a href="https://app.tookanapp.com/#/app/settings/apikey">click here</a> to get API key</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">points*</td><td>JSON array</td> <td>Array containing latitude and longitude.</td></tr>
</table>

+ Request (application/json)

        {
            "api_key":"your_api_key",
             "points":[{"latitude":"30.7133899","longitude":"76.7950984"}]
        }
        
+ Response 200 (application/json)

        {
            "message":"Successful",
            "status":200,
            "data": [{"region_id":7235,"user_id":7756,"created_by":7756,"region_name":"CHANDIGARH","region_description":"Chandigarh city of Chandigarh","region_data":[[{"x":30.73250061240159,"y":76.70157453963805}]],"is_active":1,"creation_datetime":"2019-06-20T08:22:10.000Z","last_updated_at":"2019-06-27T07:24:23.000Z"}]
        }
# Group Mission

A mission consists of multiple tasks belonging to multiple workflows (Pickup & Delivery/ Appointments/ Field Workforce) and each could be assigned to multiple agents. So, if a business has such a diverse need, then instead of creating multiple individual tasks it can create just one ‘Mission’. Once the mission is dispatched for assignment, agents are assigned corresponding to their workflow. As the mission is in progress, you can track the overall status of the mission as well as the status of the individual tasks within each mission.

## Create Mission Task [/create_mission_task]

### Create Mission Task [POST]

This API is used to create a Mission.

Request Body Parameters:

<table>
<tr><td style="padding-left: 0;" colspan="2">api_key</td><td>string</td><td> You can generate a key from settings(Login>Menu>Settings>API Keys) in your tookan account. Or <a href="https://app.tookanapp.com/#/app/settings/apikey">click here</a> to get API key</td></tr>
<tr><td style="padding-left: 0;" colspan="2">mission_name*</td><td>string</td><td>This is the name of your mission.</td></tr>
<tr><td style="padding-left: 0;" colspan="2">create_task_body</td><td>json obect</td><td>This is same as the create multiple tasks request body. Enter the array of pickups, delivery and appointments you want to create.</td></tr>
<tr><td style="padding-left: 0;" colspan="2">end_date*</td><td>string</td><td>Enter end date of your mission in (YYYY-MM-DD) format.</td></tr>
<tr><td style="padding-left: 0;" colspan="2">start_date*</td><td>string</td><td>Enter start date of your mission in (YYYY-MM-DD) format.</td></tr>
<tr><td style="padding-left: 0;" colspan="2">dispatched_status</td><td>number</td><td>Set this value to 0 if you want to save mission as a draft, otherwise set 1.</td></tr>
</table>

+ Request (application/json)

        {
            "api_key":"57666686f111544e177b60471021451fe6c3ff22de7d3a5b1a",
            "dispatched_status":1,
            "mission_name":"Mission 1",
            "create_task_body":[
            {
                "access_token":"55631.076225def01849131c152c3017162c431fe4c4fe2c",
                "is_dashboard":1,
                "fleet_id":"",
                "timezone":-330,
                "has_pickup":0,
                "has_delivery":0,
                "pickup_delivery_relationship":0,
                "layout_type":1,
                "team_id":0,
                "geofence":0,
                "auto_assignment":1,
                "tags":"",
                "no_of_agents":1,
                "deliveries":[],
                "pickups":[],
                "appointments":[{
                    "address":"CDCL, Madhya Marg, 28B, Sector 28B, Chandigarh, India",
                    "name":"test",
                    "job_description":"heeelo",
                    "latitude":30.7188978,
                    "longitude":76.81029809999995,
                    "start_time":"2018-10-09 12:55:00",
                    "end_time":"2018-10-17 12:55:00",
                    "phone":"+919467664844",
                    "template_data":[],
                    "ref_images":[],
                    "email":"yukta@gmail.com"
                }]
            }],
            "end_date":"2018-10-17",
            "start_date":"2018-10-09"
        }


+ Response 200 (application/json)

        {
            "message":"Successful",
            "status":200,
            "data":{
                "mission_id":64
            }
        }

## Mission List [/get_mission_list]

### Mission List [POST]

This API is used to view the list of mission owned by admin.

Request Body Parameters:
<table>
<tr><td style="padding-left: 0;" colspan="2">api_key</td><td>string</td><td> You can generate a key from settings(Login>Menu>Settings>API Keys) in your tookan account. Or <a href="https://app.tookanapp.com/#/app/settings/apikey">click here</a> to get API key</td></tr>
<tr><td style="padding-left: 0;" colspan="2">end_date*</td><td>string</td><td>Enter end date of your mission in (YYYY-MM-DD) format.</td></tr>
<tr><td style="padding-left: 0;" colspan="2">start_date*</td><td>string</td><td>Enter start date of your mission in (YYYY-MM-DD) format.</td></tr>
</table>

+ Request (application/json)


        {
            "api_key":"57666686f1115b1e177b60471021451fe6c3ff22de7d3a5b1a",
            "end_date":"2018-10-17",
            "start_date":"2018-10-09"
        }
        
+ Response 200 (application/json)        

        {
            "message":"Successful",
            "status":200,
            "data":[
                {
                    "mission_id":64,
                    "mission_name":"Mission 1",
                    "mission_status":6,
                    "dispatched_status":1,
                    "created_by":55631
                },
                {
                    "mission_id":66,
                    "mission_name":"Mission 1",
                    "mission_status":6,
                    "dispatched_status":1,
                    "created_by":55631
                }
            ]
        }

## Delete Mission [/delete_mission]

### Delete Mission [POST]

This API is used to delete a mission.

Request Body Parameters:
<table>
<tr><td style="padding-left: 0;" colspan="2">api_key</td><td>string</td><td> You can generate a key from settings(Login>Menu>Settings>API Keys) in your tookan account. Or <a href="https://app.tookanapp.com/#/app/settings/apikey">click here</a> to get API key</td></tr>
<tr><td style="padding-left: 0;" colspan="2">mission_id*</td><td>number</td><td>This is the unique Id assigned to a mission. You can get in using the "Mission List" Api.</td></tr>
</table>

+ Request (application/json)

        {
            "api_key":"57666686f111544b1e7b60471021451fe6c3ff22de7d3a5b1a",
            "mission_id":"63"
        }

+ Response 200 (application/json)

        {
            "message":"Successful",
            "status":200,
            "data":{}
        }
        
        
# Group Webhook

We can POST following data to your url upon status update. You can use job_id and job_status to detect the state and update accordingly at your end. For verifying the request, you can compare tookan_shared_secret param. We can set it to a key provided by you and upon web hook call, you can check if it is the same which you have shared and verify that requests are coming from Tookan.
Append ?task_history=1 at the end of the URL, if you want to include task history in the webhook data. You can customize these webhook URLs from the notifications section in the dashboard.

- Sample Webhook POST data:
       
        { 
            "job_latitude": "37.7913917",
            "fleet_email": "JonSnow@example.com",
            "is_routed": "0",
            "job_type": "1",
            "team_id": "56",
            "auto_assignment": "0",
            "job_description": "adsfasd",
            "timezone": "-330",
            "fleet_rating": "0",
            "user_id": "1",
            "job_id": "236365",
            "job_state": "Successful",
            "has_delivery": "1",
            "pickup_delivery_relationship": "cd7dd3e12424de76141787af773782c9100",
            "job_hash": "c48fcd2646c282ad3576e9b096c1d798",
            "job_address": "114, Sansome St Ste 250, San Francisco, CA, USA",
            "job_pickup_latitude": "30.7397101",
            "job_pickup_name": "Jon Snow",
            "job_status": "2",
            "sign_image": "https://app.tookanapp.com",
            "customer_username": "sesas",
            "customer_email": "",
            "order_id": "",
            "customer_comment": "",
            "customer_phone": "+13334445555",
            "is_active": "1",
            "job_longitude": "-122.4008504",
            "dispatcher_id": "",
            "job_pickup_longitude": "-122.4008504",
            "is_customer_rated": "0",
            "completed_by_admin": "0",
            "customer_id": "1074",
            "tookan_shared_secret": "",
            "total_distance_travelled": "0",
            "total_time_spent_at_task_till_completion": "15",
            "session_id": "",
            "has_pickup": "1",
            "job_token": "cd7dd3e12424de76141787af773782c9100",
            "job_pickup_address": "CDCL,MadhyaMarg,Chandigarh,India",
            "job_pickup_phone": "+917837173739",
            "fleet_id": "3635",
            "fleet_name": "SumeetRana",
            "job_pickup_email": "sumeet@clicklabs.in",
            "custom_fields": [
                {
                    "label": "Customer_Name",
                    "value": 1,
                    "required": 1,
                    "data_type": "Text",
                    "app_side": 1,
                    "data": "",
                    "template_id": "booking_information",
                    "item_id": 0,
                    "fleet_data": "harry"
                },
                {
                    "label": "CustomerImage",
                    "value": 1,
                    "required": 1,
                    "data_type": "Image",
                    "app_side": 1,
                    "data": "",
                    "template_id": "booking_information",
                    "item_id": 0,
                    "fleet_data": "['https: //tookan.s3.amazonaws.com/task_images/zJOw1452514280545-TOOKAN_11012016_053825.jpg']"
                },
                {
                    "label": "Vehicle_selected",
                    "value": 1,
                    "required": 1,
                    "data_type": "Dropdown",
                    "app_side": 1,
                    "data": "Bike, Van, Truck",
                    "template_id": "booking_information",
                    "item_id": 0,
                    "dropdown": [
                        {
                            "id": 0,
                            "value": "Bike"
                        },
                        {
                            "id": 1,
                            "value": " Van"
                        },
                        {
                            "id": 2,
                            "value": " Truck"
                        }
                    ]
                },
                {
                    "label": "Date",
                    "value": 1,
                    "required": 1,
                    "data_type": "Date",
                    "app_side": 1,
                    "data": "",
                    "template_id": "booking_information",
                    "item_id": 0
                },
                {
                    "label": "Amount",
                    "value": 1,
                    "required": 1,
                    "data_type": "Number",
                    "app_side": 1,
                    "data": "",
                    "template_id": "booking_information",
                    "item_id": 0
                },
                {
                    "label": "Gender",
                    "value": 1,
                    "required": 1,
                    "data_type": "Dropdown",
                    "app_side": 0,
                    "data": "Male,Female",
                    "template_id": "booking_information",
                    "item_id": 0,
                    "dropdown": [
                        {
                            "id": 0,
                            "value": "Male"
                        },
                        {
                            "id": 1,
                            "value": "Female"
                        }
                    ]
                },
                {
                    "label": "Gender",
                    "value": 1,
                    "required": 1,
                    "data_type": "Dropdown",
                    "app_side": 1,
                    "data": "Male,Female",
                    "template_id": "booking_information",
                    "item_id": 0,
                    "dropdown": [
                        {
                            "id": 0,
                            "value": "Male"
                        },
                        {
                            "id": 1,
                            "value": "Female"
                        }
                    ]
                },
                {
                    "label": "ID_Image",
                    "value": 1,
                    "required": 1,
                    "data_type": "Image",
                    "app_side": 1,
                    "data": "",
                    "template_id": "booking_information",
                    "item_id": 0,
                    "fleet_data": "['https: //tookan.s3.amazonaws.com/task_images/PZyQ1452514382208-TOOKAN_11012016_054006.jpg']"
                }
            ],
            "task_history": [
                {
                    "id": 235973,
                    "job_id": 85185,
                    "fleet_id": 3829,
                    "fleet_name": "bobby singh",
                    "latitude": "30.7192552",
                    "longitude": "76.8102558",
                    "type": "state_changed",
                    "description": "Status updated from Assigned to Unassigned",
                    "creation_datetime": "2016-01-11T09:34:17.000Z"
                },
                {
                    "id": 236365,
                    "job_id": 85185,
                    "fleet_id": 3635,
                    "fleet_name": "Rusty B",
                    "latitude": "30.7193512",
                    "longitude": "76.8102679",
                    "type": "state_changed",
                    "description": "Accepted at",
                    "creation_datetime": "2016-01-11T12:11:02.000Z"
                },
                {
                    "id": 236366,
                    "job_id": 85185,
                    "fleet_id": 3635,
                    "fleet_name": "Rusty B",
                    "latitude": "30.7193512",
                    "longitude": "76.8102679",
                    "type": "state_changed",
                    "description": "Started at",
                    "creation_datetime": "2016-01-11T12:11:04.000Z"
                },
                {
                    "id": 236367,
                    "job_id": 85185,
                    "fleet_id": 3635
                    "fleet_name": "Rusty B",
                    "latitude": "30.7195829",
                    "longitude": "76.8101409",
                    "type": "state_changed",
                    "description": "Arrived at",
                    "creation_datetime": "2016-01-11T12:11:07.000Z"
                },
                {
                    "id": 236368,
                    "job_id": 85185,
                    "fleet_id": 3635,
                    "fleet_name": "Rusty B",
                    "latitude": "30.7183782",
                    "longitude": "76.8096116",
                    "type": "custom_field_updated",
                    "description": "
                        {
                            'label':'CustomerImage',
                            'value':1,'required':1,
                            'data_type':'Image',
                            'app_side':1,
                            'data':'',
                            'template_id':'booking_information',
                            'item_id':0,
                            'fleet_data':'https: //tookan.s3.amazonaws.com/task_images/zJOw1452514280545-TOOKAN_11012016_053825.jpg'
                        }",
                    "creation_datetime": "2016-01-11T12:12:46.000Z"
                },
                {
                    "id": 236376,
                    "job_id": 85185,
                    "fleet_id": 3635,
                    "fleet_name": "Rusty B",
                    "latitude": "30.7183782",
                    "longitude": "76.8096116",
                    "type": "text_added",
                    "description": "vcvvvv",
                    "creation_datetime": "2016-01-11T12:13:14.000Z"
                },
                {
                    "id": 236377,
                    "job_id": 85185,
                    "fleet_id": 3635,
                    "fleet_name": "Rusty B",
                    "latitude": "30.7194513",
                    "longitude": "76.8103432",
                    "type": "image_added",
                    "description": "https://tookan.s3.amazonaws.com/acknowledgement_images/JhTU1452514406350-TOOKAN_11012016_054030.jpg",
                    "creation_datetime": "2016-01-11T12:13:27.000Z"
                },
                {
                    "id": 236378,
                    "job_id": 85185,
                    "fleet_id": 3635,
                    "fleet_name": "Rusty B",
                    "latitude": "30.7194513",
                    "longitude": "76.8103432",
                    "type": "signature_image_added",
                    "description": "https://tookan.s3.amazonaws.com/acknowledgement_images/srA51452514416346-task_signature.png",
                    "creation_datetime": "2016-01-11T12:13:36.000Z"
                },
                {
                    "id": 236379,
                    "job_id": 85185,
                    "fleet_id": 3635,
                    "fleet_name": "Rusty B",
                    "latitude": "30.7194513",
                    "longitude": "76.8103432",
                    "type": "state_changed",
                    "description": "Successful at",
                    "creation_datetime": "2016-01-11T12:13:42.000Z"
                }
            ]
        }

## Tookan Shared Secret [/set_tookan_shared_secret_key]

### Set Tookan Shared Secret [POST]

This API is used to set Tookan Shared Secret for Webhook data validation.

Request Body Parameters:
<table>
<tr><td style="padding-left: 0;" colspan="2">api_key</td><td>string</td><td> You can generate a key from settings(Login>Menu>Settings>API Keys) in your tookan account. Or <a href="https://app.tookanapp.com/#/app/settings/apikey">click here</a> to get API key</td></tr>
<tr><td style="padding-left: 0;" colspan="2">tookan_shared_secret</td><td>string</td><td>Tookan Shared Secret Value</td></tr>
</table>

+ Request (application/json)

        {
            "api_key":"eaac56717958fa6664a9c5a0a29a43810a30fcda90be26a3e023b2f70f9ffa05",
            "tookan_shared_secret":"secret value"
        }

+ Response 200 (application/json)

        {
          "message": "Successful",
          "status": 200,
          "data": {}
        }
# Group Logistics

## Adding a Hub [/hubs/addHub]

### Create Hubs [POST]
This API is used to create and add a hub. 

Request Body Parameters:

<table class="humanColumnApiDescription markdown formalTheme">
<tr><td colspan="1"><strong>name</strong><td colspan="1"><strong>Type</strong><td colspan="1"><strong>Description</strong></td></tr>
<tr><td style="padding-right: 40px; width: 140px;">api_key*</td><td>String</td> <td> You can generate a key from settings(Login>Menu>Settings>API Keys) in your tookan account. Or <a href="https://app.tookanapp.com/#/app/settings/apikey">click here</a> to get API key</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">hub_name*</td><td> String </td><td>Name of the hub.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">hub_address*</td><td> String </td><td>Address of the hub.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">hub_latitude*</td><td> String </td> <td> Latitude corresponding to the hub you wish to create.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">hub_longitude*</td><td> String </td> <td> Latitude corresponding to the hub you wish to create.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">sub_admin_ids*</td><td> Array </td> <td>  Subadmin ID/s managing the hub.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">team_ids*</td><td> Array </td> <td> ID of the team Id linked to the hub.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">hub_radius*</td><td> Number </td> <td> Radius of the hub in kilometers.</td></tr>
</table>


+ Request (application/json)   

        
        
+ Response 200 (application/json)

        {
            "message":"Successful",
            "status":200,
            "data":[
            "hub_id":124
            ]
        }

## Editing a Hub [/hubs/editHub]

### Edit Hubs [POST]
This API is used to edit hub parameters like name, address, latitude, longitude, radius.


Request Body Parameters:

<table class="humanColumnApiDescription markdown formalTheme">
<tr><td colspan="1"><strong>name</strong><td colspan="1"><strong>Type</strong><td colspan="1"><strong>Description</strong></td></tr>
<tr><td style="padding-right: 40px; width: 140px;">api_key*</td><td>String</td> <td> You can generate a key from settings(Login>Menu>Settings>API Keys) in your tookan account. Or <a href="https://app.tookanapp.com/#/app/settings/apikey">click here</a> to get API key</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">hub_id*</td><td> Number </td><td>ID of the hub to Update.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">is_delete*</td><td> Number </td><td>Set to 1 if deleting certain params, and 0 incase of UPDATION/MODIFICATION of hub details.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">is_hub_updated*</td><td> Number </td><td>Set to 1 in order to update or delete a hub.</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">hub_name</td><td> String </td><td>Name of the updated hub (Optional).</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">hub_address</td><td> String </td><td>Address of the updated hub (Optional).</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">hub_latitude</td><td> String </td> <td> Latitude corresponding to the hub you wish to update (Optional).</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">hub_longitude</td><td> String </td> <td> Latitude corresponding to the hub you wish to update (Optional).</td></tr>
<tr><td style="padding-right: 40px; width: 140px;">hub_radius</td><td> Number </td> <td> Radius of the updated hub in kilometers (Optional).</td></tr>
</table>


+ Request (application/json)   

        {
          "api_key": "c3e46bc0bbdc2d6cdf22f4dae426581259435bd522fd98b30f5baf939b9ce2ba",
          "is_delete": 0,
          "is_hub_updated": 1,
          "hub_id": 124,
          "hub_name": "Chandigarh Hub 1",
          "hub_address": "Sector 62, Mohali, India",
          "hub_radius": "70",
          "hub_latitude": "30.661367053238887",
          "hub_longitude": "76.77182077969052"
        }
        
        
+ Response 200 (application/json)

        {
            "message":"Successful",
            "status":200,
            "data":[
            ]
        }
        
## Add or Remove SubAdmin from a Hub [/hubs/addRemoveSubAdmin]

