As of December 31st, 2023 ThreadFix 2.X has reached End of Life and is no longer supported. For any further information please contact the Success and Implementation team.

Fail Task - API

/rest/{version}/tasks/failTask


Descriptor

Value

HTTP Method

POST

Description

Marks a task as failed, to complete it without a file upload.

Required Permission

Manage Scan Agents

Version Introduced2.4.0


Request Header Parameters

Parameter

Value

Required

Description

Accept

String

Yes

A value of ‘application/json’ must be provided.


Request POST Data Parameters

Parameter

Value

Required

Description

scanQueueTaskId

Integer

Yes

ID for the Scan Agent Task to mark as failed.

message

String

Yes

A message to provide as the reason for the failure.  Viewable from the Scan Agent Tasks page.

scanAgentSecureKey

String

Yes

A Secure Scan Agent Key obtained from the “Request Scan Agent Key” call.  Must be the same one used to assign the Task from the queue.

secureTaskKey

String

Yes

The Secure Task Key that was returned when the Task was assigned from the queue.


Sample Call:


curl --insecure -H 'Accept: application/json' -H "Authorization: APIKEY {apiKey}" -X POST --data 'scanQueueTaskId=3&message=Just because&scanAgentSecureKey=yMFCvtcmBtAARYS5QX8x54zvMruNLIvNMzqMI44K4JG8&secureTaskKey=AOA8veR8QNrSTgm2mzcTxmfoHj1iF0fQVoInXNuZE' http://localhost:8080/threadfix/rest/latest/tasks/failTask


Sample Output:


{
    "message": "",
    "success": true,
    "responseCode": -1,
    "object": "ScanAgent reported that the scan task: 3 had failed client-side for the following reason: Just because"
}

www.threadfix.it | www.coalfire.com
Copyright © 2024 Coalfire. All rights reserved.

This Information Security Policy is CoalFire - Public: Distribution of this material is not limited.