Skip to main content
GET
/
task
/
schedules
Read task schedule
curl --request GET \
  --url https://apiweb.mile.app/api/v3/task/schedules \
  --header 'Authorization: Bearer <token>'
import requests

url = "https://apiweb.mile.app/api/v3/task/schedules"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.text)
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

fetch('https://apiweb.mile.app/api/v3/task/schedules', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://apiweb.mile.app/api/v3/task/schedules",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"net/http"
"io"
)

func main() {

url := "https://apiweb.mile.app/api/v3/task/schedules"

req, _ := http.NewRequest("GET", url, nil)

req.Header.Add("Authorization", "Bearer <token>")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.get("https://apiweb.mile.app/api/v3/task/schedules")
.header("Authorization", "Bearer <token>")
.asString();
require 'uri'
require 'net/http'

url = URI("https://apiweb.mile.app/api/v3/task/schedules")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
{
  "status": true,
  "message": "Success",
  "taskSchedules": {
    "current_page": 1,
    "data": [
      {
        "hubId": "634e98498ce07d29474a7e29",
        "name": "Daily Morning Visit",
        "periode": "daily",
        "flow": "Visit",
        "flowId": "67be687c128306111e022022",
        "task": {
          "receiverName": "Miguel",
          "address": "gambir jakarta pusat",
          "coordinates": "",
          "weight": "5"
        },
        "schedules": [
          {
            "time": [
              "07:00"
            ]
          }
        ],
        "startTime": "2022-11-02",
        "endTime": "2022-11-05",
        "createdBy": "Pablo",
        "timeSchedules": [
          "07:00"
        ],
        "organizationId": "634e98098ce07d29474a7e22",
        "updatedTime": "2022-11-01T07:28:23+00:00",
        "createdTime": "2022-11-01T07:28:23+00:00",
        "_id": "6352736c628401059b37a2e2"
      },
      {
        "hubId": "667b8e62b76860782a455e62",
        "name": "Biweekly Inspection",
        "periode": "custom",
        "flow": "Inspection",
        "flowId": "67be688e128306111e022025",
        "task": {
          "reportContent": "Biweekly Inspection",
          "createdFrom": "SCHEDULER"
        },
        "assignee": [
          "worker@paket.id"
        ],
        "schedules": [
          {
            "day": "monday",
            "time": [
              "01:00"
            ]
          }
        ],
        "startTime": "2024-09-01 00:00",
        "endTime": "2024-12-31 23:59",
        "frequency": "weekly",
        "interval": 2,
        "createdBy": "admin@paket.id",
        "timeSchedules": [
          "monday 01:00"
        ],
        "organizationId": "634e98098ce07d29474a7e22",
        "updatedTime": "2024-08-26T00:47:42+00:00",
        "createdTime": "2024-08-26T00:47:42+00:00",
        "_id": "66cbd0aec0835f7336006992"
      }
    ],
    "first_page_url": "https://apiweb.mile.app/api/v3/task/schedules?limit=10&hubId=634fa8f119f4de35c534ad12&page=1",
    "from": 1,
    "last_page": 1,
    "last_page_url": "https://apiweb.mile.app/api/v3/task/schedules?limit=10&hubId=634fa8f119f4de35c534ad12&page=1",
    "links": [
      {
        "url": null,
        "label": "&laquo; Previous",
        "active": false
      },
      {
        "url": "https://apiweb.mile.app/api/v3/task/schedules?limit=10&hubId=634fa8f119f4de35c534ad12&page=1",
        "label": "1",
        "active": true
      },
      {
        "url": null,
        "label": "Next &raquo;",
        "active": false
      }
    ],
    "next_page_url": null,
    "path": "https://apiweb.mile.app/api/v3/task/schedules",
    "per_page": 10,
    "prev_page_url": null,
    "to": 5,
    "total": 5
  }
}
{
"status": false,
"message": "Bad request - invalid parameters provided."
}
{
"status": false,
"message": "Internal server error, please contact support@mile.app."
}

Authorizations

Authorization
string
header
required

Use a valid Bearer token to authenticate.

Query Parameters

sortBy
string

sortBy is used to sort the result-set in ascending or descending order according to selected field. The value of this param is one of available fields on task schedule objects. Example: name, periode, flow, hubId, etc. Default: createdTime

sortOrder
string

sortOrder is to decide ascending or descending order Example: asc or desc. Default: desc

limit
string

Limit of vehicles result list. Example: 10. Default: 20

page
string

Pagination of vehicles result list. Example: 2. Default: 1

hubId
string

Fundamental entity within an organization, serving as the central point for managing various operational components. Use Use GET /hubs endpoint to get the list of Hub IDs. Example: 634e98498ce07d29474a7e29

name
string

finding data by name task scheduler. Example: Morning

flow
string

The unique name of organization's flow. Use Flow /flows API to get the list of flow names. Example: Visit

flowId
string

The identifier for the flow that generated by system. Use Flow /flows API to get the list of flow id. Example: 63d8c9b0dbd5ef20a627dd86

status
string

finding data running on SUCCESS or FAILED, acceptable value:SUCCESS,FAILED. Example: SUCCESS

assignee
string

User email for a given task. Example: worker@paket.id,jhon@paket.id

fields
string

Fields is for selecting the specific fields that you can choose by multiples to show in the response using a string with a comma delimiter. Example: name,periode,hubId.

Response

Success

status
boolean

Status of response.

message
string

Message of API response.

taskSchedules
object

List of object task schedule.