curl --request PATCH \
--url https://apiweb.mile.app/api/v3/task/schedule/{scheduleId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"hubId": "634e98498ce07d29474a7e29",
"name": "Daily Morning Visit 3",
"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"
}
'import requests
url = "https://apiweb.mile.app/api/v3/task/schedule/{scheduleId}"
payload = {
"hubId": "634e98498ce07d29474a7e29",
"name": "Daily Morning Visit 3",
"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"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
hubId: '634e98498ce07d29474a7e29',
name: 'Daily Morning Visit 3',
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'
})
};
fetch('https://apiweb.mile.app/api/v3/task/schedule/{scheduleId}', 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/schedule/{scheduleId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'hubId' => '634e98498ce07d29474a7e29',
'name' => 'Daily Morning Visit 3',
'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'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://apiweb.mile.app/api/v3/task/schedule/{scheduleId}"
payload := strings.NewReader("{\n \"hubId\": \"634e98498ce07d29474a7e29\",\n \"name\": \"Daily Morning Visit 3\",\n \"periode\": \"daily\",\n \"flow\": \"Visit\",\n \"flowId\": \"67be687c128306111e022022\",\n \"task\": {\n \"receiverName\": \"Miguel\",\n \"address\": \"gambir jakarta pusat\",\n \"coordinates\": \"\",\n \"weight\": \"5\"\n },\n \"schedules\": [\n {\n \"time\": [\n \"07:00\"\n ]\n }\n ],\n \"startTime\": \"2022-11-02\",\n \"endTime\": \"2022-11-05\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://apiweb.mile.app/api/v3/task/schedule/{scheduleId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"hubId\": \"634e98498ce07d29474a7e29\",\n \"name\": \"Daily Morning Visit 3\",\n \"periode\": \"daily\",\n \"flow\": \"Visit\",\n \"flowId\": \"67be687c128306111e022022\",\n \"task\": {\n \"receiverName\": \"Miguel\",\n \"address\": \"gambir jakarta pusat\",\n \"coordinates\": \"\",\n \"weight\": \"5\"\n },\n \"schedules\": [\n {\n \"time\": [\n \"07:00\"\n ]\n }\n ],\n \"startTime\": \"2022-11-02\",\n \"endTime\": \"2022-11-05\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://apiweb.mile.app/api/v3/task/schedule/{scheduleId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"hubId\": \"634e98498ce07d29474a7e29\",\n \"name\": \"Daily Morning Visit 3\",\n \"periode\": \"daily\",\n \"flow\": \"Visit\",\n \"flowId\": \"67be687c128306111e022022\",\n \"task\": {\n \"receiverName\": \"Miguel\",\n \"address\": \"gambir jakarta pusat\",\n \"coordinates\": \"\",\n \"weight\": \"5\"\n },\n \"schedules\": [\n {\n \"time\": [\n \"07:00\"\n ]\n }\n ],\n \"startTime\": \"2022-11-02\",\n \"endTime\": \"2022-11-05\"\n}"
response = http.request(request)
puts response.read_body{
"status": true,
"message": "Update data success",
"data": {
"hubId": "634e98498ce07d29474a7e29",
"name": "Daily Morning Visit 3",
"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"
}
}{
"status": false,
"message": "Bad request - invalid parameters provided."
}{
"status": false,
"message": "Data not found"
}{
"status": false,
"message": "Internal server error, please contact support@mile.app."
}Update partially task schedule by ID
curl --request PATCH \
--url https://apiweb.mile.app/api/v3/task/schedule/{scheduleId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"hubId": "634e98498ce07d29474a7e29",
"name": "Daily Morning Visit 3",
"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"
}
'import requests
url = "https://apiweb.mile.app/api/v3/task/schedule/{scheduleId}"
payload = {
"hubId": "634e98498ce07d29474a7e29",
"name": "Daily Morning Visit 3",
"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"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
hubId: '634e98498ce07d29474a7e29',
name: 'Daily Morning Visit 3',
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'
})
};
fetch('https://apiweb.mile.app/api/v3/task/schedule/{scheduleId}', 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/schedule/{scheduleId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'hubId' => '634e98498ce07d29474a7e29',
'name' => 'Daily Morning Visit 3',
'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'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://apiweb.mile.app/api/v3/task/schedule/{scheduleId}"
payload := strings.NewReader("{\n \"hubId\": \"634e98498ce07d29474a7e29\",\n \"name\": \"Daily Morning Visit 3\",\n \"periode\": \"daily\",\n \"flow\": \"Visit\",\n \"flowId\": \"67be687c128306111e022022\",\n \"task\": {\n \"receiverName\": \"Miguel\",\n \"address\": \"gambir jakarta pusat\",\n \"coordinates\": \"\",\n \"weight\": \"5\"\n },\n \"schedules\": [\n {\n \"time\": [\n \"07:00\"\n ]\n }\n ],\n \"startTime\": \"2022-11-02\",\n \"endTime\": \"2022-11-05\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://apiweb.mile.app/api/v3/task/schedule/{scheduleId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"hubId\": \"634e98498ce07d29474a7e29\",\n \"name\": \"Daily Morning Visit 3\",\n \"periode\": \"daily\",\n \"flow\": \"Visit\",\n \"flowId\": \"67be687c128306111e022022\",\n \"task\": {\n \"receiverName\": \"Miguel\",\n \"address\": \"gambir jakarta pusat\",\n \"coordinates\": \"\",\n \"weight\": \"5\"\n },\n \"schedules\": [\n {\n \"time\": [\n \"07:00\"\n ]\n }\n ],\n \"startTime\": \"2022-11-02\",\n \"endTime\": \"2022-11-05\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://apiweb.mile.app/api/v3/task/schedule/{scheduleId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"hubId\": \"634e98498ce07d29474a7e29\",\n \"name\": \"Daily Morning Visit 3\",\n \"periode\": \"daily\",\n \"flow\": \"Visit\",\n \"flowId\": \"67be687c128306111e022022\",\n \"task\": {\n \"receiverName\": \"Miguel\",\n \"address\": \"gambir jakarta pusat\",\n \"coordinates\": \"\",\n \"weight\": \"5\"\n },\n \"schedules\": [\n {\n \"time\": [\n \"07:00\"\n ]\n }\n ],\n \"startTime\": \"2022-11-02\",\n \"endTime\": \"2022-11-05\"\n}"
response = http.request(request)
puts response.read_body{
"status": true,
"message": "Update data success",
"data": {
"hubId": "634e98498ce07d29474a7e29",
"name": "Daily Morning Visit 3",
"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"
}
}{
"status": false,
"message": "Bad request - invalid parameters provided."
}{
"status": false,
"message": "Data not found"
}{
"status": false,
"message": "Internal server error, please contact support@mile.app."
}Authorizations
Use a valid Bearer token to authenticate.
Path Parameters
Unique identifier for the task schedule that generated by system.
Example: 6352736c628401059b37a2e2
Body
Fundamental entity within an organization, serving as the central point for managing various operational components. Use GET /hubs endpoint to get the list of Hub IDs. Example: 634e98498ce07d29474a7e29
The name of task schedule. User can define task schedule name with task's flow name combined with running time, or something else.
Example: Daily Morning Visit
There are 5 types of periode: daily, weekly, monthly, byDate, custom. Period of time when the task scheduler running.
Example: daily
The unique name of organization's flow. Use Flow /flows API to get the list of flow names.
Example: Visit
Start date of task scheduler to active. this field only available when periode's value is one of:
daily, weekly, monthly
Example: 2022-11-02
End date of task scheduler to active. this field only available when periode's value is one of:
daily, weekly, monthly
Example: 2022-11-05
data of task according to selected flow.
Example:
{
'receiverName':'miguel',
'coordinates':'-6.230815251,106.75684387',
'address':'rawamangun jakarta timur'
}
Number units of frequency between each scheduled execution. For example, an interval of 2 with a frequency of daily means the task will run every 2 days. This required when select the custom periode.
Example: daily
1 <= x <= 99Specified unit of time for the scheduling interval. Determines how often the scheduled task will run based on the interval value.This required when select the custom periode.
Example: daily
daily, weekly, monthly Object with format according to value of periode. Configuration for the time of task scheduler will run.
Example for periode of daily:
[{
'time':['07:00']
}]
Example for periode of weekly:
[{
'day':'sunday',
'time':['07:00']
}]
Example for periode of monthly:
[{
'date':'1',
'time':['07:00']
}]
Example for periode of byDate:
[{
'date':'2022-11-03',
'time':['07:00']
}]
Show child attributes
Show child attributes