### Task History Started Example Source: https://tookanapi.docs.apiary.io/reference/logistics/create-api Example of a task history entry showing when a task was started by a fleet member. ```json { "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" } ``` -------------------------------- ### cURL Request Example Source: https://tookanapi.docs.apiary.io/reference/agent/delete-agent/delete-agent All sample requests in this documentation are formatted for cURL. An API key is mandatory for all requests. ```bash curl -X POST \ 'https://api.tookanapp.com/v2/create_task' \ -H 'Content-Type: application/json' \ -H 'apikey: YOUR_API_KEY' \ -d '{ "order_id": "12345", "customer_email": "customer@email.com", "customer_phone": "+919999999999", "pickup_address": "Tookan Technologies, Kolkata, West Bengal", "delivery_address": "Tookan Technologies, Kolkata, West Bengal", "job_description": "Test Job", "job_priority": "HIGH", "job_type": "URGENT", "timezone": "Asia/Kolkata", "custom_field": [ { "label": "Test Field", "value": "Test Value", "type": "text" } ] }' ``` -------------------------------- ### Create Task Example Source: https://tookanapi.docs.apiary.io/reference/customers Example of how to create a task using the Tookan API. All requests are POST and require an API key. ```APIDOC ## POST /v2/create_task ### Description Creates a new task in the Tookan system. ### Method POST ### Endpoint https://api.tookanapp.com/v2/create_task ### Parameters #### Request Body - **api_key** (string) - Required - Your unique API key for authentication. - **task_pickup_time** (string) - Required - The desired pickup time for the task in 'YYYY-MM-DD HH:MM:SS' format. - **task_address** (string) - Required - The full address for the task. - **task_title** (string) - Required - A title for the task. - **task_description** (string) - Optional - A detailed description of the task. - **customer_email** (string) - Optional - The email address of the customer associated with the task. - **customer_phone** (string) - Optional - The phone number of the customer associated with the task. - **timezone** (integer) - Optional - The timezone difference with UTC in minutes. ### Request Example ```json { "api_key": "YOUR_API_KEY", "task_pickup_time": "2023-10-27 14:00:00", "task_address": "123 Main St, Anytown, USA", "task_title": "Deliver Package", "task_description": "Urgent delivery required", "customer_email": "customer@example.com", "customer_phone": "+1234567890", "timezone": -330 } ``` ### Response #### Success Response (200) - **message** (string) - Indicates the success of the operation. - **status** (integer) - The HTTP status code, typically 200 for success. - **data** (object) - Contains the details of the created task. #### Response Example ```json { "message": "Successful", "status": 200, "data": { "task_id": "12345" } } ``` ``` -------------------------------- ### Get Merchant Report Response Example Source: https://tookanapi.docs.apiary.io/reference/merchant/get-merchant-report/get-merchant-report This is an example of a successful response from the Get Merchant Report API. It includes merchant details, task statistics, and agent information. ```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 Agent Ratings and Reviews Response Example Source: https://tookanapi.docs.apiary.io/reference/agent/get-agent-ratings-and-reviews/get-agent-ratings-and-reviews This is an example of a successful response from the Get Agent Ratings and Reviews API. It includes agent details, aggregated ratings, review counts, and detailed customer comments with timestamps. ```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 } ] } ] } ``` -------------------------------- ### Start Task Source: https://tookanapi.docs.apiary.io/reference/task Initiates the execution of a task. ```APIDOC ## Start Task ### Description Starts a task. ### Method PUT ### Endpoint /task/start/{id} ``` -------------------------------- ### Create Task Example Source: https://tookanapi.docs.apiary.io/reference/team/get-team-details This example demonstrates how to create a task using the Tookan API. All requests are made via POST to the base URL with specific endpoints appended. ```APIDOC ## POST /v2/create_task ### Description Creates a new task in the Tookan system. ### Method POST ### Endpoint https://api.tookanapp.com/v2/create_task ### Parameters #### Request Body - **api_key** (string) - Required - Your API key for authentication. - **task_pickup_time** (string) - Required - The scheduled pickup time for the task in 'YYYY-MM-DD HH:MM:SS' format. - **customer_details** (object) - Required - Details of the customer associated with the task. - **name** (string) - Required - Customer's name. - **phone** (string) - Required - Customer's phone number. - **latitude** (string) - Required - Customer's latitude. - **longitude** (string) - Required - Customer's longitude. - **task_description** (string) - Required - A description of the task. - **timezone** (string) - Optional - The timezone difference with UTC in minutes. ### Request Example { "api_key": "YOUR_API_KEY", "task_pickup_time": "2023-10-27 14:00:00", "customer_details": { "name": "John Doe", "phone": "+1234567890", "latitude": "13.0827", "longitude": "80.2707" }, "task_description": "Deliver package to customer.", "timezone": "-330" } ### Response #### Success Response (200) - **message** (string) - "Successful" - **status** (integer) - 200 - **data** (object) - Contains details of the created task. #### Response Example { "message": "Successful", "status": 200, "data": { "task_id": "12345" } } ``` -------------------------------- ### Get Job and Agent Details Response Source: https://tookanapi.docs.apiary.io/reference/team/get-job-and-agent-details/get-job-and-agent-details Example response for the 'Get Job and Agent Details' endpoint, showing job information, team data, and fleet statistics. ```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 } } } ``` -------------------------------- ### Get All Agents Response Body Source: https://tookanapi.docs.apiary.io/reference/agent/get-all-agents/get-all-agents Example successful response body for the Get All Agents API. Contains a list of agent data including IDs, contact information, and location. ```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" } ] } ``` -------------------------------- ### Create Task Example Source: https://tookanapi.docs.apiary.io/introduction/npm-module This example demonstrates how to create a task using the Tookan API. All requests are POST requests to the base URL with specific endpoints appended. An API key is mandatory for all requests. ```APIDOC ## POST /v2/create_task ### Description Creates a new task in the Tookan system. ### Method POST ### Endpoint https://api.tookanapp.com/v2/create_task ### Parameters #### Request Body - **api_key** (string) - Required - Your API key for authentication. - **timezone** (integer) - Optional - The timezone difference with UTC in minutes. - **job_data** (object) - Required - Contains the details of the task to be created. - **job_description** (string) - Required - Description of the task. - **customer_email** (string) - Optional - Email of the customer. - **customer_phone** (string) - Required - Phone number of the customer. - **customer_name** (string) - Required - Name of the customer. - **customer_address** (string) - Required - Address of the customer. - **latitude** (number) - Required - Latitude of the customer's location. - **longitude** (number) - Required - Longitude of the customer's location. ### Request Example ```json { "api_key": "YOUR_API_KEY", "timezone": -330, "job_data": { "job_description": "Pick up package from sender", "customer_email": "customer@example.com", "customer_phone": "1234567890", "customer_name": "John Doe", "customer_address": "123 Main St, Anytown, USA", "latitude": 34.0522, "longitude": -118.2437 } } ``` ### Response #### Success Response (200) - **message** (string) - Success message. - **status** (integer) - HTTP status code, expected to be 200. - **data** (object) - Contains details of the created task. #### Response Example ```json { "message": "Successful", "status": 200, "data": { "job_id": "12345" } } ``` ``` -------------------------------- ### Get All Agents Request Body Source: https://tookanapi.docs.apiary.io/reference/agent/get-all-agents/get-all-agents Example request body for the Get All Agents API endpoint. Customize parameters like tags, name, and fleet IDs to filter results. ```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 } ```