Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: added REST version to example call

/rest/policies/{policyId}

 

Descriptor

Value

HTTP Method

GET

Description

Get details for a single policy

Required Permission

Manage Policies

Version Introduced2.4.0

Changes in 2.4.1

Added the statusLastChanged and lastEvaluated fields to the response.  These fields are also now in the older versions of the call.

Changes in 2.5.1.12Changed the "passing" field to "currentStatus".  The values are "PASSING", "FAILING", and "NO SCANS FOUND".

 

Request Header Parameters

Parameter

Value

Required

Description

Accept

String

Yes

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

 

Sample Call:

Code Block
themeEclipse
curl --insecure -H 'Accept: application/json' http://localhost:8080/threadfix/rest/latest/policies/1?apiKey={apiKey}

 

Sample Output:


Code Block
themeEclipse
{
    "message": "",
    "success": true,
    "responseCode": -1,
    "object": {
        "id": 1,
        "name": "Critical Policy",
        "policyStatuses": [
            {
                "id": 2,
                "currentStatus": "PASSING",
                "emailLists": [],
                "emailAddresses": [
                    "email1@testemail.com",
                    "email3@testemail.com"
                ],
                "sendEmail": false,
                "statusLastChanged": 1469133001000,
                "name": "Passing App",
                "lastEvaluated": 1469133001000,
                "policy": {
                    "name": "Critical Policy",
                    "filterName": "Critical Filter",
                    "id": 1
                },
                "application": {
                    "name": "Passing App",
                    "id": 1,
                    "team": {
                        "name": "Test Team",
                        "id": 1
                    }
                }
            },
            {
                "id": 1,
                "currentStatus": "FAILING",
                "emailLists": [
                    {
                        "id": 1,
                        "name": "Sample Email List",
                        "emailAddresses": [
                            "email1@testemail.com",
                            "email2@testemail.com"
                        ]
                    }
                ],
                "emailAddresses": [],
                "sendEmail": false,
                "statusLastChanged": null,
                "name": "Failing App",
                "lastEvaluated": 1469132998000,
                "policy": {
                    "name": "Critical Policy",
                    "filterName": "Critical Filter",
                    "id": 1
                },
                "application": {
                    "name": "Failing App",
                    "id": 2,
                    "team": {
                        "name": "Test Team",
                        "id": 1
                    }
                }
            }
        ],
        "filterJsonBlob": {
            "id": 1,
            "json": "{\"scanners\":[],\"genericVulnerabilities\":[],\"severities\":{\"critical\":true},\"numberMerged\":null,\"path\":null,\"parameter\":null,\"numberVulnerabilities\":10,\"showOpen\":true,\"showClosed\":false,\"showFalsePositive\":false,\"showHidden\":false,\"showDefectPresent\":false,\"showDefectNotPresent\":false,\"showDefectOpen\":false,\"showDefectClosed\":false,\"showInconsistentClosedDefectNeedsScan\":false,\"showInconsistentClosedDefectOpenInScan\":false,\"showInconsistentOpenDefect\":false,\"daysOldModifier\":null,\"daysOld\":null,\"startDate\":null,\"endDate\":null,\"filterType\":{\"isVulnSearchFilter\":true},\"genericSeverities\":[{\"intValue\":5}],\"channelTypes\":[],\"usingComponentsWithKnownVulnerabilities\":false}",
            "name": "Critical Filter",
            "defaultTrending": false
        },
        "emailLists": [
            {
                "id": 1,
                "name": "Sample Email List",
                "emailAddresses": [
                    "email1@testemail.com",
                    "email2@testemail.com"
                ]
            }
        ],
        "emailAddresses": [
            "email3@testemail.com"
        ],
        "sendEmail": false,
        "applications": [
            {
                "id": 1,
                "name": "Passing App",
                "url": null,
                "applicationCriticality": {
                    "id": 2,
                    "name": "Medium"
                },
                "team": {
                    "name": "Test Team",
                    "id": 1
                }
            },
            {
                "id": 2,
                "name": "Failing App",
                "url": null,
                "applicationCriticality": {
                    "id": 2,
                    "name": "Medium"
                },
                "team": {
                    "name": "Test Team",
                    "id": 1
                }
            }
        ]
    }
}


Page Tree
rootPolicies API