Skip to main content

Logs

This page provides comprehensive information and documentation on a set of API methods specifically designed to handle logs in the Integrator.

GET List Logs

This method is used to list all logs associated with a flow ID, providing information such as their running state, success result, amount of lines, subflow logs, and more.

Path: /logs?projectid=<projectId>&limit=20&page=1&flowId=<flowId>&log_type=1

  • Prod Integrator: https://flow.entegrator.akinon.net:3000/logs

  • Dev Integrator: https://flow-dev.entegrator.akinon.net:3000/logs

Query Parameters

ParameterInDescriptionRequiredDefaultLimits
projectIdqueryProject identifier--
flowIdqueryFlow identifier--
limitqueryLimits the amount of logs25Min:1 Max:100
pagequeryOffsets the returned log page1Min:1
log_typequeryLog type enum, "1" for main logs, "2" for sub logs, "3" for line logs-One of following values: 1,2,3
filename_uuidqueryExecution ID of the process, used for filtering "main logs"--
original_filename_uuidqueryID of the process, used for finding "line logs" belonging to "main log"--
AuthenticationheaderAuth token for current user

Example Response (200 OK)

  • state:

    • 1 - Start
    • 2 - In Progress
    • 3 - Finished
  • status:

    • 1 - In Progress
    • 2 - Success
    • 3 - Failed
    • 4 - Empty
  • next : URL for the next log page

  • previous: URL for the previous log page

  • triggered_by : E-mail address of the user who triggered the flow ("System" for automatically triggered flows)

  • is_triggered: True for manually triggered inbound flows

  • created : Timestamp for log_type=1 , datetime string for others

  • finished : Timestamp for log_type=1 , datetime string for others

  {
"count": 1,
"limit": 20,
"page": 1,
"previous": "",
"next": "<next-page-url>",
"results": [
{
"created": "1687519997186",
"id": <logId>,
"process_group_id": "<flowId>",
"process_group_name": "price",
"parent_process_group_id": null,
"original_filename_uuid": "<exection_id>",
"filename_uuid": "<exection_id>",
"state": 1,
"status": 1,
"finished": null,
"fragment_count": null,
"process_count": 0,
"success_count": 0,
"fail_count": 0,
"in_bound": false,
"schedule": null,
"is_triggered": true,
"triggered_by": "test@akinon.com\n",
"log_type": 1,
"flow_order": 1,
"is_send_S3": 0,
"sub_flows": [
{
"created": "2023-06-23T11:33:17.898+00:00",
"id": <logId>,
"process_group_id": "login",
"process_group_name": "Login",
"parent_process_group_id": "<flowId>",
"original_filename_uuid": "<exection_id>",
"filename_uuid": "<step log id>",
"state": 3,
"status": 2,
"finished": "2023-06-23T11:33:42.00073+00:00",
"process_count": 1,
"success_count": 0,
"fail_count": 0,
"in_bound": false,
"schedule": null,
"is_triggered": true,
"triggered_by": "test@akinon.com\n",
"log_type": 2,
"flow_order": 2,
"is_send_S3": 0,
"fragment_count": null,
"row_num": 1
},
{
"created": "2023-06-23T11:33:18.46+00:00",
"id": <logId>,
"process_group_id": "read_data_from_erp",
"process_group_name": "Read Data From ERP",
"parent_process_group_id": "<flowId>",
"original_filename_uuid": "<exection_id>",
"filename_uuid": "<step log id>",
"state": 3,
"status": 2,
"finished": "2023-06-23T11:33:42.000768+00:00",
"process_count": 1,
"success_count": 0,
"fail_count": 0,
"in_bound": false,
"schedule": null,
"is_triggered": true,
"triggered_by": "test@akinon.com\n",
"log_type": 2,
"flow_order": 4,
"is_send_S3": 1,
"fragment_count": null,
"row_num": 1
}
]
}
]
}

Response Errors

  • Status Code 401: This status code is returned when the token is incorrect or the Authentication header is missing.
  • Status Code 400: This status code is returned when the required fields are missing or incorrect.
  • Status Code 404: This status code is returned when the search result is empty.

Example Request URL

Filter line logs with option to search within main log.

To filter using search options, the line logs (log_type=3) need to be searched within. For each search option, the corresponding search option field should be provided, and an index (starting from 1) should be assigned to match the search option field and its values. If an original_filename_uuid is provided as the main log execution ID, the search will be limited to that specific main log.

Path: /logs?flowId=123456-12345-1234&log_type=3&projectid=98765-9876-9875&limit=20&page=1&search_field.1=sku&search_value.1=examplesku

parametervaluedescription
flowId123456-12345-1234Flow identifier
log_type3line log type
original_filename_uuidasdefgh-12345-9875Execution ID
projectid98765-9876-9875Project identifier
limit20Amount of log
page1Page count of the log
search_field.1skuName of the search option
search_value.1exampleskuValue of the search option

GET Download Logs

This method is used to download the log file for the process.

Path: /logs/download?id=<log_id>&flowId=<flowId>&projectid=<projectId>&projectslug=<projectSlug>

  • Prod Integrator: https://flow.entegrator.akinon.net:3000/logs/download

  • Dev Integrator: https://flow-dev.entegrator.akinon.net:3000/logs/download

Query Parameters

ParameterInDescriptionRequired
idqueryLog ID
projectIdqueryProject identifier
flowIdqueryFlow identifier
projectslugqueryName of the project slug
AuthenticationheaderAuth token for current user

Response: The response is an encoded base64 zip file. When the zip file is extracted, it contains a json file with log details such as errors, request body, response body, and so on.

Example Request

Example Python Code for Downloading, Decoding and Reading Log:

  from io import BytesIO
import base64
import json
import zipfile

import requests

url = "https://flow-dev.entegrator.akinon.net:3000/logs/download"
params = {
"id": 000000,
"projectId": "<projectId>",
"flowId": "<flowId>",
"projectslug": "<projectSlug>"
}

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

response = requests.request("GET", url, headers=headers, params=params)

base64_decoded = base64.b64decode(response.text)
zip_input = BytesIO(base64_decoded)
zip_file = zipfile.ZipFile(zip_input, "r")
json_text = zip_file.read(zip_file.filelist[0].filename)
log = json.loads(json_text)
print(log)

Response Errors

  • Status Code 401: This status code is returned when the token is incorrect or the Authentication header is missing.
  • Status Code 400: This status code is returned when the required fields are missing or incorrect.