Create Task
This api allows you to create a Task for your project app.
POST https://api.teliver.xyz/v1/task/create?apikey=Your_Api_Key
Request Body
{
"pickup": {
"lnglat": [
80.2707,
13.0828657
],
"address": "Adyar",
"customer": {
"name": "Pickup Customer",
"mobile": "1234567"
}
},
"drop": {
"lnglat": [
80.6488,
13.8774545
],
"address": "Nungambakkam",
"customer": {
"name": "Drop Customer",
"mobile": "12345678"
}
},
"notes": "Food Delivery",
"time": "2010-10-12T08:50Z",
"type": 3,
"auto_assign": false
}
The above is the sample request data for Pick/Drop Task.
Parameters | Requires | Values | Description |
apikey | yes | | The api key is the unique identifier for your respective application. (You can get it from yourDashboard). Always pass this as query parameter. |
pickup | Mandatory if your task is a pickup task. | "pickup": {"lnglat": [80.2707,13.0828657],"address": "Adyar"} lnglat = [longitude, latitude],Address = “your complete address” | The pickup is used when the api is to create a pickup task. If the task is for both the pickup and drop then pickup and drop both were given. |
drop | Mandatory if your task is drop task. | "drop":{"lnglat": [80.6488,13.8774545],"address": "Adyar"} Lnglat = [your lnglat values],Address = “your complete address” | The drop is used when the api is used to create a drop task. If the task is for both the pickup and drop then pickup and drop both were given. |
type | yes | 1 = if the task is pickup 2. If the task is drop. 3. If the task is pickup and drop. | The type indicates the task type. |
order_id | Not mandatory | ORD123456 | This is used to linkup between your order id and created task. |
notes | Not mandatory | Some Notes | The notes will be send to the driver if any. |
time | Not mandatory | Time in UTC ISO format(2010-10-12T08:50Z) | The time will indicate the task created time. |
customer | Not mandatory | name: name of contact person, mobile: mobile number | The name and mobile number of the customer. |
auto_assign | Not mandatory | | If set to true, then the task will be assigned to the nearest available driver automatically. |
RESPONSE:
{
"message": "Task created",
"success": true,
"data": {
"task": {
"task_id": "rxiq3nGx7",
"type": 3,
"time": "2010-10-12T08:50:00.000Z",
"notes": "Food Delivery",
"status": "created",
"drop": {
"address": "Adyar",
"lnglat": [
80.6488,
13.8774545
],
"customer": {
"name": "Pickup Customer",
"mobile": "1234567"
}
},
"pickup": {
"address": "Nungambakkam",
"lnglat": [
80.2707,
13.0828657
],
"customer": {
"name": "Drop Customer",
"mobile": "12345678"
}
},
"order_id": "",
"updated_at": "2018-06-04T13:20:19.504Z",
"created_at": "2018-06-04T13:20:19.504Z"
}
}
}
Last modified 2yr ago