Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

/rest/{version}/scheduledEmailReport/{scheduledEmailReportId}/edit

Descriptor

Value

HTTP Method

PUT

Description

Edits an existing scheduled email report's basic fields.

Required Permission

Manage Email Reports (Global level)

Version Introduced

2.7.4

Request Header Parameters

Parameter

Value

Required

Description

Accept

String

Yes

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

Request PUT Data Parameters

Parameter

Value

Required

Description

teamIds

Integer

Yes

The ID for the teams to set for the report.  At least one team must be specified.  See the example below to see how to pass in multiple teams.

This parameter is not additive; if users wish to add a new team to the report's existing list of teams, they must provide all of the old team IDs as parameters as well.

severity

String

Yes

The name of the severity for the report's severity threshold. If users have customized their ThreadFix severity names, use the custom names.

schedulingMethod

String

No

Which type of schedule the user will define.  Must be either "SELECT" or "CRON", case-insenstive, but will default to "SELECT" if not specified.

frequency

String

Yes*

*Required if using "SELECT" schedulingMethod.

Must be either "Weekly" or "Daily", case-insenstive.  Determines whether schedule will be every day or only on a specified day of the week.

day

String

Yes*

*Required if using "SELECT" schedulingMethod and a "Weekly" frequency.

The day of the week the report will execute.  Must be the full name of the day of the week, for example: "Wednesday".

hour

Integer

Yes*

*Required if using "SELECT" schedulingMethod.

The hour (1-12) for the time the report will execute.

minute

Integer

Yes*

*Required if using "SELECT" schedulingMethod.

The minute the report will execute.  Must be one of: 0, 15, 30, 45.  If needing to specify a more specific minute place, please use a cron expression to define your schedule.

period

String

Yes*

*Required if using "SELECT" schedulingMethod.

Must be either "AM" or "PM", for the time the report will execute.

cronExpression

String

Yes*

*Required if using "CRON" schedulingMethod.

The Cron expression for the time the schedule will execute.  Cron Expressions in ThreadFix do not accept a "seconds" place, so please omit that from your string.  The "year" is also optional.  For example, to run a schedule every day at 9:13 AM, you would provide "13 9 * * ?".

Sample Call:

Editing a scheduled email report to only be attached to 1 team, with a severity threshold of "low", and using a cron expression to run the schedule every day at 6 AM:

Code Block
curl --insecure -H 'Accept: application/json' -H "Authorization: APIKEY {apiKey}" -X PUT --data "teamIds=1&severity=low&schedulingMethod=cron&cronExpression=0 6 * * ?" http://localhost:8080/threadfix/rest/latest/scheduledEmailReport/19/edit

Editing the above scheduled email report to add another team, change the severity threshold to "elevated" (a custom severity name), and use the select method to set the schedule to 1:30 PM every Monday:

Code Block
curl --insecure -H 'Accept: application/json' -H "Authorization: APIKEY {apiKey}" -X PUT --data "teamIds=1&teamIds=2&severity=elevated&schedulingMethod=select&frequency=weekly&day=monday&hour=1&minute=30&period=pm" http://localhost:8080/threadfix/rest/latest/scheduledEmailReport/19/edit

Sample Output:

Code Block
{
    "message": "",
    "success": true,
    "responseCode": -1,
    "object": {
        "id": 19,
        "hour": 0,
        "minute": 0,
        "period": "",
        "day": "",
        "frequency": "",
        "scheduleType": "CRON",
        "cronExpression": "0 6 * * ?",
        "severityLevel": {
            "id": 1,
            "name": "High",
            "intValue": 4,
            "displayName": "High"
        },
        "emailLists": [],
        "emailAddresses": [],
        "organizations": [
            {
                "id": 2,
                "name": "Extra"
            },
            {
                "id": 1,
                "name": "Test"
            }
        ],
        "scheduledDate": "at 06:00",
        "cronTranslation": "at 06:00"
    }
}

Page Tree
rootEmail Reporting API 3.0 - WIP