Skip to content

getting error when using api.ListInvestigations #3

@creedsin

Description

@creedsin

code

"import InsightIDR4Py as idr
from datetime import datetime, timedelta, timezone

define API key (store this value securely)

api_key = "apikey"

connect to InsightIDR API

api = idr.InsightIDR(api_key)

list investigations from the past 7 days

start_time_7d_ago = (datetime.now(timezone.utc) - timedelta(7)).strftime("%Y-%m-%dT%H:%M:%SZ")
print(start_time_7d_ago)

investigations = api.ListInvestigations(start_time=start_time_7d_ago)"

error

"Traceback (most recent call last):
File "C:\Users\user\Desktop\v1.py", line 14, in
investigations = api.ListInvestigations(start_time=start_time_7d_ago)
File "C:\Users\user\AppData\Local\Programs\Python\Python312\Lib\site-packages\InsightIDR4Py.py", line 240, in ListInvestigations
params["index"] += 100
KeyError: 'index' "

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions