-
Hi, I'm starting to work with this library. It's great:) I've just tried to update a detection following the example, but this error is returned and I don't understand it:
Thanks in advance! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 6 replies
-
Hi @jartigag! While the example code is syntactically correct, the API is confirming your request and cannot find one of the resources your request specifies. Are you passing one of the valid values for status? (List can be found here.) You will also need to pass a valid UUID for the |
Beta Was this translation helpful? Give feedback.
-
Hi @jartigag! You'll need to lookup the UUID for the user you want to assign this to first. Try the following and let us know what you get back. from falconpy import OAuth2, Detects, UserManagement
auth = OAuth2(client_id="CLIENT_ID_HERE", client_secret="CLIENT_SECRET_HERE")
detects = Detects(auth_object=auth)
users = UserManagement(auth_object=auth)
user_detail = users.retrieve_user_uuid(uid="a_valid_user_email@company.com")
if user_detail["status_code"] != 200:
raise SystemExit(f"User UUID not retrieved: {user_detail['body']['errors'][0]['message']}")
user_uuid = user_detail["body"]["resources"][0] # Should only be the one
# Now that we have the UUID, we should be able to assign the detection
result = detects.update_detects_by_ids(assigned_to_uuid=user_uuid,
show_in_ui=True,
comment="Comment here",
status="in_progress",
ids="ltd:zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz:99999999999"
)
print(result) |
Beta Was this translation helpful? Give feedback.
Hi @jartigag!
You'll need to lookup the UUID for the user you want to assign this to first. Try the following and let us know what you get back.