curl --request GET \
--url https://apiweb.mile.app/api/v3/automations \
--header 'Authorization: Bearer <token>'import requests
url = "https://apiweb.mile.app/api/v3/automations"
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/automations', 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/automations",
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/automations"
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/automations")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://apiweb.mile.app/api/v3/automations")
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",
"data": {
"current_page": 1,
"data": [
{
"name": "Auto webhook automation",
"event": "onTaskFinished",
"automationType": "webhook",
"dataType": "task",
"automationDetails": {
"url": "https://apiweb.mile.app/webhook",
"headers": {
"x-api-key": "1234e98498ce07d29474a7ev2",
"org": "general"
}
},
"rules": {
"flow": "Pickup",
"flowId": "667b712f63020e5f182f0cb2"
},
"organizationId": "621dd813eb3ebf16b94dbde3",
"isActive": true,
"updatedTime": "2022-07-13T03:16:40+00:00",
"createdTime": "2022-07-13T03:16:40+00:00",
"_id": "62ce3918d3f3e1681a3a54b5"
}
],
"first_page_url": "http://apiweb.mile.app/api/v3/automations?q=automation%201&page=1",
"from": 1,
"last_page": 1,
"last_page_url": "http://apiweb.mile.app/api/v3/automations?q=automation%201&page=1",
"links": [
{
"url": null,
"label": "« Previous",
"active": false
},
{
"url": "http://apiweb.mile.app/api/v3/automations?q=automation%201&page=1",
"label": "1",
"active": true
},
{
"url": null,
"label": "Next »",
"active": false
}
],
"next_page_url": null,
"path": "http://apiweb.mile.app/api/v3/automations",
"per_page": 10,
"prev_page_url": null,
"to": 1,
"total": 1
}
}{
"status": false,
"message": "Bad request - invalid parameters provided."
}{
"status": false,
"message": "Internal server error, please contact support@mile.app."
}Read automation
curl --request GET \
--url https://apiweb.mile.app/api/v3/automations \
--header 'Authorization: Bearer <token>'import requests
url = "https://apiweb.mile.app/api/v3/automations"
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/automations', 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/automations",
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/automations"
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/automations")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://apiweb.mile.app/api/v3/automations")
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",
"data": {
"current_page": 1,
"data": [
{
"name": "Auto webhook automation",
"event": "onTaskFinished",
"automationType": "webhook",
"dataType": "task",
"automationDetails": {
"url": "https://apiweb.mile.app/webhook",
"headers": {
"x-api-key": "1234e98498ce07d29474a7ev2",
"org": "general"
}
},
"rules": {
"flow": "Pickup",
"flowId": "667b712f63020e5f182f0cb2"
},
"organizationId": "621dd813eb3ebf16b94dbde3",
"isActive": true,
"updatedTime": "2022-07-13T03:16:40+00:00",
"createdTime": "2022-07-13T03:16:40+00:00",
"_id": "62ce3918d3f3e1681a3a54b5"
}
],
"first_page_url": "http://apiweb.mile.app/api/v3/automations?q=automation%201&page=1",
"from": 1,
"last_page": 1,
"last_page_url": "http://apiweb.mile.app/api/v3/automations?q=automation%201&page=1",
"links": [
{
"url": null,
"label": "« Previous",
"active": false
},
{
"url": "http://apiweb.mile.app/api/v3/automations?q=automation%201&page=1",
"label": "1",
"active": true
},
{
"url": null,
"label": "Next »",
"active": false
}
],
"next_page_url": null,
"path": "http://apiweb.mile.app/api/v3/automations",
"per_page": 10,
"prev_page_url": null,
"to": 1,
"total": 1
}
}{
"status": false,
"message": "Bad request - invalid parameters provided."
}{
"status": false,
"message": "Internal server error, please contact support@mile.app."
}Authorizations
Use a valid Bearer token to authenticate.
Query Parameters
The page number of results to retrieve. Example: 2
Specifies the maximum number of items to retrieve in a single request. Example: 10
1 <= x <= 1000Query param search. This field will search automation according to similar value of name, automation type or flow
Example: Automation Tigaraksa, createTask, Delivery
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 automation objects.
Example: name, flow, automationType, createdTime, etc.
Default: createdTime
sortOrder is to decide ascending or descending order
Example: asc or desc.
Default: desc
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,automationType,flow.
Act as a trigger that start an automation.
Example: onTaskCreated
Automation's type. The action of automation.
Example: webhook.
Automation's data type.
Example: task.
FlowName to select specific task for event to happens. Use GET /flows API to get the list of Flow.
Example: Pickup