curl --request PATCH \
--url https://apiweb.mile.app/api/v3/data/{data_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"dataId": "OutletAdi",
"dataTypeId": "63f854cff2bd7b342a098962",
"hubId": "63c63ab1b6972d3150348172",
"outletName": "Cabang Jakarta Pusat",
"outletHours": 12,
"outletType": "minimarket",
"outletOpen": "09:00",
"outletClose": "17:00",
"outletContractExpired": "2023-02-02",
"outletOpenInWeekend": true,
"outletGeolocation": "-6.171702325136309,106.81775093078615",
"outletPhoneNumber": "+62 123 456 789",
"outletCloseOrder": "2023-02-02 17:00:00"
}
'import requests
url = "https://apiweb.mile.app/api/v3/data/{data_id}"
payload = {
"dataId": "OutletAdi",
"dataTypeId": "63f854cff2bd7b342a098962",
"hubId": "63c63ab1b6972d3150348172",
"outletName": "Cabang Jakarta Pusat",
"outletHours": 12,
"outletType": "minimarket",
"outletOpen": "09:00",
"outletClose": "17:00",
"outletContractExpired": "2023-02-02",
"outletOpenInWeekend": True,
"outletGeolocation": "-6.171702325136309,106.81775093078615",
"outletPhoneNumber": "+62 123 456 789",
"outletCloseOrder": "2023-02-02 17:00:00"
}
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({
dataId: 'OutletAdi',
dataTypeId: '63f854cff2bd7b342a098962',
hubId: '63c63ab1b6972d3150348172',
outletName: 'Cabang Jakarta Pusat',
outletHours: 12,
outletType: 'minimarket',
outletOpen: '09:00',
outletClose: '17:00',
outletContractExpired: '2023-02-02',
outletOpenInWeekend: true,
outletGeolocation: '-6.171702325136309,106.81775093078615',
outletPhoneNumber: '+62 123 456 789',
outletCloseOrder: '2023-02-02 17:00:00'
})
};
fetch('https://apiweb.mile.app/api/v3/data/{data_id}', 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/data/{data_id}",
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([
'dataId' => 'OutletAdi',
'dataTypeId' => '63f854cff2bd7b342a098962',
'hubId' => '63c63ab1b6972d3150348172',
'outletName' => 'Cabang Jakarta Pusat',
'outletHours' => 12,
'outletType' => 'minimarket',
'outletOpen' => '09:00',
'outletClose' => '17:00',
'outletContractExpired' => '2023-02-02',
'outletOpenInWeekend' => true,
'outletGeolocation' => '-6.171702325136309,106.81775093078615',
'outletPhoneNumber' => '+62 123 456 789',
'outletCloseOrder' => '2023-02-02 17:00:00'
]),
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/data/{data_id}"
payload := strings.NewReader("{\n \"dataId\": \"OutletAdi\",\n \"dataTypeId\": \"63f854cff2bd7b342a098962\",\n \"hubId\": \"63c63ab1b6972d3150348172\",\n \"outletName\": \"Cabang Jakarta Pusat\",\n \"outletHours\": 12,\n \"outletType\": \"minimarket\",\n \"outletOpen\": \"09:00\",\n \"outletClose\": \"17:00\",\n \"outletContractExpired\": \"2023-02-02\",\n \"outletOpenInWeekend\": true,\n \"outletGeolocation\": \"-6.171702325136309,106.81775093078615\",\n \"outletPhoneNumber\": \"+62 123 456 789\",\n \"outletCloseOrder\": \"2023-02-02 17:00:00\"\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/data/{data_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"dataId\": \"OutletAdi\",\n \"dataTypeId\": \"63f854cff2bd7b342a098962\",\n \"hubId\": \"63c63ab1b6972d3150348172\",\n \"outletName\": \"Cabang Jakarta Pusat\",\n \"outletHours\": 12,\n \"outletType\": \"minimarket\",\n \"outletOpen\": \"09:00\",\n \"outletClose\": \"17:00\",\n \"outletContractExpired\": \"2023-02-02\",\n \"outletOpenInWeekend\": true,\n \"outletGeolocation\": \"-6.171702325136309,106.81775093078615\",\n \"outletPhoneNumber\": \"+62 123 456 789\",\n \"outletCloseOrder\": \"2023-02-02 17:00:00\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://apiweb.mile.app/api/v3/data/{data_id}")
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 \"dataId\": \"OutletAdi\",\n \"dataTypeId\": \"63f854cff2bd7b342a098962\",\n \"hubId\": \"63c63ab1b6972d3150348172\",\n \"outletName\": \"Cabang Jakarta Pusat\",\n \"outletHours\": 12,\n \"outletType\": \"minimarket\",\n \"outletOpen\": \"09:00\",\n \"outletClose\": \"17:00\",\n \"outletContractExpired\": \"2023-02-02\",\n \"outletOpenInWeekend\": true,\n \"outletGeolocation\": \"-6.171702325136309,106.81775093078615\",\n \"outletPhoneNumber\": \"+62 123 456 789\",\n \"outletCloseOrder\": \"2023-02-02 17:00:00\"\n}"
response = http.request(request)
puts response.read_body{
"status": true,
"message": "Success",
"data": {
"_id": "63dc641b1ed1fd63ad0c9013",
"dataId": "Outlet",
"dataTypeId": "63db2fb476bc679c540369c4",
"outletName": "Cabang Jakarta Pusat",
"outletHours": 12,
"outletType": "minimarket",
"outletOpen": "09:00",
"outletClosed": "17:00",
"outletContractExpired": "2023-02-02",
"outletOpenInWeekend": true,
"outletGeolocation": "-6.171702325136309,106.81775093078615",
"outletPhoneNumber": "+62 123 456 789",
"outletCloseOrder": "2023-02-02 17:00:00",
"hubId": "63c63ab1b6972d3150348172",
"organizationId": "63c61d865347e356d05e3052",
"createdBy": "john.doe@mile.app",
"updatedTime": "2023-02-03 01:32:11",
"createdTime": "2023-02-03 01:32:11"
}
}{
"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 data source by ID
curl --request PATCH \
--url https://apiweb.mile.app/api/v3/data/{data_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"dataId": "OutletAdi",
"dataTypeId": "63f854cff2bd7b342a098962",
"hubId": "63c63ab1b6972d3150348172",
"outletName": "Cabang Jakarta Pusat",
"outletHours": 12,
"outletType": "minimarket",
"outletOpen": "09:00",
"outletClose": "17:00",
"outletContractExpired": "2023-02-02",
"outletOpenInWeekend": true,
"outletGeolocation": "-6.171702325136309,106.81775093078615",
"outletPhoneNumber": "+62 123 456 789",
"outletCloseOrder": "2023-02-02 17:00:00"
}
'import requests
url = "https://apiweb.mile.app/api/v3/data/{data_id}"
payload = {
"dataId": "OutletAdi",
"dataTypeId": "63f854cff2bd7b342a098962",
"hubId": "63c63ab1b6972d3150348172",
"outletName": "Cabang Jakarta Pusat",
"outletHours": 12,
"outletType": "minimarket",
"outletOpen": "09:00",
"outletClose": "17:00",
"outletContractExpired": "2023-02-02",
"outletOpenInWeekend": True,
"outletGeolocation": "-6.171702325136309,106.81775093078615",
"outletPhoneNumber": "+62 123 456 789",
"outletCloseOrder": "2023-02-02 17:00:00"
}
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({
dataId: 'OutletAdi',
dataTypeId: '63f854cff2bd7b342a098962',
hubId: '63c63ab1b6972d3150348172',
outletName: 'Cabang Jakarta Pusat',
outletHours: 12,
outletType: 'minimarket',
outletOpen: '09:00',
outletClose: '17:00',
outletContractExpired: '2023-02-02',
outletOpenInWeekend: true,
outletGeolocation: '-6.171702325136309,106.81775093078615',
outletPhoneNumber: '+62 123 456 789',
outletCloseOrder: '2023-02-02 17:00:00'
})
};
fetch('https://apiweb.mile.app/api/v3/data/{data_id}', 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/data/{data_id}",
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([
'dataId' => 'OutletAdi',
'dataTypeId' => '63f854cff2bd7b342a098962',
'hubId' => '63c63ab1b6972d3150348172',
'outletName' => 'Cabang Jakarta Pusat',
'outletHours' => 12,
'outletType' => 'minimarket',
'outletOpen' => '09:00',
'outletClose' => '17:00',
'outletContractExpired' => '2023-02-02',
'outletOpenInWeekend' => true,
'outletGeolocation' => '-6.171702325136309,106.81775093078615',
'outletPhoneNumber' => '+62 123 456 789',
'outletCloseOrder' => '2023-02-02 17:00:00'
]),
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/data/{data_id}"
payload := strings.NewReader("{\n \"dataId\": \"OutletAdi\",\n \"dataTypeId\": \"63f854cff2bd7b342a098962\",\n \"hubId\": \"63c63ab1b6972d3150348172\",\n \"outletName\": \"Cabang Jakarta Pusat\",\n \"outletHours\": 12,\n \"outletType\": \"minimarket\",\n \"outletOpen\": \"09:00\",\n \"outletClose\": \"17:00\",\n \"outletContractExpired\": \"2023-02-02\",\n \"outletOpenInWeekend\": true,\n \"outletGeolocation\": \"-6.171702325136309,106.81775093078615\",\n \"outletPhoneNumber\": \"+62 123 456 789\",\n \"outletCloseOrder\": \"2023-02-02 17:00:00\"\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/data/{data_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"dataId\": \"OutletAdi\",\n \"dataTypeId\": \"63f854cff2bd7b342a098962\",\n \"hubId\": \"63c63ab1b6972d3150348172\",\n \"outletName\": \"Cabang Jakarta Pusat\",\n \"outletHours\": 12,\n \"outletType\": \"minimarket\",\n \"outletOpen\": \"09:00\",\n \"outletClose\": \"17:00\",\n \"outletContractExpired\": \"2023-02-02\",\n \"outletOpenInWeekend\": true,\n \"outletGeolocation\": \"-6.171702325136309,106.81775093078615\",\n \"outletPhoneNumber\": \"+62 123 456 789\",\n \"outletCloseOrder\": \"2023-02-02 17:00:00\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://apiweb.mile.app/api/v3/data/{data_id}")
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 \"dataId\": \"OutletAdi\",\n \"dataTypeId\": \"63f854cff2bd7b342a098962\",\n \"hubId\": \"63c63ab1b6972d3150348172\",\n \"outletName\": \"Cabang Jakarta Pusat\",\n \"outletHours\": 12,\n \"outletType\": \"minimarket\",\n \"outletOpen\": \"09:00\",\n \"outletClose\": \"17:00\",\n \"outletContractExpired\": \"2023-02-02\",\n \"outletOpenInWeekend\": true,\n \"outletGeolocation\": \"-6.171702325136309,106.81775093078615\",\n \"outletPhoneNumber\": \"+62 123 456 789\",\n \"outletCloseOrder\": \"2023-02-02 17:00:00\"\n}"
response = http.request(request)
puts response.read_body{
"status": true,
"message": "Success",
"data": {
"_id": "63dc641b1ed1fd63ad0c9013",
"dataId": "Outlet",
"dataTypeId": "63db2fb476bc679c540369c4",
"outletName": "Cabang Jakarta Pusat",
"outletHours": 12,
"outletType": "minimarket",
"outletOpen": "09:00",
"outletClosed": "17:00",
"outletContractExpired": "2023-02-02",
"outletOpenInWeekend": true,
"outletGeolocation": "-6.171702325136309,106.81775093078615",
"outletPhoneNumber": "+62 123 456 789",
"outletCloseOrder": "2023-02-02 17:00:00",
"hubId": "63c63ab1b6972d3150348172",
"organizationId": "63c61d865347e356d05e3052",
"createdBy": "john.doe@mile.app",
"updatedTime": "2023-02-03 01:32:11",
"createdTime": "2023-02-03 01:32:11"
}
}{
"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 data that generated by system.
Example: 63dc641b1ed1fd63ad0c9013
Body
The identifier of fields from data type.
Example: Outlet
The identifier of data type.
Use GET /data-types API to get the list of Data Type IDs.
Example: 63db2fb476bc679c540369c4
The identifier for the hub that generated by system. hubId is not required if the commonData configuration for the data type is true.
Use GET /hubs API to get the list of Hub IDs.
Example: 63c63ffbdef63e6f641aac72
The dynamic field, outlet name. Use GET /data-types API to get detail fields of data source.
Example: Cabang Jakarta Pusat
The dynamic field, outlet hours. Use GET /data-types API to get detail fields of data source.
Example: 12
The dynamic field, outlet type. Use GET /data-types API to get detail fields of data source.
Example: minimarket
The dynamic field, outlet open. Use GET /data-types API to get detail fields of data source.
Example: 09:00
The dynamic field, outlet closed. Use GET /data-types API to get detail fields of data source.
Example: 17:00
The dynamic field, outlet contract expired. Use GET /data-types API to get detail fields of data source.
Example: 2023-02-02
The dynamic field, outlet open in weekend. Use GET /data-types API to get detail fields of data source.
Example: true
The dynamic field, outlet geolocation. Use GET /data-types API to get detail fields of data source.
Example: -6.171702325136309,106.81775093078615