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

url = "https://apiweb.mile.app/api/v3/automation-log"

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/automation-log', 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/automation-log",
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/automation-log"

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/automation-log")
.header("Authorization", "Bearer <token>")
.asString();
require 'uri'
require 'net/http'

url = URI("https://apiweb.mile.app/api/v3/automation-log")

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": "elasticData",
  "total": 1,
  "data": [
    {
      "_index": "log-automationdev-2022.08.10",
      "_type": "_doc",
      "_id": "-DethoIBewA7zVXNTstW",
      "_score": null,
      "_source": {
        "finishRequestTime": "2022-08-10 07:34:31",
        "automationEvent": "onTaskCreated",
        "attempt": "0",
        "automationId": "62f25ada1c0cd810800157c2",
        "timestamp": "2022-08-10 07:34:31",
        "name": "automation log",
        "response": "{\"status\":true,\"code\":201,\"message\":\"Task has been created\",\"task\":{\"createdFrom\":\"Automation\",\"flow\":\"Test Flow Import Visit\",\"startTime\":\"2022-08-09T13:02:48+00:00\",\"endTime\":\"2022-08-10T13:02:48+00:00\",\"hubId\":\"622976f50b8db203ef31d312\",\"input4\":\"08:00\",\"input9\":0,\"input3\":\"123,234\",\"input2\":\"malang\",\"input5\":\"17:00\",\"input6\":0,\"input8\":0,\"input1\":\"dendi\",\"select1\":null,\"title\":\"dendi\",\"content\":\"malang\",\"geoLock\":[{\"geoLocation\":\"123,234\",\"radius\":null}],\"useGeoLock\":false,\"geoLockTrigger\":null,\"flowId\":\"625678f90fc8ba02bb5eb432\",\"organizationId\":\"621dd813eb3ebf16b94dbde3\",\"status\":\"UNASSIGNED\",\"hub\":{\"_id\":\"622976f50b8db203ef31d312\",\"name\":\"JAKARTA\",\"lat\":-6.174739001608504,\"lng\":106.79002412883601},\"orderIndex\":166011687171396,\"createdBy\":null,\"updatedTime\":\"2022-08-10T07:34:31+00:00\",\"createdTime\":\"2022-08-10T07:34:31+00:00\",\"_id\":\"62f35f8710bf27537c61d1c2\"}}",
        "automationUrl": "/api/v3/task",
        "automationDetails": "{\"taskData\":{\"input9\":null,\"input8\":null,\"select1\":null,\"input6\":null,\"input5\":null,\"input4\":null,\"input3\":\"123,234\",\"input2\":\"malang\",\"input1\":\"$refFlow.title\"},\"flow\":\"Test Flow Import Visit\"}",
        "severity": "NOTICE",
        "statusCode": "201",
        "startRequestTime": "2022-08-10 07:34:31.6996",
        "delayTime": "1660114849.699626",
        "automationName": "automation log",
        "@timestamp": "2022-08-10T07:34:34.873Z",
        "request": "{\"createdFrom\":\"Automation\",\"flow\":\"Test Flow Import Visit\",\"startTime\":\"2022-08-09T13:02:48.000000Z\",\"endTime\":\"2022-08-10T13:02:48.000000Z\",\"hubId\":\"622976f50b8db203ef31d312\",\"input4\":null,\"input9\":null,\"input3\":\"123,234\",\"input2\":\"malang\",\"input5\":null,\"input6\":null,\"input8\":null,\"input1\":\"dendi\",\"select1\":null}",
        "dispatchAt": "2022-08-10 07:34:31",
        "dataType": "task",
        "env": "dev",
        "organizationId": "621dd813eb3ebf16b94dbde3",
        "isSuccess": "true",
        "@version": "1",
        "referenceId": "62f25af61c0cd810800157c3",
        "responseTime": "0.04303693771362305",
        "automationType": "createTask"
      },
      "sort": [
        1660116874873
      ]
    }
  ],
  "params": {
    "from": 0,
    "size": 10,
    "query": {
      "bool": {
        "must": [
          {
            "term": {
              "organizationId.keyword": "621dd813eb3ebf16b94dbde3"
            }
          },
          {
            "term": {
              "automationId.keyword": "62f25ada1c0cd810800157c2"
            }
          }
        ]
      }
    },
    "sort": [
      {
        "@timestamp": {
          "order": "desc"
        }
      }
    ]
  }
}
{
"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

limit
string

Limit of automation logs list. Example: 20. Default: 10

page
integer<int32>

Pagination of automation logs list. Example: 2. Default: 1

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 automation objects. Default: @timestamp

sortOrder
string

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

startDate
string

startDate & endDate is used to select range of time of automation log. Example: 2022-08-10

endDate
string

startDate & endDate is used to select range of time of automation log. Example: 2022-08-10

taskId
string

The identifier for Task that generated by system. Use GET /tasks API to get the list of Task IDs. Example: 621dd813xy3ebf16b94d6969

automationId
string

The identifier for Automation that generated by system. Use GET /automations API to get the list of Automation IDs. Example: 621dd813xy3ebf16b87d6969

isSuccess
boolean

for selecting automation log of success or failed, acceptable value:true,false. leave it empty if you want to get all data. Example: true

Response

Success

status
boolean

Status of response.

message
string

Message of API response.

total
integer

Total data of automation logs.

data
object[]

List of automation logs object.

params
object

Params of automation logs.